Skip to content

Commit

Permalink
add using @ `DeleteQueryBuilder.
Browse files Browse the repository at this point in the history
  • Loading branch information
igalklebanov committed Nov 26, 2022
1 parent 791a7de commit a485f95
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion src/query-builder/delete-query-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -172,6 +178,27 @@ export class DeleteQueryBuilder<DB, TB extends keyof DB, O>
})
}

/**
* TODO: ...
*/
using<TE extends TableExpression<DB, TB>>(
from: TE[]
): DeleteQueryBuilder<From<DB, TE>, FromTables<DB, TB, TE>, O>

using<TE extends TableExpression<DB, TB>>(
from: TE
): DeleteQueryBuilder<From<DB, TE>, FromTables<DB, TB, TE>, O>

using(from: TableExpressionOrList<any, any>): any {
return new DeleteQueryBuilder({
...this.#props,
queryNode: DeleteQueryNode.cloneWithUsing(
this.#props.queryNode,
parseTableExpressionOrList(from)
),
})
}

/**
* Joins another table to the query using an inner join.
*
Expand Down

0 comments on commit a485f95

Please sign in to comment.