You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Switch to modernc.org/sqlite for CGO-free cross-compilation
Replace mattn/go-sqlite3 with modernc.org/sqlite to eliminate CGO
dependency and simplify cross-platform builds. The modernc.org/sqlite
driver provides a pure Go SQLite implementation compatible with the
database/sql interface.
Changes:
Database Driver:
• Replace mattn/go-sqlite3 with modernc.org/sqlite across all modules
• Register modernc.org/sqlite as "sqlite3" driver in memory package for Ent compatibility
• Update SQLite connection string pragma syntax from _fk=1 to _pragma=foreign_keys(1)
• Update journal mode pragma from _journal=WAL to _pragma=journal_mode(WAL)
• Update busy timeout pragma from _busy_timeout=5000 to _pragma=busy_timeout(5000)
Dependencies:
• Update backend/go.mod to include modernc.org/sqlite v1.33.1 and related dependencies
• Update frontend/cli/go.mod to include modernc.org/sqlite v1.33.1
• Add supporting libraries: modernc.org/libc, mathutil, memory, token, strutil, gc/v3
• Add adrg/xdg v0.5.3 for platform-specific paths
Testing:
• Update all test files to import modernc.org/sqlite instead of go-sqlite3
• Update test connection strings to use new pragma syntax
• Add EventBus and MessageHub to test setup where missing
This change eliminates the need for CGO during compilation, enabling
easier cross-compilation for multiple platforms and architectures
without requiring a C compiler toolchain.
Co-authored-by: construct-agent <noreply@construct.sh>
0 commit comments