From a397ddba61ce2b3546b4a042f7aa50028ab827be Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Sun, 21 Jul 2024 17:43:48 +0200 Subject: [PATCH] fix pg connection string --- context.go | 4 ++-- docker-compose.yml | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/context.go b/context.go index 48b38da..34cdeaf 100644 --- a/context.go +++ b/context.go @@ -84,7 +84,7 @@ func connectAndMigrate(opts *connectMigrateOpts) (*sql.DB, error) { dbtype = "postgres" default: // default to sqlite - datasource = opts.SQliteConnection + datasource = fmt.Sprintf("%s?_timeout=5000&_journal=WAL&_cache=shared", opts.SQliteConnection) dbtype = "sqlite3" } @@ -93,7 +93,7 @@ func connectAndMigrate(opts *connectMigrateOpts) (*sql.DB, error) { return nil, nil } - db, err := sql.Open(dbtype, fmt.Sprintf("%s?_timeout=5000&_journal=WAL&_cache=shared", datasource)) + db, err := sql.Open(dbtype, datasource) if err != nil { return nil, err } diff --git a/docker-compose.yml b/docker-compose.yml index c2c7ce6..db974c1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,7 +24,6 @@ services: - PGPORT=5432 - PGDATABASE=postgres - LOGLEVEL=debug - - CGO_ENABLED=0 - GO_FLAGS=-count=1 working_dir: /data command: ["go", "test", "./...", "-cover"]