Closed
Description
Version
1.12.0
What happened?
Generated code:
type CreateACRow struct {
Foo int32
Foo_2 int32
Bar sql.NullInt32
}
Similar to #568. It always creates duplicate fields with _2
suffix. Using DISTINCT
also does not work, checked the #896, it's not supported anyway.
Relevant log output
No response
Database schema
create table a
(
foo int primary key
);
create table c
(
bar int
);
SQL queries
-- Simple Example
select * from ((select * from a limit 1) union (select * from c limit 1)) as ac;
-- My Case
with x as (insert into a (foo) values ($1) returning *),
y as (insert into c (bar) values ($2) returning *)
select *
from ((select * from x) union (select * from y)) as ac;
Configuration
version: "1"
packages:
- name: "db"
path: "./db/"
queries: "./query/"
schema: "./schema/"
engine: "postgresql"
Playground URL
No response
What operating system are you using?
macOS
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go