Skip to content

Commit 65b104e

Browse files
committed
Fix handleColumns use of factory.zodInstance
The `handleColumns` used in `drizzle-zod` now uses the `zodInstance` passed in to the `factory` options. The previous implementation caused `createSchemaFactory` to return its methods using `z.object(columnSchemas)` ignoring the custom zod instance passed to the `CreateSchemaFactoryOptions`.
1 parent 33f0374 commit 65b104e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drizzle-zod/src/schema.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ function handleColumns(
5959
}
6060
}
6161
}
62-
63-
return z.object(columnSchemas) as any;
62+
const zod: typeof z = factory?.zodInstance ?? z;
63+
return zod.object(columnSchemas) as any;
6464
}
6565

6666
function handleEnum(

0 commit comments

Comments
 (0)