可以在SQLite数据库的每个页面末尾保留字节。如何用保留字节创建数据库?
SQLite has the ability to set aside a small number of extra bytes at the end of every page for use by extensions. These extra bytes are used, for example, by the SQLite Encryption Extension to store a nonce and/or cryptographic checksum associated with each page. The "reserved space" size in the 1-byte integer at offset 20 is the number of bytes of space at the end of each page to reserve for extensions. This value is usually 0. The value can be odd.
欲使用该功能的使用和创建一个正常,空数据库尝试过了,手动改变该字节(报头,在偏移20;使用十六进制编辑器),以一个非空值( - >十六个保留字节的x10)。
在sqlite3的使用.dbinfo:
(…) reserved bytes: 16 (…)
所以一切都似乎是正确的,但没有命令编辑数据库会成功。 每个命令(例如CREATE TABLE example('id' int);
)导致此错误消息:
Error: database disk image is malformed
所以我的问题是:如何创建一个SQLite数据库与该保留的空间(这将不会被拒绝畸形)?