Class: Mammoth::OperationalState::SQLiteAdapter
- Defined in:
- lib/mammoth/operational_state/sqlite_adapter.rb
Overview
SQLite-backed operational state adapter used by Mammoth OSS.
Instance Attribute Summary collapse
-
#sqlite_store ⇒ Object
readonly
Returns the value of attribute sqlite_store.
Class Method Summary collapse
-
.from_config(config) ⇒ Mammoth::OperationalState::SQLiteAdapter
Build a SQLite state adapter from Mammoth configuration.
Instance Method Summary collapse
- #checkpoint_store ⇒ Mammoth::CheckpointStore
- #dead_letter_store ⇒ Mammoth::DeadLetterStore
- #delivered_envelope_store ⇒ Mammoth::DeliveredEnvelopeStore
-
#initialize(sqlite_store) ⇒ SQLiteAdapter
constructor
A new instance of SQLiteAdapter.
-
#summary ⇒ Hash
JSON-friendly SQLite state summary.
Constructor Details
#initialize(sqlite_store) ⇒ SQLiteAdapter
Returns a new instance of SQLiteAdapter.
10 11 12 13 |
# File 'lib/mammoth/operational_state/sqlite_adapter.rb', line 10 def initialize(sqlite_store) super() @sqlite_store = sqlite_store.bootstrap! end |
Instance Attribute Details
#sqlite_store ⇒ Object (readonly)
Returns the value of attribute sqlite_store.
7 8 9 |
# File 'lib/mammoth/operational_state/sqlite_adapter.rb', line 7 def sqlite_store @sqlite_store end |
Class Method Details
.from_config(config) ⇒ Mammoth::OperationalState::SQLiteAdapter
Build a SQLite state adapter from Mammoth configuration.
19 20 21 |
# File 'lib/mammoth/operational_state/sqlite_adapter.rb', line 19 def self.from_config(config) new(SQLiteStore.connect(config.dig("sqlite", "path"))) end |
Instance Method Details
#checkpoint_store ⇒ Mammoth::CheckpointStore
24 25 26 |
# File 'lib/mammoth/operational_state/sqlite_adapter.rb', line 24 def checkpoint_store @checkpoint_store ||= CheckpointStore.new(sqlite_store) end |
#dead_letter_store ⇒ Mammoth::DeadLetterStore
29 30 31 |
# File 'lib/mammoth/operational_state/sqlite_adapter.rb', line 29 def dead_letter_store @dead_letter_store ||= DeadLetterStore.new(sqlite_store) end |
#delivered_envelope_store ⇒ Mammoth::DeliveredEnvelopeStore
34 35 36 |
# File 'lib/mammoth/operational_state/sqlite_adapter.rb', line 34 def delivered_envelope_store @delivered_envelope_store ||= DeliveredEnvelopeStore.new(sqlite_store) end |
#summary ⇒ Hash
Returns JSON-friendly SQLite state summary.
39 40 41 |
# File 'lib/mammoth/operational_state/sqlite_adapter.rb', line 39 def summary super.merge(adapter: "sqlite", path: sqlite_store.path, tables: sqlite_store.tables) end |