メインコンテンツまでスキップ
Version: Fegg 5.x(開発版)

Pdo::pragma

Set pragma query

Description​

public self Pdo::pragma( string $table, string $mode )

Builds an SQLite PRAGMA on $table. Read the rows with all after execute. SQLite only.

Arguments​

NameData typeDefaultRemarks
$tablestringTable name
$modestringPragma mode (below)

Pragma mode​

ModeQuery
tablePRAGMA table_info("table") (also any unknown mode)
index_listPRAGMA index_list("table")
indexPRAGMA index_info("table")

Example​

Controller
$db = new \Fegg\Database\Pdo();

// Columns of cms_news: cid, name, type, notnull, dflt_value, pk
$columns = $db->pragma('cms_news', 'table')->execute()->all();

// Indexes of cms_news: seq, name, unique, origin, partial
$indexes = $db->pragma('cms_news', 'index_list')->execute()->all();