Model::pragma
テーブルにSQLiteのPRAGMAを実行します
説明
public array Model::pragma( string $mode )
モデルのテーブルに対してSQLiteのPRAGMAを実行し、結果の行を返します。SQLite専用です。
引数
| 名前 | データ型 | デフォルト | 備考 |
|---|---|---|---|
| $mode | string | PRAGMAのモード |
PRAGMAのモード
| モード | クエリ |
|---|---|
table | PRAGMA table_info("table")(不明なモードもこれになります) |
index_list | PRAGMA index_list("table") |
index | PRAGMA index_info("table") |
例
Controller
$model = new Model(true, array(
'table' => 'cms_news',
));
// PRAGMA table_info("cms_news")
$columns = $model->pragma('table');
print_r($columns[0]);
Output
Array
(
[cid] => 0
[name] => news_id
[type] => INTEGER
[notnull] => 1
[dflt_value] =>
[pk] => 1
)