The Pdo\Sqlite class
(PHP 8 >= 8.4.0)
简介
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).
类摘要
string
$name,callable
$step,callable
$finalize,int
$numArgs = -1): bool
string
$function_name,callable
$callback,int
$num_args = -1,int
$flags = 0): bool
string
$table,string
$column,int
$rowid,?string
$dbname = "main",int
$flags = Pdo\Sqlite::OPEN_READONLY): resource|false
string
$dsn,?string
$username = null,#[\SensitiveParameter] ?string
$password = null,?array
$options = null)
string
$dsn,?string
$username = null,#[\SensitiveParameter] ?string
$password = null,?array
$options = null): static
$query, ?int $fetchMode = PDO::FETCH_COLUMN, int $colno): PDOStatement|falsestring
$query,?int
$fetchMode = PDO::FETCH_CLASS,string
$classname,array
$constructorArgs): PDOStatement|false
$query, ?int $fetchMode = PDO::FETCH_INTO, object $object): PDOStatement|false预定义常量
Pdo\Sqlite::DETERMINISTIC
Pdo\Sqlite::OPEN_READONLY
Pdo\Sqlite::OPEN_READWRITE
Pdo\Sqlite::OPEN_CREATE
Pdo\Sqlite::ATTR_OPEN_FLAGS
Pdo\Sqlite::ATTR_READONLY_STATEMENT
Pdo\Sqlite::ATTR_EXTENDED_RESULT_CODES
Pdo\Sqlite::ATTR_BUSY_STATEMENT
A 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_STATEMENT
A statement attribute controlling the explain mode, set with
PDOStatement::setAttribute(). Possible values are
Pdo\Sqlite::EXPLAIN_MODE_PREPARED,
Pdo\Sqlite::EXPLAIN_MODE_EXPLAIN, and
Pdo\Sqlite::EXPLAIN_MODE_EXPLAIN_QUERY_PLAN.
A ValueError is 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_PREPARED
Value 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_EXPLAIN
Value for Pdo\Sqlite::ATTR_EXPLAIN_STATEMENT:
returns the opcodes of the virtual machine used to execute the statement
(equivalent to SQLite's EXPLAIN).
Available as of PHP 8.5.0, when compiled against libsqlite >= 3.43.0.
Pdo\Sqlite::EXPLAIN_MODE_EXPLAIN_QUERY_PLAN
Value for Pdo\Sqlite::ATTR_EXPLAIN_STATEMENT:
returns the query plan (equivalent to SQLite's
EXPLAIN QUERY PLAN).
Available as of PHP 8.5.0, when compiled against libsqlite >= 3.43.0.
Pdo\Sqlite::ATTR_TRANSACTION_MODE
A connection attribute configuring the transaction mode used by
PDO::beginTransaction(). Possible values are
Pdo\Sqlite::TRANSACTION_MODE_DEFERRED,
Pdo\Sqlite::TRANSACTION_MODE_IMMEDIATE, and
Pdo\Sqlite::TRANSACTION_MODE_EXCLUSIVE.
Available as of PHP 8.5.0.
Pdo\Sqlite::TRANSACTION_MODE_DEFERRED
Value 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_IMMEDIATE
Value for Pdo\Sqlite::ATTR_TRANSACTION_MODE:
uses SQLite's IMMEDIATE transaction mode.
Available as of PHP 8.5.0.
Pdo\Sqlite::TRANSACTION_MODE_EXCLUSIVE
Value for Pdo\Sqlite::ATTR_TRANSACTION_MODE:
uses SQLite's EXCLUSIVE transaction mode.
Available as of PHP 8.5.0.
Pdo\Sqlite::OK
Return value of an authorizer callback set with Pdo\Sqlite::setAuthorizer(), allowing the action. Available as of PHP 8.5.0.
Pdo\Sqlite::DENY
Return value of an authorizer callback set with Pdo\Sqlite::setAuthorizer(), denying the action. Available as of PHP 8.5.0.
Pdo\Sqlite::IGNORE
Return 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.
更新日志
目录
- Pdo\Sqlite::createAggregate — Registers an aggregating user-defined function for use in SQL statements
- Pdo\Sqlite::createCollation — Registers a user-defined function for use as a collating function in SQL statements
- Pdo\Sqlite::createFunction — Registers a user-defined function for use in SQL statements
- Pdo\Sqlite::loadExtension — Description
- Pdo\Sqlite::openBlob — Description
- Pdo\Sqlite::setAuthorizer — Configures a callback to be used as an authorizer to limit what a statement can do
来源:PHP Documentation Group · 作者与贡献记录 · CC BY 3.0。离线整理了版式、链接和媒体显示。
