Closed
Description
I'm trying to use custom Go types for some SQL columns, mapping a sql int64
to Go type FooID uint64
.
It seems I can have
SELECT foo.id FROM ...
and get generated type FooRow struct { ID FooID }
or I can have
SELECT foo.id AS foo_id FROM ...
and get type FooRow struct { FooID int64 }
but I cannot get both at the same time. Using the AS
forgets the association with the Go type, but without the AS
my struct fields are kinda misleading. Consider SELECT foo.id, bar.id FROM ...
, can't have two things fighting for the struct field name ID
.
Metadata
Metadata
Assignees
Labels
No labels