/**
* @ingroup Database
*/
-class DatabaseSqlite extends Database {
+class DatabaseSqlite extends DatabaseBase {
var $mAffectedRows;
var $mLastResult;
return $ret;
}
- /**
- * SQLite does not have a "USE INDEX" clause, so return an empty string
- */
- function useIndexClause($index) {
- return '';
- }
-
/**
* Returns the size of a text field, or -1 for "unlimited"
* In SQLite this is SQLITE_MAX_LENGTH, by default 1GB. No way to query it though.
return -1;
}
- /**
- * No low priority option in SQLite
- */
- function lowPriorityOption() {
- return '';
- }
-
- /**
- * Returns an SQL expression for a simple conditional.
- * - uses CASE on SQLite
- */
- function conditional($cond, $trueVal, $falseVal) {
- return " (CASE WHEN $cond THEN $trueVal ELSE $falseVal END) ";
- }
-
function wasDeadlock() {
return $this->lastErrno() == SQLITE_BUSY;
}
function quote_ident($s) { return $s; }
- /**
- * Not possible in SQLite
- * We have ATTACH_DATABASE but that requires database selectors before the
- * table names and in any case is really a different concept to MySQL's USE
- */
- function selectDB($db) {
- if ( $db != $this->mName ) {
- throw new MWException( 'selectDB is not implemented in SQLite' );
- }
- }
-
- /**
- * not done
- */
- public function setTimeout($timeout) { return; }
-
- /**
- * No-op for a non-networked database
- */
- function ping() {
- return true;
- }
-
/**
* How lagged is this slave?
*/
/**
* No-op lock functions
*/
- public function lock( $lockName, $method ) {
+ public function lock( $lockName, $method, $timeout = 5 ) {
return true;
}
public function unlock( $lockName, $method ) {
return $s;
}
- /** No-op */
- public function setBigSelects( $value = true ) {}
+ public function lockTables( $read, $write, $method ) {}
+
+ public function unlockTables( $method ) {}
+
+ /*
+ * Build a concatenation list to feed into a SQL query
+ */
+ function buildConcat( $stringList ) {
+ return implode( ' || ', $stringList );
+ }
} // end DatabaseSqlite class