© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•13mo ago•
4 replies
Yuya

TypeError unless column is notNull

gave the following error.
Object literal may only specify known properties, and <column> does not exist in type:

schema.ts:
export const usersSchema = sqliteTable('users', {
  id: int().primaryKey({ autoIncrement: true }),
  name: text().notNull(),
  email: text().notNull().unique(),
  verified: int().notNull(),
  columnWithError: text(),
});
export const usersSchema = sqliteTable('users', {
  id: int().primaryKey({ autoIncrement: true }),
  name: text().notNull(),
  email: text().notNull().unique(),
  verified: int().notNull(),
  columnWithError: text(),
});

const user = await db
   .insert(usersSchema)
   .values({
      name: '',
      email,
      passwordHash,
      verified: 0,
      columnWithError, // NOT READ FOR SOME REASON
   })
const user = await db
   .insert(usersSchema)
   .values({
      name: '',
      email,
      passwordHash,
      verified: 0,
      columnWithError, // NOT READ FOR SOME REASON
   })


Once I add the
.notNull() 
.notNull() 
the error is gone, am I doning something wrong?
Thanks.
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

Conditional NotNull Column?
Drizzle TeamDTDrizzle Team / help
16mo ago
Can't alter column from `.notNull()` to `allow null`
Drizzle TeamDTDrizzle Team / help
2y ago
db push when adding notNull column with default() value
Drizzle TeamDTDrizzle Team / help
3y ago
PgColumnBuilderBase and notNull()
Drizzle TeamDTDrizzle Team / help
17mo ago