flatsql 3.10.1 → 3.11.1

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": "flatsql",
3
- "version": "3.10.1",
3
+ "version": "3.11.1",
4
4
  "description": "SQL queries over raw FlatBuffer storage: the SQLite-backed wasm engine, the multithreaded partition store (flatsql-ps-threads.wasm) and store format 4, a FlatBuffer stream per source feed with its index in SQLite (flatsql-p4-threads.wasm)",
5
5
  "type": "module",
6
6
  "main": "wasm/index.js",
@@ -113,7 +113,7 @@
113
113
  "bench": "node bench/flatsql-perf.mjs",
114
114
  "bench:perf": "node bench/flatsql-perf.mjs",
115
115
  "bench:perf:profile": "node bench/flatsql-perf.mjs --profile",
116
- "prepublishOnly": "npm run build && npm run check:dist && npm run check:imports && npm run check:integrity && npm run test:wasi && npm test -- --runInBand --runTestsByPath test/package-exports.test.ts test/wasm-generic-extractor.test.ts test/wasm-pointer.test.ts test/ps-node-threads.test.ts",
116
+ "prepublishOnly": "npm run check:dist && bash scripts/ci-e2e.sh --wasm-only",
117
117
  "emsdk:install": "bash scripts/install-emsdk.sh",
118
118
  "emsdk:env": "echo 'Run: source packages/emsdk/emsdk_env.sh'",
119
119
  "test:wasi": "node --experimental-wasm-exnref --experimental-vm-modules node_modules/jest/bin/jest.js --runTestsByPath test/wasi.test.ts test/standalone-wasm-imports.test.ts",
@@ -279,9 +279,13 @@ export function createNodeFsBackend(fs, options = {}) {
279
279
  fs.unlinkSync(full);
280
280
  return 0;
281
281
  }
282
- let mode = 'r';
282
+ let mode = fs.constants.O_RDONLY;
283
283
  if (flags & FLATSQL_IO_WRITE) {
284
- mode = flags & FLATSQL_IO_EXCL ? 'wx+' : flags & FLATSQL_IO_CREATE ? 'a+' : 'r+';
284
+ // SQLite needs positional writes. O_APPEND makes Linux ignore their
285
+ // offsets, corrupting the database as soon as it rewrites a page.
286
+ mode = fs.constants.O_RDWR;
287
+ if (flags & (FLATSQL_IO_CREATE | FLATSQL_IO_EXCL)) mode |= fs.constants.O_CREAT;
288
+ if (flags & FLATSQL_IO_EXCL) mode |= fs.constants.O_EXCL;
285
289
  }
286
290
  const fd = fs.openSync(full, mode);
287
291
  return handles.add({
Binary file
@@ -5,9 +5,9 @@
5
5
  "size": 2332160,
6
6
  "files": {
7
7
  "flatsql-p4-threads.wasm": {
8
- "sha256": "fe70f7a0292b3d72cf4b73d7cc0b830387e406cac5f9ecdff4737730b0695f55",
9
- "sri": "sha384-gIxYJpsrHr50piS8j7gc5sh4/pBXkaR2ZPHUPXRAi0j5y9nqVkbfxJPEtG/rXHuA",
10
- "size": 3537379
8
+ "sha256": "56b242de531a657714141583f0ed378335049cc6a94c28930e0f85a2d7297477",
9
+ "sri": "sha384-5n15mndPLu4Nl68m5LiZVLnopDGeJaIhO9PFaf94IaUL1xxP11ylXueXffRM88MX",
10
+ "size": 3615814
11
11
  },
12
12
  "flatsql-ps-threads.wasm": {
13
13
  "sha256": "aa1ed58de773347c478215a763328f2aca9bca795c0944a85247e53b2433736a",