export interface DatabaseSchema { tables: TableInfo[]; } export interface TableInfo { name: string; schema: string; comment?: string; columns: ColumnInfo[]; primaryKey: string[]; foreignKeys: ForeignKey[]; uniqueKeys: UniqueKey[]; } export interface ColumnInfo { name: string; sqlType: string; jsType: JsType; nullable: boolean; hasDefault: boolean; /** * The raw SQL default expression (e.g. "nextval('users_id_seq'::regclass)", * "now()", "'pending'::text"). Optional: only populated when the * introspector can read it. Useful for distinguishing user-supplied * defaults from server-managed ones (timestamps, sequences). */ defaultExpression?: string; autoIncrement: boolean; comment?: string; } export interface ForeignKey { name: string; columns: string[]; referencedTable: string; referencedSchema: string; referencedColumns: string[]; } export interface UniqueKey { name: string; columns: string[]; } export type JsType = 'string' | 'number' | 'bigint' | 'boolean' | 'Date' | 'Buffer' | 'object' | 'unknown';