Sqliteでテーブル一覧と定義を取得する

技術関係

テーブルの情報を取得する

select tbl_name, sql from sqlite_master  where type = 'table';

MysqlでのShow Tableのようにテーブルの一覧を取得する

select tbl_name from sqlite_master where type = 'table';

もしくは

.tables TABLENAME

MysqlでのDESCのようにテーブルの定義を取得する

select sql from sqlite_master where type = 'table';

もしくは

.schema TABLENAME

タイトルとURLをコピーしました