/**
* @ingroup Database
*/
-class DatabaseSqlite extends DatabaseBase {
+class DatabaseSqlite extends Database {
/** @var bool Whether full text is enabled */
private static $fulltextEnabled = null;
$p['schema'] = false;
$p['tablePrefix'] = '';
- return DatabaseBase::factory( 'sqlite', $p );
+ return Database::factory( 'sqlite', $p );
}
/**
$this->dbPath = $fileName;
try {
- if ( $this->mFlags & DBO_PERSISTENT ) {
+ if ( $this->mFlags & self::DBO_PERSISTENT ) {
$this->mConn = new PDO( "sqlite:$fileName", '', '',
[ PDO::ATTR_PERSISTENT => true ] );
} else {
$res = $this->mConn->query( $sql );
if ( $res === false ) {
return false;
- } else {
- $r = $res instanceof ResultWrapper ? $res->result : $res;
- $this->mAffectedRows = $r->rowCount();
- $res = new ResultWrapper( $this, $r->fetchAll() );
}
+ $r = $res instanceof ResultWrapper ? $res->result : $res;
+ $this->mAffectedRows = $r->rowCount();
+ $res = new ResultWrapper( $this, $r->fetchAll() );
+
return $res;
}
return str_replace( '"', '', parent::tableName( $name, $format ) );
}
- /**
- * Index names have DB scope
- *
- * @param string $index
- * @return string
- */
- protected function indexName( $index ) {
- return $index;
- }
-
/**
* This must be called after nextSequenceVal
*
}
/**
- * @param Blob|string $s
- * @return string
+ * @param string|int|null|bool|Blob $s
+ * @return string|int
*/
function addQuotes( $s ) {
if ( $s instanceof Blob ) {
return 'CAST ( ' . $field . ' AS TEXT )';
}
- /**
- * @return string
- */
- public function getSearchEngine() {
- return "SearchSqlite";
- }
-
/**
* No-op version of deadlockLoop
*
return $this->query( $sql, $fName );
}
+ protected function requiresDatabaseUser() {
+ return false; // just a file
+ }
+
/**
* @return string
*/
public function __toString() {
return 'SQLite ' . (string)$this->mConn->getAttribute( PDO::ATTR_SERVER_VERSION );
}
-
-} // end DatabaseSqlite class
+}