Skip to content

Commit

Permalink
Merge pull request #38 from sailshq/upgrade-knex-to-2.4.2
Browse files Browse the repository at this point in the history
Upgrade Knex to 2.4.2
  • Loading branch information
eashaw authored Mar 20, 2023
2 parents dc07d4e + 2e6c0da commit 8274444
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
],
"license": "MIT",
"dependencies": {
"knex": "0.21.1",
"knex": "2.4.2",
"@sailshq/lodash": "^3.10.2",
"waterline-utils": "^1.3.8"
},
Expand Down
6 changes: 3 additions & 3 deletions test/unit/generate/returning.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('Query Generation ::', function() {
},
{
dialect: 'sqlite3',
sql: 'insert into `books` (`title`) values (?)',
sql: 'insert into `books` (`title`) values (?) returning `author`',
bindings: ['Slaughterhouse Five']
},
{
Expand Down Expand Up @@ -64,7 +64,7 @@ describe('Query Generation ::', function() {
},
{
dialect: 'sqlite3',
sql: 'insert into `books` (`author`, `title`) values (?, ?)',
sql: 'insert into `books` (`author`, `title`) values (?, ?) returning `author`, `title`',
bindings: ['Kurt Vonnegut', 'Slaughterhouse Five']
},
{
Expand Down Expand Up @@ -103,7 +103,7 @@ describe('Query Generation ::', function() {
},
{
dialect: 'sqlite3',
sql: 'insert into `books` (`title`) values (?)',
sql: 'insert into `books` (`title`) values (?) returning *',
bindings: ['Slaughterhouse Five']
},
{
Expand Down
8 changes: 4 additions & 4 deletions test/unit/generate/union.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ describe('Query Generation ::', function() {
outcomes: [
{
dialect: 'postgresql',
sql: 'select * from "users" where "firstName" = $1 union (select * from "users" where "lastName" = $2) union (select * from "users" where "middleName" = $3)',
sql: '(select * from "users" where "firstName" = $1) union (select * from "users" where "lastName" = $2) union (select * from "users" where "middleName" = $3)',
bindings: ['Bob', 'Smith', 'Allen']
},
{
dialect: 'mysql',
sql: 'select * from `users` where `firstName` = ? union (select * from `users` where `lastName` = ?) union (select * from `users` where `middleName` = ?)',
sql: '(select * from `users` where `firstName` = ?) union (select * from `users` where `lastName` = ?) union (select * from `users` where `middleName` = ?)',
bindings: ['Bob', 'Smith', 'Allen']
},
{
dialect: 'sqlite3',
sql: 'select * from `users` where `firstName` = ? union (select * from `users` where `lastName` = ?) union (select * from `users` where `middleName` = ?)',
sql: '(select * from `users` where `firstName` = ?) union (select * from `users` where `lastName` = ?) union (select * from `users` where `middleName` = ?)',
bindings: ['Bob', 'Smith', 'Allen']
},
{
Expand All @@ -62,7 +62,7 @@ describe('Query Generation ::', function() {
},
{
dialect: 'mariadb',
sql: 'select * from `users` where `firstName` = ? union (select * from `users` where `lastName` = ?) union (select * from `users` where `middleName` = ?)',
sql: '(select * from `users` where `firstName` = ?) union (select * from `users` where `lastName` = ?) union (select * from `users` where `middleName` = ?)',
bindings: ['Bob', 'Smith', 'Allen']
}
]
Expand Down
8 changes: 4 additions & 4 deletions test/unit/generate/unionAll.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ describe('Query Generation ::', function() {
outcomes: [
{
dialect: 'postgresql',
sql: 'select * from "users" where "firstName" = $1 union all (select * from "users" where "lastName" = $2) union all (select * from "users" where "middleName" = $3)',
sql: '(select * from "users" where "firstName" = $1) union all (select * from "users" where "lastName" = $2) union all (select * from "users" where "middleName" = $3)',
bindings: ['Bob', 'Smith', 'Allen']
},
{
dialect: 'mysql',
sql: 'select * from `users` where `firstName` = ? union all (select * from `users` where `lastName` = ?) union all (select * from `users` where `middleName` = ?)',
sql: '(select * from `users` where `firstName` = ?) union all (select * from `users` where `lastName` = ?) union all (select * from `users` where `middleName` = ?)',
bindings: ['Bob', 'Smith', 'Allen']
},
{
dialect: 'sqlite3',
sql: 'select * from `users` where `firstName` = ? union all (select * from `users` where `lastName` = ?) union all (select * from `users` where `middleName` = ?)',
sql: '(select * from `users` where `firstName` = ?) union all (select * from `users` where `lastName` = ?) union all (select * from `users` where `middleName` = ?)',
bindings: ['Bob', 'Smith', 'Allen']
},
{
Expand All @@ -62,7 +62,7 @@ describe('Query Generation ::', function() {
},
{
dialect: 'mariadb',
sql: 'select * from `users` where `firstName` = ? union all (select * from `users` where `lastName` = ?) union all (select * from `users` where `middleName` = ?)',
sql: '(select * from `users` where `firstName` = ?) union all (select * from `users` where `lastName` = ?) union all (select * from `users` where `middleName` = ?)',
bindings: ['Bob', 'Smith', 'Allen']
}
]
Expand Down
2 changes: 1 addition & 1 deletion test/unit/sequelizer/sequelizer.union.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('Sequelizer ::', function() {
});

var result = Sequelizer(tree);
assert.equal(result.sql, 'select * from "users" where "firstName" = $1 union (select * from "users" where "lastName" = $2) union (select * from "users" where "middleName" = $3)');
assert.equal(result.sql, '(select * from "users" where "firstName" = $1) union (select * from "users" where "lastName" = $2) union (select * from "users" where "middleName" = $3)');
assert.deepEqual(result.bindings, ['Bob', 'Smith', 'Allen']);
});
});
Expand Down
2 changes: 1 addition & 1 deletion test/unit/sequelizer/sequelizer.unionAll.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('Sequelizer ::', function() {
});

var result = Sequelizer(tree);
assert.equal(result.sql, 'select * from "users" where "firstName" = $1 union all (select * from "users" where "lastName" = $2) union all (select * from "users" where "middleName" = $3)');
assert.equal(result.sql, '(select * from "users" where "firstName" = $1) union all (select * from "users" where "lastName" = $2) union all (select * from "users" where "middleName" = $3)');
assert.deepEqual(result.bindings, ['Bob', 'Smith', 'Allen']);
});
});
Expand Down

0 comments on commit 8274444

Please sign in to comment.