Skip to content

Commit

Permalink
chore(package): upgrade for knex latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Aug 18, 2019
1 parent 0896fe2 commit 25fba81
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 8 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,28 @@
"@poppinss/logger": "^1.1.2",
"@poppinss/profiler": "^1.0.0",
"@poppinss/utils": "^1.0.4",
"knex": "^0.19.1",
"knex": "^0.19.2",
"knex-dynamic-connection": "^1.0.0",
"ts-essentials": "^3.0.1"
"ts-essentials": "^3.0.2"
},
"devDependencies": {
"@adonisjs/mrm-preset": "^2.0.3",
"@poppinss/dev-utils": "^1.0.0",
"@types/dotenv": "^6.1.1",
"@types/node": "^12.7.1",
"@types/node": "^12.7.2",
"clone": "^2.1.2",
"commitizen": "^4.0.3",
"cz-conventional-changelog": "^3.0.2",
"del-cli": "^2.0.0",
"doctoc": "^1.4.0",
"dotenv": "^8.0.0",
"husky": "^3.0.3",
"dotenv": "^8.1.0",
"husky": "^3.0.4",
"japa": "^2.0.10",
"mrm": "^1.2.2",
"mysql": "^2.17.1",
"pg": "^7.12.1",
"pkg-ok": "^2.3.1",
"sqlite3": "^4.0.9",
"sqlite3": "^4.1.0",
"ts-node": "^8.3.0",
"tslint": "^5.18.0",
"tslint-eslint-rules": "^5.4.0",
Expand Down
7 changes: 7 additions & 0 deletions src/QueryBuilder/Database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,13 @@ export class DatabaseQueryBuilder extends Chainable implements DatabaseQueryBuil
* Define returning columns
*/
public returning (columns: any): this {
/**
* Do not chain `returning` in sqlite3 to avoid knex warnings
*/
if (this._client && this._client.dialect === 'sqlite3') {
return this
}

this.$knexBuilder.returning(columns)
return this
}
Expand Down
7 changes: 7 additions & 0 deletions src/QueryBuilder/Insert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ export class InsertQueryBuilder implements InsertQueryBuilderContract {
* Define returning columns for the insert query
*/
public returning (column: any): any {
/**
* Do not chain `returning` in sqlite3 to avoid knex warnings
*/
if (this._client && this._client.dialect === 'sqlite3') {
return this
}

this.$knexBuilder.returning(column)
return this
}
Expand Down
2 changes: 1 addition & 1 deletion src/QueryClient/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class QueryClient implements QueryClientContract {
public mode: 'dual' | 'write' | 'read',
private _connection: ConnectionContract,
) {
this.dialect = resolveClientNameWithAliases(this._getAvailableClient().client.config)
this.dialect = resolveClientNameWithAliases(this._getAvailableClient().client.config.client)
}

/**
Expand Down
2 changes: 1 addition & 1 deletion test/insert-query-builder.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import * as test from 'japa'
import { Connection } from '../src/Connection'
import { getConfig, setup, cleanup, getInsertBuilder, getLogger } from '../test-helpers'

test.group('Query Builder | from', (group) => {
test.group('Query Builder | insert', (group) => {
group.before(async () => {
await setup()
})
Expand Down

0 comments on commit 25fba81

Please sign in to comment.