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 100
static DriverException
createException(string $message, $code, string $sql)
No description
at line 130
int|null
getAffectedRows()
Gets the number of affected rows by the last INSERT, UPDATE or DELETE query.
at line 139
int|null
getInsertId(string|null $sequence)
Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
at line 149
void
begin(string|null $savepoint = null)
Begins a transaction (if supported).
at line 159
void
commit(string|null $savepoint = null)
Commits statements in a transaction.
at line 169
void
rollback(string|null $savepoint = null)
Rollback changes in a transaction.
at line 178
mixed
getResource()
Returns the connection resource.
at line 187
Reflector
getReflector()
Returns the connection reflector.
at line 196
SqliteResult
createResultDriver(SQLite3Result $result)
Result set driver factory.
at line 208
string
escapeText(string $value)
Encodes data for use in a SQL statement.
at line 214
string
escapeBinary(string $value)
No description
at line 220
string
escapeIdentifier(string $value)
No description
at line 226
string
escapeBool(bool $value)
No description
at line 232
string
escapeDate(DateTimeInterface $value)
No description
at line 238
string
escapeDateTime(DateTimeInterface $value)
No description
at line 244
string
escapeDateInterval(DateInterval $value)
No description
at line 253
string
escapeLike(string $value, int $pos)
Encodes string for use in a LIKE statement.
at line 263
void
applyLimit(string $sql, int|null $limit, int|null $offset)
Injects LIMIT/OFFSET to the SQL query.
at line 281
void
registerFunction(string $name, callable $callback, int $numArgs = -1)
Registers an user defined function for use in SQL statements.
at line 290
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.