© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•9mo ago•
14 replies
Queen Elizabeth II

Type error when using `drizzle-zod` with sqlite table schema

I'm trying to do this:

const a = createSelectSchema(schema.deckInfo)
const a = createSelectSchema(schema.deckInfo)


My table is:

export const deckInfo = sqliteTable(
    'deck_info',
    {
        id: integer().primaryKey(),
        deckId: text().notNull(),
        name: text().notNull(),
        description: text(),
        ownerUserId: text().notNull(),
        color: integer().notNull(),
        createdAt: integer({ mode: 'timestamp' }).notNull(),
        updatedAt: integer({ mode: 'timestamp' }).notNull(),
        aiAssisted: integer({ mode: 'boolean' }).notNull().default(false) // Whether AI was used at any point in making the deck
    },
    (table) => [check('singleton', sql`${table.id} = 1`)]
)
export const deckInfo = sqliteTable(
    'deck_info',
    {
        id: integer().primaryKey(),
        deckId: text().notNull(),
        name: text().notNull(),
        description: text(),
        ownerUserId: text().notNull(),
        color: integer().notNull(),
        createdAt: integer({ mode: 'timestamp' }).notNull(),
        updatedAt: integer({ mode: 'timestamp' }).notNull(),
        aiAssisted: integer({ mode: 'boolean' }).notNull().default(false) // Whether AI was used at any point in making the deck
    },
    (table) => [check('singleton', sql`${table.id} = 1`)]
)


I get a type error on my input to
createSelectSchema
createSelectSchema
.

No overload matches this call.
  The last overload gave the following error.
    Argument of type 'SQLiteTableWithColumns<{ name: "deck_info"; schema: undefined; columns: { id: SQLiteColumn<{ name: "id"; tableName: "deck_info"; dataType: "number"; columnType: "SQLiteInteger"; data: number; driverParam: number; notNull: true; ... 7 more ...; generated: undefined; }, {}, {}>; ... 7 more ...; aiAssisted: SQLiteColum...' is not assignable to parameter of type 'PgEnum<any>'.
      Type 'SQLiteTable<{ name: "deck_info"; schema: undefined; columns: { id: SQLiteColumn<{ name: "id"; tableName: "deck_info"; dataType: "number"; columnType: "SQLiteInteger"; data: number; driverParam: number; notNull: true; ... 7 more ...; generated: undefined; }, {}, {}>; ... 7 more ...; aiAssisted: SQLiteColumn<...>; }; ...' is missing the following properties from type 'PgEnum<any>': enumName, enumValues, schemats(2769)
No overload matches this call.
  The last overload gave the following error.
    Argument of type 'SQLiteTableWithColumns<{ name: "deck_info"; schema: undefined; columns: { id: SQLiteColumn<{ name: "id"; tableName: "deck_info"; dataType: "number"; columnType: "SQLiteInteger"; data: number; driverParam: number; notNull: true; ... 7 more ...; generated: undefined; }, {}, {}>; ... 7 more ...; aiAssisted: SQLiteColum...' is not assignable to parameter of type 'PgEnum<any>'.
      Type 'SQLiteTable<{ name: "deck_info"; schema: undefined; columns: { id: SQLiteColumn<{ name: "id"; tableName: "deck_info"; dataType: "number"; columnType: "SQLiteInteger"; data: number; driverParam: number; notNull: true; ... 7 more ...; generated: undefined; }, {}, {}>; ... 7 more ...; aiAssisted: SQLiteColumn<...>; }; ...' is missing the following properties from type 'PgEnum<any>': enumName, enumValues, schemats(2769)


Is
drizzle-zod
drizzle-zod
Postgres only or something?
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Issue with sqlite real type and drizzle-zod schema
Drizzle TeamDTDrizzle Team / help
4mo ago
drizzle schema type error
Drizzle TeamDTDrizzle Team / help
2y ago
drizzle-zod insert/update schema refinements type
Drizzle TeamDTDrizzle Team / help
11mo ago
Type error when passing schema to drizzle
Drizzle TeamDTDrizzle Team / help
3y ago