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 43
__construct(array $config)
No description
at line 78
void
disconnect()
Disconnects from a database.
at line 88
ResultDriver|null
query(string $sql)
Executes the SQL query.
at line 101
static DriverException
createException(string $message, $code, string $sql)
No description
at line 131
int|null
getAffectedRows()
Gets the number of affected rows by the last INSERT, UPDATE or DELETE query.
at line 140
int|null
getInsertId(string|null $sequence)
Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
at line 150
void
begin(string $savepoint = null)
Begins a transaction (if supported).
at line 160
void
commit(string $savepoint = null)
Commits statements in a transaction.
at line 170
void
rollback(string $savepoint = null)
Rollback changes in a transaction.
at line 179
mixed
getResource()
Returns the connection resource.
at line 188
Reflector
getReflector()
Returns the connection reflector.
at line 197
SqliteResult
createResultDriver(SQLite3Result $result)
Result set driver factory.
at line 209
string
escapeText(string $value)
Encodes data for use in a SQL statement.
at line 215
string
escapeBinary(string $value)
No description
at line 221
string
escapeIdentifier(string $value)
No description
at line 227
string
escapeBool(bool $value)
No description
at line 236
string
escapeDate(DateTimeInterface|string|int $value)
No description
at line 248
string
escapeDateTime(DateTimeInterface|string|int $value)
No description
at line 260
string
escapeLike(string $value, int $pos)
Encodes string for use in a LIKE statement.
at line 270
void
applyLimit(string $sql, int|null $limit, int|null $offset)
Injects LIMIT/OFFSET to the SQL query.
at line 288
void
registerFunction(string $name, callable $callback, int $numArgs = -1)
Registers an user defined function for use in SQL statements.
at line 297
void
registerAggregateFunction(string $name, callable $rowCallback, callable $agrCallback, int $numArgs = -1)
Registers an aggregating user defined function for use in SQL statements.
Traits
Better OOP experience.