26 {
"BEGIN TRANSACTION;",
28 "CREATE TABLE IF NOT EXISTS Ledgers ( \
29 LedgerHash CHARACTER(64) PRIMARY KEY, \
30 LedgerSeq BIGINT UNSIGNED, \
31 PrevHash CHARACTER(64), \
32 TotalCoins BIGINT UNSIGNED, \
33 ClosingTime BIGINT UNSIGNED, \
34 PrevClosingTime BIGINT UNSIGNED, \
35 CloseTimeRes BIGINT UNSIGNED, \
36 CloseFlags BIGINT UNSIGNED, \
37 AccountSetHash CHARACTER(64), \
38 TransSetHash CHARACTER(64) \
40 "CREATE INDEX IF NOT EXISTS SeqLedger ON Ledgers(LedgerSeq);",
43 "DROP TABLE IF EXISTS Validations;",
50inline constexpr auto TxDBName{
"transaction.db"};
53 {
"BEGIN TRANSACTION;",
55 "CREATE TABLE IF NOT EXISTS Transactions ( \
56 TransID CHARACTER(64) PRIMARY KEY, \
57 TransType CHARACTER(24), \
58 FromAcct CHARACTER(35), \
59 FromSeq BIGINT UNSIGNED, \
60 LedgerSeq BIGINT UNSIGNED, \
61 Status CHARACTER(1), \
65 "CREATE INDEX IF NOT EXISTS TxLgrIndex ON \
66 Transactions(LedgerSeq);",
68 "CREATE TABLE IF NOT EXISTS AccountTransactions ( \
69 TransID CHARACTER(64), \
70 Account CHARACTER(64), \
71 LedgerSeq BIGINT UNSIGNED, \
74 "CREATE INDEX IF NOT EXISTS AcctTxIDIndex ON \
75 AccountTransactions(TransID);",
76 "CREATE INDEX IF NOT EXISTS AcctTxIndex ON \
77 AccountTransactions(Account, LedgerSeq, TxnSeq, TransID);",
78 "CREATE INDEX IF NOT EXISTS AcctLgrIndex ON \
79 AccountTransactions(LedgerSeq, Account, TransID);",
88 {
"BEGIN TRANSACTION;",
96 "CREATE TABLE IF NOT EXISTS NodeIdentity ( \
97 PublicKey CHARACTER(53), \
98 PrivateKey CHARACTER(52) \
102 "CREATE TABLE IF NOT EXISTS PeerReservations ( \
103 PublicKey CHARACTER(53) UNIQUE NOT NULL, \
104 Description CHARACTER(64) NOT NULL \
108 "CREATE TABLE IF NOT EXISTS ValidatorManifests ( \
109 RawData BLOB NOT NULL \
112 "CREATE TABLE IF NOT EXISTS PublisherManifests ( \
113 RawData BLOB NOT NULL \
116 "END TRANSACTION;"}};
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
constexpr std::array< char const *, 8 > TxDBInit
constexpr auto WalletDBName
constexpr char const * CommonDBPragmaTemp
constexpr std::uint32_t SQLITE_TUNING_CUTOFF
constexpr char const * CommonDBPragmaSync
constexpr std::array< char const *, 6 > WalletDBInit
constexpr std::array< char const *, 5 > LgrDBInit
constexpr char const * CommonDBPragmaJournal