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

feat: extra database connection properties #34

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

djcass44
Copy link
Contributor

@djcass44 djcass44 commented Sep 11, 2024

Added an option to set extra client properties when connecting to the database. This is primarily needed so that SSL/TLS can be used to connect to the database.

This change should be backwards compatible as well as if no props are set, it just won't set anything and behave exactly as it does now.

Fixes #28

I wasn't sure of a good way to test this because I couldn't find a way to get the PostgreSQL testcontainer to use TLS.

Note: this doesn't solve the issue of custom CA's that was discussed in #28, but at least we can turn SSL/TLS on. It's a start...

@djcass44 djcass44 changed the title Extra database connection properties feat: extra database connection properties Sep 11, 2024
@berenddeboer
Copy link
Owner

You're sure this is not the default?? So surprised by this. But yeah, adding connections seems to be valuable in itself.

@berenddeboer berenddeboer merged commit c2b264c into berenddeboer:main Sep 11, 2024
3 of 6 checks passed
@berenddeboer
Copy link
Owner

I've reverted your commit as "projen build" fails with this, and ran out of time to fix. Please resubmit with proof "projen build" works.

I kept getting variations of this, whatever I tried:

[2024-09-12T09:46:40.612] [ERROR] jsii/compiler - Type model errors prevented the JSII assembly from being created
src/provider.ts:86:19 - error JSII9000: Encountered use of module that is not declared in "dependencies" or "peerDependencies": "@types/pg"

86   public readonly connectionProps: ClientConfig
                     ~~~~~~~~~~~~~~~
👾 Task "build » compile" failed when executing "jsii --silence-warnings=reserved-word" (cwd: /home/berend/src/cdk-rds-sql)

@djcass44
Copy link
Contributor Author

djcass44 commented Sep 11, 2024 via email

berenddeboer added a commit that referenced this pull request Sep 21, 2024
Set the ssl option on the provider to false to revert to the previous
behaviour. This addresses #34 and #35.

BREAKING CHANGE: ssl connections are now enabled by default.
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.

Encryption error when connecting to Postgres 16
2 participants