type Join = K extends string ? (P extends string ? `${K}${'' extends P ? '' : '.'}${P}` : never) : never type Prev = [never, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...0[]] export type Column = [D] extends [never] ? never : T extends Record ? { [K in keyof T]-?: K extends string ? T[K] extends Date ? `${K}` : T[K] extends Array ? `${K}` | Join> : `${K}` | Join> : never }[keyof T] : '' export type RelationColumn = Extract< Column, { [K in Column]: K extends `${infer R}.${string}` ? R : never }[Column] > export type Order = [Column, 'ASC' | 'DESC'] export type SortBy = Order[]