Merge branch 'main' of github.com:steveyegge/beads

This commit is contained in:
Steve Yegge
2025-11-07 14:22:36 -08:00
8 changed files with 95 additions and 10 deletions

View File

@@ -13,7 +13,7 @@ builds:
main: ./cmd/bd
binary: bd
env:
- CGO_ENABLED=1
- CGO_ENABLED=0
goos:
- linux
- darwin

View File

@@ -314,7 +314,7 @@ func checkIDFormat(path string) doctorCheck {
}
// Open database
db, err := sql.Open("sqlite", dbPath+"?mode=ro")
db, err := sql.Open("sqlite3", dbPath+"?mode=ro")
if err != nil {
return doctorCheck{
Name: "Issue IDs",
@@ -400,7 +400,7 @@ func checkCLIVersion() doctorCheck {
}
func getDatabaseVersionFromPath(dbPath string) string {
db, err := sql.Open("sqlite", dbPath+"?mode=ro")
db, err := sql.Open("sqlite3", dbPath+"?mode=ro")
if err != nil {
return "unknown"
}
@@ -785,7 +785,7 @@ func checkDatabaseJSONLSync(path string) doctorCheck {
jsonlCount, jsonlPrefixes, jsonlErr := countJSONLIssues(jsonlPath)
// Single database open for all queries (instead of 3 separate opens)
db, err := sql.Open("sqlite", dbPath)
db, err := sql.Open("sqlite3", dbPath)
if err != nil {
// Database can't be opened. If JSONL has issues, suggest recovery.
if jsonlErr == nil && jsonlCount > 0 {
@@ -990,7 +990,7 @@ func checkPermissions(path string) doctorCheck {
dbPath := filepath.Join(beadsDir, beads.CanonicalDatabaseName)
if _, err := os.Stat(dbPath); err == nil {
// Try to open database
db, err := sql.Open("sqlite", dbPath)
db, err := sql.Open("sqlite3", dbPath)
if err != nil {
return doctorCheck{
Name: "Permissions",
@@ -1038,7 +1038,7 @@ func checkDependencyCycles(path string) doctorCheck {
}
// Open database to check for cycles
db, err := sql.Open("sqlite", dbPath)
db, err := sql.Open("sqlite3", dbPath)
if err != nil {
return doctorCheck{
Name: "Dependency Cycles",

View File

@@ -84,7 +84,7 @@ CREATE INDEX IF NOT EXISTS idx_checkpoints_execution ON myapp_checkpoints(execut
`
func InitializeMyAppSchema(dbPath string) error {
db, err := sql.Open("sqlite", dbPath)
db, err := sql.Open("sqlite3", dbPath)
if err != nil {
return err
}
@@ -572,7 +572,7 @@ if dbPath == "" {
}
// Open your own connection to the same database
db, err := sql.Open("sqlite", dbPath)
db, err := sql.Open("sqlite3", dbPath)
if err != nil {
log.Fatal(err)
}

View File

@@ -182,7 +182,7 @@ jsonlPath := beads.FindJSONLPath(dbPath)
```go
// Open same database for extension tables
db, err := sql.Open("sqlite", dbPath)
db, err := sql.Open("sqlite3", dbPath)
// Initialize extension schema
_, err = db.Exec(Schema)

View File

@@ -30,7 +30,7 @@ func main() {
// Open bd storage + extension database
store, _ := beads.NewSQLiteStorage(*dbPath)
defer store.Close()
db, _ := sql.Open("sqlite", *dbPath)
db, _ := sql.Open("sqlite3", *dbPath)
defer db.Close()
db.Exec("PRAGMA journal_mode=WAL")
db.Exec("PRAGMA busy_timeout=5000")

View File

@@ -19,6 +19,12 @@ func (s *Server) handleCompact(req *Request) Response {
}
store := s.storage
if store == nil {
return Response{
Success: false,
Error: "storage not available (global daemon deprecated - use local daemon instead with 'bd daemon' in your project)",
}
}
sqliteStore, ok := store.(*sqlite.SQLiteStorage)
if !ok {
@@ -228,6 +234,12 @@ func (s *Server) handleCompactStats(req *Request) Response {
}
store := s.storage
if store == nil {
return Response{
Success: false,
Error: "storage not available (global daemon deprecated - use local daemon instead with 'bd daemon' in your project)",
}
}
sqliteStore, ok := store.(*sqlite.SQLiteStorage)
if !ok {

View File

@@ -87,6 +87,12 @@ func (s *Server) handleCreate(req *Request) Response {
}
store := s.storage
if store == nil {
return Response{
Success: false,
Error: "storage not available (global daemon deprecated - use local daemon instead with 'bd daemon' in your project)",
}
}
ctx := s.reqCtx(req)
// If parent is specified, generate child ID
@@ -242,6 +248,12 @@ func (s *Server) handleUpdate(req *Request) Response {
}
store := s.storage
if store == nil {
return Response{
Success: false,
Error: "storage not available (global daemon deprecated - use local daemon instead with 'bd daemon' in your project)",
}
}
ctx := s.reqCtx(req)
updates := updatesFromArgs(updateArgs)
@@ -284,6 +296,12 @@ func (s *Server) handleClose(req *Request) Response {
}
store := s.storage
if store == nil {
return Response{
Success: false,
Error: "storage not available (global daemon deprecated - use local daemon instead with 'bd daemon' in your project)",
}
}
ctx := s.reqCtx(req)
if err := store.CloseIssue(ctx, closeArgs.ID, closeArgs.Reason, s.reqActor(req)); err != nil {
@@ -314,6 +332,12 @@ func (s *Server) handleList(req *Request) Response {
}
store := s.storage
if store == nil {
return Response{
Success: false,
Error: "storage not available (global daemon deprecated - use local daemon instead with 'bd daemon' in your project)",
}
}
filter := types.IssueFilter{
Limit: listArgs.Limit,
@@ -492,6 +516,13 @@ func (s *Server) handleResolveID(req *Request) Response {
}
}
if s.storage == nil {
return Response{
Success: false,
Error: "storage not available (global daemon deprecated - use local daemon instead with 'bd daemon' in your project)",
}
}
ctx := s.reqCtx(req)
resolvedID, err := utils.ResolvePartialID(ctx, s.storage, args.ID)
if err != nil {
@@ -518,6 +549,12 @@ func (s *Server) handleShow(req *Request) Response {
}
store := s.storage
if store == nil {
return Response{
Success: false,
Error: "storage not available (global daemon deprecated - use local daemon instead with 'bd daemon' in your project)",
}
}
ctx := s.reqCtx(req)
issue, err := store.GetIssue(ctx, showArgs.ID)
@@ -593,6 +630,12 @@ func (s *Server) handleReady(req *Request) Response {
}
store := s.storage
if store == nil {
return Response{
Success: false,
Error: "storage not available (global daemon deprecated - use local daemon instead with 'bd daemon' in your project)",
}
}
wf := types.WorkFilter{
Status: types.StatusOpen,
@@ -632,6 +675,12 @@ func (s *Server) handleStale(req *Request) Response {
}
store := s.storage
if store == nil {
return Response{
Success: false,
Error: "storage not available (global daemon deprecated - use local daemon instead with 'bd daemon' in your project)",
}
}
filter := types.StaleFilter{
Days: staleArgs.Days,
@@ -657,6 +706,12 @@ func (s *Server) handleStale(req *Request) Response {
func (s *Server) handleStats(req *Request) Response {
store := s.storage
if store == nil {
return Response{
Success: false,
Error: "storage not available (global daemon deprecated - use local daemon instead with 'bd daemon' in your project)",
}
}
ctx := s.reqCtx(req)
stats, err := store.GetStatistics(ctx)
@@ -684,6 +739,12 @@ func (s *Server) handleEpicStatus(req *Request) Response {
}
store := s.storage
if store == nil {
return Response{
Success: false,
Error: "storage not available (global daemon deprecated - use local daemon instead with 'bd daemon' in your project)",
}
}
ctx := s.reqCtx(req)
epics, err := store.GetEpicsEligibleForClosure(ctx)

View File

@@ -19,6 +19,12 @@ func (s *Server) handleDepAdd(req *Request) Response {
}
store := s.storage
if store == nil {
return Response{
Success: false,
Error: "storage not available (global daemon deprecated - use local daemon instead with 'bd daemon' in your project)",
}
}
dep := &types.Dependency{
IssueID: depArgs.FromID,
@@ -51,6 +57,12 @@ func (s *Server) handleSimpleStoreOp(req *Request, argsPtr interface{}, argDesc
}
store := s.storage
if store == nil {
return Response{
Success: false,
Error: "storage not available (global daemon deprecated - use local daemon instead with 'bd daemon' in your project)",
}
}
ctx := s.reqCtx(req)
if err := opFunc(ctx, store, s.reqActor(req)); err != nil {