UNPKG

@datazod/zod-sql

Version:

Convert Zod schemas to SQL table definitions with support for SQLite, PostgreSQL, and MySQL

17 lines 703 B
import { ZodObject, ZodRawShape } from 'zod'; import { TableWithMigrationOptions } from '../types'; /** * Database client interface for migration operations */ export interface MigrationClient { execute(sql: string): Promise<any>; } /** * Get current table columns from database */ export declare function getTableColumns(tableName: string, client: MigrationClient, dialect?: 'sqlite' | 'mysql' | 'postgres'): Promise<string[]>; /** * Migrate table schema automatically */ export declare function migrateTableSchema<T extends ZodRawShape>(tableName: string, schema: ZodObject<T>, client: MigrationClient, options?: TableWithMigrationOptions): Promise<void>; //# sourceMappingURL=index.d.ts.map