Drizzle-Zod not supported in latest version of Drizzle-ORM

I tried upgrading to drizzle orm 0.36, but I was having problems similar to this github issue. I downgraded back and everything is working fine. Has anybody been having this issue? https://github.com/drizzle-team/drizzle-orm/issues/3125
GitHub
[BUG]: Latest versions of drizzle-orm (0.34.1) and drizzle-zod (0.5...
What version of drizzle-orm are you using? 0.34.1 What version of drizzle-kit are you using? 0.25.0 Describe the Bug For example, I have a table: export const userTable = pgTable('user', { ...
6 Replies
Niiju
Niiju3w ago
I'm having this issue as well what's the version you downgraded to ?
pedrocarlo
pedrocarloOP2w ago
@Niiju sorry just saw your message. I these are the versions that are working for me: "drizzle-orm": "^0.35.3", "drizzle-zod": "^0.5.1",
Niiju
Niiju2w ago
thank you, I tried it but still get the error :/ did you do anything else?
pedrocarlo
pedrocarloOP2w ago
Send the error message you are getting. Maybe it is not the same error as I was getting @Niiju just updated my packages again to see if they corrected it. In my case the error is gone now with the upgraded version
Niiju
Niiju2w ago
sorry I didnt see :
Argument of type 'PgTableWithColumns<{ name: "users"; schema: "auth"; columns: { id: PgColumn<{ name: "id"; tableName: "users"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; ... 4 more ...; generated: undefined; }, {}, {}>; ... 6 more ...; updatedAt...' is not assignable to parameter of type 'Table<TableConfig<Column<any, object, object>>>'.
The types of '_.config.columns' are incompatible between these types.
Type '{ id: PgColumn<{ name: "id"; tableName: "users"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [...]; baseColumn: never; generated: undefined; }, {}, {}>; ... 6 more ......' is not assignable to type 'Record<string, Column<any, object, object>>'.
Property 'id' is incompatible with index signature.
Type 'PgColumn<{ name: "id"; tableName: "users"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [...]; baseColumn: never; generated: undefined; }, {}, {}>' is not assignable to type 'Column<any, object, object>'.
The types of 'table._.config.columns' are incompatible between these types.
Type 'Record<string, PgColumn<ColumnBaseConfig<ColumnDataType, string>, {}, {}>>' is not assignable to type 'Record<string, Column<any, object, object>>'.
'string' index signatures are incompatible.
Type 'PgColumn<ColumnBaseConfig<ColumnDataType, string>, {}, {}>' is not assignable to type 'Column<any, object, object>'.
Property 'config' is protected but type 'Column<T, TRuntimeConfig, TTypeConfig>' is not a class derived from 'Column<T, TRuntimeConfig, TTypeConfig>'.deno-ts(2345)
Argument of type 'PgTableWithColumns<{ name: "users"; schema: "auth"; columns: { id: PgColumn<{ name: "id"; tableName: "users"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; ... 4 more ...; generated: undefined; }, {}, {}>; ... 6 more ...; updatedAt...' is not assignable to parameter of type 'Table<TableConfig<Column<any, object, object>>>'.
The types of '_.config.columns' are incompatible between these types.
Type '{ id: PgColumn<{ name: "id"; tableName: "users"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [...]; baseColumn: never; generated: undefined; }, {}, {}>; ... 6 more ......' is not assignable to type 'Record<string, Column<any, object, object>>'.
Property 'id' is incompatible with index signature.
Type 'PgColumn<{ name: "id"; tableName: "users"; dataType: "string"; columnType: "PgText"; data: string; driverParam: string; notNull: true; hasDefault: false; isPrimaryKey: false; isAutoincrement: false; hasRuntimeDefault: false; enumValues: [...]; baseColumn: never; generated: undefined; }, {}, {}>' is not assignable to type 'Column<any, object, object>'.
The types of 'table._.config.columns' are incompatible between these types.
Type 'Record<string, PgColumn<ColumnBaseConfig<ColumnDataType, string>, {}, {}>>' is not assignable to type 'Record<string, Column<any, object, object>>'.
'string' index signatures are incompatible.
Type 'PgColumn<ColumnBaseConfig<ColumnDataType, string>, {}, {}>' is not assignable to type 'Column<any, object, object>'.
Property 'config' is protected but type 'Column<T, TRuntimeConfig, TTypeConfig>' is not a class derived from 'Column<T, TRuntimeConfig, TTypeConfig>'.deno-ts(2345)
export const selectUserSchema = createSelectSchema(usersInAuth); no luck. I didn't do anything else other than drizzle-kit pull and creating a zod schema
Xpecial Poo
Xpecial Poo4d ago
I am having the same issue: "drizzle-orm": "^0.36.3", "drizzle-kit": "0.28.1", I have 0 code completion, typescript errors everywhere. Can anyone help? my config: export const db = drizzle({ client: createPool(), logger: true, schema: { ...schema, ...relations }, })
Want results from more Discord servers?
Add your server