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

Example with pgxpool and migrator as library #113

Open
mispp opened this issue Dec 7, 2024 · 1 comment
Open

Example with pgxpool and migrator as library #113

mispp opened this issue Dec 7, 2024 · 1 comment

Comments

@mispp
Copy link

mispp commented Dec 7, 2024

Hi,

Can someone please add an example how to use Migrator with pgxpool to the migrate library

Thanks

@jackc
Copy link
Owner

jackc commented Dec 9, 2024

Migrator requires a *pgx.Conn. Call Acquire on your *pgxpool.Pool and call Conn() on the response to get a *pgx.Conn. Pass that to NewMigrator. When you're done call Release on the connection you acquired from the pool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants