SQLite3Stmt クラス

(PHP 5 >= 5.3.0, PHP 7, PHP 8)

はじめに

SQLite 3 拡張モジュールのプリペアドステートメントを扱うクラスです。 インスタンスは SQLite3::prepare() で取得します。 SQLite3Stmt::execute() を呼び出すとクエリを実行し、 結果セットを扱う SQLite3Result を返します。

クラス概要

class SQLite3Stmt {
/* 定数 */
public const int EXPLAIN_MODE_PREPARED = 0;
public const int EXPLAIN_MODE_EXPLAIN = 1;
/* メソッド */
private function __construct(SQLite3 $sqlite3, string $query)
public function bindParam(string|int $param, mixed &$var, int $type = SQLITE3_TEXT): bool
public function bindValue(string|int $param, mixed $value, int $type = SQLITE3_TEXT): bool
public function busy(): bool
public function clear(): bool
public function close(): true
public function execute(): SQLite3Result|false
public function explain(): int
public function getSQL(bool $expand = false): string|false
public function paramCount(): int
public function readOnly(): bool
public function reset(): bool
public function setExplain(int $mode): bool
}

定義済み定数

SQLite3Stmt::EXPLAIN_MODE_PREPARED

ステートメントは、通常のプリペアドステートメントモードで動作します (EXPLAIN は付きません)。 PHP 8.5.0 以降で、libsqlite 3.43.0 以降を使ってビルドした場合に 利用できます。

SQLite3Stmt::EXPLAIN_MODE_EXPLAIN

ステートメントは、先頭に EXPLAIN を付けた場合と同じように動作し、 仮想マシンのオペコード情報を返します。 PHP 8.5.0 以降で、libsqlite 3.43.0 以降を使ってビルドした場合に 利用できます。

SQLite3Stmt::EXPLAIN_MODE_EXPLAIN_QUERY_PLAN

ステートメントは、先頭に EXPLAIN QUERY PLAN を付けた場合と同じように動作し、 高レベルなクエリプラン情報を返します。 PHP 8.5.0 以降で、libsqlite 3.43.0 以降を使ってビルドした場合に 利用できます。

目次

+add a note

User Contributed Notes

There are no user contributed notes for this page.