The DriverName is hardcoded to "postgres", which makes using Atlas with pgx tricky since that library registers with the name "pgx" (instead of "postgres" as lib/pq does). I hit this in the context of using versioned migrations with ent. One workaround was to re-register pgx as "postgres", which might cause some confusion for folks.
import (
"database/sql"
pgx "github.com/jackc/pgx/v5/stdlib"
)
pgxDriver := pgx.GetDefaultDriver()
sql.Register("postgres", pgxDriver)
I'm not sure how other libraries are dealing with this since it seems like a common issue, but thought I'd flag in case it was helpful. Thanks!
The
DriverNameis hardcoded to "postgres", which makes using Atlas with pgx tricky since that library registers with the name "pgx" (instead of "postgres" as lib/pq does). I hit this in the context of using versioned migrations with ent. One workaround was to re-register pgx as "postgres", which might cause some confusion for folks.I'm not sure how other libraries are dealing with this since it seems like a common issue, but thought I'd flag in case it was helpful. Thanks!