-
-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression: inference of subquery aliased field name and type (number
instead of boolean
)
#362
Comments
fixed in 3.6.3 |
Hmm, still seeing this with // 💥 Query has incorrect type annotation.
// Expected: { rsvped: boolean }[]
// Actual: { id: number }[]
await sql<{ 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: CREATE TABLE event_rsvps (
id integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY
); |
does it still happening on 3.6.6? for some reason I was unable to reproduce it |
number
instead of boolean
)
I still see it on 3.6.6, yeah. Is Eg:
|
yes |
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: