ios - 如何检查特定版本的 SQLite 支持哪些功能?

标签 ios sqlite compatibility

我想确保 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 工具以编程方式检查它?

提前致谢。

最佳答案

文档说:

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 "PRAGMA 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/

相关文章:

ios - 当我返回时自定义 tableview 单元格没有取消选择?

ios - 应用程序退出时保存 NSUserDefaults

ios - 模态视图 Controller 在 iOS 7 上工作,在 iOS 6 上留下一个空白

java - 从 jdbc ResultSet 获取数据行

java - 最新的 Java 6 是否开箱即用地运行 JavaFX 2

excel - 32 位 Excel 加载项是否可以在 64 位 Excel 中工作?

ios - 如何利用不同的类切换 SceneKit View

python - 将数据从 tweepy 保存到 sqlite

android - 尝试在 android 中创建表时出现 SQlite 异常

linux - “silicon power” sd卡4ggb class 10存储卡与树莓派兼容吗?