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

[postgres-kit] Pass ssl and max connection options to postgres #3936

Open
wants to merge 5 commits into
base: beta
Choose a base branch
from

Conversation

mikkokaar
Copy link

Pass ssl and max connection options to postgres.

ssl - Needed if using Drizzle with a server that enforces ssl. This PR allows using url & ssl, instead of having to split url into host, port, username, password, database just to be able to pass ssl as a parameter to postgres.

max - Don't know what the story behind max: 1 here is, but I had to set max to 2, otherwise drizzle-kit push would get stuck pulling database schema from Supabase pooler (with enforce ssl enabled). Having max: 1 first and ...credentials afterwards allows overriding max from drizzle.config.ts which solved that issue.

There would be plenty more options to add, see https://www.npmjs.com/package/postgres#connection-details

Might be worth it changing the other pg connections in connections.ts to use the same pattern. I couldn't test those so didn't touch them. Also unsure if those other packages would support the same set of connection options.

@mikkokaar mikkokaar marked this pull request as ready for review January 11, 2025 21:00
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.

1 participant