From fd9ff55ffaebcb1f442e2df5e3921cf41000ad2a Mon Sep 17 00:00:00 2001 From: EugeneTes Date: Sat, 15 Aug 2026 11:24:23 +0000 Subject: [PATCH] Plan: use Supabase session pooler (IPv4) for Postgres connection Direct DB host is IPv6-only for new Supabase projects and unreachable from IPv4-only environments. The session pooler (Supavisor, port 5432) is the correct entry point and keeps prepared statements working with EF Core. --- .../plans/2026-08-15-supabase-todo-app.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/docs/superpowers/plans/2026-08-15-supabase-todo-app.md b/docs/superpowers/plans/2026-08-15-supabase-todo-app.md index 7c92115..b85eee7 100644 --- a/docs/superpowers/plans/2026-08-15-supabase-todo-app.md +++ b/docs/superpowers/plans/2026-08-15-supabase-todo-app.md @@ -198,6 +198,14 @@ Replace `backend/Properties/launchSettings.json` with: - [ ] **Step 4: Create `appsettings.Development.example.json` (committed template)** +The connection string uses Supabase's **session pooler** (Supavisor), not the direct DB host. Rationale: the direct host (`db..supabase.co`) is IPv6-only for new Supabase projects; the pooler is IPv4-reachable and is Supabase's recommended entry point. Session mode (port `5432`) keeps prepared statements working with EF Core; transaction mode (`6543`) would break them. + +Pooler URL shape: +``` +Host=aws--.pooler.supabase.com;Port=5432;Username=postgres.;Password=… +``` +Get the exact `n` and `region` from your Supabase dashboard → Project Settings → Database → Connection string → "Session pooler" tab. + Create `backend/appsettings.Development.example.json`: ```json @@ -206,11 +214,11 @@ Create `backend/appsettings.Development.example.json`: "LogLevel": { "Default": "Information", "Microsoft.AspNetCore": "Warning" } }, "ConnectionStrings": { - "Postgres": "Host=db.YOURPROJECT.supabase.co;Port=5432;Database=postgres;Username=postgres;Password=REPLACE_ME;SSL Mode=Require;Trust Server Certificate=true" + "Postgres": "Host=aws-N-REGION.pooler.supabase.com;Port=5432;Database=postgres;Username=postgres.YOURPROJECTREF;Password=REPLACE_ME;SSL Mode=Require;Trust Server Certificate=true" }, "Supabase": { - "MetadataAddress": "https://YOURPROJECT.supabase.co/auth/v1/.well-known/openid-configuration", - "Issuer": "https://YOURPROJECT.supabase.co/auth/v1", + "MetadataAddress": "https://YOURPROJECTREF.supabase.co/auth/v1/.well-known/openid-configuration", + "Issuer": "https://YOURPROJECTREF.supabase.co/auth/v1", "Audience": "authenticated" } } @@ -218,7 +226,7 @@ Create `backend/appsettings.Development.example.json`: - [ ] **Step 5: Create `appsettings.Development.json` (gitignored, real values)** -Create `backend/appsettings.Development.json`. Substitute the DB password provided out of band (the credentials were given in the brainstorming session — the executor has them). Do **not** paste the DB password into any committed file: +Create `backend/appsettings.Development.json`. Substitute the DB password provided out of band. Do **not** paste the DB password into any committed file: ```json { @@ -226,7 +234,7 @@ Create `backend/appsettings.Development.json`. Substitute the DB password provid "LogLevel": { "Default": "Information", "Microsoft.AspNetCore": "Warning" } }, "ConnectionStrings": { - "Postgres": "Host=db.jrbqfctqhjttxobtoqts.supabase.co;Port=5432;Database=postgres;Username=postgres;Password=REPLACE_WITH_DB_PASSWORD;SSL Mode=Require;Trust Server Certificate=true" + "Postgres": "Host=aws-1-eu-west-1.pooler.supabase.com;Port=5432;Database=postgres;Username=postgres.jrbqfctqhjttxobtoqts;Password=REPLACE_WITH_DB_PASSWORD;SSL Mode=Require;Trust Server Certificate=true" }, "Supabase": { "MetadataAddress": "https://jrbqfctqhjttxobtoqts.supabase.co/auth/v1/.well-known/openid-configuration",