Skip to content

Conversation

@Ltadrian
Copy link

@Ltadrian Ltadrian commented Oct 15, 2025

Implement DatabaseServer service to handle use case of upgrading client connection to TLS stream over TCP to databases that require SSL.

This is useful for local development with Hyperdrive binding where running wrangler dev can not automatically connect to an external database fails upgrading to TLS stream.

  • Handles custom TLS start up packets for postgres/mysql
  • Handles sslmodes 'prefer' anad 'require'
  • Implement unit tests for DatabaseServer service with Hyperdrive binding
  • Tested locally against local databases/external databases (i.e neondb/planetscale)

@github-actions
Copy link

github-actions bot commented Oct 15, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@Ltadrian Ltadrian force-pushed the agracia/SQC-646-tcpvariant branch from ec26748 to 9828ecf Compare October 15, 2025 15:09
@Ltadrian
Copy link
Author

recheck

@Ltadrian
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Oct 15, 2025
@Ltadrian
Copy link
Author

recheck

@Ltadrian Ltadrian force-pushed the agracia/SQC-646-tcpvariant branch 2 times, most recently from cdc303d to 94d3e70 Compare October 15, 2025 16:44
…ing to TLS stream over TCP to databases that require SSL.

This is useful for local development with Hyperdrive binding where running wrangler dev can not automatically connect to an external database
without upgrading to TLS stream.
- Handles custom TLS start up packets for postgres/mysql
- Handles sslmodes 'prefer' anad 'require'
- Implement unit tests for DatabaseServer service with Hyperdrive binding
- Tested locally against local databases/external databases (i.e neondb/planetscale)
@Ltadrian Ltadrian force-pushed the agracia/SQC-646-tcpvariant branch from 94d3e70 to 64b23bc Compare October 15, 2025 17:11
@Ltadrian Ltadrian marked this pull request as ready for review October 15, 2025 17:13
@Ltadrian Ltadrian requested review from a team as code owners October 15, 2025 17:13
Copy link
Member

@kentonv kentonv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please come talk to us about what you're trying to do here.

This PR is introducing a major new public-facing feature to the workerd architecture. This sort of thing can't just arrive as a PR, it needs docs explaining what it is and why it is needed and some sort of discussion with the code owners first.

In particular I don't understand why ExternalServer is insufficient here. It's already intended to support arbitrary TCP connections. Why are databases special?

@ReppCodes
Copy link
Contributor

Please come talk to us about what you're trying to do here.

This PR is introducing a major new public-facing feature to the workerd architecture. This sort of thing can't just arrive as a PR, it needs docs explaining what it is and why it is needed and some sort of discussion with the code owners first.

In particular I don't understand why ExternalServer is insufficient here. It's already intended to support arbitrary TCP connections. Why are databases special?

We have talked to you and Dan repeatedly, and demo'd this a couple weeks ago.

@Ltadrian
Copy link
Author

@kentonv I responded in the internal google chat thread!

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.

3 participants