Merge pull request #285 from ggozad/fix/info-readonly

Open database in read-only mode for info and history commands.
This commit is contained in:
Yiorgis Gozadinos 2026-02-20 19:40:41 +02:00 committed by GitHub
commit c529ecc940
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 3 deletions

View file

@ -1,6 +1,10 @@
# Changelog
## [Unreleased]
### Fixed
- **`info` and `history` commands**: Open database in read-only mode to prevent write failures on read-only filesystems
## [0.31.0] - 2026-02-20
### Added

View file

@ -80,10 +80,16 @@ class HaikuRAGApp: # pragma: no cover
versions = get_package_versions()
# Get comprehensive table statistics (this also runs migrations)
from haiku.rag.store.engine import Store
store = Store(self.db_path, config=self.config, skip_validation=True)
store = Store(
self.db_path,
config=self.config,
skip_validation=True,
read_only=True,
skip_migration_check=True,
before=self.before,
)
table_stats = store.get_stats()
# Read settings after Store init (migrations have run)
@ -199,7 +205,14 @@ class HaikuRAGApp: # pragma: no cover
self.console.print("[red]Database path does not exist.[/red]")
return
store = Store(self.db_path, config=self.config, skip_validation=True)
store = Store(
self.db_path,
config=self.config,
skip_validation=True,
read_only=True,
skip_migration_check=True,
before=self.before,
)
tables = ["documents", "chunks", "settings"]
if table: