1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-10-24 09:53:10 +03:00

Restructure the interface for the sqlite3.wasm pointer-size-dependent details.

FossilOrigin-Name: 8ac12e1f5144380d4ecc8b27a1f62dcda0e5a86409ae7149f62c33caeea19a23
This commit is contained in:
stephan
2025-09-21 13:53:59 +00:00
parent 72d81265ab
commit 1e2156e926
9 changed files with 153 additions and 115 deletions

View File

@@ -728,7 +728,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
dealloc: wasm.dealloc,
bigIntEnabled: wasm.bigIntEnabled,
pointerIR: wasm.pointerIR,
pointerSizeof: wasm.pointerSizeof,
pointerSizeof: wasm.ptr.size,
memberPrefix: /* Never change this: this prefix is baked into any
amount of code and client-facing docs. (Much
later: it probably should have been '$$', but see
@@ -1534,7 +1534,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
const [xSql, xSqlLen] = __flexiString(sql, sqlLen);
switch(typeof xSql){
case 'string': return __prepare.basic(pDb, xSql, xSqlLen, prepFlags, ppStmt, null);
case (typeof wasm.NullPtr):
case (typeof wasm.ptr.null):
return __prepare.full(pDb, xSql, xSqlLen, prepFlags, ppStmt, pzTail);
default:
return util.sqlite3__wasm_db_error(
@@ -1759,9 +1759,9 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
const zV = wasm.scopedAllocCString(jV);
if(nBuf > nV + 1) nBuf = nV + 1;
wasm.heap8u().copyWithin(
Number(zBuf), Number(zV), Number(wasm.ptrAdd(zV, nBuf,- 1))
Number(zBuf), Number(zV), wasm.ptr.addn(zV, nBuf,- 1)
);
wasm.poke(wasm.ptrAdd(zBuf, nBuf, -1), 0);
wasm.poke(wasm.ptr.add(zBuf, nBuf, -1), 0);
return nBuf - 1;
}catch(e){
sqlite3.config.error("kvstorageRead()",e);