1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

wasm/js: rename /persistent to /opfs to account for potential future persistent storage options. Minor flag-handling cleanups in the speedtest1 pages. Minor API tweaks in oo1.

FossilOrigin-Name: 4dc972a3656b2a9ec915bfb3f653136560c753ce4024c3f0d0d0c28f66db7a0a
This commit is contained in:
stephan
2022-09-27 09:17:37 +00:00
parent 278d3faf1f
commit 3d64548491
14 changed files with 372 additions and 359 deletions

View File

@ -44,7 +44,7 @@
oo = sqlite3.oo1/*high-level OO API*/;
log("sqlite3 version",capi.sqlite3_libversion(), capi.sqlite3_sourceid());
const db = new oo.DB("/mydb.sqlite3");
log("transient b =",db.filename);
log("transient db =",db.filename);
/**
Never(!) rely on garbage collection to clean up DBs and
(especially) prepared statements. Always wrap their lifetimes
@ -82,7 +82,12 @@
}
log("Insert using a prepared statement...");
let q = db.prepare("insert into t(a,b) values(?,?)");
let q = db.prepare([
// SQL may be a string or array of strings
// (concatenated w/o separators).
"insert into t(a,b) ",
"values(?,?)"
]);
try {
for( i = 100; i < 103; ++i ){
q.bind( [i, i*2] ).step();