server/db/cake.db.ts
Database Model
Example
Declare one database table with the Cake20 schema builder.
export const Cake = {
id: z.id(),
name: z.string().min(1).max(80),
price: z.int().min(1),
createdAt: z.date().defaultNow().timestamp(),
};
export const seed = async () => {
const rows = [
{ id: "20", name: "Strawberry Cake", price: 24 },
{ id: "21", name: "Chocolate Cake", price: 28 },
];
return rows;
};