sqlc
sqlc copied to clipboard
wrong type for params in tuple
Version
1.26.0
What happened?
The type for id is detected wrong.
type ListTasksParams struct {
CreateTime pgtype.Timestamptz
CreateTime_2 pgtype.Timestamptz
Limit int32
Offset int32
}
func (q *Queries) ListTasks(ctx context.Context, arg ListTasksParams) ([]Task, error)
I expected it to be:
type ListTasksParams struct {
CreateTime pgtype.Timestamptz
IDorSth int64
Limit int32
Offset int32
}
Relevant log output
No response
Database schema
create table tasks (
id bigint generated by default as identity primary key,
info text,
create_time timestamp with time zone not null default current_timestamp
);
SQL queries
select * from tasks
where
(create_time, id) > ($1, $2)
order by create_time, id
limit $3 offset $4;
Configuration
version: "2"
sql:
- engine: "postgresql"
queries: "query.sql"
schema: "schema.sql"
gen:
go:
package: "dbgw"
out: "dbgw"
sql_package: "pgx/v5"
Playground URL
No response
What operating system are you using?
Windows
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go
I have the same issue using Mac OS. @ehsangifani did you find any workaround ?
I couldn't find any workaround. So, I wrote the code for that specific query (in another file under the same package) manually.