Class: OllamaAgent::Runtime::DatabaseRegistry
- Inherits:
-
Object
- Object
- OllamaAgent::Runtime::DatabaseRegistry
- Defined in:
- lib/ollama_agent/runtime/database_registry.rb
Overview
Opens kernel SQLite databases under root_dir/.ollama_agent/kernel/ and applies idempotent migrations.
Instance Attribute Summary collapse
-
#kernel_dir ⇒ Object
readonly
Returns the value of attribute kernel_dir.
Instance Method Summary collapse
-
#event_store ⇒ SQLite3::Database
Event store connection (WAL, synchronous FULL).
-
#initialize(root_dir:) ⇒ DatabaseRegistry
constructor
A new instance of DatabaseRegistry.
-
#runtime ⇒ SQLite3::Database
Runtime connection (WAL, synchronous NORMAL).
Constructor Details
#initialize(root_dir:) ⇒ DatabaseRegistry
Returns a new instance of DatabaseRegistry.
13 14 15 16 17 18 19 20 |
# File 'lib/ollama_agent/runtime/database_registry.rb', line 13 def initialize(root_dir:) @root_dir = root_dir @kernel_dir = File.join(root_dir, ".ollama_agent", "kernel") @open_mutex = Mutex.new @event_store = nil @runtime = nil @migrations_ran = false end |
Instance Attribute Details
#kernel_dir ⇒ Object (readonly)
Returns the value of attribute kernel_dir.
32 33 34 |
# File 'lib/ollama_agent/runtime/database_registry.rb', line 32 def kernel_dir @kernel_dir end |
Instance Method Details
#event_store ⇒ SQLite3::Database
Returns event store connection (WAL, synchronous FULL).
23 24 25 |
# File 'lib/ollama_agent/runtime/database_registry.rb', line 23 def event_store open_mutex_sync { @event_store ||= connect_event_store } end |
#runtime ⇒ SQLite3::Database
Returns runtime connection (WAL, synchronous NORMAL).
28 29 30 |
# File 'lib/ollama_agent/runtime/database_registry.rb', line 28 def runtime open_mutex_sync { @runtime ||= connect_runtime } end |