diff --git a/package.json b/package.json index 286133a2..09238ca3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wa-sqlite", - "version": "0.9.0", + "version": "0.9.1", "type": "module", "main": "src/sqlite-api.js", "types": "src/types/index.d.ts", diff --git a/src/libmodule.js b/src/libmodule.js index 961969b8..0f46d01a 100644 --- a/src/libmodule.js +++ b/src/libmodule.js @@ -63,7 +63,7 @@ const mod_methods = { const struct = {}; struct['nConstraint'] = getValue(p + offset[0], 'i32'); struct['aConstraint'] = []; - const constraintPtr = getValue(p + offset[1], 'i32'); + const constraintPtr = getValue(p + offset[1], '*'); const constraintSize = mapStructToLayout.get('sqlite3_index_constraint').size; for (let i = 0; i < struct['nConstraint']; ++i) { struct['aConstraint'].push( @@ -71,7 +71,7 @@ const mod_methods = { } struct['nOrderBy'] = getValue(p + offset[2], 'i32'); struct['aOrderBy'] = []; - const orderPtr = getValue(p + offset[3], 'i32'); + const orderPtr = getValue(p + offset[3], '*'); const orderSize = mapStructToLayout.get('sqlite3_index_orderby').size; for (let i = 0; i < struct['nOrderBy']; ++i) { struct['aOrderBy'].push( @@ -117,7 +117,7 @@ const mod_methods = { function pack_sqlite3_index_info(p, struct) { const layout = mapStructToLayout.get('sqlite3_index_info'); const offset = layout.offsets; - const usagePtr = getValue(p + offset[4], 'i32'); + const usagePtr = getValue(p + offset[4], '*'); const usageSize = mapStructToLayout.get('sqlite3_index_constraint_usage').size; for (let i = 0; i < struct['nConstraint']; ++i) { pack_sqlite_index_constraint_usage( @@ -129,7 +129,7 @@ const mod_methods = { const length = lengthBytesUTF8(struct['idxStr']); const z = ccall('sqlite3_malloc', 'number', ['number'], [length + 1]); stringToUTF8(struct['idxStr'], z, length + 1); - setValue(p + offset[6], z, 'i32'); + setValue(p + offset[6], z, '*'); setValue(p + offset[7], 1, 'i32'); } setValue(p + offset[8], struct['orderByConsumed'], 'i32'); diff --git a/src/sqlite-api.js b/src/sqlite-api.js index acf97e0a..a8d59105 100644 --- a/src/sqlite-api.js +++ b/src/sqlite-api.js @@ -490,7 +490,7 @@ export function Factory(Module) { zVfs = createUTF8(zVfs); const result = await f(zFilename, tmpPtr[0], flags, zVfs); - const db = Module.getValue(tmpPtr[0], 'i32'); + const db = Module.getValue(tmpPtr[0], '*'); databases.add(db); Module._sqlite3_free(zVfs); @@ -507,10 +507,10 @@ export function Factory(Module) { const result = await f(db, sql, -1, tmpPtr[0], tmpPtr[1]); check(fname, result, db); - const stmt = Module.getValue(tmpPtr[0], 'i32'); + const stmt = Module.getValue(tmpPtr[0], '*'); if (stmt) { mapStmtToDB.set(stmt, db); - return { stmt, sql: Module.getValue(tmpPtr[1], 'i32') }; + return { stmt, sql: Module.getValue(tmpPtr[1], '*') }; } return null; };