Skip to content

Commit

Permalink
fix: use correct query constructs for truncating table
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Oct 22, 2019
1 parent 7c544c5 commit 8be74bc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"@adonisjs/sink": "^2.2.3",
"@poppinss/dev-utils": "^1.0.1",
"@types/dotenv": "^6.1.1",
"@types/node": "^12.11.1",
"@types/node": "^12.11.2",
"@types/pluralize": "0.0.29",
"clone": "^2.1.2",
"commitizen": "^4.0.3",
Expand Down
2 changes: 1 addition & 1 deletion src/QueryClient/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export class QueryClient implements QueryClientContract {
* Truncate table
*/
public async truncate (table: string): Promise<void> {
await this.getWriteClient().select(table).truncate()
await this.getWriteClient().table(table).truncate()
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/TransactionClient/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class TransactionClient extends EventEmitter implements TransactionClient
* Truncate tables inside a transaction
*/
public async truncate (table: string): Promise<void> {
await this.knexClient.select(table).truncate()
await this.knexClient.table(table).truncate()
}

/**
Expand Down

0 comments on commit 8be74bc

Please sign in to comment.