| 
    rippled
    
   | 
 
#include <SQLiteDatabase.h>


Public Types | |
| using | AccountTx = std::pair< std::shared_ptr< Transaction >, std::shared_ptr< TxMeta > > | 
| using | AccountTxs = std::vector< AccountTx > | 
| using | txnMetaLedgerType = std::tuple< Blob, Blob, std::uint32_t > | 
| using | MetaTxsList = std::vector< txnMetaLedgerType > | 
| using | LedgerSequence = uint32_t | 
| using | LedgerHash = uint256 | 
| using | LedgerShortcut = RPC::LedgerShortcut | 
| using | LedgerSpecifier = std::variant< LedgerRange, LedgerShortcut, LedgerSequence, LedgerHash > | 
Public Member Functions | |
| virtual std::optional< LedgerIndex > | getTransactionsMinLedgerSeq ()=0 | 
| getTransactionsMinLedgerSeq Returns the minimum ledger sequence stored in the Transactions table.   | |
| virtual std::optional< LedgerIndex > | getAccountTransactionsMinLedgerSeq ()=0 | 
| getAccountTransactionsMinLedgerSeq Returns the minimum ledger sequence stored in the AccountTransactions table.   | |
| virtual void | deleteTransactionByLedgerSeq (LedgerIndex ledgerSeq)=0 | 
| deleteTransactionByLedgerSeq Deletes transactions from the ledger with the given sequence.   | |
| virtual void | deleteBeforeLedgerSeq (LedgerIndex ledgerSeq)=0 | 
| deleteBeforeLedgerSeq Deletes all ledgers with a sequence number less than or equal to the given ledger sequence.   | |
| virtual void | deleteTransactionsBeforeLedgerSeq (LedgerIndex ledgerSeq)=0 | 
| deleteTransactionsBeforeLedgerSeq Deletes all transactions with a sequence number less than or equal to the given ledger sequence.   | |
| virtual void | deleteAccountTransactionsBeforeLedgerSeq (LedgerIndex ledgerSeq)=0 | 
| deleteAccountTransactionsBeforeLedgerSeq Deletes all account transactions with a sequence number less than or equal to the given ledger sequence.   | |
| virtual std::size_t | getTransactionCount ()=0 | 
| getTransactionCount Returns the number of transactions.   | |
| virtual std::size_t | getAccountTransactionCount ()=0 | 
| getAccountTransactionCount Returns the number of account transactions.   | |
| virtual struct CountMinMax | getLedgerCountMinMax ()=0 | 
| getLedgerCountMinMax Returns the minimum ledger sequence, maximum ledger sequence and total number of saved ledgers.   | |
| virtual bool | saveValidatedLedger (std::shared_ptr< Ledger const > const &ledger, bool current)=0 | 
| saveValidatedLedger Saves a ledger into the database.   | |
| virtual std::optional< LedgerInfo > | getLimitedOldestLedgerInfo (LedgerIndex ledgerFirstIndex)=0 | 
| getLimitedOldestLedgerInfo Returns the info of the oldest ledger whose sequence number is greater than or equal to the given sequence number.   | |
| virtual std::optional< LedgerInfo > | getLimitedNewestLedgerInfo (LedgerIndex ledgerFirstIndex)=0 | 
| getLimitedNewestLedgerInfo Returns the info of the newest ledger whose sequence number is greater than or equal to the given sequence number.   | |
| virtual AccountTxs | getOldestAccountTxs (AccountTxOptions const &options)=0 | 
| getOldestAccountTxs Returns the oldest transactions for the account that matches the given criteria starting from the provided offset.   | |
| virtual AccountTxs | getNewestAccountTxs (AccountTxOptions const &options)=0 | 
| getNewestAccountTxs Returns the newest transactions for the account that matches the given criteria starting from the provided offset.   | |
| virtual MetaTxsList | getOldestAccountTxsB (AccountTxOptions const &options)=0 | 
| getOldestAccountTxsB Returns the oldest transactions in binary form for the account that matches the given criteria starting from the provided offset.   | |
| virtual MetaTxsList | getNewestAccountTxsB (AccountTxOptions const &options)=0 | 
| getNewestAccountTxsB Returns the newest transactions in binary form for the account that matches the given criteria starting from the provided offset.   | |
| virtual std::pair< AccountTxs, std::optional< AccountTxMarker > > | oldestAccountTxPage (AccountTxPageOptions const &options)=0 | 
| oldestAccountTxPage Returns the oldest transactions for the account that matches the given criteria starting from the provided marker.   | |
| virtual std::pair< AccountTxs, std::optional< AccountTxMarker > > | newestAccountTxPage (AccountTxPageOptions const &options)=0 | 
| newestAccountTxPage Returns the newest transactions for the account that matches the given criteria starting from the provided marker.   | |
| virtual std::pair< MetaTxsList, std::optional< AccountTxMarker > > | oldestAccountTxPageB (AccountTxPageOptions const &options)=0 | 
| oldestAccountTxPageB Returns the oldest transactions in binary form for the account that matches the given criteria starting from the provided marker.   | |
| virtual std::pair< MetaTxsList, std::optional< AccountTxMarker > > | newestAccountTxPageB (AccountTxPageOptions const &options)=0 | 
| newestAccountTxPageB Returns the newest transactions in binary form for the account that matches the given criteria starting from the provided marker.   | |
| virtual std::variant< AccountTx, TxSearched > | getTransaction (uint256 const &id, std::optional< ClosedInterval< uint32_t > > const &range, error_code_i &ec)=0 | 
| getTransaction Returns the transaction with the given hash.   | |
| virtual uint32_t | getKBUsedAll ()=0 | 
| getKBUsedAll Returns the amount of space used by all databases.   | |
| virtual uint32_t | getKBUsedLedger ()=0 | 
| getKBUsedLedger Returns the amount of space space used by the ledger database.   | |
| virtual uint32_t | getKBUsedTransaction ()=0 | 
| getKBUsedTransaction Returns the amount of space used by the transaction database.   | |
| virtual void | closeLedgerDB ()=0 | 
| Closes the ledger database.   | |
| virtual void | closeTransactionDB ()=0 | 
| Closes the transaction database.   | |
| virtual std::optional< LedgerIndex > | getMinLedgerSeq ()=0 | 
| getMinLedgerSeq Returns the minimum ledger sequence in the Ledgers table.   | |
| virtual std::optional< LedgerIndex > | getMaxLedgerSeq ()=0 | 
| getMaxLedgerSeq Returns the maximum ledger sequence in the Ledgers table.   | |
| virtual std::optional< LedgerInfo > | getLedgerInfoByIndex (LedgerIndex ledgerSeq)=0 | 
| getLedgerInfoByIndex Returns a ledger by its sequence.   | |
| virtual std::optional< LedgerInfo > | getNewestLedgerInfo ()=0 | 
| getNewestLedgerInfo Returns the info of the newest saved ledger.   | |
| virtual std::optional< LedgerInfo > | getLedgerInfoByHash (uint256 const &ledgerHash)=0 | 
| getLedgerInfoByHash Returns the info of the ledger with given hash.   | |
| virtual uint256 | getHashByIndex (LedgerIndex ledgerIndex)=0 | 
| getHashByIndex Returns the hash of the ledger with the given sequence.   | |
| virtual std::optional< LedgerHashPair > | getHashesByIndex (LedgerIndex ledgerIndex)=0 | 
| getHashesByIndex Returns the hashes of the ledger and its parent as specified by the ledgerIndex.   | |
| virtual std::map< LedgerIndex, LedgerHashPair > | getHashesByIndex (LedgerIndex minSeq, LedgerIndex maxSeq)=0 | 
| getHashesByIndex Returns hashes of each ledger and its parent for all ledgers within the provided range.   | |
| virtual std::vector< std::shared_ptr< Transaction > > | getTxHistory (LedgerIndex startIndex)=0 | 
| getTxHistory Returns the 20 most recent transactions starting from the given number.   | |
| virtual bool | ledgerDbHasSpace (Config const &config)=0 | 
| ledgerDbHasSpace Checks if the ledger database has available space.   | |
| virtual bool | transactionDbHasSpace (Config const &config)=0 | 
| transactionDbHasSpace Checks if the transaction database has available space.   | |
Static Public Member Functions | |
| static std::unique_ptr< RelationalDatabase > | init (Application &app, Config const &config, JobQueue &jobQueue) | 
| init Creates and returns an appropriate RelationalDatabase instance based on configuration.   | |
Definition at line 27 of file SQLiteDatabase.h.
      
  | 
  inherited | 
Definition at line 85 of file RelationalDatabase.h.
      
  | 
  inherited | 
Definition at line 87 of file RelationalDatabase.h.
      
  | 
  inherited | 
Definition at line 88 of file RelationalDatabase.h.
      
  | 
  inherited | 
Definition at line 89 of file RelationalDatabase.h.
      
  | 
  inherited | 
Definition at line 91 of file RelationalDatabase.h.
      
  | 
  inherited | 
Definition at line 92 of file RelationalDatabase.h.
      
  | 
  inherited | 
Definition at line 93 of file RelationalDatabase.h.
      
  | 
  inherited | 
Definition at line 94 of file RelationalDatabase.h.
      
  | 
  pure virtual | 
getTransactionsMinLedgerSeq Returns the minimum ledger sequence stored in the Transactions table.
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtual | 
getAccountTransactionsMinLedgerSeq Returns the minimum ledger sequence stored in the AccountTransactions table.
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtual | 
deleteTransactionByLedgerSeq Deletes transactions from the ledger with the given sequence.
| ledgerSeq | Ledger sequence. | 
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtual | 
deleteBeforeLedgerSeq Deletes all ledgers with a sequence number less than or equal to the given ledger sequence.
| ledgerSeq | Ledger sequence. | 
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtual | 
deleteTransactionsBeforeLedgerSeq Deletes all transactions with a sequence number less than or equal to the given ledger sequence.
| ledgerSeq | Ledger sequence. | 
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtual | 
deleteAccountTransactionsBeforeLedgerSeq Deletes all account transactions with a sequence number less than or equal to the given ledger sequence.
| ledgerSeq | Ledger sequence. | 
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtual | 
getTransactionCount Returns the number of transactions.
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtual | 
getAccountTransactionCount Returns the number of account transactions.
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtual | 
getLedgerCountMinMax Returns the minimum ledger sequence, maximum ledger sequence and total number of saved ledgers.
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtual | 
saveValidatedLedger Saves a ledger into the database.
| ledger | The ledger. | 
| current | True if the ledger is current. | 
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtual | 
getLimitedOldestLedgerInfo Returns the info of the oldest ledger whose sequence number is greater than or equal to the given sequence number.
| ledgerFirstIndex | Minimum ledger sequence. | 
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtual | 
getLimitedNewestLedgerInfo Returns the info of the newest ledger whose sequence number is greater than or equal to the given sequence number.
| ledgerFirstIndex | Minimum ledger sequence. | 
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtual | 
getOldestAccountTxs Returns the oldest transactions for the account that matches the given criteria starting from the provided offset.
| options | Struct AccountTxOptions which contains the criteria to match: the account, ledger search range, the offset of the first entry to return, the number of transactions to return, a flag if this number is unlimited. | 
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtual | 
getNewestAccountTxs Returns the newest transactions for the account that matches the given criteria starting from the provided offset.
| options | Struct AccountTxOptions which contains the criteria to match: the account, the ledger search range, the offset of the first entry to return, the number of transactions to return, a flag if this number unlimited. | 
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtual | 
getOldestAccountTxsB Returns the oldest transactions in binary form for the account that matches the given criteria starting from the provided offset.
| options | Struct AccountTxOptions which contains the criteria to match: the account, the ledger search range, the offset of the first entry to return, the number of transactions to return, a flag if this number unlimited. | 
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtual | 
getNewestAccountTxsB Returns the newest transactions in binary form for the account that matches the given criteria starting from the provided offset.
| options | Struct AccountTxOptions which contains the criteria to match: the account, the ledger search range, the offset of the first entry to return, the number of transactions to return, a flag if this number is unlimited. | 
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtual | 
oldestAccountTxPage Returns the oldest transactions for the account that matches the given criteria starting from the provided marker.
| options | Struct AccountTxPageOptions which contains the criteria to match: the account, the ledger search range, the marker of first returned entry, the number of transactions to return, a flag if this number is unlimited. | 
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtual | 
newestAccountTxPage Returns the newest transactions for the account that matches the given criteria starting from the provided marker.
| options | Struct AccountTxPageOptions which contains the criteria to match: the account, the ledger search range, the marker of the first returned entry, the number of transactions to return, a flag if this number unlimited. | 
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtual | 
oldestAccountTxPageB Returns the oldest transactions in binary form for the account that matches the given criteria starting from the provided marker.
| options | Struct AccountTxPageOptions which contains criteria to match: the account, the ledger search range, the marker of the first returned entry, the number of transactions to return, a flag if this number unlimited. | 
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtual | 
newestAccountTxPageB Returns the newest transactions in binary form for the account that matches the given criteria starting from the provided marker.
| options | Struct AccountTxPageOptions which contains the criteria to match: the account, the ledger search range, the marker of the first returned entry, the number of transactions to return, a flag if this number is unlimited. | 
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtual | 
getTransaction Returns the transaction with the given hash.
If a range is provided but the transaction is not found, then check if all ledgers in the range are present in the database.
| id | Hash of the transaction. | 
| range | Range of ledgers to check, if present. | 
| ec | Default error code value. | 
      
  | 
  pure virtual | 
getKBUsedAll Returns the amount of space used by all databases.
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtual | 
getKBUsedLedger Returns the amount of space space used by the ledger database.
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtual | 
getKBUsedTransaction Returns the amount of space used by the transaction database.
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtual | 
Closes the ledger database.
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtual | 
Closes the transaction database.
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  staticinherited | 
init Creates and returns an appropriate RelationalDatabase instance based on configuration.
| app | Application object. | 
| config | Config object. | 
| jobQueue | JobQueue object. | 
Definition at line 30 of file RelationalDatabase.cpp.
      
  | 
  pure virtualinherited | 
getMinLedgerSeq Returns the minimum ledger sequence in the Ledgers table.
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtualinherited | 
getMaxLedgerSeq Returns the maximum ledger sequence in the Ledgers table.
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtualinherited | 
getLedgerInfoByIndex Returns a ledger by its sequence.
| ledgerSeq | Ledger sequence. | 
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtualinherited | 
getNewestLedgerInfo Returns the info of the newest saved ledger.
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtualinherited | 
getLedgerInfoByHash Returns the info of the ledger with given hash.
| ledgerHash | Hash of the ledger. | 
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtualinherited | 
getHashByIndex Returns the hash of the ledger with the given sequence.
| ledgerIndex | Ledger sequence. | 
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtualinherited | 
getHashesByIndex Returns the hashes of the ledger and its parent as specified by the ledgerIndex.
| ledgerIndex | Ledger sequence. | 
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtualinherited | 
getHashesByIndex Returns hashes of each ledger and its parent for all ledgers within the provided range.
| minSeq | Minimum ledger sequence. | 
| maxSeq | Maximum ledger sequence. | 
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtualinherited | 
getTxHistory Returns the 20 most recent transactions starting from the given number.
| startIndex | First number of returned entry. | 
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtualinherited | 
ledgerDbHasSpace Checks if the ledger database has available space.
| config | Config object. | 
Implemented in ripple::SQLiteDatabaseImp.
      
  | 
  pure virtualinherited | 
transactionDbHasSpace Checks if the transaction database has available space.
| config | Config object. | 
Implemented in ripple::SQLiteDatabaseImp.