Updated GORM driver.

Fixes https://github.com/go-gorm/sqlite/issues/192.
This commit is contained in:
Nuno Cruces
2025-01-07 12:29:16 +00:00
parent 8175407754
commit 31c5000875
6 changed files with 192 additions and 32 deletions

View File

@@ -14,6 +14,11 @@ import (
"github.com/ncruces/go-sqlite3/driver"
)
type _Dialector struct {
DSN string
Conn gorm.ConnPool
}
// Open opens a GORM dialector from a data source name.
func Open(dsn string) gorm.Dialector {
return &_Dialector{DSN: dsn}
@@ -24,11 +29,6 @@ func OpenDB(db gorm.ConnPool) gorm.Dialector {
return &_Dialector{Conn: db}
}
type _Dialector struct {
DSN string
Conn gorm.ConnPool
}
func (dialector _Dialector) Name() string {
return "sqlite"
}