@livestore/wa-sqlite 1.0.3-dev.3 → 1.0.3-dev.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/sqlite-api.js +4 -1
package/package.json
CHANGED
package/src/sqlite-api.js
CHANGED
|
@@ -343,8 +343,11 @@ export function Factory(Module) {
|
|
|
343
343
|
verifyStatement(stmt);
|
|
344
344
|
const nBytes = sqlite3.column_bytes(stmt, iCol);
|
|
345
345
|
const address = f(stmt, iCol);
|
|
346
|
+
if (address === 0) {
|
|
347
|
+
return null; // Handle NULL BLOBs
|
|
348
|
+
}
|
|
346
349
|
const result = Module.HEAPU8.subarray(address, address + nBytes);
|
|
347
|
-
return result;
|
|
350
|
+
return new Uint8Array(result); // Ensure a copy is returned
|
|
348
351
|
};
|
|
349
352
|
})();
|
|
350
353
|
|