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:
@@ -6,7 +6,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
_ "modernc.org/sqlite"
|
||||
)
|
||||
|
||||
type Database struct {
|
||||
@@ -21,7 +21,7 @@ func NewDatabase(dbPath string) (*Database, error) {
|
||||
}
|
||||
}
|
||||
|
||||
conn, err := sql.Open("sqlite3", dbPath)
|
||||
conn, err := sql.Open("sqlite", dbPath)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to open database: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user