当前位置:首页 > 数据库 > SQlite

您如何根据SQLite文档调整Android的SQLite,例如PRAGMA cache_size?

这里的SQLite文档http://web.utk.edu/~jplyon/sqlite/SQLite_optimization_FAQ.html#pragmas看起来很有趣.有没有办法尝试一下Android中的建议?

解决方法:

引用the SQLite documentation

The PRAGMA statement is an SQL extension specific to SQLite and used to modify the operation of the SQLite library or to query the SQLite library for internal (non-table) data. The PRAGMA statement is issued using the same interface as other SQLite commands (e.g. SELECT, INSERT)

因此,我希望SQLiteDatabase上的execSQL()应该与不返回结果集的PRAGMA一起使用.

如果PRAGMA影响SQLite语句的编译,请尝试使用带有SQLiteDatabase的compileStatement()并查看是否可行.我希望可以在SQLite C API中映射到sqlite3_prepare(),尽管我不确定.


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!