= {
R"(
CREATE TABLE IF NOT EXISTS Encryptions
(
ide INTEGER PRIMARY KEY AUTOINCREMENT,
algo INTEGER NOT NULL, -- algorithm enum id used in encryption. e.g: AES=1 ..
title VARCHAR(255) NOT NULL,
date_time DATETIME NOT NULL,
size INTEGER NOT NULL, -- size of compressed cipher in bytes
is_file BOOLEAN NOT NULL,
file_ext VARCHAR(9), -- file extension to remember file type on decryption
CHECK(LENGTH(title) <= 255) -- check title length <= 255
);
)",
R"(
CREATE TABLE IF NOT EXISTS CipherChunks
(
idc INTEGER PRIMARY KEY AUTOINCREMENT,
ide INTEGER NOT NULL,
offset INTEGER NOT NULL,
size INTEGER NOT NULL,
bytes BLOB NOT NULL,
FOREIGN KEY(ide) REFERENCES Encryptions(ide) ON DELETE CASCADE -- when an Encryption record is deleted, all associated Cipher records will also be deleted automatically.
);
)"
}