import type { TailorAnyDBField } from "@tailor-platform/sdk"; import type { Kysely, Selectable, Insertable, Updateable } from "@tailor-platform/sdk/kysely"; export type InferSchema = T extends Kysely ? S : never; export type { Selectable, Insertable, Updateable }; export type EmptyFields = {}; // Fields every db.table has: implicit id plus db.fields.timestamps(). export type CommonReservedFields = "id" | "createdAt" | "updatedAt"; // A string-literal type so the message shows in the assignability error. type ReservedFieldError = `Cannot redefine built-in field '${K}'`; // Turns reserved keys in F into a compile error, leaving other keys intact. export type NoReservedFields< F extends Record, Reserved extends string, > = { [K in keyof F]: K extends Reserved ? ReservedFieldError : F[K]; };