Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a311180

Browse filesBrowse files
authored
Add getRowsModified to worker (#596)
1 parent fbc1f07 commit a311180
Copy full SHA for a311180

File tree

2 files changed

+8
-0
lines changed
Filter options

2 files changed

+8
-0
lines changed

‎src/worker.js

Copy file name to clipboardExpand all lines: src/worker.js
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ function onModuleReady(SQL) {
3535
id: data["id"],
3636
results: db.exec(data["sql"], data["params"], config)
3737
});
38+
case "getRowsModified":
39+
return postMessage({
40+
id: data["id"],
41+
rowsModified: db.getRowsModified()
42+
});
3843
case "each":
3944
if (db === null) {
4045
createDb();

‎test/test_worker.js

Copy file name to clipboardExpand all lines: test/test_worker.js
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ exports.test = async function test(SQL, assert) {
118118
assert.strictEqual(table.values[2][1], 'c', 'Reading string');
119119
assert.deepEqual(obj2array(table.values[2][2]), [0x00, 0x44], 'Reading BLOB byte');
120120

121+
data = await worker.postMessage({ action: 'getRowsModified' });
122+
assert.equal(data.rowsModified, 1, 'Number of changed rows')
123+
121124
data = await worker.postMessage({ action: 'export' });
122125
var header = "SQLite format 3\0";
123126
var actual = "";

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.