You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When following the official App Engine Postgres CloudSQL connection instructions here to connect to a Postgres instance via a public IP in the App Engine Standard Environment, I expect a socket:// connection string passed to Slonik to work.
Currently, Slonik throws an the error [ERR_INVALID_URL]: Invalid URL, when given a connection string in any of the following forms:
Google App Engine recommends this as the default way to connect to CloudSQL, and it is also the only way to connect if the database has a public IP address or is in a different region to the client initiating a connection.
Google/Firebase Cloud Functions only allow socket:// connections
A variety of other reasons have been proposed in this issue, however, they advocate passing a full-blown connection object which is not strictly necessary for this use case
Other issues imply that this previously worked, but was broken in subsequent updates.
Implementation
@gajus has previously recommended a solution here.
The text was updated successfully, but these errors were encountered:
Yes, #409 should fix it! You need to url-encode the unix socket path, so the final connection uri should be passed like postgresql://<user>:<password>@%2Fcloudsql%2F<project-id>%3A<region-name>%3A<sql-instance>/<db-name>
Desired Behavior
[ERR_INVALID_URL]: Invalid URL
, when given a connection string in any of the following forms:socket://PASSWORD@/cloudsql/INSTANCE_CONNECTION_NAME/.s.PGSQL.5432?db=DB_NAME
socket://PASSWORD@/cloudsql/INSTANCE_CONNECTION_NAME?db=DB_NAME
socket://PASSWORD@/cloudsql/INSTANCE_CONNECTION_NAME/DB_NAME
Motivation
connection
object which is not strictly necessary for this use caseImplementation
The text was updated successfully, but these errors were encountered: