Closed karlhorky closed 2 months ago
Latest commit: 208ce1e1d2b81c5bd1e1f3cae1c2425ec6b68c95
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
The latest updates on your projects. Learn more about Vercel for Git ↗︎
One thing this PR doesn't touch is IS NOT NULL
and IS NULL
inside of a subquery, which yields unknown
:
// 💥 Query has incorrect type annotation.
// Expected: { is_null: boolean }[]
// Actual: { is_null: unknown }[]
await sql<{ is_null: boolean }>`
SELECT (SELECT 1 IS NULL) AS is_null
`
Well done! LGTM. Regaring a AST Explorer - sadly there isn't. I usually rely heavily on logs and breakpoints.
Nice, thanks for the review and merge!
Regaring a AST Explorer - sadly there isn't. I usually rely heavily on logs and breakpoints.
Interesting, yeah then I'll work like this to start too.
Wonder how easy it is to contribute something like this to AST explorer... 🤔 Would be an interesting thing to have the SQL AST more observable / visually debuggable. Or alternatively, build some minimal custom tooling. I'll keep it in mind.
Omg amazing, that looks great!! I will definitely use this for the next PRs!
Avoid the
| null
here, from my comment:The tests I added are passing, but I'm not sure if I am missing out on other cases which should NOT be non-nullable.
By the way, is there something like AST explorer for the SQL AST types? I am fumbling a bit in the dark here, searching through the codebase - would be great to have a visual UI to select the parts of the code I'm interested in and have the node types identified.