Skip to content

Allow users to pass in their own stdlib.OptionOpenDB#322

Merged
jinzhu merged 1 commit intogo-gorm:masterfrom
sblackstone:master
Sep 15, 2025
Merged

Allow users to pass in their own stdlib.OptionOpenDB#322
jinzhu merged 1 commit intogo-gorm:masterfrom
sblackstone:master

Conversation

@sblackstone
Copy link
Copy Markdown
Contributor

This PR enables users to supply custom stdlib.OptionOpenDB to the underlying Postgres driver.

We're using an Azure Postgres instance that requires access token authentication. Since these tokens expire periodically, we need the ability to pass a BeforeConnect hook to jackc/pgx. This allows us to detect expired tokens and fetch new ones automatically before establishing a connection.

@sblackstone sblackstone changed the title Allow the user to pass in their own stdlib.OptionOpenDB Allow users to pass in their own stdlib.OptionOpenDB Aug 29, 2025
@jinzhu jinzhu merged commit c65a34e into go-gorm:master Sep 15, 2025
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants