© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•3y ago•
2 replies
Yamato

Issue with drizzle-zod?

Schema

export const testinArray = pgTable("testing_array", {
  id: varchar("id", { length: 14 })
    .primaryKey()
    .$defaultFn(() => nanoid(14)),
  names: text("names").array(),
});
export const testinArray = pgTable("testing_array", {
  id: varchar("id", { length: 14 })
    .primaryKey()
    .$defaultFn(() => nanoid(14)),
  names: text("names").array(),
});


const testingSchema = createInsertSchema(testinArray);
const data = { names: ["test1", "test2"] };
const newData = testingSchema.parse({ ...data });
db.insert(testinArray).values(newData).execute();
const testingSchema = createInsertSchema(testinArray);
const data = { names: ["test1", "test2"] };
const newData = testingSchema.parse({ ...data });
db.insert(testinArray).values(newData).execute();


No overload matches this call.
  Overload 1 of 2, '(value: { id?: string | SQL<unknown> | Placeholder<string, any> | undefined; names?: string[] | SQL<unknown> | Placeholder<string, any> | null | undefined; }): PgInsert<...>', gave the following error.
      Type '{ id?: string | undefined; names?: string | null | undefined; }' is missing the following properties from type '{ id?: string | SQL<unknown> | Placeholder<string, any> | undefined; names?: string[] | SQL<unknown> | Placeholder<string, any> | null | undefined; }[]': length, pop, push, concat, and 35 more.ts(2769)
const newData: {
    id?: string | undefined;
    names?: string | null | undefined;
}
No overload matches this call.
  Overload 1 of 2, '(value: { id?: string | SQL<unknown> | Placeholder<string, any> | undefined; names?: string[] | SQL<unknown> | Placeholder<string, any> | null | undefined; }): PgInsert<...>', gave the following error.
      Type '{ id?: string | undefined; names?: string | null | undefined; }' is missing the following properties from type '{ id?: string | SQL<unknown> | Placeholder<string, any> | undefined; names?: string[] | SQL<unknown> | Placeholder<string, any> | null | undefined; }[]': length, pop, push, concat, and 35 more.ts(2769)
const newData: {
    id?: string | undefined;
    names?: string | null | undefined;
}
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

Issue with Drizzle-Zod: Due to a type mismatch between the ZodObject and ZodType types.
Drizzle TeamDTDrizzle Team / help
3y ago
Drizzle-zod combined with regular zod? 🙃
Drizzle TeamDTDrizzle Team / help
15mo ago
Drizzle Zod with relations
Drizzle TeamDTDrizzle Team / help
2y ago
Help with Drizzle-zod
Drizzle TeamDTDrizzle Team / help
3y ago