Skip to content

sourceTable: unsupported list item type: *ast.JoinExpr #1100

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
carpenter-ryan opened this issue Jul 30, 2021 · 9 comments · Fixed by #2841
Closed

sourceTable: unsupported list item type: *ast.JoinExpr #1100

carpenter-ryan opened this issue Jul 30, 2021 · 9 comments · Fixed by #2841
Labels
📚 postgresql bug Something isn't working
Milestone

Comments

@carpenter-ryan
Copy link

carpenter-ryan commented Jul 30, 2021

UPDATE group_calc_totals gct SET npn = nem.npn FROM producer_group_attribute ga JOIN npn_external_map nem ON ga.npn_external_map_id = nem.id WHERE gct.group_id = ga.group_id;

This produces the error, sourceTable: unsupported list item type: *ast.JoinExpr.

The SQL is valid Postgres and executes as expected. I'm using version 1.8 of sqlc.

@kyleconroy kyleconroy modified the milestones: v1.9.0, v1.10.0 Aug 4, 2021
@kyleconroy kyleconroy modified the milestones: v1.10.0, v1.11.0 Sep 5, 2021
@kyleconroy
Copy link
Collaborator

CREATE TABLE group_calc_totals (
  npn  text,
  group_id text
);

CREATE TABLE producer_group_attribute (
  npn_external_map_id text,
  group_id text
);

CREATE TABLE npn_external_map (
  id   text
);

-- name: Percentile :exec
UPDATE group_calc_totals gct 
SET npn = nem.npn 
FROM producer_group_attribute ga 
JOIN npn_external_map nem ON ga.npn_external_map_id = nem.id 
WHERE gct.group_id = ga.group_id;

https://play.sqlc.dev/p/125fcccc7ba6707e40dbabc2d698313f7ec6ea9695672d49e37bd75ffb3352e2

@kyleconroy kyleconroy added bug Something isn't working 📚 postgresql labels Sep 12, 2021
@kyleconroy kyleconroy removed this from the v1.11.0 milestone Jan 31, 2022
@DarkHeros09
Copy link

any update on this issue?

1 similar comment
@akhmadnurmuhammad
Copy link

any update on this issue?

@ahobsonsayers
Copy link

Hate to add to unnecessary notifications, but is there any update on this?

@ghandic
Copy link

ghandic commented Jul 26, 2023

Any news?

@BuilderHarrison
Copy link

Hello, any update on this?

@kyleconroy
Copy link
Collaborator

No update yet, but adding this to my list to look for 1.23

@kyleconroy
Copy link
Collaborator

Fixed in #2841 and will be released in v1.23

@kyleconroy
Copy link
Collaborator

This is fixed in v1.23.0 by enabling the database-backed query analyzer. We added a test case for this issue so it won’t break in the future.

You can play around with the working example on the playground

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📚 postgresql bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants