jackc / tern

The SQL Fan's Migrator
MIT License
925 stars 68 forks source link

Use tern/migrate with pgx v4 and pgxpool? #12

Closed lpar closed 4 years ago

lpar commented 4 years ago

Is it possible to use tern/migrate to embed migration functionality into an application that uses pgx/v4 and pgxpool?

jackc commented 4 years ago

Yes, but probably not how you are hoping.

Go modules supports importing multiple versions of the same package. You would have to establish a pgx v3 connection for tern/migrate. It can coexist with v4 but it doesn't interoperate cooperate.

It'd be fairly simple to upgrade tern to use pgx v4 -- it just hasn't been a priority since it won't really benefit the standalone CLI tool (and that's what I use on a daily basis).

lpar commented 4 years ago

Fair enough, though you do also say that pgx v3 is unsupported :-)

I've opted for using the database/sql wrappers and go-migrate for now.