chore: Switch to glebarez/sqlite and add migration support

- Replace mattn/go-sqlite3 with glebarez/sqlite for better cross-platform compatibility
- Add gormigrate for database migration support
- Update go.mod and go.sum with new dependencies
- Modify database initialization to use the new SQLite driver
- Ignore compiled binary in .gitignore
This commit is contained in:
StarFleetCPTN committed 2025-03-08 12:41:53 -08:00
1 parent 2b2c305ccb
commit 248f9cce51
4 files changed
+39 -9

No files matched your search

+2 -2
View File
@@ -8,7 +8,7 @@ import (
"time"
"github.com/starfleetcptn/gomft/internal/auth"
"gorm.io/driver/sqlite"
"github.com/glebarez/sqlite"
"gorm.io/gorm"
)
@@ -136,7 +136,7 @@ func Initialize(dbPath string) (*DB, error) {
return nil, fmt.Errorf("failed to create database directory: %v", err)
}
// Open database connection
// Open database connection with modernc.org/sqlite driver
db, err := gorm.Open(sqlite.Open(dbPath), &gorm.Config{})
if err != nil {
return nil, fmt.Errorf("failed to connect to database: %v", err)