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
Describe the bug
A clear and concise description of what the bug is.
Getting error ESLint: Invalid Query: Union types must be of the same type (found unknown (524288), unknown (524288), unknown (524288), unknown (524288))(@ts-safeql/ check-sql).
These are clearly the same type, in postgres at least. The issue is happening when trying to insert using unnest to a column that takes TEXT.
@timvandam If you can provide a reproduction in this format with the table schema, sql tag and ESLint error, that would be helpful to understand the problem:
CREATETABLEusers (
-- ...
)
// 💥 Query has incorrect type annotation.// Expected: { has_private_url: boolean; }// Actual: { has_private_url: boolean | null; }[]awaitsql<{has_private_url: boolean}[]>` SELECT${true} AS has_private_url FROM users`;
Describe the bug
A clear and concise description of what the bug is.
Getting error
ESLint: Invalid Query: Union types must be of the same type (found unknown (524288), unknown (524288), unknown (524288), unknown (524288))(@ts-safeql/ check-sql)
.These are clearly the same type, in postgres at least. The issue is happening when trying to insert using unnest to a column that takes TEXT.
To keep things short:
Where
name
has type:If I update this type to:
It does work. However I don't have control over that as the variable is the output of a function
To Reproduce
Steps to reproduce the behavior:
Try inserting many values to a TEXT column using UNNEST with an array with a similar type as mine
Expected behavior
A clear and concise description of what you expected to happen.
Should work
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
May have time to look into this myself this weekend
The text was updated successfully, but these errors were encountered: