SQLite3

目次

SQLite3 クラス

はじめに

SQLite 3 データベースとのインターフェイスとなるクラスです。

クラス概要

SQLite3
/* 定数 */
public const int SQLite3::OK;
public const int SQLite3::DENY;
public const int SQLite3::IGNORE;
public const int SQLite3::CREATE_INDEX;
public const int SQLite3::CREATE_TABLE;
public const int SQLite3::CREATE_TEMP_INDEX;
public const int SQLite3::CREATE_TEMP_TABLE;
public const int SQLite3::CREATE_TEMP_TRIGGER;
public const int SQLite3::CREATE_TEMP_VIEW;
public const int SQLite3::CREATE_TRIGGER;
public const int SQLite3::CREATE_VIEW;
public const int SQLite3::DELETE;
public const int SQLite3::DROP_INDEX;
public const int SQLite3::DROP_TABLE;
public const int SQLite3::DROP_TEMP_INDEX;
public const int SQLite3::DROP_TEMP_TABLE;
public const int SQLite3::DROP_TEMP_TRIGGER;
public const int SQLite3::DROP_TEMP_VIEW;
public const int SQLite3::DROP_TRIGGER;
public const int SQLite3::DROP_VIEW;
public const int SQLite3::INSERT;
public const int SQLite3::PRAGMA;
public const int SQLite3::READ;
public const int SQLite3::SELECT;
public const int SQLite3::TRANSACTION;
public const int SQLite3::UPDATE;
public const int SQLite3::ATTACH;
public const int SQLite3::DETACH;
public const int SQLite3::ALTER_TABLE;
public const int SQLite3::REINDEX;
public const int SQLite3::ANALYZE;
public const int SQLite3::CREATE_VTABLE;
public const int SQLite3::DROP_VTABLE;
public const int SQLite3::FUNCTION;
public const int SQLite3::SAVEPOINT;
public const int SQLite3::COPY;
public const int SQLite3::RECURSIVE;
/* メソッド */
public __construct(string $filename, int $flags = SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE, string $encryptionKey = "")
public bool backup(SQLite3 $destination, string $sourceDatabase = "main", string $destinationDatabase = "main")
public bool busyTimeout(int $milliseconds)
public int changes()
public bool close()
public bool createAggregate(
    string $name,
    callable $stepCallback,
    callable $finalCallback,
    int $argCount = -1
)
public bool createCollation(string $name, callable $callback)
public bool createFunction(
    string $name,
    callable $callback,
    int $argCount = -1,
    int $flags = 0
)
public bool enableExceptions(bool $enable = false)
public static string escapeString(string $string)
public bool exec(string $query)
public int lastErrorCode()
public string lastErrorMsg()
public int lastInsertRowID()
public bool loadExtension(string $name)
public void open(string $filename, int $flags = SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE, string $encryptionKey = "")
public resourcefalse openBlob(
    string $table,
    string $column,
    int $rowid,
    string $database = "main",
    int $flags = SQLITE3_OPEN_READONLY
)
public SQLite3Stmtfalse prepare(string $query)
public SQLite3Resultfalse query(string $query)
public mixed querySingle(string $query, bool $entireRow = false)
public bool setAuthorizer(callablenull $callback)
public static array version()

定義済み定数

SQLite3::OK

SQLite3::DENY

SQLite3::IGNORE

SQLite3::CREATE_INDEX

SQLite3::CREATE_TABLE

SQLite3::CREATE_TEMP_INDEX

SQLite3::CREATE_TEMP_TABLE

SQLite3::CREATE_TEMP_TRIGGER

SQLite3::CREATE_TEMP_VIEW

SQLite3::CREATE_TRIGGER

SQLite3::CREATE_VIEW

SQLite3::DELETE

SQLite3::DROP_INDEX

SQLite3::DROP_TABLE

SQLite3::DROP_TEMP_INDEX

SQLite3::DROP_TEMP_TABLE

SQLite3::DROP_TEMP_TRIGGER

SQLite3::DROP_TEMP_VIEW

SQLite3::DROP_TRIGGER

SQLite3::DROP_VIEW

SQLite3::INSERT

SQLite3::PRAGMA

SQLite3::READ

SQLite3::SELECT

SQLite3::TRANSACTION

SQLite3::UPDATE

SQLite3::ATTACH

SQLite3::DETACH

SQLite3::ALTER_TABLE

SQLite3::REINDEX

SQLite3::ANALYZE

SQLite3::CREATE_VTABLE

SQLite3::DROP_VTABLE

SQLite3::FUNCTION

SQLite3::SAVEPOINT

SQLite3::COPY

SQLite3::RECURSIVE

SQLite3Exception クラス

はじめに

SQLite3 特有の例外を表します。

クラス概要

SQLite3Exception
extends Exception
/* 継承したプロパティ */
protected string $message = "";
private string $string = "";
protected int $code;
protected string $file = "";
protected int $line;
private array $trace = [];
private Throwablenull $previous = null;
/* 継承したメソッド */
public __construct(string $message = "", int $code = 0, Throwablenull $previous = null)
final public string getMessage()
final public Throwablenull getPrevious()
final public int getCode()
final public string getFile()
final public int getLine()
final public array getTrace()
final public string getTraceAsString()
public string __toString()
private void __clone()

SQLite3Stmt クラス

はじめに

SQLite 3 拡張モジュールのプリペアドステートメントを扱うクラスです。

クラス概要

SQLite3Stmt
/* メソッド */
private __construct(SQLite3 $sqlite3, string $query)
public bool bindParam(stringint $param, mixed &$var, int $type = SQLITE3_TEXT)
public bool bindValue(stringint $param, mixed $value, int $type = SQLITE3_TEXT)
public bool clear()
public bool close()
public SQLite3Resultfalse execute()
public stringfalse getSQL(bool $expand = false)
public int paramCount()
public bool readOnly()
public bool reset()

SQLite3Result クラス

はじめに

SQLite 3 拡張モジュールの結果セットを扱うクラスです。

クラス概要

SQLite3Result
/* メソッド */
private __construct()
public stringfalse columnName(int $column)
public intfalse columnType(int $column)
public arrayfalse fetchArray(int $mode = SQLITE3_BOTH)
public bool finalize()
public int numColumns()
public bool reset()