Skip to content

Commit

Permalink
fixup!: Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
simonplend committed Aug 1, 2022
1 parent 5265348 commit 7612d0f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
8 changes: 8 additions & 0 deletions lib/dialects/sqlite3/index.js
Expand Up @@ -124,6 +124,14 @@ class Client_SQLite3 extends Client {
const { method } = obj;
let callMethod;
switch (method) {
case 'insert':
case 'update':
if (obj.returning) {
callMethod = 'all';
} else {
callMethod = 'run';
}
break;
case 'counter':
case 'del':
callMethod = 'run';
Expand Down
16 changes: 11 additions & 5 deletions test/integration2/query/insert/inserts.spec.js
Expand Up @@ -126,7 +126,7 @@ describe('Inserts', function () {
1,
TEST_TIMESTAMP,
],
[1]
[{ id: 1 }]
);
tester(
'oracledb',
Expand Down Expand Up @@ -270,7 +270,7 @@ describe('Inserts', function () {
2,
TEST_TIMESTAMP,
],
[2]
[{ id: 1 }, { id: 2 }]
);
tester(
'oracledb',
Expand Down Expand Up @@ -488,7 +488,7 @@ describe('Inserts', function () {
2,
TEST_TIMESTAMP,
],
[2]
[{ id: 1 }, { id: 2 }]
);
tester(
'oracledb',
Expand Down Expand Up @@ -724,7 +724,7 @@ describe('Inserts', function () {
2,
TEST_TIMESTAMP,
],
[1]
[{ id: 1 }]
);
tester(
'oracledb',
Expand Down Expand Up @@ -1018,7 +1018,13 @@ describe('Inserts', function () {
'Lorem ipsum Minim nostrud Excepteur consectetur enim ut qui sint in veniam in nulla anim do cillum sunt voluptate Duis non incididunt.',
0,
],
[1]
[
{
account_id: 10,
details:
'Lorem ipsum Minim nostrud Excepteur consectetur enim ut qui sint in veniam in nulla anim do cillum sunt voluptate Duis non incididunt.',
},
]
);
tester(
'oracledb',
Expand Down

0 comments on commit 7612d0f

Please sign in to comment.