pggen
pggen copied to clipboard
inconsistent return structures generated
-- name: FindCollectionsWithAssignee :many
select *
from collections
where assignee = pggen.arg('assignee')
order by created
limit pggen.arg('start') offset pggen.arg('limit');
-- name: FindCollectionWithIdentifier :one
select * from collections where collection_id = pggen.arg('collectionID');
produces:
type FindCollectionWithIdentifierRow struct {
...
Version int `json:"version"`
...
}
type FindCollectionsWithAssigneeRow struct {
...
Version *int `json:"version"`
...
Even if I make them both return :one it still makes the Version member on one of them a pointer when they're referencing the same table and column. I've tried removing everything after the where including the order by and limit and still a inconsistent
Thanks for reporting. Definitely looks like a bug. Probably similar to https://github.com/jschaf/pggen/pull/77. Couple of requests to speed up the fix:
- What was the pggen command line you used, specifically the
--go-typeflags? - Can you provide a minimal schema that reproduces the issue?
- What's the output of
pggen version?