diff options
author | stephan <stephan@noemail.net> | 2023-10-27 21:05:50 +0000 |
---|---|---|
committer | stephan <stephan@noemail.net> | 2023-10-27 21:05:50 +0000 |
commit | 26422f823fe813d45543a43412e98ddab16360a5 (patch) | |
tree | 498dc0b84e48e07cef4436c66415e55a923331ed /ext/wasm/tester1.c-pp.js | |
parent | 334b6fe418a504129959bc6bbc4ef3e044887244 (diff) | |
download | sqlite-26422f823fe813d45543a43412e98ddab16360a5.tar.gz sqlite-26422f823fe813d45543a43412e98ddab16360a5.zip |
Export sqlite3_get_autocommit() to WASM and add tests for it.
FossilOrigin-Name: 7cb6d3cd3926882240c91a4b90fdf237b931653295d8d94b05ed885dcae59608
Diffstat (limited to 'ext/wasm/tester1.c-pp.js')
-rw-r--r-- | ext/wasm/tester1.c-pp.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/wasm/tester1.c-pp.js b/ext/wasm/tester1.c-pp.js index 92d763f1b..c26bce25b 100644 --- a/ext/wasm/tester1.c-pp.js +++ b/ext/wasm/tester1.c-pp.js @@ -2644,13 +2644,17 @@ globalThis.sqlite3InitModule = sqlite3InitModule; T.assert( 0 === rc /*void pointer*/ ); // Commit hook... + T.assert( 0!=capi.sqlite3_get_autocommit(db) ); db.exec("BEGIN; SELECT 1; COMMIT"); T.assert(0 === countCommit, "No-op transactions (mostly) do not trigger commit hook."); db.exec("BEGIN EXCLUSIVE; SELECT 1; COMMIT"); T.assert(1 === countCommit, "But EXCLUSIVE transactions do."); - db.transaction((d)=>{d.exec("create table t(a)");}); + db.transaction((d)=>{ + T.assert( 0==capi.sqlite3_get_autocommit(db) ); + d.exec("create table t(a)"); + }); T.assert(2 === countCommit); // Rollback hook: |