first
This commit is contained in:
commit
8538ab969a
434 changed files with 44051 additions and 0 deletions
40
packages/database/drizzle/zod.ts
Normal file
40
packages/database/drizzle/zod.ts
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import {
|
||||
createInsertSchema,
|
||||
createSelectSchema,
|
||||
createUpdateSchema,
|
||||
} from "drizzle-zod";
|
||||
import { z } from "zod";
|
||||
import {
|
||||
account,
|
||||
aiChat,
|
||||
invitation,
|
||||
member,
|
||||
organization,
|
||||
passkey,
|
||||
purchase,
|
||||
session,
|
||||
user,
|
||||
verification,
|
||||
} from "./schema";
|
||||
|
||||
export const AiChatSchema = createSelectSchema(aiChat);
|
||||
export const UserSchema = createSelectSchema(user);
|
||||
export const UserUpdateSchema = createUpdateSchema(user, {
|
||||
id: z.string(),
|
||||
});
|
||||
export const OrganizationSchema = createSelectSchema(organization);
|
||||
export const OrganizationUpdateSchema = createUpdateSchema(organization, {
|
||||
id: z.string(),
|
||||
});
|
||||
export const MemberSchema = createSelectSchema(member);
|
||||
export const InvitationSchema = createSelectSchema(invitation);
|
||||
export const PurchaseSchema = createSelectSchema(purchase);
|
||||
export type Purchase = typeof purchase.$inferSelect;
|
||||
export const PurchaseInsertSchema = createInsertSchema(purchase);
|
||||
export const PurchaseUpdateSchema = createUpdateSchema(purchase, {
|
||||
id: z.string(),
|
||||
});
|
||||
export const SessionSchema = createSelectSchema(session);
|
||||
export const AccountSchema = createSelectSchema(account);
|
||||
export const VerificationSchema = createSelectSchema(verification);
|
||||
export const PasskeySchema = createSelectSchema(passkey);
|
||||
Loading…
Add table
Add a link
Reference in a new issue