import { it } from "vitest";
import { z } from "zod";
import { Database } from "./index";
const userSchema = z.object({
user: z.object({ id: z.number(), name: z.string() }),
});
//here i can userSchema.shape.user;
export type UserSchema = z.infer<typeof userSchema>;
it("Should create a database instance with correct schema", async () => {
const database = new Database<UserSchema>({ schema: userSchema });
//what should i do to be able to do database.user.create()
});
import { it } from "vitest";
import { z } from "zod";
import { Database } from "./index";
const userSchema = z.object({
user: z.object({ id: z.number(), name: z.string() }),
});
//here i can userSchema.shape.user;
export type UserSchema = z.infer<typeof userSchema>;
it("Should create a database instance with correct schema", async () => {
const database = new Database<UserSchema>({ schema: userSchema });
//what should i do to be able to do database.user.create()
});