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
SafeQL infers that the field in the subquery is id and not the aliased name rsvped:
// 💥 Query has incorrect type annotation.// Expected: { rsvped: boolean }[]// Actual: { id: number }[]awaitsql<{rsvped: boolean}[]>` SELECT x.* FROM ( SELECT event_rsvps.id IS NOT NULL AS rsvped FROM event_rsvps ) x`
Workaround
Use explicit field names (x.rsvped instead of x.*)
Switch boolean type to boolean | null (not accurate, but I think this is a separate SafeQL nullability inference error)
// ✅awaitsql<{rsvped: boolean|null}[]>` SELECT x.rsvped FROM ( SELECT event_rsvps.id IS NOT NULL AS rsvped FROM event_rsvps ) x`
To Reproduce
See above
Expected behavior
Inference of the aliased name rsvped in the subquery
Screenshots
--
Desktop (please complete the following information):
// 💥 Query has incorrect type annotation.// Expected: { rsvped: boolean }[]// Actual: { id: number }[]awaitsql<{rsvped: boolean}[]>` SELECT x.* FROM ( SELECT event_rsvps.id IS NOT NULL AS rsvped FROM event_rsvps ) x`
Here's the minimal table definition, in case that works for reproducing for you:
CREATETABLEevent_rsvps (
id integerPRIMARY KEY GENERATED ALWAYS AS IDENTITY
);
Describe the bug
SafeQL infers that the field in the subquery is
id
and not the aliased namersvped
:Workaround
x.rsvped
instead ofx.*
)boolean
type toboolean | null
(not accurate, but I think this is a separate SafeQL nullability inference error)To Reproduce
See above
Expected behavior
Inference of the aliased name
rsvped
in the subqueryScreenshots
--
Desktop (please complete the following information):
Additional context
Originally introduced in this PR:
The text was updated successfully, but these errors were encountered: