feat(storage): add --backend flag for Dolt backend selection
Phase 2 of Dolt integration - enables runtime backend selection: - Add --backend flag to bd init (sqlite|dolt) - Create storage factory for backend instantiation - Update daemon and main.go to use factory with config detection - Update database discovery to find Dolt backends via metadata.json - Fix Dolt schema init to split statements for MySQL compatibility - Add ReadOnly mode to skip schema init for read-only commands Usage: bd init --backend dolt --prefix myproject Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
gastown/crew/dennis
parent
e861a667fc
commit
669ea40684
@@ -12,6 +12,7 @@ const ConfigFileName = "metadata.json"
|
||||
type Config struct {
|
||||
Database string `json:"database"`
|
||||
JSONLExport string `json:"jsonl_export,omitempty"`
|
||||
Backend string `json:"backend,omitempty"` // "sqlite" (default) or "dolt"
|
||||
|
||||
// Deletions configuration
|
||||
DeletionsRetentionDays int `json:"deletions_retention_days,omitempty"` // 0 means use default (3 days)
|
||||
@@ -113,3 +114,17 @@ func (c *Config) GetDeletionsRetentionDays() int {
|
||||
}
|
||||
return c.DeletionsRetentionDays
|
||||
}
|
||||
|
||||
// Backend constants
|
||||
const (
|
||||
BackendSQLite = "sqlite"
|
||||
BackendDolt = "dolt"
|
||||
)
|
||||
|
||||
// GetBackend returns the configured backend type, defaulting to SQLite.
|
||||
func (c *Config) GetBackend() string {
|
||||
if c.Backend == "" {
|
||||
return BackendSQLite
|
||||
}
|
||||
return c.Backend
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user