© 2026 Hedgehog Software, LLC

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

Types aren't being inferred properly

I have the following schema.
export const taskFolders = pgTable('task_folders', {
  id: uuid('id').primaryKey().defaultRandom(),
  taskId: uuid('taskId').references(() => tasks.id, { onDelete: 'cascade' }),
  name: text('name').notNull(),
  createdAt: timestamp('created_at', { mode: 'string' }).notNull().defaultNow(),
  deletedAt: timestamp('deleted_at'),
});
export type InsertTaskFolder = typeof taskFolders.$inferInsert;
//          ?^ { name: string }
export const taskFolders = pgTable('task_folders', {
  id: uuid('id').primaryKey().defaultRandom(),
  taskId: uuid('taskId').references(() => tasks.id, { onDelete: 'cascade' }),
  name: text('name').notNull(),
  createdAt: timestamp('created_at', { mode: 'string' }).notNull().defaultNow(),
  deletedAt: timestamp('deleted_at'),
});
export type InsertTaskFolder = typeof taskFolders.$inferInsert;
//          ?^ { name: string }

I'm trying to update the
deleted_at
deleted_at
column but when I do, Typescript is erroring.

  @Delete(':id')
  async delete(@Param('id', new ParseUUIDPipe()) id: Guid) {
    await this.db
      .update(scheme.taskFolders)
      .set({ deletedAt: new Date() }) // Typescript error here: Object literal may only specify known properties, and 'deletedAt' does not exist in type '{ name?: string | SQL<unknown>; }'.
      .where(eq(scheme.taskFolders.id, id));
  }
  @Delete(':id')
  async delete(@Param('id', new ParseUUIDPipe()) id: Guid) {
    await this.db
      .update(scheme.taskFolders)
      .set({ deletedAt: new Date() }) // Typescript error here: Object literal may only specify known properties, and 'deletedAt' does not exist in type '{ name?: string | SQL<unknown>; }'.
      .where(eq(scheme.taskFolders.id, id));
  }


My question is why
deletedAt
deletedAt
isn't being inferred and how I can fix this
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

Explicit inferred types
Drizzle TeamDTDrizzle Team / help
3y ago
Inferred Types not picking up Relations
Drizzle TeamDTDrizzle Team / help
3y ago
uuid's being inferred as strings
Drizzle TeamDTDrizzle Team / help
3y ago
help with drizzle types not inferred well
Drizzle TeamDTDrizzle Team / help
3y ago