-
-
Notifications
You must be signed in to change notification settings - Fork 172
Open
Labels
bugSomething isn't workingSomething isn't working
Description
- I confirm this is a bug with Supabase, not with my own application.
- I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
When I use a .limit(1).maybeSingle() in select() the type inference produces non nullable types even when the return type might be null.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- Create a tableX with columnX of type number
- Query the table like with following query
await supabase
.from('tableX')
.select('*')
.match({
columnX: 999, <-- Number for which a row is not found
})
.limit(1)
.maybeSingle()
- Typescript will not include
null
in a return type union even when a fresh Supabase Database type has been exported and is being passed to createServerClient.
Expected behavior
For null
to be included in a union return type.
Screenshots
If applicable, add screenshots to help explain your problem.
System information
- OS: macOS
- Version of supabase-js: 2.57.4
- Version of postgrest-js: 1.21.4
- Version of Typescript: 4.9.5
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working