fix(dolt): proper server mode support for routing and storage
- FindDatabasePath now handles Dolt server mode (no local dir required) - main.go uses NewFromConfigWithOptions for Dolt to read server settings - Routing uses factory via callback to respect backend configuration - Handle Dolt "database exists" error (error 1007) gracefully Previously, Dolt server mode failed because: 1. FindDatabasePath required a local directory to exist 2. main.go bypassed server mode config when creating Dolt storage 3. Routing always opened SQLite regardless of backend config Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
Steve Yegge
parent
13c362e67e
commit
e82f5136c1
@@ -232,7 +232,11 @@ func findDatabaseInBeadsDir(beadsDir string, warnOnIssues bool) string {
|
||||
if cfg, err := configfile.Load(beadsDir); err == nil && cfg != nil {
|
||||
backend := cfg.GetBackend()
|
||||
if backend == configfile.BackendDolt {
|
||||
// For Dolt, check if the configured database directory exists
|
||||
// For Dolt server mode, database is on the server - no local directory required
|
||||
if cfg.IsDoltServerMode() {
|
||||
return cfg.DatabasePath(beadsDir)
|
||||
}
|
||||
// For embedded Dolt, check if the configured database directory exists
|
||||
doltPath := cfg.DatabasePath(beadsDir)
|
||||
if info, err := os.Stat(doltPath); err == nil && info.IsDir() {
|
||||
return doltPath
|
||||
|
||||
Reference in New Issue
Block a user