Enigma  3.2.0
A Simple, Reliable and Efficient Encryption Tool
Enigma::Constants::Algorithm::Database Namespace Reference

Variables

static const fs::path DATABASE_FILE_PATH = ::Enigma::ResourceManager::getResourcesDir() / "database" / "Enigma.db"
 
static constexpr const std::array< std::string_view, 2 > CREATE_TABLES_SQL
 

Variable Documentation

◆ CREATE_TABLES_SQL

constexpr const std::array<std::string_view, 2> Enigma::Constants::Algorithm::Database::CREATE_TABLES_SQL
staticconstexpr
Initial value:
= {
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.
);
)"
}

Definition at line 46 of file Constants.hpp.

◆ DATABASE_FILE_PATH

const fs::path Enigma::Constants::Algorithm::Database::DATABASE_FILE_PATH = ::Enigma::ResourceManager::getResourcesDir() / "database" / "Enigma.db"
static

Definition at line 44 of file Constants.hpp.