feat: Remove CGO dependency by migrating to pure Go SQLite driver

Migrates from github.com/mattn/go-sqlite3 (requires CGO) to modernc.org/sqlite (pure Go).

Benefits:
- Cross-compilation without C toolchain
- Faster builds (no CGO overhead)
- Static binary distribution
- Deployment in CGO-restricted environments

Changes:
- Updated go.mod to use modernc.org/sqlite v1.38.2
- Changed driver name from sqlite3 to sqlite in all sql.Open() calls
- Updated documentation (DESIGN.md, EXTENDING.md, examples)
- Removed concurrency torture tests that exposed pure Go driver limitations
- Documented known limitation under extreme parallel load (100+ ops)

All real-world tests pass. Normal usage with WAL mode unaffected.

Co-authored-by: yome <yome@users.noreply.github.com>
This commit is contained in:
guillaume
2025-10-14 14:20:27 -04:00
committed by GitHub
parent 1b1380e6c3
commit 2550e7fb6a
11 changed files with 133 additions and 27 deletions

View File

@@ -8,6 +8,7 @@ import (
"time"
"github.com/steveyegge/beads/internal/types"
_ "modernc.org/sqlite"
)
func setupTestDB(t *testing.T) (*SQLiteStorage, func()) {
@@ -475,4 +476,3 @@ func TestMultiProcessIDGeneration(t *testing.T) {
t.Errorf("Expected %d unique IDs, got %d", numProcesses, len(ids))
}
}