From a485f95aa23177ba7a651e3adc2e33ac0fc2ab01 Mon Sep 17 00:00:00 2001 From: Igal Klebanov Date: Sun, 27 Nov 2022 01:13:31 +0200 Subject: [PATCH] add `using` @ `DeleteQueryBuilder. --- src/query-builder/delete-query-builder.ts | 29 ++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/query-builder/delete-query-builder.ts b/src/query-builder/delete-query-builder.ts index 59a427d79..33f66641b 100644 --- a/src/query-builder/delete-query-builder.ts +++ b/src/query-builder/delete-query-builder.ts @@ -5,7 +5,13 @@ import { JoinReferenceExpression, parseJoin, } from '../parser/join-parser.js' -import { TableExpression } from '../parser/table-parser.js' +import { + From, + FromTables, + parseTableExpressionOrList, + TableExpression, + TableExpressionOrList, +} from '../parser/table-parser.js' import { parseSelectExpressionOrList, parseSelectAll, @@ -172,6 +178,27 @@ export class DeleteQueryBuilder }) } + /** + * TODO: ... + */ + using>( + from: TE[] + ): DeleteQueryBuilder, FromTables, O> + + using>( + from: TE + ): DeleteQueryBuilder, FromTables, O> + + using(from: TableExpressionOrList): any { + return new DeleteQueryBuilder({ + ...this.#props, + queryNode: DeleteQueryNode.cloneWithUsing( + this.#props.queryNode, + parseTableExpressionOrList(from) + ), + }) + } + /** * Joins another table to the query using an inner join. *