The HookFiringStore decorator wraps DoltStorage for automatic hook
firing, but hides the concrete store's optional interfaces
(StoreLocator, BackupStore, Flattener, Compactor, etc.) from type
assertions. This caused "storage backend does not support X" errors
for flatten, backup, compact, dolt remote, and other operations.
Add storage.UnwrapStore() helper that peels the decorator before type
assertions, and apply it at all 24 callsites in cmd/bd/.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add bd context command showing effective backend identity (beads dir, repo
root, dolt mode, server endpoint, database, project ID, role) without requiring
DB open -- useful for degraded-state diagnostics. Supports --json.
Update error messages across 13 commands to suggest bd doctor for diagnosis
before bd init for reset, preventing unsafe destructive recovery paths.
Fix: use cfg.GetDoltServerPort() instead of doltserver.DefaultConfig() for
correct port resolution in context command. Add env var isolation in tests
to prevent BEADS_DOLT_PORT interference.
Co-Authored-By: matt wilkie <maphew@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The --no-db CLI flag was removed when beads switched to Dolt-only, but
several user-facing messages still referenced it:
- bd init help text mentioned "--no-db" as a valid option
- Error messages in 6 commands suggested "use 'bd --no-db'" as a fix
- Generic "no database found" hint suggested the removed flag
- Dead code block in init.go handled --no-db initialization
The config key (no-db: true in config.yaml) is still valid for the
CGO fallback path; only the CLI flag references are removed.
Fixes#1848
Adds a new `bd sql` subcommand that passes raw SQL queries directly to
the underlying database (SQLite or Dolt). Supports table, JSON, and CSV
output for SELECT queries, and reports rows affected for write queries.
Write queries are blocked in read-only mode via CheckReadonly.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Executed-By: beads/polecats/jasper
Rig: beads
Role: polecats