diff options
author | stephan <stephan@noemail.net> | 2024-07-13 13:22:32 +0000 |
---|---|---|
committer | stephan <stephan@noemail.net> | 2024-07-13 13:22:32 +0000 |
commit | 0b9efaffd7eaf7881196b9d443670809f949be60 (patch) | |
tree | dc5e7abf3ea7ce08e66435b4a14a6e551acc3ac2 /ext/wasm/tester1.c-pp.js | |
parent | 6f9b37b35bf31ee3bc9158c9309cf205efab8d90 (diff) | |
download | sqlite-0b9efaffd7eaf7881196b9d443670809f949be60.tar.gz sqlite-0b9efaffd7eaf7881196b9d443670809f949be60.zip |
Add missing sqlite3_bind_parameter_name() binding to JS.
FossilOrigin-Name: 6dcfcc7e1c0772b11aec750bb75899a5c8e452735ecf5028c001fbaa7aa6fda0
Diffstat (limited to 'ext/wasm/tester1.c-pp.js')
-rw-r--r-- | ext/wasm/tester1.c-pp.js | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/ext/wasm/tester1.c-pp.js b/ext/wasm/tester1.c-pp.js index 4ebe8f83a..a6befb54e 100644 --- a/ext/wasm/tester1.c-pp.js +++ b/ext/wasm/tester1.c-pp.js @@ -2064,15 +2064,6 @@ globalThis.sqlite3InitModule = sqlite3InitModule; }) //////////////////////////////////////////////////////////////////// - .t("Interrupt", function(sqlite3){ - const db = new sqlite3.oo1.DB(); - T.assert( 0===capi.sqlite3_is_interrupted(db) ); - capi.sqlite3_interrupt(db); - T.assert( 0!==capi.sqlite3_is_interrupted(db) ); - db.close(); - }) - - //////////////////////////////////////////////////////////////////// .t("Read-only", function(sqlite3){ T.assert( 0===capi.sqlite3_db_readonly(this.db, "main") ); const db = new sqlite3.oo1.DB('file://'+this.db.filename+'?mode=ro'); @@ -3223,6 +3214,34 @@ globalThis.sqlite3InitModule = sqlite3InitModule; }/*OPFS SAH Pool sanity checks*/) //////////////////////////////////////////////////////////////////////// + T.g('Misc. APIs') + .t('bind_parameter', function(sqlite3){ + const db = new sqlite3.oo1.DB(); + db.exec("create table t(a)"); + const stmt = db.prepare("insert into t(a) values($a)"); + T.assert( 1===capi.sqlite3_bind_parameter_count(stmt) ) + .assert( 1===capi.sqlite3_bind_parameter_index(stmt, "$a") ) + .assert( 0===capi.sqlite3_bind_parameter_index(stmt, ":a") ) + .assert( 1===stmt.getParamIndex("$a") ) + .assert( 0===stmt.getParamIndex(":a") ) + .assert( "$a"===capi.sqlite3_bind_parameter_name(stmt, 1) ) + .assert( null===capi.sqlite3_bind_parameter_name(stmt, 0) ) + .assert( "$a"===stmt.getParamName(1) ) + .assert( null===stmt.getParamName(0) ); + stmt.finalize(); + db.close(); + }) + + //////////////////////////////////////////////////////////////////// + .t("interrupt", function(sqlite3){ + const db = new sqlite3.oo1.DB(); + T.assert( 0===capi.sqlite3_is_interrupted(db) ); + capi.sqlite3_interrupt(db); + T.assert( 0!==capi.sqlite3_is_interrupted(db) ); + db.close(); + }) + + //////////////////////////////////////////////////////////////////////// T.g('Bug Reports') .t({ name: 'Delete via bound parameter in subquery', |