feat(federation): add dolt sql-server mode for daemon (bd-wkumz.2)
Add --federation flag to bd daemon start that runs dolt sql-server instead of the embedded driver. Enables multi-writer support and exposes remotesapi on port 8080 for peer-to-peer push/pull. Changes: - Add --federation flag to daemon start command - Create dolt server manager (internal/storage/dolt/server.go) - Update DoltStore to support server mode via MySQL protocol - Integrate server lifecycle into daemon (auto-start/stop) - Add tests for server management and server mode connections Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
Steve Yegge
parent
458fb7197a
commit
da4584ae57
@@ -26,6 +26,11 @@ func RegisterBackend(name string, factory BackendFactory) {
|
||||
type Options struct {
|
||||
ReadOnly bool
|
||||
LockTimeout time.Duration
|
||||
|
||||
// Dolt server mode options (federation)
|
||||
ServerMode bool // Connect to dolt sql-server instead of embedded
|
||||
ServerHost string // Server host (default: 127.0.0.1)
|
||||
ServerPort int // Server port (default: 3306)
|
||||
}
|
||||
|
||||
// New creates a storage backend based on the backend type.
|
||||
|
||||
@@ -41,6 +41,12 @@ func init() {
|
||||
fmt.Fprintf(os.Stderr, "\n Dolt database ready\n")
|
||||
}
|
||||
|
||||
return dolt.New(ctx, &dolt.Config{Path: path, ReadOnly: opts.ReadOnly})
|
||||
return dolt.New(ctx, &dolt.Config{
|
||||
Path: path,
|
||||
ReadOnly: opts.ReadOnly,
|
||||
ServerMode: opts.ServerMode,
|
||||
ServerHost: opts.ServerHost,
|
||||
ServerPort: opts.ServerPort,
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user