© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•16mo ago•
2 replies
Ben Quan

Semicolon separated emails using drizzle-zod.

I have the following Schema definition for drizzle-zod:
export const RegistroSchema = createSelectSchema(registro, {
    correo: (schema) => schema.correo.email(),
    retencionRenta: (schema) => schema.retencionRenta.optional(),
    retencionIVA: (schema) => schema.retencionIVA.optional()
});
export const RegistroSchema = createSelectSchema(registro, {
    correo: (schema) => schema.correo.email(),
    retencionRenta: (schema) => schema.retencionRenta.optional(),
    retencionIVA: (schema) => schema.retencionIVA.optional()
});


I want to change the email verification from a single to a multi email verification
I have an idea of the required zod definition
z.object({
  factoryEmail: z
    .string()
    .refine((emailValue) => emailValue.split(";").every((item) => z.string().email().safeParse(item).success)),
});
z.object({
  factoryEmail: z
    .string()
    .refine((emailValue) => emailValue.split(";").every((item) => z.string().email().safeParse(item).success)),
});

but I am not sure how to represent that inside ResitroShema (for the field: correo)?
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

Using drizzle-zod on zod-based form
Drizzle TeamDTDrizzle Team / help
7mo ago
Using drizzle-zod with superforms
Drizzle TeamDTDrizzle Team / help
7mo ago
Why does drizzle-zod create ZodString's instead of z.ZodStrings for mySQL?
Drizzle TeamDTDrizzle Team / help
3y ago
Drizzle-Zod
Drizzle TeamDTDrizzle Team / help
9mo ago