Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/cteMaker.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type QueryDefinition from "./queryKinds/dml/dmlQueryDefinition.js";
import SelectQuery from "./queryKinds/dml/select.js";
import Union from "./queryKinds/dml/union.js";

/**
* Cte represents a Common Table Expression (CTE) in SQL.
Expand Down Expand Up @@ -76,9 +75,7 @@ export class Cte {
*/
public build(): { text: string; values: any[] } {
const recursiveStr = this.recursiveCte ? "RECURSIVE " : "";
const query = this.query instanceof Union
? this.query.rawUnion()
: this.query.build();
const query = this.query.build();
return {
text: `${recursiveStr}${this.name} AS (\n${query.text}\n)`,
values: query.values,
Expand Down