createInsertSchema & createSelectSchema difference
I am using
drizzle-zod
along with sveltekit-superforms
and thoroughly enjoying the combo so far. One question I have is that what is the fundamental difference between the two functions above. I didn't find any related questions or documentation. I think they are mostly the same. taking in a drizzle schema and returning a zod object. Is it just a difference in semantics? I'll appreciate any input on this.3 Replies
And how about schema to delete or update?
in delete you only need an id to delete
update you can use createInsertSchema(table).partial()
Yeah that would be the normal way to do CRUD schemas. I’m actually talking about the difference between the two specific functions shown in drizzle-zod documentation