Skip to content

fix(stack): connect functions to the database as postgres (CLI-2957) - #7571

Merged
7ttp merged 3 commits into
developfrom
7ttp/cli-2957-stack-connect-functions-to-the-database-as
Nov 11, 2026
Merged

7ttp merged 3 commits into
developfrom
7ttp/cli-2957-stack-connect-functions-to-the-database-as

Conversation

@7ttp

@7ttp 7ttp commented Nov 10, 2026

Copy link
Copy Markdown
Member

TL;DR

fixes edge functions on the stack connecting to the database as the supabase_admin superuser instead of postgres

whats hurting?

on the stack, SUPABASE_DB_URL inside a function pointed at supabase_admin, while the legacy backend and deployed functions get postgres

so a function could run superuser only sql locally that fails once deployed

tables a function created were also owned by supabase_admin, so migrations and db query as postgres could not alter them

now fixed by?

the stack hands functions a postgres role url, on supabase start and on functions serve
a stack created before this picks it up on its next stack start, while stack restart keeps the saved value

ref:

@7ttp 7ttp self-assigned this Nov 10, 2026
@7ttp
7ttp requested a review from a team as a code owner November 10, 2026 22:35
@7ttp
7ttp requested a review from Coly010 November 10, 2026 22:35
@github-actions

Copy link
Copy Markdown
Contributor

CLI benchmark (Lightweight Commands): no changes found

Commit 5e86917 against develop at 6324f99 · 10 runs each · report only, never blocks merging

Command Workload Before After Change
supabase --version version 183 ms 189 ms no real change
supabase --help help 190 ms 195 ms no real change
supabase init init 211 ms 207 ms no real change
supabase migration new bench migration-new 204 ms 206 ms no real change
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 225 ms 241 ms no real change (+7%, within normal variation)
supabase projects list projects-list 204 ms 217 ms no real change (+7%, within normal variation)
supabase functions list --project-ref replayfixtureprojref functions-list 225 ms 204 ms no real change (-9%, within normal variation)

API calls: unchanged for all 7 commands.

Binary size: 134.9 MB, up 4.0 KB from 134.9 MB.

Details: timing ranges, API calls per command, slowest phases

Timing ranges

Command Workload Before range After range Change Verdict
supabase --version version 169-217 ms 173-193 ms +7 ms (+4%) within noise
supabase --help help 185-207 ms 175-417 ms +5 ms (+3%) within noise
supabase init init 186-265 ms 189-250 ms -3 ms (-2%) within noise
supabase migration new bench migration-new 189-218 ms 184-220 ms +2 ms (+1%) within noise
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 205-332 ms 207-340 ms +16 ms (+7%) within noise
supabase projects list projects-list 192-261 ms 187-259 ms +13 ms (+7%) within noise
supabase functions list --project-ref replayfixtureprojref functions-list 210-241 ms 197-222 ms -21 ms (-9%) within noise

API calls per command

Command Workload Before After Endpoint changes
supabase --version version 0 0
supabase --help help 0 0
supabase init init 0 0
supabase migration new bench migration-new 0 0
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 2 2
supabase projects list projects-list 1 1
supabase functions list --project-ref replayfixtureprojref functions-list 2 2

Slowest phases

No command moved beyond noise, so there are no phase deltas.

Workflow run

Comment /bench to run the lightweight benchmark (this comment) again on the latest commit, or /bench full to also run the integration-heavy benchmark, which posts in its own comment.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤖 AI Review

Both independent reviews completed with no findings. Inspection of the checked-out code confirms consistent postgres-role URL rendering and Functions wiring. No actionable issues or fundamental conflicts with the pending next-branch work were identified. Tests were not run during adjudication.

Findings

No issues found.

Stats

Claude findings: 0 · Codex findings: 0 · Confirmed: 0 · Refuted: 0 · Uncertain: 0


Models: claude-opus-5-5 + gpt-6.1-sol · Trigger: auto · Workflow run

This review runs once per PR. A maintainer can request another with a /ai-review comment.

@Coly010 Coly010 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, one small optional ask:

  1. the PR body says a stack created before this keeps supabase_admin across stack restart until its next stack start - might be worth a line in stack/start/SIDE_EFFECTS.md too, so folk hitting it on an older stack can find it without the PR. happy for you to skip it if you think it's too niche

@7ttp
7ttp added this pull request to the merge queue Nov 11, 2026
Merged via the queue into develop with commit 16dda0e Nov 11, 2026
49 checks passed
@7ttp
7ttp deleted the 7ttp/cli-2957-stack-connect-functions-to-the-database-as branch November 11, 2026 11:29
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