You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using UNION ALL in a query, SQLC generates a new row type (e.g., FindOrCreateAssetsByNameAndSymbolRow) instead of using the base table type (Asset), even though both parts of the UNION are returning the same table structure.
Current Behavior
Given a query like this:
-- name: FindOrCreateAssetsByNameAndSymbol :many
WITH new_assets AS (
INSERT INTO asset (name, symbol)
SELECT unnest(@names::text[]), unnest(@symbols::text[])
WHERE NOT EXISTS (...)
RETURNING *
)
SELECT*FROM new_assets
UNION ALLSELECT*FROM asset
WHERE ...;
Description
When using
UNION ALL
in a query, SQLC generates a new row type (e.g.,FindOrCreateAssetsByNameAndSymbolRow
) instead of using the base table type (Asset
), even though both parts of the UNION are returning the same table structure.Current Behavior
Given a query like this:
SQLC generates:
Expected Behavior
Since both parts of the UNION ALL return the same table structure (asset), the generated function should return the base table type:
What database engines need to be changed?
PostgreSQL
What programming language backends need to be changed?
Go
The text was updated successfully, but these errors were encountered: