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 41
__construct(array $config)
No description
at line 76
void
disconnect()
Disconnects from a database.
at line 86
ResultDriver|null
query(string $sql)
Executes the SQL query.
at line 99
static DriverException
createException(string $message, $code, string $sql)
No description
at line 129
int|null
getAffectedRows()
Gets the number of affected rows by the last INSERT, UPDATE or DELETE query.
at line 138
int|null
getInsertId(string|null $sequence)
Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
at line 148
void
begin(string $savepoint = null)
Begins a transaction (if supported).
at line 158
void
commit(string $savepoint = null)
Commits statements in a transaction.
at line 168
void
rollback(string $savepoint = null)
Rollback changes in a transaction.
at line 177
mixed
getResource()
Returns the connection resource.
at line 186
Reflector
getReflector()
Returns the connection reflector.
at line 195
SqliteResult
createResultDriver(SQLite3Result $result)
Result set driver factory.
at line 207
string
escapeText(string $value)
Encodes data for use in a SQL statement.
at line 213
string
escapeBinary(string $value)
No description
at line 219
string
escapeIdentifier(string $value)
No description
at line 225
string
escapeBool(bool $value)
No description
at line 231
string
escapeDate(DateTimeInterface $value)
No description
at line 237
string
escapeDateTime(DateTimeInterface $value)
No description
at line 243
string
escapeDateInterval(DateInterval $value)
No description
at line 252
string
escapeLike(string $value, int $pos)
Encodes string for use in a LIKE statement.
at line 262
void
applyLimit(string $sql, int|null $limit, int|null $offset)
Injects LIMIT/OFFSET to the SQL query.
at line 280
void
registerFunction(string $name, callable $callback, int $numArgs = -1)
Registers an user defined function for use in SQL statements.
at line 289
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.