flatsql 3.11.1 → 3.12.0
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/README.md +61 -795
- package/bin/flatsql.mjs +76 -0
- package/cpp/README.md +18 -0
- package/cpp/include/flatsql/flatsql.h +162 -0
- package/cpp/include/flatsql/flatsql_io.h +159 -0
- package/docs/API-3.12.md +114 -0
- package/package.json +28 -123
- package/wasm/flatsql.wasm +0 -0
- package/wasm/index.d.ts +61 -548
- package/wasm/index.js +280 -1281
- package/wasm/integrity.json +6 -26
- package/wasm/runtime/LICENSE.sdk.txt +190 -0
- package/wasm/runtime/NOTICE.txt +2 -0
- package/wasm/runtime/browser-guest.mjs +1 -0
- package/wasm/runtime/browser-host.mjs +1 -0
- package/wasm/runtime/node-guest.mjs +2 -0
- package/wasm/runtime/node-host.mjs +5 -0
- package/wasm/runtime/opfsIoWorker.mjs +1 -0
- package/wasm/runtime/wasiThreadBrowserWorker.mjs +1 -0
- package/dist/artifacts/index.d.ts +0 -3
- package/dist/artifacts/index.d.ts.map +0 -1
- package/dist/artifacts/index.js +0 -3
- package/dist/artifacts/index.js.map +0 -1
- package/dist/artifacts/transport.d.ts +0 -5
- package/dist/artifacts/transport.d.ts.map +0 -1
- package/dist/artifacts/transport.js +0 -45
- package/dist/artifacts/transport.js.map +0 -1
- package/dist/artifacts/types.d.ts +0 -34
- package/dist/artifacts/types.d.ts.map +0 -1
- package/dist/artifacts/types.js +0 -2
- package/dist/artifacts/types.js.map +0 -1
- package/dist/btree/btree.d.ts +0 -34
- package/dist/btree/btree.d.ts.map +0 -1
- package/dist/btree/btree.js +0 -234
- package/dist/btree/btree.js.map +0 -1
- package/dist/btree/index.d.ts +0 -3
- package/dist/btree/index.d.ts.map +0 -1
- package/dist/btree/index.js +0 -3
- package/dist/btree/index.js.map +0 -1
- package/dist/btree/types.d.ts +0 -36
- package/dist/btree/types.d.ts.map +0 -1
- package/dist/btree/types.js +0 -55
- package/dist/btree/types.js.map +0 -1
- package/dist/cluster/index.d.ts +0 -11
- package/dist/cluster/index.d.ts.map +0 -1
- package/dist/cluster/index.js +0 -59
- package/dist/cluster/index.js.map +0 -1
- package/dist/response/artifact.d.ts +0 -4
- package/dist/response/artifact.d.ts.map +0 -1
- package/dist/response/artifact.js +0 -102
- package/dist/response/artifact.js.map +0 -1
- package/dist/response/cache-key.d.ts +0 -6
- package/dist/response/cache-key.d.ts.map +0 -1
- package/dist/response/cache-key.js +0 -114
- package/dist/response/cache-key.js.map +0 -1
- package/dist/response/index.d.ts +0 -5
- package/dist/response/index.d.ts.map +0 -1
- package/dist/response/index.js +0 -5
- package/dist/response/index.js.map +0 -1
- package/dist/response/memory-cache.d.ts +0 -17
- package/dist/response/memory-cache.d.ts.map +0 -1
- package/dist/response/memory-cache.js +0 -76
- package/dist/response/memory-cache.js.map +0 -1
- package/dist/response/types.d.ts +0 -57
- package/dist/response/types.d.ts.map +0 -1
- package/dist/response/types.js +0 -2
- package/dist/response/types.js.map +0 -1
- package/dist/schema/index.d.ts +0 -3
- package/dist/schema/index.d.ts.map +0 -1
- package/dist/schema/index.js +0 -3
- package/dist/schema/index.js.map +0 -1
- package/dist/schema/parser.d.ts +0 -25
- package/dist/schema/parser.d.ts.map +0 -1
- package/dist/schema/parser.js +0 -474
- package/dist/schema/parser.js.map +0 -1
- package/dist/schema/types.d.ts +0 -33
- package/dist/schema/types.d.ts.map +0 -1
- package/dist/schema/types.js +0 -29
- package/dist/schema/types.js.map +0 -1
- package/dist/standalone/index.d.ts +0 -3
- package/dist/standalone/index.d.ts.map +0 -1
- package/dist/standalone/index.js +0 -3
- package/dist/standalone/index.js.map +0 -1
- package/dist/standalone/process-client.d.ts +0 -85
- package/dist/standalone/process-client.d.ts.map +0 -1
- package/dist/standalone/process-client.js +0 -537
- package/dist/standalone/process-client.js.map +0 -1
- package/dist/standalone/wasmedge-runner.d.ts +0 -19
- package/dist/standalone/wasmedge-runner.d.ts.map +0 -1
- package/dist/standalone/wasmedge-runner.js +0 -108
- package/dist/standalone/wasmedge-runner.js.map +0 -1
- package/dist/storage/index.d.ts +0 -3
- package/dist/storage/index.d.ts.map +0 -1
- package/dist/storage/index.js +0 -3
- package/dist/storage/index.js.map +0 -1
- package/dist/storage/stacked-flatbuffers.d.ts +0 -38
- package/dist/storage/stacked-flatbuffers.d.ts.map +0 -1
- package/dist/storage/stacked-flatbuffers.js +0 -253
- package/dist/storage/stacked-flatbuffers.js.map +0 -1
- package/dist/storage/types.d.ts +0 -23
- package/dist/storage/types.d.ts.map +0 -1
- package/dist/storage/types.js +0 -27
- package/dist/storage/types.js.map +0 -1
- package/dist/stress/aggregate.d.ts +0 -3
- package/dist/stress/aggregate.d.ts.map +0 -1
- package/dist/stress/aggregate.js +0 -61
- package/dist/stress/aggregate.js.map +0 -1
- package/dist/stress/docker-compose.d.ts +0 -17
- package/dist/stress/docker-compose.d.ts.map +0 -1
- package/dist/stress/docker-compose.js +0 -156
- package/dist/stress/docker-compose.js.map +0 -1
- package/dist/stress/index.d.ts +0 -10
- package/dist/stress/index.d.ts.map +0 -1
- package/dist/stress/index.js +0 -10
- package/dist/stress/index.js.map +0 -1
- package/dist/stress/metrics.d.ts +0 -3
- package/dist/stress/metrics.d.ts.map +0 -1
- package/dist/stress/metrics.js +0 -83
- package/dist/stress/metrics.js.map +0 -1
- package/dist/stress/native-publish-event-workload.d.ts +0 -3
- package/dist/stress/native-publish-event-workload.d.ts.map +0 -1
- package/dist/stress/native-publish-event-workload.js +0 -465
- package/dist/stress/native-publish-event-workload.js.map +0 -1
- package/dist/stress/production-gate.d.ts +0 -4
- package/dist/stress/production-gate.d.ts.map +0 -1
- package/dist/stress/production-gate.js +0 -12
- package/dist/stress/production-gate.js.map +0 -1
- package/dist/stress/report.d.ts +0 -3
- package/dist/stress/report.d.ts.map +0 -1
- package/dist/stress/report.js +0 -174
- package/dist/stress/report.js.map +0 -1
- package/dist/stress/sds-discovery.d.ts +0 -4
- package/dist/stress/sds-discovery.d.ts.map +0 -1
- package/dist/stress/sds-discovery.js +0 -40
- package/dist/stress/sds-discovery.js.map +0 -1
- package/dist/stress/smoke-runner.d.ts +0 -3
- package/dist/stress/smoke-runner.d.ts.map +0 -1
- package/dist/stress/smoke-runner.js +0 -64
- package/dist/stress/smoke-runner.js.map +0 -1
- package/dist/stress/types.d.ts +0 -219
- package/dist/stress/types.d.ts.map +0 -1
- package/dist/stress/types.js +0 -2
- package/dist/stress/types.js.map +0 -1
- package/dist/stress/workload.d.ts +0 -6
- package/dist/stress/workload.d.ts.map +0 -1
- package/dist/stress/workload.js +0 -144
- package/dist/stress/workload.js.map +0 -1
- package/docs/PARTITION-STORE-WASM.md +0 -338
- package/docs/PARTITION-STORE.md +0 -2380
- package/docs/agents/response-artifacts.md +0 -65
- package/docs/response-artifacts.md +0 -86
- package/scripts/stress-docker.sh +0 -279
- package/sdm/flatsql-spatial.wasm +0 -0
- package/sdm/index.d.ts +0 -88
- package/sdm/index.js +0 -253
- package/sdm/manifest.json +0 -402
- package/stress/docker/Dockerfile +0 -11
- package/stress/docker/docker-compose.yml +0 -51
- package/stress/sds/aggregate.mjs +0 -97
- package/stress/sds/run.mjs +0 -105
- package/stress/sds/write-compose.mjs +0 -96
- package/wasm/flatsql-client.js +0 -280
- package/wasm/flatsql-io.d.ts +0 -97
- package/wasm/flatsql-io.js +0 -625
- package/wasm/flatsql-p4-threads.wasm +0 -0
- package/wasm/flatsql-ps-threads.wasm +0 -0
- package/wasm/flatsql-wasi-noeh.wasm +0 -0
- package/wasm/flatsql-wasi.wasm +0 -0
- package/wasm/flatsql.js +0 -2
- package/wasm/flatsql.worker.js +0 -209
- package/wasm/native/flatsql_wasmedge_runner.cpp +0 -858
- package/wasm/ps-node-fault.d.mts +0 -23
- package/wasm/ps-node-fault.mjs +0 -381
- package/wasm/ps-node-guest.mjs +0 -173
- package/wasm/ps-node-host.d.mts +0 -95
- package/wasm/ps-node-host.mjs +0 -476
- package/wasm/ps-node-imports.mjs +0 -847
- package/wasm/ps.d.ts +0 -21
- package/wasm/ps.js +0 -75
- package/wasm/wasi.d.ts +0 -11
- package/wasm/wasi.js +0 -51
package/wasm/ps.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// Types for wasm/ps.js (the partition store artifact, flatsql-ps-threads.wasm).
|
|
2
|
-
|
|
3
|
-
export const FLATSQL_PS_THREADS_FILE: 'flatsql-ps-threads.wasm';
|
|
4
|
-
|
|
5
|
-
/** URL of the packaged flatsql-ps-threads.wasm. */
|
|
6
|
-
export function getFlatSQLPsThreadsURL(): URL;
|
|
7
|
-
|
|
8
|
-
export interface LoadFlatSQLPsThreadsOptions {
|
|
9
|
-
url?: string | URL;
|
|
10
|
-
path?: string;
|
|
11
|
-
/** false skips the integrity.json check. */
|
|
12
|
-
verify?: boolean;
|
|
13
|
-
/** SHA-256 (hex) provider outside Node; back it with WASM or native crypto. Browser WebCrypto is intentionally not used. */
|
|
14
|
-
computeSHA256?: (bytes: Uint8Array) => string | Promise<string>;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/** The artifact's bytes, checked against integrity.json (Node, or with computeSHA256). */
|
|
18
|
-
export function loadFlatSQLPsThreads(options?: LoadFlatSQLPsThreadsOptions): Promise<Uint8Array>;
|
|
19
|
-
|
|
20
|
-
/** The artifact's sha256 (hex) from the packaged integrity.json, or null. */
|
|
21
|
-
export function flatsqlPsThreadsSha256(): Promise<string | null>;
|
package/wasm/ps.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
// The partition store artifact, flatsql-ps-threads.wasm (docs/PARTITION-STORE-WASM.md).
|
|
2
|
-
//
|
|
3
|
-
// A wasm32-wasip1-threads reactor: hosts instantiate it once per writer or
|
|
4
|
-
// reader instance over a shared env.memory, provide WASI preview1,
|
|
5
|
-
// wasi.thread-spawn and the seven env.flatsql_io_* imports, and drive it
|
|
6
|
-
// through the flatsql_ps_* C ABI (cpp/include/flatsql/ps/flatsql_ps.h).
|
|
7
|
-
// Node: flatsql/ps/node-host. Go/WasmEdge: the SDN host. Browsers: sdn-js.
|
|
8
|
-
|
|
9
|
-
const PS_THREADS_URL = new URL('./flatsql-ps-threads.wasm', import.meta.url);
|
|
10
|
-
|
|
11
|
-
/** File name of the artifact next to this module. */
|
|
12
|
-
export const FLATSQL_PS_THREADS_FILE = 'flatsql-ps-threads.wasm';
|
|
13
|
-
|
|
14
|
-
/** URL of the packaged flatsql-ps-threads.wasm. */
|
|
15
|
-
export function getFlatSQLPsThreadsURL() {
|
|
16
|
-
return PS_THREADS_URL;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* The artifact's bytes, checked against wasm/integrity.json: in Node with
|
|
21
|
-
* node:crypto, elsewhere with `computeSHA256` (bytes -> hex), which the caller
|
|
22
|
-
* backs with WASM or native crypto (browser WebCrypto is intentionally not
|
|
23
|
-
* used, as in wasm/index.js). A mismatch throws.
|
|
24
|
-
*
|
|
25
|
-
* @param {{ url?: string | URL, path?: string, verify?: boolean,
|
|
26
|
-
* computeSHA256?: (bytes: Uint8Array) => string | Promise<string> }} [options]
|
|
27
|
-
* @returns {Promise<Uint8Array>}
|
|
28
|
-
*/
|
|
29
|
-
export async function loadFlatSQLPsThreads(options = {}) {
|
|
30
|
-
let bytes;
|
|
31
|
-
const url = options.url ? new URL(options.url, import.meta.url) : PS_THREADS_URL;
|
|
32
|
-
if (options.path || url.protocol === 'file:') {
|
|
33
|
-
const [{ readFile }, { fileURLToPath }] = await Promise.all([import('node:fs/promises'), import('node:url')]);
|
|
34
|
-
bytes = new Uint8Array(await readFile(options.path ?? fileURLToPath(url)));
|
|
35
|
-
} else {
|
|
36
|
-
const response = await fetch(url);
|
|
37
|
-
if (!response.ok) throw new Error(`Failed to load ${FLATSQL_PS_THREADS_FILE}: ${response.status}`);
|
|
38
|
-
bytes = new Uint8Array(await response.arrayBuffer());
|
|
39
|
-
}
|
|
40
|
-
if (options.verify === false || options.url || options.path) return bytes;
|
|
41
|
-
const hash = options.computeSHA256 ?? (await nodeSha256());
|
|
42
|
-
if (!hash) return bytes;
|
|
43
|
-
const expected = await flatsqlPsThreadsSha256();
|
|
44
|
-
if (!expected) throw new Error(`integrity.json has no sha256 for ${FLATSQL_PS_THREADS_FILE}`);
|
|
45
|
-
const actual = await hash(bytes);
|
|
46
|
-
if (actual !== expected) {
|
|
47
|
-
throw new Error(`${FLATSQL_PS_THREADS_FILE}: sha256 ${actual} does not match integrity.json (${expected})`);
|
|
48
|
-
}
|
|
49
|
-
return bytes;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/** The artifact's sha256 (hex) from the packaged integrity.json, or null. */
|
|
53
|
-
export async function flatsqlPsThreadsSha256() {
|
|
54
|
-
const integrityUrl = new URL('./integrity.json', import.meta.url);
|
|
55
|
-
let text;
|
|
56
|
-
try {
|
|
57
|
-
if (integrityUrl.protocol === 'file:') {
|
|
58
|
-
const [{ readFile }, { fileURLToPath }] = await Promise.all([import('node:fs/promises'), import('node:url')]);
|
|
59
|
-
text = await readFile(fileURLToPath(integrityUrl), 'utf8');
|
|
60
|
-
} else {
|
|
61
|
-
const response = await fetch(integrityUrl);
|
|
62
|
-
if (!response.ok) return null;
|
|
63
|
-
text = await response.text();
|
|
64
|
-
}
|
|
65
|
-
} catch {
|
|
66
|
-
return null;
|
|
67
|
-
}
|
|
68
|
-
return JSON.parse(text)?.files?.[FLATSQL_PS_THREADS_FILE]?.sha256 ?? null;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
async function nodeSha256() {
|
|
72
|
-
if (!globalThis.process?.versions?.node) return null;
|
|
73
|
-
const { createHash } = await import('node:crypto');
|
|
74
|
-
return (bytes) => createHash('sha256').update(bytes).digest('hex');
|
|
75
|
-
}
|
package/wasm/wasi.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface FlatSQLWASILoadOptions {
|
|
2
|
-
url?: string | URL;
|
|
3
|
-
path?: string;
|
|
4
|
-
as?: 'arrayBuffer' | 'uint8array';
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export declare function getFlatSQLWASIURL(): URL;
|
|
8
|
-
|
|
9
|
-
export declare function loadFlatSQLWASI(
|
|
10
|
-
options?: FlatSQLWASILoadOptions
|
|
11
|
-
): Promise<ArrayBuffer | Uint8Array>;
|
package/wasm/wasi.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
const DEFAULT_WASI_URL = new URL('./flatsql-wasi.wasm', import.meta.url);
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Resolve the packaged FlatSQL WASI module URL.
|
|
5
|
-
*/
|
|
6
|
-
export function getFlatSQLWASIURL() {
|
|
7
|
-
return DEFAULT_WASI_URL;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
async function readViaFsPath(path) {
|
|
11
|
-
const fs = await import('node:fs/promises');
|
|
12
|
-
return new Uint8Array(await fs.readFile(path));
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Load the packaged FlatSQL WASI module bytes.
|
|
17
|
-
*
|
|
18
|
-
* @param {{
|
|
19
|
-
* url?: string | URL,
|
|
20
|
-
* path?: string,
|
|
21
|
-
* as?: 'arrayBuffer' | 'uint8array'
|
|
22
|
-
* }} [options]
|
|
23
|
-
* @returns {Promise<ArrayBuffer | Uint8Array>}
|
|
24
|
-
*/
|
|
25
|
-
export async function loadFlatSQLWASI(options = {}) {
|
|
26
|
-
const as = options.as === 'uint8array' ? 'uint8array' : 'arrayBuffer';
|
|
27
|
-
|
|
28
|
-
let bytes;
|
|
29
|
-
if (options.path) {
|
|
30
|
-
bytes = await readViaFsPath(options.path);
|
|
31
|
-
} else {
|
|
32
|
-
const wasmUrl = options.url ? new URL(options.url, import.meta.url) : DEFAULT_WASI_URL;
|
|
33
|
-
|
|
34
|
-
if (wasmUrl.protocol === 'file:') {
|
|
35
|
-
const { fileURLToPath } = await import('node:url');
|
|
36
|
-
bytes = await readViaFsPath(fileURLToPath(wasmUrl));
|
|
37
|
-
} else {
|
|
38
|
-
const response = await fetch(wasmUrl);
|
|
39
|
-
if (!response.ok) {
|
|
40
|
-
throw new Error(`Failed to load flatsql-wasi.wasm: ${response.status}`);
|
|
41
|
-
}
|
|
42
|
-
bytes = new Uint8Array(await response.arrayBuffer());
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (as === 'uint8array') {
|
|
47
|
-
return bytes;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength);
|
|
51
|
-
}
|