1#ifndef XRPL_APP_DATA_DBINIT_H_INCLUDED
2#define XRPL_APP_DATA_DBINIT_H_INCLUDED
27 {
"BEGIN TRANSACTION;",
29 "CREATE TABLE IF NOT EXISTS Ledgers ( \
30 LedgerHash CHARACTER(64) PRIMARY KEY, \
31 LedgerSeq BIGINT UNSIGNED, \
32 PrevHash CHARACTER(64), \
33 TotalCoins BIGINT UNSIGNED, \
34 ClosingTime BIGINT UNSIGNED, \
35 PrevClosingTime BIGINT UNSIGNED, \
36 CloseTimeRes BIGINT UNSIGNED, \
37 CloseFlags BIGINT UNSIGNED, \
38 AccountSetHash CHARACTER(64), \
39 TransSetHash CHARACTER(64) \
41 "CREATE INDEX IF NOT EXISTS SeqLedger ON Ledgers(LedgerSeq);",
44 "DROP TABLE IF EXISTS Validations;",
51inline constexpr auto TxDBName{
"transaction.db"};
54 {
"BEGIN TRANSACTION;",
56 "CREATE TABLE IF NOT EXISTS Transactions ( \
57 TransID CHARACTER(64) PRIMARY KEY, \
58 TransType CHARACTER(24), \
59 FromAcct CHARACTER(35), \
60 FromSeq BIGINT UNSIGNED, \
61 LedgerSeq BIGINT UNSIGNED, \
62 Status CHARACTER(1), \
66 "CREATE INDEX IF NOT EXISTS TxLgrIndex ON \
67 Transactions(LedgerSeq);",
69 "CREATE TABLE IF NOT EXISTS AccountTransactions ( \
70 TransID CHARACTER(64), \
71 Account CHARACTER(64), \
72 LedgerSeq BIGINT UNSIGNED, \
75 "CREATE INDEX IF NOT EXISTS AcctTxIDIndex ON \
76 AccountTransactions(TransID);",
77 "CREATE INDEX IF NOT EXISTS AcctTxIndex ON \
78 AccountTransactions(Account, LedgerSeq, TxnSeq, TransID);",
79 "CREATE INDEX IF NOT EXISTS AcctLgrIndex ON \
80 AccountTransactions(LedgerSeq, Account, TransID);",
89 {
"BEGIN TRANSACTION;",
97 "CREATE TABLE IF NOT EXISTS NodeIdentity ( \
98 PublicKey CHARACTER(53), \
99 PrivateKey CHARACTER(52) \
103 "CREATE TABLE IF NOT EXISTS PeerReservations ( \
104 PublicKey CHARACTER(53) UNIQUE NOT NULL, \
105 Description CHARACTER(64) NOT NULL \
109 "CREATE TABLE IF NOT EXISTS ValidatorManifests ( \
110 RawData BLOB NOT NULL \
113 "CREATE TABLE IF NOT EXISTS PublisherManifests ( \
114 RawData BLOB NOT NULL \
117 "END TRANSACTION;"}};
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
constexpr std::array< char const *, 8 > TxDBInit
constexpr char const * CommonDBPragmaSync
constexpr std::array< char const *, 5 > LgrDBInit
constexpr std::array< char const *, 6 > WalletDBInit
constexpr char const * CommonDBPragmaTemp
constexpr std::uint32_t SQLITE_TUNING_CUTOFF
constexpr char const * CommonDBPragmaJournal
constexpr auto WalletDBName