Class: XRBP::NodeStore::SQLDB
- Inherits:
-
Object
- Object
- XRBP::NodeStore::SQLDB
- Defined in:
- lib/xrbp/nodestore/sqldb.rb
Overview
Wraps sqlite3 database created/maintianed by rippled. Allows client to query for data stored in sql database.
Defined Under Namespace
Classes: Ledgers
Instance Method Summary collapse
-
#initialize(dir) ⇒ SQLDB
constructor
SQL DB intializer.
- #ledger_db ⇒ Object
- #ledgers ⇒ Object
- #tx_db ⇒ Object
Constructor Details
#initialize(dir) ⇒ SQLDB
SQL DB intializer
15 16 17 |
# File 'lib/xrbp/nodestore/sqldb.rb', line 15 def initialize(dir) @dir = dir end |
Instance Method Details
#ledger_db ⇒ Object
19 20 21 |
# File 'lib/xrbp/nodestore/sqldb.rb', line 19 def ledger_db @ledger_db ||= SQLite3::Database.new File.join(@dir, "..", "ledger.db") end |
#ledgers ⇒ Object
27 28 29 |
# File 'lib/xrbp/nodestore/sqldb.rb', line 27 def ledgers @ledgers ||= Ledgers.new(self) end |
#tx_db ⇒ Object
23 24 25 |
# File 'lib/xrbp/nodestore/sqldb.rb', line 23 def tx_db @ledger_db ||= SQLite3::Database.new File.join(@dir, "..", "transaction.db") end |