【问题标题】:Golang SQLite: How to prevent file corruption upon unexpected shutdowns?Golang SQLite:如何防止意外关闭时文件损坏?
【发布时间】:2017-07-20 09:43:05
【问题描述】:

我在嵌入式设备上运行的应用程序上使用 github.com/jinzhu/gorm 和 sqlite。此设备可能随时关闭。

有没有办法告诉 sqlite 在每次 SQL 调用后关闭/刷新所有内容?

【问题讨论】:

    标签: sqlite go-gorm


    【解决方案1】:

    SQlite uses transactions,并在事务提交时刷新所有内容。

    所以默认情况下 SQLite 是安全的(除非您的设备 is broken)。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-04-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多