{"id":26762275,"url":"https://github.com/edosrecki/google-cloud-sql-nodejs-connector-example","last_synced_at":"2025-06-29T21:33:26.469Z","repository":{"id":192911571,"uuid":"685975236","full_name":"edosrecki/google-cloud-sql-nodejs-connector-example","owner":"edosrecki","description":"Example of using Google Cloud SQL connector for Node.js.","archived":false,"fork":false,"pushed_at":"2023-10-09T17:13:11.000Z","size":347,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-15T09:37:20.358Z","etag":null,"topics":["cloud-sql","cloud-sql-proxy","gcloud","google-cloud","google-cloud-sql","javascript","knex","nodejs","proxy","sequelize","sql","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/edosrecki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-09-01T12:46:30.000Z","updated_at":"2024-10-04T14:26:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"876442b7-cd97-4f4e-9178-e39fcefa51d4","html_url":"https://github.com/edosrecki/google-cloud-sql-nodejs-connector-example","commit_stats":{"total_commits":20,"total_committers":1,"mean_commits":20.0,"dds":0.0,"last_synced_commit":"d9c525c5d7c000b78013815ffd8f988c7bb4d79b"},"previous_names":["edosrecki/google-cloud-sql-nodejs-connector-example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/edosrecki/google-cloud-sql-nodejs-connector-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edosrecki%2Fgoogle-cloud-sql-nodejs-connector-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edosrecki%2Fgoogle-cloud-sql-nodejs-connector-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edosrecki%2Fgoogle-cloud-sql-nodejs-connector-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edosrecki%2Fgoogle-cloud-sql-nodejs-connector-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edosrecki","download_url":"https://codeload.github.com/edosrecki/google-cloud-sql-nodejs-connector-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edosrecki%2Fgoogle-cloud-sql-nodejs-connector-example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262672106,"owners_count":23346517,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud-sql","cloud-sql-proxy","gcloud","google-cloud","google-cloud-sql","javascript","knex","nodejs","proxy","sequelize","sql","typescript"],"created_at":"2025-03-28T18:36:56.581Z","updated_at":"2025-06-29T21:33:26.441Z","avatar_url":"https://github.com/edosrecki.png","language":"TypeScript","readme":"# Google Cloud SQL Node.js Connector Example\n\nExample usage of [Google Cloud SQL Node.js Connector][cloud-sql-connector-node]. This is an alternative approach for connecting to Google Cloud SQL instance without needing Google Cloud SQL Auth Proxy.\n\nExamples include:\n\n* Databases: MySQL, PostgreSQL, and SQL Server\n* Libraries: [knex], [sequelize], [typeorm], [prisma]\n\n[cloud-sql-connector-node]: https://github.com/GoogleCloudPlatform/cloud-sql-nodejs-connector\n[knex]: https://knexjs.org/\n[sequelize]: https://sequelize.org/\n[typeorm]: https://typeorm.io/\n[prisma]: https://www.prisma.io/\n\n## Google Cloud SQL Setup\n\n### Terraform\n\nSee [terraform/README.adoc](terraform/README.adoc) for instructions.\n\n### Manual\n\n1. Create Cloud SQL instance(s).\n   1. (Optional) Configure private IP connectivity.\n   1. (Optional) Enable flag for IAM authentication.\n3. (Optional) Create a service account for IAM authentication to the SQL instance.\n    1. Assign `Cloud SQL Client` and `Cloud SQL Instance User` roles.\n    2. Download JSON key file, or use Application Default Credentials, or service account impersonation.\n\n## Run\n\n```sh\n## Install dependencies\n## ~~~~~~~~~~~~~~~~~~~~\nnvm install\nnpm install\n\n## Configure environment for a DB that you want to test\n## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n# If you used manual setup\ncp .env.postgres.example .env   # PostgreSQL\ncp .env.mysql.example .env      # MySQL\ncp .env.sqlserver.example .env  # SQL Server\n\nvim .env\n\n# If you used Terraform\ncd terraform\nterraform output -raw postgres_env \u003e ../.env   # PostgreSQL\nterraform output -raw mysql_env \u003e ../.env      # MySQL\nterraform output -raw sqlserver_env \u003e ../.env  # SQL Server\ncd ..\n\n## Run examples for each library\n## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n## NOTE:\n## If you are using IAM authentication, make sure to authenticate\n## as that service account, either by using JSON key, Application\n## Default Credentials, or service account impersonation.\n\nnpm run pg\nnpm run mysql2\nnpm run mssql\n\nnpm run knex\n# { connected: 'True' }\n\nnpm run sequelize\n# Executing (default): SELECT 1+1 AS result\n\nnpm run typeorm\n# [ { connected: 'True' } ]\n\nnpm run prisma\n# [ { connected: 'True' } ]\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedosrecki%2Fgoogle-cloud-sql-nodejs-connector-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedosrecki%2Fgoogle-cloud-sql-nodejs-connector-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedosrecki%2Fgoogle-cloud-sql-nodejs-connector-example/lists"}