-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
📚 postgresqlbugSomething isn't workingSomething isn't workingduplicateThis issue or pull request already existsThis issue or pull request already exists
Milestone
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?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
📚 postgresqlbugSomething isn't workingSomething isn't workingduplicateThis issue or pull request already existsThis issue or pull request already exists