OGeek|极客世界-中国程序员成长平台

标题: ios - 如何检查特定版本的 SQLite 支持哪些功能? [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 11:34
标题: ios - 如何检查特定版本的 SQLite 支持哪些功能?

我想确保 iOS 4.0 附带的 SQLite 库支持 foreign key constraints .官方文档声明:

In order to use foreign key constraints in SQLite, the library must be compiled with neither SQLITE_OMIT_FOREIGN_KEY or SQLITE_OMIT_TRIGGER defined.

如何在 C 中以编程方式或使用 sqlite3 CLI 工具检查它?

提前致谢。



Best Answer-推荐答案


文档说:

sqlite> PRAGMA foreign_keys;
0
sqlite> PRAGMA foreign_keys = ON;
sqlite> PRAGMA foreign_keys;
1
sqlite> PRAGMA foreign_keys = OFF;
sqlite> PRAGMA foreign_keys;
0

Tip: If the command "RAGMA foreign_keys" returns no data instead of a single row containing "0" or "1", then the version of SQLite you are using does not support foreign keys (either because it is older than 3.6.19 or because it was compiled with SQLITE_OMIT_FOREIGN_KEY or SQLITE_OMIT_TRIGGER defined).

关于ios - 如何检查特定版本的 SQLite 支持哪些功能?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9229180/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4