Row, Insert, Update 모델
generateModels(metadata, options)는 순수한 offline 함수입니다. 독립 실행 가능한 TypeScript 소스, 모델 이름, 진단, 메타데이터/정책 provenance, options hash를 반환합니다.
숫자 identity id, 필수 email, 생성 또는 쓰기 불가 증거가 없는 테이블의 경우 codegen은 다음을 출력합니다.
export interface UsersRow { id: string; email: string;}
export interface UsersInsert { id?: string; email: string;}
export interface UsersUpdate { id?: string; email?: string;}- Row는 TypePolicy의
outputType을 사용하며, 데이터베이스 nullable은| null을 추가합니다. - Insert는
inputType을 사용합니다. nullable/default/identity 열은 optional이 되고, 삽입할 수 없거나 생성된 것으로 입증된 열은 제외됩니다. - Update는
inputType을 사용합니다. 포함된 속성은 optional이며, 업데이트할 수 없거나 생성된 것으로 입증된 열은 제외됩니다. identity만으로 금지하지는 않습니다.
정확한 정수와 10진수의 output type은 canonical string이고, 근사 이진
타입은 number입니다. 생성된 모델은 exact string을 bigint나 decimal
객체로 조용히 decode하지 않습니다.
View, materialized view, foreign, virtual 관계에는 Row 모델만 부여됩니다. 열이 있는 알 수 없는 관계 종류에는 경고와 함께 Row 모델이 부여됩니다. 지원되지 않거나 입증되지 않은 타입은 any가 아니라 계속 unknown입니다. 생성된 소스를 사용하기 전에 진단을 확인하세요.
Native parsed JSON root는 선택한 profile이 더 좁은 root 형태를 증명하지
않는 한 unknown입니다. Scalar mapping도 array, range, composite, object,
sql_variant, vector 및 기타 container를 재귀적으로 인증하지 않습니다.
Nested application type을 생성하려면 container-specific 증거가 필요합니다.
열 이름은 필요한 경우 인용된 TypeScript 속성으로 정확한 데이터베이스 키를 유지합니다. namespace 증거와 안정적인 identity 접미사가 충돌을 방지합니다. 결정적인 출력은 메타데이터 캡처 타임스탬프나 객체 삽입 순서에 의존하지 않습니다.