Skip to content
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

Query "SELECT * FROM unnest(..)" has wrong generated code #3342

Open
AntonOcean opened this issue Apr 16, 2024 · 0 comments
Open

Query "SELECT * FROM unnest(..)" has wrong generated code #3342

AntonOcean opened this issue Apr 16, 2024 · 0 comments
Labels
bug Something isn't working triage New issues that hasn't been reviewed

Comments

@AntonOcean
Copy link

Version

1.25.0

What happened?

This is my expectation from SQL-query
expectation


But this is a reality of SQLC generated code
reality

Relevant log output

const getAuthors = `-- name: GetAuthors :exec
SELECT unnest FROM unnest($1::authors[])
`

Database schema

CREATE TABLE authors (
  id   BIGSERIAL PRIMARY KEY,
  name text      NOT NULL,
  bio  text
);

SQL queries

-- name: GetAuthors :exec
SELECT * FROM unnest($1::authors[]);

Configuration

{
  "version": "2",
  "sql": [{
    "schema": "schema.sql",
    "queries": "query.sql",
    "engine": "postgresql",
    "gen": {
      "go": {
        "out": "db"
      }
    }
  }]
}

Playground URL

https://play.sqlc.dev/p/92a526ef05f1b3ec8c4dbc2360e1ff0c7cc27464a8b5870957166137b8e119af

What operating system are you using?

macOS

What database engines are you using?

PostgreSQL

What type of code are you generating?

Go

@AntonOcean AntonOcean added bug Something isn't working triage New issues that hasn't been reviewed labels Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage New issues that hasn't been reviewed
Projects
None yet
Development

No branches or pull requests

1 participant