beads/cmd/bd/dolt_server_nocgo.go
beads/crew/emma 2137693dad revert: restore embedded Dolt mode (was only supposed to be removed from Gas Town)
Revert commits e5330641 and 0df41523 which removed embedded Dolt mode
from the beads codebase. The embedded Dolt removal was only intended for
Gas Town, not for Beads.

Restores:
- dolthub/driver dependency and embedded connection path
- Advisory flock (AccessLock) for concurrent process protection
- Embedded connector lifecycle management in DoltStore
- All CGO build tags across ~45 files
- Vendored go-icu-regex library
- nocgo stub files for non-CGO builds
- Bootstrap and embedded_uow helpers
- factory_dolt_test.go and dolt_singleprocess_test.go

Merge conflict resolutions:
- store.go: TCP fail-fast check wrapped inside if cfg.ServerMode
- store.go: backtick-quoting for embedded CREATE DATABASE (prefix-based names)
- perf_dolt.go: port references updated from 3306 to 3307
- ci.yml: restored continue-on-error for Nix (dolthub/driver requires Go 1.25.6+)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Executed-By: beads/crew/emma
Rig: beads
Role: crew
2026-02-07 21:21:24 -08:00

51 lines
1.2 KiB
Go

//go:build !cgo
package main
import (
"context"
"errors"
)
// DoltServerHandle is a stub for non-CGO builds
type DoltServerHandle struct{}
// DoltDefaultSQLPort is the default SQL port for dolt server
const DoltDefaultSQLPort = 3306
// DoltDefaultRemotesAPIPort is the default remotesapi port for dolt server
const DoltDefaultRemotesAPIPort = 50051
// ErrDoltRequiresCGO is returned when dolt features are requested without CGO
var ErrDoltRequiresCGO = errors.New("dolt backend requires CGO; use pre-built binaries from GitHub releases or enable CGO")
// StartDoltServer returns an error in non-CGO builds
func StartDoltServer(ctx context.Context, dataDir, logFile string, sqlPort, remotePort int) (*DoltServerHandle, error) {
return nil, ErrDoltRequiresCGO
}
// Stop is a no-op stub
func (h *DoltServerHandle) Stop() error {
return nil
}
// SQLPort returns 0 in non-CGO builds
func (h *DoltServerHandle) SQLPort() int {
return 0
}
// RemotesAPIPort returns 0 in non-CGO builds
func (h *DoltServerHandle) RemotesAPIPort() int {
return 0
}
// Host returns empty string in non-CGO builds
func (h *DoltServerHandle) Host() string {
return ""
}
// DoltServerAvailable returns false when CGO is not available
func DoltServerAvailable() bool {
return false
}