From b1b12dc10ab197b51f267c74685b76483225b4b0 Mon Sep 17 00:00:00 2001 From: Ivan Sitkin Date: Wed, 24 Jan 2024 19:29:27 +0100 Subject: [PATCH 1/4] feat: some renames --- {migrations/goose => migoose}/migrations.go | 2 +- {migrations/goose => migoose}/migrations_test.go | 2 +- {database => tempdb}/database.go | 4 ++-- {database => tempdb}/database_postgres_test.go | 2 +- {database => tempdb}/querier/postgres.go | 0 {database => tempdb}/querier/querier.go | 0 6 files changed, 5 insertions(+), 5 deletions(-) rename {migrations/goose => migoose}/migrations.go (97%) rename {migrations/goose => migoose}/migrations_test.go (99%) rename {database => tempdb}/database.go (97%) rename {database => tempdb}/database_postgres_test.go (99%) rename {database => tempdb}/querier/postgres.go (100%) rename {database => tempdb}/querier/querier.go (100%) diff --git a/migrations/goose/migrations.go b/migoose/migrations.go similarity index 97% rename from migrations/goose/migrations.go rename to migoose/migrations.go index 57d67f4..e12626e 100644 --- a/migrations/goose/migrations.go +++ b/migoose/migrations.go @@ -1,4 +1,4 @@ -package migrations +package migoose import ( "context" diff --git a/migrations/goose/migrations_test.go b/migoose/migrations_test.go similarity index 99% rename from migrations/goose/migrations_test.go rename to migoose/migrations_test.go index fd01a79..4f89f2f 100644 --- a/migrations/goose/migrations_test.go +++ b/migoose/migrations_test.go @@ -1,4 +1,4 @@ -package migrations +package migoose import ( "context" diff --git a/database/database.go b/tempdb/database.go similarity index 97% rename from database/database.go rename to tempdb/database.go index 6e9f1b8..8186d0a 100644 --- a/database/database.go +++ b/tempdb/database.go @@ -1,4 +1,4 @@ -package database +package tempdb import ( "context" @@ -6,7 +6,7 @@ import ( "errors" "fmt" - "github.com/Alviner/drillerfy/database/querier" + "github.com/Alviner/drillerfy/tempdb/querier" "github.com/google/uuid" ) diff --git a/database/database_postgres_test.go b/tempdb/database_postgres_test.go similarity index 99% rename from database/database_postgres_test.go rename to tempdb/database_postgres_test.go index 3a1dad0..8ee4501 100644 --- a/database/database_postgres_test.go +++ b/tempdb/database_postgres_test.go @@ -1,4 +1,4 @@ -package database +package tempdb import ( "context" diff --git a/database/querier/postgres.go b/tempdb/querier/postgres.go similarity index 100% rename from database/querier/postgres.go rename to tempdb/querier/postgres.go diff --git a/database/querier/querier.go b/tempdb/querier/querier.go similarity index 100% rename from database/querier/querier.go rename to tempdb/querier/querier.go From 5f155a5c74c9c3cf8738da57ef66d17a6bb36ce6 Mon Sep 17 00:00:00 2001 From: Ivan Sitkin Date: Thu, 25 Jan 2024 13:51:37 +0100 Subject: [PATCH 2/4] feat: refact tempdb --- README.md | 72 ++---------------- examples/migoose/main.go | 33 ++++++++ examples/tempdb/main.go | 29 +++++++ tempdb/create.go | 44 +++++++++++ tempdb/create_test.go | 39 ++++++++++ tempdb/database.go | 101 ------------------------- tempdb/database_postgres_test.go | 126 ------------------------------- tempdb/postgres/postgres.go | 73 ++++++++++++++++++ tempdb/postgres/postgres_test.go | 84 +++++++++++++++++++++ tempdb/querier/postgres.go | 27 ------- tempdb/querier/querier.go | 9 --- utils_test/dns.go | 16 ++++ utils_test/postgres/databases.go | 38 ++++++++++ 13 files changed, 364 insertions(+), 327 deletions(-) create mode 100644 examples/migoose/main.go create mode 100644 examples/tempdb/main.go create mode 100644 tempdb/create.go create mode 100644 tempdb/create_test.go delete mode 100644 tempdb/database.go delete mode 100644 tempdb/database_postgres_test.go create mode 100644 tempdb/postgres/postgres.go create mode 100644 tempdb/postgres/postgres_test.go delete mode 100644 tempdb/querier/postgres.go delete mode 100644 tempdb/querier/querier.go create mode 100644 utils_test/dns.go create mode 100644 utils_test/postgres/databases.go diff --git a/README.md b/README.md index 2ff772b..f0417a7 100644 --- a/README.md +++ b/README.md @@ -29,35 +29,8 @@ go get github.com/Alviner/drillerfy Provides functionality to easily create and drop databases. This is particularly useful in testing environments where you need to set up a fresh database instance for each test run and clean it up afterward. -```(go) -package main - -import ( - "context" - "database/sql" - "log" - - "github.com/Alviner/drillerfy/database" - _ "github.com/jackc/pgx/v5/stdlib" -) - -func main() { - conn, err := sql.Open("pgx", "database dns") - if err != nil { - log.Fatal(err) - } - database, err := database.New(database.WithDialect(database.DialectPostgres)) - if err != nil { - log.Fatal(err) - } - - dbName, closer, err := database.Create(context.Background(), "test", conn) - if err != nil { - log.Fatal(err) - } - defer closer() - // ... some useful staff with created db -} +```go:examples/tempdb/main.py + ``` ### Migrations Module @@ -66,40 +39,8 @@ Provides functionality to easily run stairway tests for migrations via goose Pro This module simplifies the process of applying and reverting database schema changes, which is essential in maintaining consistent database states for testing. -```(go) -package main - -import ( - "database/sql" - "log" - "os" - "time" - - _ "github.com/jackc/pgx/v5/stdlib" - - "github.com/Alviner/drillerfy/migrations" - "github.com/pressly/goose/v3" -) - -func main() { - db, err := sql.Open("pgx", "database dns") - if err != nil { - log.Fatal(err) - } - provider, err := goose.NewProvider( - goose.DialectPostgres, - db, - os.DirFS("migrations"), - ) - if err != nil { - log.Fatal(err) - } - migrator := migrations.New(provider) - - if err := migrator.Stairway(2 * time.Second); err != nil { - log.Fatal(err) - } -} +```go:examples/migoose/main.py + ``` ## Contributing @@ -117,4 +58,7 @@ See the LICENSE file in the repository for full license text. Drillerfy was created and is maintained by [Alviner](https://github.com/Alviner). Contributions from the community are appreciated. -```` + +``` + +``` diff --git a/examples/migoose/main.go b/examples/migoose/main.go new file mode 100644 index 0000000..3baa925 --- /dev/null +++ b/examples/migoose/main.go @@ -0,0 +1,33 @@ +package main + +import ( + "database/sql" + "log" + "os" + "time" + + _ "github.com/jackc/pgx/v5/stdlib" + + "github.com/Alviner/drillerfy/migoose" + "github.com/pressly/goose/v3" +) + +func main() { + db, err := sql.Open("pgx", "database dns") + if err != nil { + log.Fatal(err) + } + provider, err := goose.NewProvider( + goose.DialectPostgres, + db, + os.DirFS("migrations"), + ) + if err != nil { + log.Fatal(err) + } + migrator := migoose.New(provider) + + if err := migrator.Stairway(2 * time.Second); err != nil { + log.Fatal(err) + } +} diff --git a/examples/tempdb/main.go b/examples/tempdb/main.go new file mode 100644 index 0000000..5c395aa --- /dev/null +++ b/examples/tempdb/main.go @@ -0,0 +1,29 @@ +package main + +import ( + "context" + "log" + "time" + + "github.com/Alviner/drillerfy/tempdb" +) + +const ( + PG_DNS = "postgresql://pguser:pgpass@localhost:5432/pgdb" +) + +func main() { + db, err := tempdb.New(PG_DNS) + if err != nil { + log.Fatal(err) + } + ctx, done := context.WithTimeout(context.Background(), 2*time.Second) + defer done() + + if err := db.CreateDatabase(ctx, "example", ""); err != nil { + log.Fatal(err) + } + // .. useful staff + defer db.DeleteDatabase(ctx, "example") + +} diff --git a/tempdb/create.go b/tempdb/create.go new file mode 100644 index 0000000..2d273c3 --- /dev/null +++ b/tempdb/create.go @@ -0,0 +1,44 @@ +package tempdb + +import ( + "context" + "fmt" + "net/url" + + "github.com/Alviner/drillerfy/tempdb/postgres" +) + +// Querier is the interface that wraps the basic methods to create a dialect +// specific queries. +type Querier interface { + CreateDatabase(ctx context.Context, name, temlate string) error + DeleteDatabase(ctx context.Context, name string) error +} + +func New(dbUrl string) (Querier, error) { + parsedUrl, err := url.Parse(dbUrl) + if err != nil { + return nil, err + } + querier, err := querierFromUrl(parsedUrl) + if err != nil { + return nil, fmt.Errorf("cannot create querier: %w", err) + } + return querier, nil + +} + +func querierFromUrl(url *url.URL) (Querier, error) { + dialect := url.Scheme + + switch dialect { + case "postgresql": + q, err := postgres.New(url) + if err != nil { + return nil, fmt.Errorf("cannot create postgres: %w", err) + } + return q, nil + default: + return nil, fmt.Errorf("unknown dialect: %q", dialect) + } +} diff --git a/tempdb/create_test.go b/tempdb/create_test.go new file mode 100644 index 0000000..c50a97c --- /dev/null +++ b/tempdb/create_test.go @@ -0,0 +1,39 @@ +package tempdb + +import ( + "testing" + + "github.com/Alviner/drillerfy/tempdb/postgres" + "github.com/Alviner/drillerfy/utils_test" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestCreate(t *testing.T) { + t.Parallel() + + require := require.New(t) + assert := assert.New(t) + + t.Run("postgres", func(t *testing.T) { + t.Parallel() + //act + db, err := New(utils_test.PostgresDNS(t)) + require.NoError(err) + // assert + assert.IsType(new(postgres.Postgres), db) + }) + t.Run("unknown", func(t *testing.T) { + t.Parallel() + //act + _, err := New("unknown://database.url") + // assert + require.EqualErrorf( + err, + "cannot create querier: unknown dialect: \"unknown\"", + "cannot create querier: unknown dialect: %q", + "unknown", + ) + }) + +} diff --git a/tempdb/database.go b/tempdb/database.go deleted file mode 100644 index 8186d0a..0000000 --- a/tempdb/database.go +++ /dev/null @@ -1,101 +0,0 @@ -package tempdb - -import ( - "context" - "database/sql" - "errors" - "fmt" - - "github.com/Alviner/drillerfy/tempdb/querier" - "github.com/google/uuid" -) - -type Dialect string -type DBOption func(*DB) error -type Closer func() error - -const ( - DialectPostgres Dialect = "postgres" -) - -type DB struct { - templateName string - querier querier.Querier -} - -func New(opts ...DBOption) (*DB, error) { - store := new(DB) - for _, option := range opts { - if err := option(store); err != nil { - return nil, fmt.Errorf("failed to apply option: %w", err) - } - } - return store, nil -} - -func WithDialect(dialect Dialect) DBOption { - return func(s *DB) error { - if dialect == "" { - return errors.New("dialect must not be empty") - } - lookup := map[Dialect]querier.Querier{ - DialectPostgres: new(querier.Postgres), - } - querier, ok := lookup[dialect] - if !ok { - return fmt.Errorf("unknown dialect: %q", dialect) - } - s.querier = querier - return nil - } -} - -func WithTemplate(templateName string) DBOption { - return func(s *DB) error { - s.templateName = templateName - return nil - } -} - -func (s *DB) Create(ctx context.Context, prefix string, db *sql.DB) (string, Closer, error) { - databaseName := GenerateName(prefix) - - q := s.querier.CreateDatabase(databaseName, s.templateName) - if _, err := db.ExecContext(ctx, q); err != nil { - return "", nil, fmt.Errorf( - "failed to create database %q from template %q: %w", - databaseName, - s.templateName, - err, - ) - } - return databaseName, func() error { - ctx := context.Background() - if err := s.disconnect(ctx, databaseName, db); err != nil { - return err - } - return s.Delete(ctx, databaseName, db) - }, nil -} - -func (s *DB) Delete(ctx context.Context, name string, db *sql.DB) error { - q := s.querier.DeleteDatabase(name) - if _, err := db.ExecContext(ctx, q); err != nil { - return fmt.Errorf("failed to delete database %s: %w", name, err) - } - return nil -} - -func (s *DB) disconnect(ctx context.Context, name string, db *sql.DB) error { - q := s.querier.DisconnectFromDatabase(name) - if _, err := db.ExecContext(ctx, q); err != nil { - return fmt.Errorf("failed to disconnect database %s: %w", name, err) - } - return nil -} - -func GenerateName(prefix string) string { - u := uuid.New() - return fmt.Sprintf("%s-%s", prefix, u) - -} diff --git a/tempdb/database_postgres_test.go b/tempdb/database_postgres_test.go deleted file mode 100644 index 8ee4501..0000000 --- a/tempdb/database_postgres_test.go +++ /dev/null @@ -1,126 +0,0 @@ -package tempdb - -import ( - "context" - "database/sql" - "os" - "testing" - "time" - - _ "github.com/jackc/pgx/v5/stdlib" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func dns(t *testing.T) string { - t.Helper() - - value, ok := os.LookupEnv("TEST_PG_DNS") - if !ok { - return "postgresql://pguser:pgpass@localhost:5432/pgdb" - } - return value -} - -func dbNames(t *testing.T, db *sql.DB) (map[string]bool, error) { - t.Helper() - - ctx, done := context.WithTimeout(context.Background(), 2*time.Second) - defer done() - names := make(map[string]bool) - - rows, err := db.QueryContext(ctx, "SELECT datname FROM pg_catalog.pg_database") - if err != nil { - return names, err - } - defer rows.Close() - for rows.Next() { - var name string - if err := rows.Scan(&name); err != nil { - return names, err - } - names[name] = true - } - return names, nil - -} - -func TestDatabase(t *testing.T) { - t.Parallel() - - require := require.New(t) - assert := assert.New(t) - - t.Run("create", func(t *testing.T) { - t.Parallel() - // arrange - ctx, done := context.WithTimeout(context.Background(), 2*time.Second) - defer done() - - conn, err := sql.Open("pgx", dns(t)) - require.NoError(err) - database, err := New(WithDialect(DialectPostgres)) - require.NoError(err) - - //act - dbName, closer, err := database.Create(ctx, "test", conn) - require.NoError(err) - defer func() { require.NoError(closer()) }() - - // assert - names, err := dbNames(t, conn) - require.NoError(err) - assert.Contains(names, dbName) - - }) - t.Run("create from template", func(t *testing.T) { - t.Parallel() - // arrange - ctx, done := context.WithTimeout(context.Background(), 5*time.Second) - defer done() - - conn, err := sql.Open("pgx", dns(t)) - require.NoError(err) - template, err := New(WithDialect(DialectPostgres)) - require.NoError(err) - templateName, templateCloser, err := template.Create(ctx, "template", conn) - require.NoError(err) - defer func() { require.NoError(templateCloser()) }() - - database, err := New(WithDialect(DialectPostgres), WithTemplate(templateName)) - require.NoError(err) - - // act - dbName, closer, err := database.Create(ctx, "test", conn) - require.NoError(err) - defer func() { require.NoError(closer()) }() - - // assert - names, err := dbNames(t, conn) - require.NoError(err) - assert.Contains(names, dbName) - - }) - - t.Run("clear", func(t *testing.T) { - t.Parallel() - // arrange - ctx, done := context.WithTimeout(context.Background(), 2*time.Second) - defer done() - - conn, err := sql.Open("pgx", dns(t)) - require.NoError(err) - database, err := New(WithDialect(DialectPostgres)) - require.NoError(err) - dbName, closer, err := database.Create(ctx, "test", conn) - require.NoError(err) - - // act - require.NoError(closer()) - - // assert - names, err := dbNames(t, conn) - require.NoError(err) - assert.NotContains(names, dbName) - }) -} diff --git a/tempdb/postgres/postgres.go b/tempdb/postgres/postgres.go new file mode 100644 index 0000000..1e1a32a --- /dev/null +++ b/tempdb/postgres/postgres.go @@ -0,0 +1,73 @@ +package postgres + +import ( + "context" + "database/sql" + "fmt" + "net/url" + + _ "github.com/jackc/pgx/v5/stdlib" +) + +type Postgres struct { + db *sql.DB +} + +func (p *Postgres) CreateDatabase(ctx context.Context, name, templateName string) error { + query := fmt.Sprintf(`CREATE DATABASE "%s"`, name) + if templateName != "" { + query = fmt.Sprintf(`CREATE DATABASE "%s" TEMPLATE "%s"`, name, templateName) + } + if _, err := p.db.ExecContext(ctx, query); err != nil { + return fmt.Errorf( + "failed to create database %q from template %q: %w", + name, + templateName, + err, + ) + } + return nil +} + +func (p *Postgres) DeleteDatabase(ctx context.Context, name string) error { + if err := p.DisconnectFromDatabase(ctx, name); err != nil { + return err + } + + query := fmt.Sprintf(`DROP DATABASE "%s"`, name) + if _, err := p.db.ExecContext(ctx, query); err != nil { + return fmt.Errorf( + "failed to delete database %q: %w", + name, + err, + ) + } + return nil +} + +func (p *Postgres) DisconnectFromDatabase(ctx context.Context, name string) error { + query := fmt.Sprintf( + `SELECT pg_terminate_backend(pg_stat_activity.pid) + FROM pg_stat_activity + WHERE pg_stat_activity.datname = '%s' + AND pg_stat_activity.pid <> pg_backend_pid()`, name) + if _, err := p.db.ExecContext(ctx, query); err != nil { + return fmt.Errorf( + "failed to disconnect from database %q: %w", + name, + err, + ) + } + return nil + +} + +func New(url *url.URL) (*Postgres, error) { + db, err := sql.Open("pgx", url.String()) + if err != nil { + return nil, fmt.Errorf("cannot connect postgresql: %w", err) + } + ins := new(Postgres) + ins.db = db + return ins, nil +} diff --git a/tempdb/postgres/postgres_test.go b/tempdb/postgres/postgres_test.go new file mode 100644 index 0000000..3e2e5d4 --- /dev/null +++ b/tempdb/postgres/postgres_test.go @@ -0,0 +1,84 @@ +package postgres + +import ( + "context" + "fmt" + "net/url" + "testing" + "time" + + "github.com/Alviner/drillerfy/utils_test" + "github.com/Alviner/drillerfy/utils_test/postgres" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestPostgres(t *testing.T) { + t.Parallel() + + require := require.New(t) + assert := assert.New(t) + + dbUrl, err := url.Parse(utils_test.PostgresDNS(t)) + require.NoError(err) + + t.Run("create", func(t *testing.T) { + t.Parallel() + // arrange + dbName := t.Name() + ctx, done := context.WithTimeout(context.Background(), 2*time.Second) + defer done() + + pg, err := New(dbUrl) + require.NoError(err) + //act + require.NoError(pg.CreateDatabase(ctx, dbName, "")) + defer func() { require.NoError(pg.DeleteDatabase(ctx, dbName)) }() + // assert + names, err := postgres.DBNames(t, dbUrl) + require.NoError(err) + assert.Contains(names, dbName) + }) + t.Run("create from template", func(t *testing.T) { + t.Parallel() + // arrange + dbName := t.Name() + templateName := fmt.Sprintf("%s-template", t.Name()) + ctx, done := context.WithTimeout(context.Background(), 5*time.Second) + defer done() + + pg, err := New(dbUrl) + require.NoError(err) + + require.NoError(pg.CreateDatabase(ctx, templateName, "")) + defer func() { require.NoError(pg.DeleteDatabase(ctx, templateName)) }() + //act + require.NoError(pg.CreateDatabase(ctx, dbName, templateName)) + defer func() { require.NoError(pg.DeleteDatabase(ctx, dbName)) }() + + // assert + names, err := postgres.DBNames(t, dbUrl) + require.NoError(err) + assert.Contains(names, dbName) + }) + + t.Run("clear", func(t *testing.T) { + t.Parallel() + // arrange + dbName := t.Name() + ctx, done := context.WithTimeout(context.Background(), 5*time.Second) + defer done() + + pg, err := New(dbUrl) + require.NoError(err) + + require.NoError(pg.CreateDatabase(ctx, dbName, "")) + //act + require.NoError(pg.DeleteDatabase(ctx, dbName)) + + // assert + names, err := postgres.DBNames(t, dbUrl) + require.NoError(err) + assert.NotContains(names, dbName) + }) +} diff --git a/tempdb/querier/postgres.go b/tempdb/querier/postgres.go deleted file mode 100644 index 450d70a..0000000 --- a/tempdb/querier/postgres.go +++ /dev/null @@ -1,27 +0,0 @@ -package querier - -import "fmt" - -type Postgres struct{} - -func (p *Postgres) CreateDatabase(name, templateName string) string { - if templateName != "" { - return fmt.Sprintf(`CREATE DATABASE "%s" TEMPLATE "%s"`, name, templateName) - - } - return fmt.Sprintf(`CREATE DATABASE "%s"`, name) -} - -func (p *Postgres) DeleteDatabase(name string) string { - q := `DROP DATABASE "%s"` - return fmt.Sprintf(q, name) -} - -func (p *Postgres) DisconnectFromDatabase(name string) string { - q := `SELECT pg_terminate_backend(pg_stat_activity.pid) - FROM pg_stat_activity - WHERE pg_stat_activity.datname = '%s' - AND pg_stat_activity.pid <> pg_backend_pid()` - return fmt.Sprintf(q, name) - -} diff --git a/tempdb/querier/querier.go b/tempdb/querier/querier.go deleted file mode 100644 index bd78936..0000000 --- a/tempdb/querier/querier.go +++ /dev/null @@ -1,9 +0,0 @@ -package querier - -// Querier is the interface that wraps the basic methods to create a dialect -// specific query. -type Querier interface { - CreateDatabase(name, temlate string) string - DeleteDatabase(name string) string - DisconnectFromDatabase(name string) string -} diff --git a/utils_test/dns.go b/utils_test/dns.go new file mode 100644 index 0000000..9e4428b --- /dev/null +++ b/utils_test/dns.go @@ -0,0 +1,16 @@ +package utils_test + +import ( + "os" + "testing" +) + +func PostgresDNS(t *testing.T) string { + t.Helper() + + value, ok := os.LookupEnv("TEST_PG_DNS") + if !ok { + return "postgresql://pguser:pgpass@localhost:5432/pgdb" + } + return value +} diff --git a/utils_test/postgres/databases.go b/utils_test/postgres/databases.go new file mode 100644 index 0000000..6b1c0b4 --- /dev/null +++ b/utils_test/postgres/databases.go @@ -0,0 +1,38 @@ +package postgres + +import ( + "context" + "database/sql" + "net/url" + "testing" + "time" + + _ "github.com/jackc/pgx/v5/stdlib" +) + +func DBNames(t *testing.T, url *url.URL) (map[string]bool, error) { + t.Helper() + names := make(map[string]bool) + + db, err := sql.Open("pgx", url.String()) + if err != nil { + return names, err + } + ctx, done := context.WithTimeout(context.Background(), 2*time.Second) + defer done() + + rows, err := db.QueryContext(ctx, "SELECT datname FROM pg_catalog.pg_database") + if err != nil { + return names, err + } + defer rows.Close() + for rows.Next() { + var name string + if err := rows.Scan(&name); err != nil { + return names, err + } + names[name] = true + } + return names, nil + +} From 6f16dd200e18d00a028828e87cab8969afebaf09 Mon Sep 17 00:00:00 2001 From: Ivan Sitkin Date: Thu, 25 Jan 2024 13:52:11 +0100 Subject: [PATCH 3/4] feat: refact tempdb --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index f0417a7..90bcec2 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,3 @@ See the LICENSE file in the repository for full license text. Drillerfy was created and is maintained by [Alviner](https://github.com/Alviner). Contributions from the community are appreciated. - -``` - -``` From 2abc95228ad004bb6ef17565da125726d0019405 Mon Sep 17 00:00:00 2001 From: Ivan Sitkin Date: Thu, 25 Jan 2024 13:55:21 +0100 Subject: [PATCH 4/4] feat: refact tempdb --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e487e5..3017207 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,4 +42,4 @@ jobs: - name: Test run: make test env: - TEST_PG_DNS: postgres://pguser:pgpass@localhost:5432/pgdb + TEST_PG_DNS: postgresql://pguser:pgpass@localhost:5432/pgdb