The Pdo\Sqlite class
A PDO subclass representing a connection using the SQLite PDO driver.
Intro
A PDO subclass representing a connection using the SQLite PDO driver.
This driver supports a dedicated SQL query parser for the SQLite dialect. It can handle the following:
- Single, double-quoted, and backtick literals, with doubling as escaping mechanism.
- Square brackets quoting for identifiers.
- Two-dashes and C-style comments (non-nested).
Class synopsis
Predefined Constants
Pdo\Sqlite::DETERMINISTICPdo\Sqlite::OPEN_READONLYPdo\Sqlite::OPEN_READWRITEPdo\Sqlite::OPEN_CREATEPdo\Sqlite::ATTR_OPEN_FLAGSPdo\Sqlite::ATTR_READONLY_STATEMENTPdo\Sqlite::ATTR_EXTENDED_RESULT_CODESPdo\Sqlite::ATTR_BUSY_STATEMENTA read-only statement attribute, retrieved with
PDOStatement::getAttribute, which is true if the statement has been executed and still has a pending row, and false otherwise. Available as of PHP 8.5.0.Pdo\Sqlite::ATTR_EXPLAIN_STATEMENTA statement attribute controlling the explain mode, set with
PDOStatement::setAttribute. Possible values arePdo\Sqlite::EXPLAIN_MODE_PREPARED,Pdo\Sqlite::EXPLAIN_MODE_EXPLAIN, andPdo\Sqlite::EXPLAIN_MODE_EXPLAIN_QUERY_PLAN. AValueErroris thrown if PHP has been compiled against a libsqlite older than 3.43.0. Available as of PHP 8.5.0.Pdo\Sqlite::EXPLAIN_MODE_PREPAREDValue for
Pdo\Sqlite::ATTR_EXPLAIN_STATEMENT: returns the statement as prepared (no explanation). Available as of PHP 8.5.0, when compiled against libsqlite >= 3.43.0.Pdo\Sqlite::EXPLAIN_MODE_EXPLAINValue for
Pdo\Sqlite::ATTR_EXPLAIN_STATEMENT: returns the opcodes of the virtual machine used to execute the statement (equivalent to SQLite'sEXPLAIN). Available as of PHP 8.5.0, when compiled against libsqlite >= 3.43.0.Pdo\Sqlite::EXPLAIN_MODE_EXPLAIN_QUERY_PLANValue for
Pdo\Sqlite::ATTR_EXPLAIN_STATEMENT: returns the query plan (equivalent to SQLite'sEXPLAIN QUERY PLAN). Available as of PHP 8.5.0, when compiled against libsqlite >= 3.43.0.Pdo\Sqlite::ATTR_TRANSACTION_MODEA connection attribute configuring the transaction mode used by
PDO::beginTransaction. Possible values arePdo\Sqlite::TRANSACTION_MODE_DEFERRED,Pdo\Sqlite::TRANSACTION_MODE_IMMEDIATE, andPdo\Sqlite::TRANSACTION_MODE_EXCLUSIVE. Available as of PHP 8.5.0.Pdo\Sqlite::TRANSACTION_MODE_DEFERREDValue for
Pdo\Sqlite::ATTR_TRANSACTION_MODE: uses SQLite's DEFERRED transaction mode (the default). Available as of PHP 8.5.0.Pdo\Sqlite::TRANSACTION_MODE_IMMEDIATEValue for
Pdo\Sqlite::ATTR_TRANSACTION_MODE: uses SQLite's IMMEDIATE transaction mode. Available as of PHP 8.5.0.Pdo\Sqlite::TRANSACTION_MODE_EXCLUSIVEValue for
Pdo\Sqlite::ATTR_TRANSACTION_MODE: uses SQLite's EXCLUSIVE transaction mode. Available as of PHP 8.5.0.Pdo\Sqlite::OKReturn value of an authorizer callback set with
Pdo\Sqlite::setAuthorizer, allowing the action. Available as of PHP 8.5.0.Pdo\Sqlite::DENYReturn value of an authorizer callback set with
Pdo\Sqlite::setAuthorizer, denying the action. Available as of PHP 8.5.0.Pdo\Sqlite::IGNOREReturn value of an authorizer callback set with
Pdo\Sqlite::setAuthorizer, substituting a null value for the column that would have been read. Available as of PHP 8.5.0.
Changelog
| Version | Description |
|---|---|
| 8.5.0 | Added constants Pdo\Sqlite::ATTR_BUSY_STATEMENT, Pdo\Sqlite::ATTR_EXPLAIN_STATEMENT, Pdo\Sqlite::EXPLAIN_MODE_PREPARED, Pdo\Sqlite::EXPLAIN_MODE_EXPLAIN, Pdo\Sqlite::EXPLAIN_MODE_EXPLAIN_QUERY_PLAN, Pdo\Sqlite::ATTR_TRANSACTION_MODE, Pdo\Sqlite::TRANSACTION_MODE_DEFERRED, Pdo\Sqlite::TRANSACTION_MODE_IMMEDIATE, and Pdo\Sqlite::TRANSACTION_MODE_EXCLUSIVE, Pdo\Sqlite::OK, Pdo\Sqlite::DENY, and Pdo\Sqlite::IGNORE. |
Sqlite