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.
This commit is contained in:
EugeneTes
2026-08-15 11:24:23 +00:00
parent afe9ba1956
commit fd9ff55ffa

View File

@@ -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.<ref>.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-<n>-<region>.pooler.supabase.com;Port=5432;Username=postgres.<project-ref>;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",