diff --git a/lib/dialects/sqlite3/index.js b/lib/dialects/sqlite3/index.js index ba926bd7d3..afdb5812d4 100644 --- a/lib/dialects/sqlite3/index.js +++ b/lib/dialects/sqlite3/index.js @@ -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'; diff --git a/test/integration2/query/insert/inserts.spec.js b/test/integration2/query/insert/inserts.spec.js index 476e77865c..b8fc752a91 100644 --- a/test/integration2/query/insert/inserts.spec.js +++ b/test/integration2/query/insert/inserts.spec.js @@ -126,7 +126,7 @@ describe('Inserts', function () { 1, TEST_TIMESTAMP, ], - [1] + [{ id: 1 }] ); tester( 'oracledb', @@ -270,7 +270,7 @@ describe('Inserts', function () { 2, TEST_TIMESTAMP, ], - [2] + [{ id: 1 }, { id: 2 }] ); tester( 'oracledb', @@ -488,7 +488,7 @@ describe('Inserts', function () { 2, TEST_TIMESTAMP, ], - [2] + [{ id: 1 }, { id: 2 }] ); tester( 'oracledb', @@ -724,7 +724,7 @@ describe('Inserts', function () { 2, TEST_TIMESTAMP, ], - [1] + [{ id: 1 }] ); tester( 'oracledb', @@ -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',