Skip to content

Commit

Permalink
fix(QueryBuilder): Use table as from on update and delete.
Browse files Browse the repository at this point in the history
  • Loading branch information
RWOverdijk committed Oct 9, 2016
1 parent 4bfce9c commit 9b0cded
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/QueryBuilder.ts
Expand Up @@ -459,6 +459,7 @@ export class QueryBuilder<T> {
* @returns {QueryBuilder}
*/
public update(values, returning?: any): this {
this.statement.from(this.mappings[this.alias].getTableName());
this.statement.update(this.mapToColumns(values), returning);

return this;
Expand Down Expand Up @@ -550,6 +551,7 @@ export class QueryBuilder<T> {
* @returns {QueryBuilder}
*/
public remove(): this {
this.statement.from(this.mappings[this.alias].getTableName());
this.statement.del();

return this;
Expand Down

0 comments on commit 9b0cded

Please sign in to comment.