Skip to content

Commit

Permalink
feat: query.delete method, it is an alias for the existing .del method
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Apr 27, 2020
1 parent eaff60a commit ea7166c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions adonis-typings/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ declare module '@ioc:Adonis/Lucid/Model' {
* Perform delete operation
*/
del (): ModelQueryBuilderContract<Model, number>
delete (): ModelQueryBuilderContract<Model, number>

/**
* Execute query with pagination
Expand Down
1 change: 1 addition & 0 deletions adonis-typings/querybuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,7 @@ declare module '@ioc:Adonis/Lucid/DatabaseQueryBuilder' {
* Perform delete operation
*/
del (): this
delete (): this

/**
* A shorthand to define limit and offset based upon the
Expand Down
7 changes: 7 additions & 0 deletions src/Database/QueryBuilder/Database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ export class DatabaseQueryBuilder extends Chainable implements DatabaseQueryBuil
return this
}

/**
* Alias for [[del]]
*/
public delete (): this {
return this.del()
}

/**
* Clone the current query builder
*/
Expand Down
7 changes: 7 additions & 0 deletions src/Orm/QueryBuilder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,13 @@ export class ModelQueryBuilder extends Chainable implements ModelQueryBuilderCon
return this
}

/**
* Alias for [[del]]
*/
public delete (): this {
return this.del()
}

/**
* Turn on/off debugging for this query
*/
Expand Down

0 comments on commit ea7166c

Please sign in to comment.