sqlc icon indicating copy to clipboard operation
sqlc copied to clipboard

sqlc ignores parameters following a HAVING clause

Open nkicg6 opened this issue 1 year ago • 0 comments

Version

1.27.0

What happened?

parameters following HAVING clause are ignored. parameters should be included in generated functions.

Relevant log output

No response

Database schema

CREATE TABLE tab(a TEXT, b TEXT, c TEXT);

SQL queries

-- name: WhereQueryWorksParameterinFunction :many
SELECT a, b, c
FROM tab
WHERE a LIKE (?);

-- name: HavingQueryFailsNoParametersInFunction :many
SELECT a, b, c
FROM tab
GROUP BY b,c
HAVING
a LIKE (?);

Configuration

version: "2"
sql:
  - engine: "sqlite"
    queries: "query.sql"
    schema: "schema.sql"
    gen:
      go:
        package: "db"
        out: "db"

Playground URL

No response

What operating system are you using?

Linux

What database engines are you using?

SQLite

What type of code are you generating?

Go

nkicg6 avatar Oct 02 '24 02:10 nkicg6