可以在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數據庫與該保留的空間(這將不會被拒絕畸形)?