ts-sql-query
Advanced tools
Comparing version 1.57.0 to 1.58.0
{ | ||
"name": "ts-sql-query", | ||
"version": "1.57.0", | ||
"version": "1.58.0", | ||
"description": "Type-safe SQL query builder like QueryDSL or JOOQ in Java or Linq in .Net for TypeScript with MariaDB, MySql, Oracle, PostgreSql, Sqlite and SqlServer support.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -527,2 +527,3 @@ "use strict"; | ||
const recursiveInternalView = new WithViewImpl_1.WithViewImpl(this.__sqlBuilder, name, this); | ||
recursiveInternalView.__ignoreWith = true; | ||
let recursiveInternalSelect; | ||
@@ -1221,2 +1222,14 @@ if (unionAll) { | ||
(0, ColumnImpl_1.createColumnsFrom)(this.__sqlBuilder, firstQuery.__columns, this.__columns, new View_1.View('')); | ||
const firstQueryWiths = firstQuery.__withs; | ||
const thisWiths = this.__withs; | ||
for (let i = 0, lenght = firstQueryWiths.length; i < lenght; i++) { | ||
thisWiths.push(firstQueryWiths[i]); | ||
} | ||
const secondQueryWiths = secondQuery.__withs; | ||
for (let i = 0, lenght = secondQueryWiths.length; i < lenght; i++) { | ||
const withTable = secondQueryWiths[i]; | ||
if (!thisWiths.includes(withTable)) { | ||
thisWiths.push(withTable); | ||
} | ||
} | ||
} | ||
@@ -1223,0 +1236,0 @@ __registerRequiredColumnInSelect(sqlBuilder, requiredColumns, onlyForTablesOrViews) { |
@@ -54,3 +54,3 @@ import { AnyDB } from "../databases"; | ||
type InnerColumnsForCompound<TABLE_OR_VIEW extends ITableOrViewRef<AnyDB>, COLUMNS> = { | ||
[K in keyof COLUMNS]: COLUMNS[K] extends AnyValueSource | undefined ? RemapIValueSourceTypeWithOptionalType<TABLE_OR_VIEW, COLUMNS[K], CompoundColumnOptionalType<COLUMNS[K]>> : InnerColumnsForCompound<TABLE_OR_VIEW, COLUMNS>; | ||
[K in keyof COLUMNS]: COLUMNS[K] extends AnyValueSource | undefined ? RemapIValueSourceTypeWithOptionalType<TABLE_OR_VIEW, COLUMNS[K], CompoundColumnOptionalType<COLUMNS[K]>> : InnerColumnsForCompound<TABLE_OR_VIEW, COLUMNS[K]>; | ||
}; | ||
@@ -57,0 +57,0 @@ type CompoundColumnOptionalType<COLUMN> = COLUMN extends IValueSource<any, any, any, infer OPTIONAL_TYPE> ? OptionalTypeRequiredOrAny<OPTIONAL_TYPE> : never; |
2312574
38610