<?php

class dbeng_pdo_sqlite extends dbeng_pdo {
	protected $_conn;
	
	function __construct() {
		/* 
		 * sqlite does not support batch inserts
		 */
		$this->_batchInsertChunks = 1;
    } # ctor

	function connect($host, $user, $pass, $db) {
		try {
			if (!$this->_conn instanceof PDO) {
				$this->_conn = new PDO('sqlite:' . $db);
				$this->_conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
			} # if		
		} catch(PDOException $e) {
				throw new DatabaseConnectionException($e->getMessage(), -1);
		} # catch
	} # connect()

} # class

<?php

class dbeng_pdo_sqlite extends dbeng_pdo {
	protected $_conn;
	
	function __construct() {
		/* 
		 * sqlite does not support batch inserts
		 */
		$this->_batchInsertChunks = 1;
    } # ctor

	function connect($host, $user, $pass, $db) {
		try {
			if (!$this->_conn instanceof PDO) {
				$this->_conn = new PDO('sqlite:' . $db);
				$this->_conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
				$this->_conn->setAttribute(PDO::ATTR_TIMEOUT, 300);
			} # if		
		} catch(PDOException $e) {
				throw new DatabaseConnectionException($e->getMessage(), -1);
		} # catch
	} # connect()

} # class

Set timeout to 5 minutes for SQLite. (Needed for some actions on a slow Raspberry Pi.)
Set timeout to 5 minutes for SQLite. (Needed for some actions on a slow
Raspberry Pi.)
