feat(dolt): add server mode support for multi-client access

- Add dolt_mode, dolt_server_host, dolt_server_port fields to configfile.Config
- Add IsDoltServerMode(), GetDoltServerHost(), GetDoltServerPort() helpers
- Update factory to read server mode config and set Options accordingly
- Skip bootstrap in server mode (database lives on server)
- Pass Database name to dolt.Config for USE statement after connecting
- Disable dolt stats collection to avoid lock issues in embedded mode

This enables bd to connect to a running dolt sql-server (started via
'gt dolt start') instead of using embedded mode, allowing multi-client
access without file locking conflicts.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
mayor
2026-01-23 22:33:55 -08:00
committed by gastown/crew/george
parent db0c6fbd3f
commit 13c362e67e
4 changed files with 23 additions and 6 deletions

View File

@@ -838,6 +838,18 @@ var rootCmd = &cobra.Command{
if backend == configfile.BackendDolt {
// For Dolt, use the dolt subdirectory
doltPath := filepath.Join(beadsDir, "dolt")
// Check if server mode is configured in metadata.json
cfg, cfgErr := configfile.Load(beadsDir)
if cfgErr == nil && cfg != nil && cfg.IsDoltServerMode() {
opts.ServerMode = true
opts.ServerHost = cfg.GetDoltServerHost()
opts.ServerPort = cfg.GetDoltServerPort()
if cfg.Database != "" {
opts.Database = cfg.Database
}
}
store, err = factory.NewWithOptions(rootCtx, backend, doltPath, opts)
} else {
// SQLite backend