Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(compiler): insert-with-select statements#4006

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
dennisgsmith wants to merge1 commit intosqlc-dev:main
base:main
Choose a base branch
Loading
fromdennisgsmith:dennisgsmith/fix-insert-cte-select-compiler-error

Conversation

dennisgsmith
Copy link

@dennisgsmithdennisgsmith commentedJun 30, 2025
edited
Loading

Fixes#3847
Fixes#3996

I was bumping into the above issues (but for postgres) and this bug seemed to be engine agnostic. After inspecting the output withSQLCDEBUG=dumpast=1 andSQLCDEBUG=dumpcatalog=1 I found that:

  1. The CTE relation name was not in the catalog when using insert-cte-select queries.
  2. The ASTWithClause was under theSelectStmt, not directly within the parentInsertStmt node.

Using theSelectStmtWithClause when it's not null resolves the issue. Please let me know if there are any changes you'd like to see. Thanks!

@dosubotdosubotbot added size:XLThis PR changes 500-999 lines, ignoring generated files. 🔧 golang labelsJun 30, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
size:XLThis PR changes 500-999 lines, ignoring generated files.🔧 golang
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

CTE doesn't get recognized by sqlc in insert statement. relation does not exist with insert using CTE
1 participant
@dennisgsmith

[8]ページ先頭

©2009-2025 Movatter.jp