Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions internal/storage/sql/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func init() {
// drop references to lib/pq and relay on pgx
dburl.Unregister("postgres")
dburl.RegisterAlias("pgx", "postgres")
dburl.RegisterAlias("pgx", "postgresql")
}

// Open opens a connection to the db
Expand Down
25 changes: 25 additions & 0 deletions internal/storage/sql/db_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,31 @@ func TestParse(t *testing.T) {
driver: SQLite,
dsn: "flipt.db?_fk=true&cache=shared&mode=rwc",
},
{
name: "postgresql url",
cfg: config.DatabaseConfig{
URL: "postgresql://postgres@localhost:5432/flipt?sslmode=disable",
},
driver: Postgres,
dsn: "postgres://postgres@localhost:5432/flipt?binary_parameters=yes&sslmode=disable",
},
{
name: "postgresql url prepared statements enabled",
cfg: config.DatabaseConfig{
URL: "postgresql://postgres@localhost:5432/flipt?sslmode=disable",
PreparedStatementsEnabled: true,
},
driver: Postgres,
dsn: "postgres://postgres@localhost:5432/flipt?sslmode=disable",
},
{
name: "postgresql no disable sslmode",
cfg: config.DatabaseConfig{
URL: "postgresql://postgres@localhost:5432/flipt",
},
driver: Postgres,
dsn: "postgres://postgres@localhost:5432/flipt?binary_parameters=yes",
},
{
name: "postgres url prepared statements enabled",
cfg: config.DatabaseConfig{
Expand Down
Loading