@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livestore/wa-sqlite",
3
- "version": "1.0.3-dev.3",
3
+ "version": "1.0.3-dev.4",
4
4
  "type": "module",
5
5
  "main": "src/sqlite-api.js",
6
6
  "types": "src/types/index.d.ts",
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