New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]:drizzle-zod produces wrong type #1110
Comments
I ran into this as well. This fixes it for now export const selectDataSchema = createSelectSchema(
responseData,
{
text_array: z.array(z.string()),
},
) |
The following produces correct types (It's strange): type Committee = Partial<InferInsertModel<typeof committee>>; The type it produces: type Committee = {
safety_health?: string | null | undefined;
safety_health_sources?: string[] | null | undefined; // <--- it works, it produces string[]
// other properties
} |
Ran into this exact problem and have a quick replication example here. Likely related to #1345 as well |
This is showing up in |
@dankochetov any updates on this issue 😃 |
…added related type tests, removed unnecessary or repeating checks
…added related type tests, removed unnecessary or repeating checks
What version of
drizzle-orm
are you using?0.28.5
What version of
drizzle-kit
are you using?0.19.13
Describe the Bug
I'm using drizzle-orm, drizzle-kit & drizzle-zod in my application. One of my schema looks like following:
The schema works fine when I push, safety_health_sources is created as an array (No issues till this point)
I create zod schema as well, like following:
and when I do:
Expected behavior
The type should be something like:
Environment & setup
NodeJS:
v20.5.0
npm:
9.8.0
OS:
EndeavourOS Linux x86_64
The text was updated successfully, but these errors were encountered: