
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
google-cloud-sql
Advanced tools
Connect to private Google Cloud SQL/AlloyDB instance through Cloud SQL/AlloyDB Auth Proxy running in GKE cluster.
:toc: macro :toc-title: :toclevels: 10
= ⛅ google-cloud-sql
image:https://img.shields.io/github/package-json/v/edosrecki/google-cloud-sql-cli/master?color=blue&label=google-cloud-sql["google-cloud-sql CLI Version"] image:https://img.shields.io/github/actions/workflow/status/edosrecki/google-cloud-sql-cli/continuous-integration.yml["Build Status", link="https://github.com/edosrecki/google-cloud-sql-cli/actions"]
A CLI app which establishes a connection to a private Google Cloud SQL instance or AlloyDB instance and port-forwards it to a local machine.
Connection is established by running a Google Cloud SQL Auth Proxy pod (for Cloud SQL) or AlloyDB Auth Proxy pod (for AlloyDB) in a Google Kubernetes Engine cluster which runs in the same VPC network as the private database instance. Connection is then port-forwarded to the local machine, where a user can connect to the instance on localhost. Corresponding workload identity has to be configured in the cluster, with service account which has Cloud SQL Client role (for Cloud SQL instances) or AlloyDB Client role (for AlloyDB instances) on the given database instance. Configurations in the app can be saved for practical future usage.
The app relies on local gcloud and kubectl commands which have to be configured and authenticated with the proper Google Cloud user and GKE Kubernetes cluster.
image::screenshot.png[]
toc::[]
brew install edosrecki/tools/google-cloud-sql
=== Releases
Download a corresponding distribution from https://github.com/edosrecki/google-cloud-sql-cli/releases[Releases] and add
the executable to your PATH.
=== Build from source Build the app from source by building and packaging it manually: see Build and Package sections.
== Use === Prerequisites
gcloud auth logingcloud container clusters get-credentialsgcloud services enable sqladmin.googleapis.com --project=$PROJECT
** AlloyDB API for AlloyDB instances: gcloud services enable alloydb.googleapis.com --project=$PROJECTgoogle-cloud-sql help
google-cloud-sql configurations create
google-cloud-sql configurations run
google-cloud-sql configurations run $NAME
alias myDbProd="google-cloud-sql configurations run $NAME"
psql -h localhost -p $LOCAL_PORT -U $USER
== Migrations
=== v1 to v2
Migration from v1 to v2 is done automatically when the app is run for the first time after upgrade to version 2.0.0.
== Package === Pre-configured Package the app for Node.JS 24 on MacOS, Linux, and Windows.
=== Manual See https://github.com/yao-pkg/pkg?tab=readme-ov-file#targets[pkg] for details.
pnpm build pnpm exec pkg dist/index.cjs -t '<NODE_RANGE>--' -o 'google-cloud-sql'
== Deploy
To deploy a new version of google-cloud-sql app, manually run a https://github.com/edosrecki/google-cloud-sql-cli/actions/workflows/continuous-deployment.yml["Continuous Deployment"] worklow in GitHub Actions.
== Todo
FAQs
Connect to private Google Cloud SQL instance through Cloud SQL Auth Proxy running in GKE cluster.
We found that google-cloud-sql demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.