SQLite PRAGMA

PRAGMA 读写 SQLite 的内部设置:journal_mode、foreign_keys、cache_size 等运行参数。

Intermediate
Key PointsSQLite,PRAGMA,journal_mode,foreign_keys,配置

讲解

PRAGMA 读写 SQLite 的内部设置:journal_mode、foreign_keys、cache_size 等运行参数。

示例

Shell
PRAGMA foreign_keys = ON;       -- 开启外键检查
PRAGMA journal_mode = WAL;      -- 提升并发读写
PRAGMA table_info(company);     -- 查看表结构
Output
foreign_keys
1
journal_mode
wal

Friends & Partners