20[[nodiscard]]
inline std::string
23 return std::format(
"PRAGMA journal_mode={};", journalMode);
29 return std::format(
"PRAGMA synchronous={};", synchronous);
35 return std::format(
"PRAGMA temp_store={};", tempStore);
49 {
"BEGIN TRANSACTION;",
51 "CREATE TABLE IF NOT EXISTS Ledgers ( \
52 LedgerHash CHARACTER(64) PRIMARY KEY, \
53 LedgerSeq BIGINT UNSIGNED, \
54 PrevHash CHARACTER(64), \
55 TotalCoins BIGINT UNSIGNED, \
56 ClosingTime BIGINT UNSIGNED, \
57 PrevClosingTime BIGINT UNSIGNED, \
58 CloseTimeRes BIGINT UNSIGNED, \
59 CloseFlags BIGINT UNSIGNED, \
60 AccountSetHash CHARACTER(64), \
61 TransSetHash CHARACTER(64) \
63 "CREATE INDEX IF NOT EXISTS SeqLedger ON Ledgers(LedgerSeq);",
66 "DROP TABLE IF EXISTS Validations;",
76 {
"BEGIN TRANSACTION;",
78 "CREATE TABLE IF NOT EXISTS Transactions ( \
79 TransID CHARACTER(64) PRIMARY KEY, \
80 TransType CHARACTER(24), \
81 FromAcct CHARACTER(35), \
82 FromSeq BIGINT UNSIGNED, \
83 LedgerSeq BIGINT UNSIGNED, \
84 Status CHARACTER(1), \
88 "CREATE INDEX IF NOT EXISTS TxLgrIndex ON \
89 Transactions(LedgerSeq);",
91 "CREATE TABLE IF NOT EXISTS AccountTransactions ( \
92 TransID CHARACTER(64), \
93 Account CHARACTER(64), \
94 LedgerSeq BIGINT UNSIGNED, \
97 "CREATE INDEX IF NOT EXISTS AcctTxIDIndex ON \
98 AccountTransactions(TransID);",
99 "CREATE INDEX IF NOT EXISTS AcctTxIndex ON \
100 AccountTransactions(Account, LedgerSeq, TxnSeq, TransID);",
101 "CREATE INDEX IF NOT EXISTS AcctLgrIndex ON \
102 AccountTransactions(LedgerSeq, Account, TransID);",
104 "END TRANSACTION;"}};
111 {
"BEGIN TRANSACTION;",
119 "CREATE TABLE IF NOT EXISTS NodeIdentity ( \
120 PublicKey CHARACTER(53), \
121 PrivateKey CHARACTER(52) \
125 "CREATE TABLE IF NOT EXISTS PeerReservations ( \
126 PublicKey CHARACTER(53) UNIQUE NOT NULL, \
127 Description CHARACTER(64) NOT NULL \
131 "CREATE TABLE IF NOT EXISTS ValidatorManifests ( \
132 RawData BLOB NOT NULL \
135 "CREATE TABLE IF NOT EXISTS PublisherManifests ( \
136 RawData BLOB NOT NULL \
139 "END TRANSACTION;"}};
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
constexpr std::array< char const *, 5 > kLgrDbInit
constexpr std::uint32_t kSqliteTuningCutoff
constexpr std::array< char const *, 8 > kTxDbInit
constexpr auto kWalletDbName
std::string commonDbPragmaJournal(std::string_view journalMode)
constexpr auto kLgrDbName
constexpr std::array< char const *, 6 > kWalletDbInit
std::string commonDbPragmaTemp(std::string_view tempStore)
std::string commonDbPragmaSync(std::string_view synchronous)