-
Notifications
You must be signed in to change notification settings - Fork 978
Open
Labels
Description
Version
1.30.0
What happened?
Cannot compile a correct query, got error column reference "id" is ambiguous, the problem column is in a subquery.
Relevant log output
column reference "id" is ambiguousDatabase schema
CREATE TABLE IF NOT EXISTS t1 (
id UUID PRIMARY KEY
);
CREATE TABLE IF NOT EXISTS t2 (
id UUID,
t1_id UUID REFERENCES t1(id) ON DELETE CASCADE
);SQL queries
-- name: GetT1 :many
SELECT * FROM t1
WHERE id IN (
SELECT t1_id
FROM t2
WHERE id = $1
);Configuration
version: "2"
sql:
- engine: "postgresql"
schema: "../migrations"
queries: "internal/db/query/example"
gen:
go:
package: "query"
out: "internal/db/query/example"
sql_package: "pgx/v5"
emit_sql_as_comment: truePlayground URL
No response
What operating system are you using?
Linux
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go