© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•2y ago
CS

Is there a way to define "nullable" types for magic SQL?

For example
sql<number | null>...
sql<number | null>...
? It seems that you can't pass a union like that, but you can pass a type that you define as
type NumOrNull = number | null
type NumOrNull = number | null
, but when looking at the type hints of my return value it still shows just number.
Not a really important question at this point - just thought I'd ask! :)
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Raw sql nullable types, sql<Type | undefined>
Drizzle TeamDTDrizzle Team / help
3y ago
Is there a way to declare a custom SQL index?
Drizzle TeamDTDrizzle Team / help
3y ago
How to define types for jsonb
Drizzle TeamDTDrizzle Team / help
3y ago
Is there a better way to access enum types?
Drizzle TeamDTDrizzle Team / help
3y ago