Drizzle TeamDT
Drizzle Team•11mo ago
natedunn

Missing Refine type after update

Seem like with a recent release of drizzle-zod, we lost an exported type (namely Refine) to satisfy types in a single place. Anyone know of a better way to do this so we don't need to repeat code? And maybe any way we can export the Refine type (seems like its BuildRefine now 🤔)?

import type { Refine } from 'drizzle-zod';
import { teamsTable } from '../teams-table';

const refineSchema = {
    name: ({ name }) => name.min(3).max(50),
} satisfies Refine<typeof teamsTable, 'select'>;

export const insertSchema = createInsertSchema(teamsTable, refineSchema);
export const selectSchema = createSelectSchema(teamsTable, refineSchema);
Was this page helpful?