Moar fix
This commit is contained in:
parent
1bea7db60c
commit
3090acd6ee
|
@ -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"
|
||||||
}
|
}
|
||||||
|
|
|
@ -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(),
|
||||||
|
|
Loading…
Reference in a new issue