ts-safeql / safeql

Validate and auto-generate TypeScript types from raw SQL queries in PostgreSQL.
https://safeql.dev
MIT License
1.35k stars 22 forks source link

Plugin error when using `UNION` in queries #241

Closed Shahor closed 3 months ago

Shahor commented 4 months ago

Describe the bug

The following query:

SELECT 1
UNION
SELECT 2

Makes the plugin error:

Internal error: stmt.targetList is not iterable

To Reproduce Steps to reproduce the behavior:

Write a query like the one above. It should error straight away

Expected behavior It doesn't break the plugin :)

Screenshots If applicable, add screenshots to help explain your problem.

image