From ef1ec95751ab4f65f71cc2c562966c5b6ce67d59 Mon Sep 17 00:00:00 2001 From: Andrew Zolotukhin Date: Tue, 14 Apr 2026 12:31:03 +0000 Subject: [PATCH] Update InsertType to make all properties optional for better compatibility with generated DB schemas --- libs/knex-schema/src/types.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/knex-schema/src/types.ts b/libs/knex-schema/src/types.ts index d701dd7..152c8c5 100644 --- a/libs/knex-schema/src/types.ts +++ b/libs/knex-schema/src/types.ts @@ -187,8 +187,8 @@ export type ValidatedSpec = | ({ type: 'many' } & ValidatedJoinManySpec); // --------------------------------------------------------------------------- -// InsertType — like InferType but makes optional properties omittable +// InsertType — all properties optional (DB may generate some, e.g. SERIAL id) // --------------------------------------------------------------------------- export type InsertType< T extends ObjectSchemaBuilder -> = InferType; +> = InferType>;