Class DibiSqliteDriver
The dibi driver for SQLite database.
Driver options:
- database (or file) => the filename of the SQLite database
- persistent (bool) => try to find a persistent link?
- unbuffered (bool) => sends query without fetching and buffering the result rows automatically?
- formatDate => how to format date in SQL (@see date)
- formatDateTime => how to format datetime in SQL (@see date)
- dbcharset => database character encoding (will be converted to 'charset')
- charset => character encoding to set (default is UTF-8)
- resource (resource) => existing connection resource
- lazy, profiler, result, substitutes, ... => see DibiConnection options
DibiObject | --DibiSqliteDriver
Implements interfaces:
| Constructor Summary | |
|---|---|
| public |
__construct
()
|
| Method Summary | |
|---|---|
| void |
applyLimit
(string &$sql, int $limit, int $offset)
Injects LIMIT/OFFSET to the SQL query.
|
| void |
begin
([string $savepoint =
NULL])
Begins a transaction (if supported).
|
| void |
commit
([string $savepoint =
NULL])
Commits statements in a transaction.
|
| void |
connect
(&$config)
Connects to a database.
|
| void |
disconnect
()
Disconnects from a database.
|
| string |
escape
(mixed $value, string $type)
Encodes data for use in a SQL statement.
|
| string |
escapeLike
(string $value, int $pos)
Encodes string for use in a LIKE statement.
|
| array |
fetch
(bool $assoc)
Fetches the row at current position and moves the internal cursor to the next position.
|
| void |
free
()
Frees the resources allocated for this result set.
|
| int|FALSE |
Gets the number of affected rows by the last INSERT, UPDATE or DELETE query.
|
| int|FALSE |
getInsertId
($sequence)
Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
|
| IDibiReflector |
getReflector
()
Returns the connection reflector.
|
| mixed |
getResource
()
Returns the connection resource.
|
| array |
Returns metadata for all columns in a result set.
|
| mixed |
Returns the result set resource.
|
| int |
getRowCount
()
Returns the number of rows in a result set.
|
| IDibiResultDriver|NULL |
query
(string $sql)
Executes the SQL query.
|
| void |
registerAggregateFunction
(string $name, mixed $rowCallback, mixed $agrCallback, [int $numArgs =
-1])
Registers an aggregating user defined function for use in SQL statements.
|
| void |
registerFunction
(string $name, mixed $callback, [int $numArgs =
-1])
Registers an user defined function for use in SQL statements.
|
| void |
rollback
([string $savepoint =
NULL])
Rollback changes in a transaction.
|
| boolean |
seek
(int $row)
Moves cursor position without fetching row.
|
| string |
unescape
(string $value, string $type)
Decodes data from result set.
|
| Constructor Details | ||
|---|---|---|
|
line 56 __constructpublic __construct () |
||
| Method Details | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
line 295 applyLimitpublic void applyLimit (string &$sql, int $limit, int $offset) Injects LIMIT/OFFSET to the SQL query.
|
|||||||||||||||||||||
|
line 166 beginpublic void begin ([string $savepoint = Begins a transaction (if supported).
|
|||||||||||||||||||||
|
line 179 commitpublic void commit ([string $savepoint = Commits statements in a transaction.
|
|||||||||||||||||||||
|
line 70 connectpublic void connect (&$config) Connects to a database.
|
|||||||||||||||||||||
|
line 104 disconnectpublic void disconnect () Disconnects from a database.
|
|||||||||||||||||||||
|
line 232 escapepublic string escape (mixed $value, string $type) Encodes data for use in a SQL statement.
|
|||||||||||||||||||||
|
line 264 escapeLikepublic string escapeLike (string $value, int $pos) Encodes string for use in a LIKE statement.
|
|||||||||||||||||||||
|
line 326 fetchpublic array fetch (bool $assoc) Fetches the row at current position and moves the internal cursor to the next position.
|
|||||||||||||||||||||
|
line 365 freepublic void free () Frees the resources allocated for this result set.
|
|||||||||||||||||||||
|
line 142 getAffectedRowspublic int|FALSE getAffectedRows () Gets the number of affected rows by the last INSERT, UPDATE or DELETE query.
|
|||||||||||||||||||||
|
line 153 getInsertIdpublic int|FALSE getInsertId ($sequence) Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
|
|||||||||||||||||||||
|
line 214 getReflectorpublic IDibiReflector getReflector () Returns the connection reflector.
|
|||||||||||||||||||||
|
line 203 getResourcepublic mixed getResource () Returns the connection resource.
|
|||||||||||||||||||||
|
line 376 getResultColumnspublic array getResultColumns () Returns metadata for all columns in a result set.
|
|||||||||||||||||||||
|
line 399 getResultResourcepublic mixed getResultResource () Returns the result set resource.
|
|||||||||||||||||||||
|
line 311 getRowCountpublic int getRowCount () Returns the number of rows in a result set.
|
|||||||||||||||||||||
|
line 117 querypublic IDibiResultDriver|NULL query (string $sql) Executes the SQL query.
|
|||||||||||||||||||||
|
line 432 registerAggregateFunctionpublic void registerAggregateFunction (string $name, mixed $rowCallback, mixed $agrCallback, [int $numArgs = Registers an aggregating user defined function for use in SQL statements.
|
|||||||||||||||||||||
|
line 417 registerFunctionpublic void registerFunction (string $name, mixed $callback, [int $numArgs = Registers an user defined function for use in SQL statements.
|
|||||||||||||||||||||
|
line 192 rollbackpublic void rollback ([string $savepoint = Rollback changes in a transaction.
|
|||||||||||||||||||||
|
line 351 seekpublic boolean seek (int $row) Moves cursor position without fetching row.
|
|||||||||||||||||||||
|
line 278 unescapepublic string unescape (string $value, string $type) Decodes data from result set.
|
|||||||||||||||||||||