diff --git a/drizzle-orm/src/sql/index.ts b/drizzle-orm/src/sql/index.ts index 3533ca3f0..c07f22edd 100644 --- a/drizzle-orm/src/sql/index.ts +++ b/drizzle-orm/src/sql/index.ts @@ -55,7 +55,8 @@ function mergeQueries(queries: Query[]): Query { for (const query of queries) { result.sql += query.sql; result.params.push(...query.params); - if (result.typings && query.typings?.length) { + if (query.typings?.length) { + result.typings = result.typings || []; result.typings.push(...query.typings); } }