Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add driver for pgx v5 #848

Merged
merged 3 commits into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SOURCE ?= file go_bindata github github_ee bitbucket aws_s3 google_cloud_storage godoc_vfs gitlab
DATABASE ?= postgres mysql redshift cassandra spanner cockroachdb yugabytedb clickhouse mongodb sqlserver firebird neo4j pgx pgxv5
DATABASE ?= postgres mysql redshift cassandra spanner cockroachdb yugabytedb clickhouse mongodb sqlserver firebird neo4j pgx pgx5
DATABASE_TEST ?= $(DATABASE) sqlite sqlite3 sqlcipher
VERSION ?= $(shell git describe --tags 2>/dev/null | cut -c 2-)
TEST_FLAGS ?=
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Forked from [mattes/migrate](https://github.com/mattes/migrate)
Database drivers run migrations. [Add a new database?](database/driver.go)

* [PostgreSQL](database/postgres)
* [PGX v4](database/pgx/v4)
* [PGX v4](database/pgx)
* [PGX v5](database/pgx/v5)
* [Redshift](database/redshift)
* [Ql](database/ql)
Expand Down
1 change: 1 addition & 0 deletions database/pgx/pgx.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
func init() {
db := Postgres{}
database.Register("pgx", &db)
database.Register("pgx/v4", &db)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Register this as pgx4 since pgx/v4 is verbose. We don't need to be consistent with the upstream. Also, our DSN/connection string parsing uses URL parsing and / is not a valid scheme character

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

}

var (
Expand Down
2 changes: 1 addition & 1 deletion database/pgx/v5/pgx.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (

func init() {
db := Postgres{}
database.Register("pgx", &db)
database.Register("pgx/v5", &db)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Register as pgx5 for the same reason

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

}

var (
Expand Down
4 changes: 2 additions & 2 deletions internal/cli/build_pgxv5.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build pgxv5
// +build pgxv5
//go:build pgx5
// +build pgx5

package cli

Expand Down