© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•17mo ago•
1 reply
tcurdt

PgColumnBuilderBase and notNull()

holy mother of types ... could someone help me out here?

export function ref(id: AnyPgColumn): PgColumnBuilderBase {
  return bigint({ mode: 'number' })
    .references((): AnyPgColumn => id)
}
export function ref(id: AnyPgColumn): PgColumnBuilderBase {
  return bigint({ mode: 'number' })
    .references((): AnyPgColumn => id)
}


OK:
id: ref(sometable.id)
id: ref(sometable.id)

KO:
id: ref(sometable.id).notNull()
id: ref(sometable.id).notNull()


Is there a base type or interface I can use that does include
notNull()
notNull()
and friends?
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

notNull and Unique
Drizzle TeamDTDrizzle Team / help
2y ago
Conditional NotNull Column?
Drizzle TeamDTDrizzle Team / help
16mo ago
TypeError unless column is notNull
Drizzle TeamDTDrizzle Team / help
13mo ago
notNull(); in a specific condition
Drizzle TeamDTDrizzle Team / help
2y ago