mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-27 20:41:58 +03:00
Add missing sqlite3_bind_parameter_name() binding to JS.
FossilOrigin-Name: 6dcfcc7e1c0772b11aec750bb75899a5c8e452735ecf5028c001fbaa7aa6fda0
This commit is contained in:
@ -2063,15 +2063,6 @@ globalThis.sqlite3InitModule = sqlite3InitModule;
|
||||
"Because foo is no longer attached.");
|
||||
})
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
.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") );
|
||||
@ -3222,6 +3213,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({
|
||||
|
Reference in New Issue
Block a user