import type * as schema from "@/server/db/schema"; import type { BuildQueryResult, DBQueryConfig, ExtractTablesWithRelations, } from "drizzle-orm"; import { z } from "zod"; /* * This is for testing purposes in the case we need a nested relational types * */ type Schema = typeof schema; type TSchema = ExtractTablesWithRelations; export type IncludeRelation = DBQueryConfig< "one" | "many", boolean, TSchema, TSchema[TableName] >["with"]; export type InferResultType< TableName extends keyof TSchema, With extends IncludeRelation | undefined = undefined, > = BuildQueryResult< TSchema, TSchema[TableName], { with: With; } >; type AnyObj = Record; type ZodObj = { [key in keyof T]: z.ZodType; }; const zObject = (arg: ZodObj) => z.object(arg); // const goodDogScheme = zObject({ // // prueba: schema.selectDatabaseSchema, // // domain: z.string(), // // domainId: z.string(), // });