jackaltd
DTDrizzle Team
•Created by jackaltd on 9/17/2023 in #help
drizzle-zod object scoped refine
I would like to check an object
s multiple columns. For example whether password field is equal to confirmPassword filed.
With zod it was a .refine() after a z.object(), but I cant
get it work with createInsertSchema()
Is there any workaround to work with react hook forms?1 replies
DTDrizzle Team
•Created by jackaltd on 8/20/2023 in #help
Default values to integer timestamps in sqlite
I would like to set a default timestamp on record create in mysql.
My schema look like this:
export const users = sqliteTable("user", {
...
createdAt: integer("createdAt", { mode: "timestamp_ms" }) .default(new Date())
}
Unfortunately this doesn`t work. Db push throws an error: "SqliteError: near "Aug": syntax error"
Typescript is not accepting time as number.
Can anybody help me to fill the proper value in default method?
7 replies