-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
How to get the pooled connection url? #119
Comments
@lohrm-stabl Hello Michael! Please check this issue, it illustrates how to output connection URI. |
Ok, so you are confirming the use of outputs/local variables to build the connection string manually. This works, but maybe it should be added to the docs. In your comment on the other issue you propose to just use It would be great (and improve the DX and code readability so much) if the provider would have the capability to compose the connection strings for you. |
@lohrm-stabl Hey Michael, thank you for the feedback. I'll consider adding such functionality as connection string. However, strictly speaking, all attributes required to establish connection to the database are present in the output attributes of respective resources 😉 The objective of the tf provider does not include strings concatenation on behalf of the client. If your database adapter requires specific format of database connection attributes, it shall be adapted on the client's side. |
@lohrm-stabl hey Michael, I feel like I misunderstood the issue you raised. I somehow thought it concerned the database resource, while the problem is in the endpoint 🙃. I verified that indeed the output attribute It will be fixed in the next release - thank you for your support! 🙏 |
Honestly, I don't think you misunderstood me. I never used the I thought that they were basically replicas (which is not something we currently use). I guess every project already has a default endpoint, so I'm also not sure how I would import that one? By using the default branch? However, I'm glad you discovered something else related to this! |
@lohrm-stabl thanks for understanding! You are right, the project is provisioned with the default endpoint. However, the tf provider does not support pooling for default endpoint yet. Regardless, the misbehavior of the endpoint resource was confirmed thanks to your issue - thank you! |
@lohrm-stabl it appears so, AFAIK, Neon use pgbouncer as a proxy to db instances by default. It's up to the user, whether to use it; dns will be configured for both URIs. So how would you propose to implement it on the provider side? Though, please assume that custom tf functions will not be supported yet - I want to maintain BW compatibility with old versions of terraform which did not support custom functions. |
Hi there,
I wonder how to get the pooled connection url from the project.
I want to replicate something similar like the neon integration does in vercel (adding one env var for unpooled and one for the pooled connection.
Currently, I do it like this (typescript via CDKTF):
There needs to be a better way surely?
The text was updated successfully, but these errors were encountered: