加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

什么时候在sqlite上使用pragma?

发布时间:2020-12-12 19:07:09 所属栏目:百科 来源:网络整理
导读:什么时候使用pragma? 数据库是第一次创建还是在每次连接数据库时? 这取决于使用的pragma.从 The definitive guide to SQLite,Database Configuration: Many pragmas have both temporary and permanent forms. Temporary forms affect only the current s
什么时候使用pragma?

数据库是第一次创建还是在每次连接数据库时?

这取决于使用的pragma.从 The definitive guide to SQLite,Database Configuration:

Many pragmas have both temporary and permanent forms. Temporary forms affect only the current session for the duration of its lifetime. The permanent forms are stored in the database and affect every session.

或者,用你的问题的话来说:临时表格用于与数据库的每个连接,在第一次创建数据库时使用永久表格.

pragma documentation没有明确指定pragma是临时的还是永久的.然而,它通常会说类似的东西

auto-vacuuming must be turned on before any tables are created. It is not possible to enable or disable auto-vacuum after a table has been created.

意思是auto_vacuum是一个永久的pragma,或者

When you change the cache size using the cache_size pragma,the change only endures for the current session.

表示cache_size是临时的.

所以你最好回答你的问题是仔细阅读你特定的pragma文档.或者,您可以学习pragma source code(搜索** PRAGMA [,区分大小写).

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读