Closed
Description
Hey all!
I'm loving sqlc as it's greatly reducing my dev-time but I've run into an issue and I'm not sure if I've misunderstood the API or not.
I essentially have a couple of tables that hold a bunch of enums for a few reusable values (i.e listing_type can only take on the value of one of 3 strings, so these strings are stored in their own table and are referenced as foreign keys).
Anyway, I wanted to write a query that just grabs all the enums from all the tables and unions
them into a single table rather than a select * from
statement for each table as so:
-- name: GetAllEnums :many
SELECT * FROM payment_terms
UNION
SELECT * FROM collection_terms
UNION
SELECT * FROM packaging_type
UNION
SELECT * FROM load_type
UNION
SELECT * FROM price_type
UNION
SELECT * FROM listing_type;
However this throws the following error:
error generating code: template: table:255:79: executing "queryCode" at <.Ret.Type>: error calling Type: no type for QueryValue:
Any ideas?