Switch to pure-Go SQLite driver for cross-compilation

- Replace mattn/go-sqlite3 with modernc.org/sqlite (pure-Go, no CGO required)
- Update GoReleaser config to disable CGO for ARM64 builds
- Change driver name from 'sqlite3' to 'sqlite' in all sql.Open calls
- Enables successful cross-compilation for ARM64 without cross-compiler toolchain
- All tests passing with new driver
This commit is contained in:
2025-11-28 01:36:18 +01:00
parent 0e909182c2
commit 4290ee3455
10 changed files with 1047 additions and 22 deletions
@@ -15,7 +15,7 @@ import (
"apocapoc-api/internal/infrastructure/crypto"
"apocapoc-api/internal/infrastructure/persistence/sqlite"
_ "github.com/mattn/go-sqlite3"
_ "modernc.org/sqlite"
)
type TestServer struct {
@@ -24,7 +24,7 @@ type TestServer struct {
}
func setupTestServer(t *testing.T) *TestServer {
db, err := sql.Open("sqlite3", ":memory:")
db, err := sql.Open("sqlite", ":memory:")
if err != nil {
t.Fatalf("Failed to open test database: %v", err)
}