-
Notifications
You must be signed in to change notification settings - Fork 46
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
Add support for stream
parameter for PostgreSQL and MySQL
#303
Comments
Thanks for opening this issue @edosrecki! I don't have the bandwith right now to contribute to atdatabases but if anyone is willing to take a try at adding the support to the
|
Issue
Both
mysql2
andpg
clients support an optionalstream
config parameter (see references), which is either an existing stream, or a factory which creates a stream lazily. However,@databases
library does not acceptstream
parameter, and does not pass it to underlying drivers.Justification
stream
parameter allows a more flexible control of the socket connection creation. It supports a variety of setups such as secure socket connections that are used by cloud providers such as Google Cloud Platform. In references you can see how Google Cloud SQL Connector creates a stream factory which is used to connect to Google Cloud SQL instances (with password, or IAM authentication), secured by an ephemeral certificate.It would be beneficial for GCP users, who want to use
@databases
, if the library accepted thestream
parameter and passed it down to drivers.References
mysql2
: https://github.com/sidorares/node-mysql2/blob/a0e0e2fe2c115dc0246c52783fd29945ae01bf77/lib/connection.js#L67C2-L67C2pg
: https://github.com/brianc/node-postgres/blob/a84ebb3fe85edafb1b358965bdb5e3de58b12c5d/packages/pg/lib/connection.js#L19cloud-sql-nodejs-connector
: https://github.com/GoogleCloudPlatform/cloud-sql-nodejs-connector/blob/00e726f4f60f9c83fb816211d447013f6c0163e0/src/connector.ts#L185The text was updated successfully, but these errors were encountered: