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

Add support for Unix Path on Postgres databases for GCP Cloud SQL #980

Open
FrenchMajesty opened this issue Dec 29, 2023 · 1 comment
Open

Comments

@FrenchMajesty
Copy link

FrenchMajesty commented Dec 29, 2023

Why this feature is required (specific use-cases will be appreciated)?

At the moment, it is impossible to establish a connection to Cloud SQL instance on GCP without using socketPath. I have a backend API deployed on App Engine and a Postgres DB so this is an important feature needed to support.
See the documentation.

The only means that Google Cloud provides for connecting a App Engine (standard) Node.js application to a Postgres DB is via Unix sockets.

Have you tried any other work arounds?

I've tried other connection protocols and they all fail. I've gone with the ridiculous work around of standing up an AWS db because going the route of a private IP adds a lot of DevOps overhead (from creating and managing network connections, to VPC, to registered IP ranges, ingress, etc...) and also adds a lot in terms of costs as well. Those VPC are not cheap at all.

Are you willing to work on it with little guidance?

Sure

@FrenchMajesty FrenchMajesty changed the title Add support for SocketPath on databases Add support for Unix Path on Postgres databases for GCP Cloud SQL Dec 29, 2023
@markgidman-rad
Copy link

Google has released the Cloud SQL Node.js connector which is now the preferred mechanism for connecting to Cloud SQL from NodeJS on App Engine and/or Cloud Run.

While the connector has been demonstrated to work with Knex, I don't think it can work with Lucid yet because the connector determines config options asynchronously at runtime and Lucid loads the database config synchronously. I've put in a feature request to support asynchronous database configs. adonisjs/core#4508

I'm hoping to avoid AWS as a workaround. I think rewriting everything in PHP might be preferable. :)

If you have any fresh insight on this, it would be appreciated.

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

No branches or pull requests

2 participants