feat: ability to use drizzle-zod validation schemas in expo #966
Replies: 5 comments 2 replies
-
I believe you can do this now by just using @acme/validators? |
Beta Was this translation helpful? Give feedback.
-
wouldn't we have to install
import { createInsertSchema, createSelectSchema } from "drizzle-zod";
import type { z } from "zod";
import { user } from "@acme/db/src/schema";
export const insertUserSchema = createInsertSchema(user);
export const selectUserSchema = createSelectSchema(user);
export type InsertUser = z.infer<typeof insertUserSchema>;
export type User = z.infer<typeof selectUserSchema>; |
Beta Was this translation helpful? Give feedback.
-
Any solution? I tried to import
|
Beta Was this translation helpful? Give feedback.
-
Yeah I'm getting the same problem trying to get my schemas that came from drizzle-zod in client components. I believe that drizzle-zod will only work server-side. |
Beta Was this translation helpful? Give feedback.
-
With a little different split it's possible: #989 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the feature you'd like to request
I am reading this on the create-t3-turbo README:
Currently, I am referencing the OpenStatus repo where they create the validation schemas in the db package https://github.com/openstatusHQ/openstatus/blob/main/packages/db/src/schema/users/validation.ts. How would I use these in expo if I cannot have
@acme/db
as a dependency?Do I have to manually create the validators in the validators package and only use
drizzle-zod
in Next.js?Describe the solution you'd like to see
Ideally there is a way to use the drizzle-zod validation schemas in expo safely, but I am not sure how if I understand correctly.
Additional information
No response
Beta Was this translation helpful? Give feedback.
All reactions