Skip to content

Adding SQL Connector db connection option to enable SQL Auth#95

Merged
evanpetzoldt merged 1 commit intomainfrom
feat-sql-auth-connector
Mar 17, 2026
Merged

Adding SQL Connector db connection option to enable SQL Auth#95
evanpetzoldt merged 1 commit intomainfrom
feat-sql-auth-connector

Conversation

@evanpetzoldt
Copy link
Copy Markdown
Contributor

This pull request introduces support for connecting to a PostgreSQL database using either a direct TCP connection or the Google Cloud SQL Connector, controlled by a new environment variable. The changes add configuration options for both modes, update environment files, and integrate the Cloud SQL Connector library.

Database connection mode support:

  • Added DB_CONNECTION_MODE environment variable to .env.example and apphosting.yaml to switch between "direct" and "connector" modes. [1] [2]
  • Implemented logic in src/lib/db.ts to initialize the PostgreSQL connection pool using either a direct TCP connection (DATABASE_URL) or the Cloud SQL Connector, based on DB_CONNECTION_MODE. [1] [2]

Cloud SQL Connector integration:

  • Added Cloud SQL Connector-related environment variables to .env.example and apphosting.yaml for configuration (e.g., CLOUD_SQL_CONNECTION_NAME, DB_USER, DB_PASSWORD, DB_NAME, CLOUD_SQL_IP_TYPE). [1] [2]
  • Added @google-cloud/cloud-sql-connector dependency to package.json.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 16, 2026

Deploy Preview for f3-the-codex-demo ready!

Name Link
🔨 Latest commit e5c2a6a
🔍 Latest deploy log https://app.netlify.com/projects/f3-the-codex-demo/deploys/69b7fa43ea75f9000869cf9c
😎 Deploy Preview https://deploy-preview-95--f3-the-codex-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown

@taterhead247 taterhead247 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it works on netlify (which I don't think is a valid test) and the code seems reasonable.

@evanpetzoldt evanpetzoldt merged commit 4f049f8 into main Mar 17, 2026
8 of 9 checks passed
@evanpetzoldt evanpetzoldt deleted the feat-sql-auth-connector branch March 17, 2026 10:58
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

Successfully merging this pull request may close these issues.

2 participants