ยฉ 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Teamโ€ข3y agoโ€ข
8 replies
volks

Raw sql nullable types, sql<Type | undefined>

const result = await db.select({
  customField: sql<Type | null>`...`
const result = await db.select({
  customField: sql<Type | null>`...`


This gets inferred to
SQL<any>
SQL<any>


Is there a way to have a nullable type when using raw sql?
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Get type of raw sql record
Drizzle TeamDTDrizzle Team / help
15mo ago
How to specify types for raw sql statement?
Drizzle TeamDTDrizzle Team / help
13mo ago
How to types and parsing with raw sql
Drizzle TeamDTDrizzle Team / help
15mo ago
pgTable - raw sql
Drizzle TeamDTDrizzle Team / help
3y ago