This commit is contained in:
Neil Alexander 2022-10-07 11:48:06 +01:00
parent 1bea7db60c
commit 3090acd6ee
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
2 changed files with 3 additions and 3 deletions

View file

@ -117,7 +117,7 @@ func Test_insertMigration(t *testing.T) {
test.WithAllDatabases(t, func(t *testing.T, dbType test.DBType) { test.WithAllDatabases(t, func(t *testing.T, dbType test.DBType) {
conStr, close := test.PrepareDBConnectionString(t, dbType) conStr, close := test.PrepareDBConnectionString(t, dbType)
defer close() defer close()
driverName := "sqlite3" driverName := "sqlite"
if dbType == test.DBTypePostgres { if dbType == test.DBTypePostgres {
driverName = "postgres" driverName = "postgres"
} }

View file

@ -20,7 +20,7 @@ func Open(dbProperties *config.DatabaseOptions, writer Writer) (*sql.DB, error)
var driverName, dsn string var driverName, dsn string
switch { switch {
case dbProperties.ConnectionString.IsSQLite(): case dbProperties.ConnectionString.IsSQLite():
driverName = "sqlite3" driverName = "sqlite"
dsn, err = ParseFileURI(dbProperties.ConnectionString) dsn, err = ParseFileURI(dbProperties.ConnectionString)
if err != nil { if err != nil {
return nil, fmt.Errorf("ParseFileURI: %w", err) return nil, fmt.Errorf("ParseFileURI: %w", err)
@ -39,7 +39,7 @@ func Open(dbProperties *config.DatabaseOptions, writer Writer) (*sql.DB, error)
if err != nil { if err != nil {
return nil, err return nil, err
} }
if driverName != "sqlite3" { if driverName != "sqlite" {
logger := logrus.WithFields(logrus.Fields{ logger := logrus.WithFields(logrus.Fields{
"max_open_conns": dbProperties.MaxOpenConns(), "max_open_conns": dbProperties.MaxOpenConns(),
"max_idle_conns": dbProperties.MaxIdleConns(), "max_idle_conns": dbProperties.MaxIdleConns(),