Provides abstraction for DBA functions and implents a swDba class using Sqlite3
File also sets default $swDbaHandler to 'sqlite3'. You can change than in site/configuration.php.
swDba Provides a class to to use Sqlite3 as a key-value database (DBA). Opens a database and returns it Sets the cursor to the first record, returns false if not possible Sets the cursor to the next record, returns false if not possible Returns true if a key exists in the database. Returns a value for a given key. Throws an exception if the key does not exists Sets a value for a given key. Saves the database to disks. Deletes a value for a given key. Throws an exception if the key does not exists Closes the database, syncs first if neede. Returns the number of keys SQLite3, swDba, swDbaError, swPersistanceDba $action, $lang, $name, $query, $swDbaHandler, $swRoot, $username Short variables: $bd, $db, $err, $k, $key, $q, $r, $row, $v array, dba, exception, math, sqlite3, str Exception, key, next
Don't confuse $db var of this class with the global $db object.
$path holds the file path of the Sqlite3 database.
$db holds the Sqlite3 database.
$rows holds the relation (allowing holding status firstkey-nextkey
$journal holds modifications that are not synchedMethods
Properties
swPersistanceDba extends swPersistance
Last resort class if neither Sqlite nor dba functions are presentMethods
Properties
swDbaError extends
Holds an error class.Methods
Properties
Functions
swDbaOpen($file,$mode,$handler='')
@param $file path to file
@param $mode rdt, wdt, c...
@param $handler 'db', 'db4', 'sqlite3'swDbaFirstKey($db)
@param $dbswDbaNextKey($db)
@param $dbswDbaExists($key,$db)
@param $key
@param $dbswDbaFetch($key,$db)
@param $key
@param $dbswDbaReplace($key,$value,$db)
@param $key
@param $value
@param $dbswDbaSync($db)
Before sync, new rows live only in the journal.
@param $dbswDbaDelete($key,$db)
@param $key
@param $dbswDbaClose($db)
@param $dbswDbaCount($db)
@param $dbUsed elements
Classes
Functions
Globals
Variables
$error, $file, $handler, $lines, $message, $mode, $path, $result, $statement, $test, $valueFeatures
Others