Repository navigation
fix: bump sqlc fork to restore CTE scope tracking - #32187
Merged
Merged
Conversation
The pin moved to coder/sqlc's merge of upstream v1.31.1 in #25105, but the CTE scope fix (coder/sqlc#1) had never been merged into the fork's main, so it was dropped. coder/sqlc#1 is now on main as fb627c9c. Generated code is unchanged. The flake vendorHash stays the same: the fork's go.mod and go.sum did not change.
Member
Author
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
jakehwll
approved these changes
Nov 17, 2026
mafredri
had a problem deploying
to
docs-preview
November 17, 2026 10:41 — with
GitHub Actions
Failure
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bumps the coder/sqlc pin to
fb627c9c, which restores the CTE scope fix (coder/sqlc#1). That fix lets sqlc generate valid queries that put a subquery inside a CTE, instead of failing with a falsecolumn reference "..." is ambiguous.#25105 moved the pin to coder/sqlc's merge of upstream v1.31.1 (
337309bf). The fix had only ever existed on the side branch the old pin pointed at, so the new pin silently dropped it. Nothing broke because the one query that needed it,GetWorkspaces, had been rewritten in #22290 and its trigger removed in #29085. coder/sqlc#1 is now on the fork'smain.Generated code is unchanged. The
flake.nixcomment now says what the fork adds on top of upstream. The flakevendorHashstays the same because the fork'sgo.modandgo.sumdid not change. I computed the newsrchash withnix-prefetch-url --unpack; the same command reproduces the old hash for337309bf.Regression check
Checked against
main(d412c38afb) with sqlc built fromfb627c9c:make genandscripts/check_unstaged.sh: clean, no generated file changes.sqlc vetagainst a migrated database: passes, as it does with337309bf.go test ./coderd/database/...: passes.The fix still matters for queries like the original #20501
GetWorkspaces. That query was theowner_idsort infiltered_workspaces_order, with theEXISTS (SELECT 1 FROM tasks ...)filter infiltered_workspaces. On25af21b5d5~1with that sort restored,337309bffails withworkspaces.sql:403:13: column reference "owner_id" is ambiguous, and the fixed build generates it.In the fork,
go test ./...against PostgreSQL 16 fails the same tests with and without the fix:TestReplay/{base,managed-db}/wasm_plugin_sqlc_gen_unsafe_paths. That test's expected path depends on where the repository is checked out.No queries in
coderd/database/queriescarry casts, aliases, or type hints that exist because of this bug, so none are simplified here.