SqliteDriver
class SqliteDriver implements Driver
The driver for SQLite v3 database.
Driver options:
- database (or file) => the filename of the SQLite3 database
- formatDate => how to format date in SQL (date)
- formatDateTime => how to format datetime in SQL (date)
- resource (SQLite3) => existing connection resource
Methods
No description
Disconnects from a database.
Executes the SQL query.
No description
Gets the number of affected rows by the last INSERT, UPDATE or DELETE query.
Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
Begins a transaction (if supported).
Commits statements in a transaction.
Rollback changes in a transaction.
Returns the connection resource.
Returns the connection reflector.
Encodes data for use in a SQL statement.
No description
No description
No description
Encodes string for use in a LIKE statement.
Injects LIMIT/OFFSET to the SQL query.
Registers an user defined function for use in SQL statements.
Registers an aggregating user defined function for use in SQL statements.
Details
at line 34
__construct(array $config)
No description
at line 69
void
disconnect()
Disconnects from a database.
at line 79
ResultDriver|null
query(string $sql)
Executes the SQL query.
at line 93
static DriverException
createException(string $message, $code, string $sql)
No description
at line 123
int|null
getAffectedRows()
Gets the number of affected rows by the last INSERT, UPDATE or DELETE query.
at line 132
int|null
getInsertId(string|null $sequence)
Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
at line 142
void
begin(string|null $savepoint = null)
Begins a transaction (if supported).
at line 152
void
commit(string|null $savepoint = null)
Commits statements in a transaction.
at line 162
void
rollback(string|null $savepoint = null)
Rollback changes in a transaction.
at line 171
mixed
getResource()
Returns the connection resource.
at line 180
Reflector
getReflector()
Returns the connection reflector.
at line 189
SqliteResult
createResultDriver(SQLite3Result $result)
Result set driver factory.
at line 201
string
escapeText(string $value)
Encodes data for use in a SQL statement.
at line 207
string
escapeBinary(string $value)
No description
at line 213
string
escapeIdentifier(string $value)
No description
at line 219
string
escapeBool(bool $value)
No description
at line 225
string
escapeDate(DateTimeInterface $value)
No description
at line 231
string
escapeDateTime(DateTimeInterface $value)
No description
at line 237
string
escapeDateInterval(DateInterval $value)
No description
at line 246
string
escapeLike(string $value, int $pos)
Encodes string for use in a LIKE statement.
at line 256
void
applyLimit(string $sql, int|null $limit, int|null $offset)
Injects LIMIT/OFFSET to the SQL query.
at line 274
void
registerFunction(string $name, callable $callback, int $numArgs = -1)
Registers an user defined function for use in SQL statements.
at line 283
void
registerAggregateFunction(string $name, callable $rowCallback, callable $agrCallback, int $numArgs = -1)
Registers an aggregating user defined function for use in SQL statements.