hyperdb-wasm 0.0.27002-dev.wasm.g543e26d5 → 0.0.27099-dev.wasm.g3764e520
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/dist/api.d.ts +11 -9
- package/dist/browser.d.ts +3 -4
- package/dist/browser.js +2913 -4234
- package/dist/browser_worker.js +29 -87
- package/dist/client.d.ts +2 -5
- package/dist/hyperdb-wasm.cjs +1 -1
- package/dist/hyperdb-wasm.js +1 -1
- package/dist/hyperdb-wasm.wasm.br +0 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.node.d.ts +1 -2
- package/dist/node.d.ts +2 -3
- package/dist/node.js +2956 -4279
- package/dist/node_worker.js +27 -84
- package/dist/protocol.d.ts +1 -54
- package/dist/raw.browser.js +17 -110
- package/dist/raw.d.ts +1 -1
- package/dist/raw.node.js +13 -105
- package/dist/worker_setup.d.ts +1 -5
- package/examples/browser-attached-databases.html +12 -13
- package/examples/browser.html +1 -1
- package/examples/node-attached-databases.mjs +14 -14
- package/examples/node.mjs +6 -6
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import type { HyperDBEngineClient } from './client.js';
|
|
|
4
4
|
import type { BrowserClientOptions } from './browser.js';
|
|
5
5
|
import type { MountSource, WasmResult } from './protocol.js';
|
|
6
6
|
import type { HyperDBErrorSource } from './protocol.js';
|
|
7
|
-
import type { UnaryRpcHandler } from './protocol.js';
|
|
8
7
|
export interface HyperDBClient {
|
|
9
8
|
ready(): Promise<void>;
|
|
10
9
|
initialize(settings: string): Promise<WasmResult>;
|
|
@@ -43,7 +42,6 @@ export type HyperDBSettingValue = string | number | boolean | null | readonly Hy
|
|
|
43
42
|
export type HyperDBSettings = Readonly<Record<string, HyperDBSettingValue>>;
|
|
44
43
|
export interface HyperDBCreateOptions {
|
|
45
44
|
readonly settings?: HyperDBSettings;
|
|
46
|
-
readonly unaryRpc?: UnaryRpcHandler;
|
|
47
45
|
}
|
|
48
46
|
export type BrowserCreateOptions = BrowserClientOptions & HyperDBCreateOptions;
|
|
49
47
|
export type QueryMetricValue = null | boolean | number | string | readonly QueryMetricValue[] | {
|
|
@@ -74,10 +72,13 @@ export interface QueryInfo {
|
|
|
74
72
|
readonly preExecutionMetrics: QueryMetrics | null;
|
|
75
73
|
readonly executionMetrics: QueryMetrics | null;
|
|
76
74
|
}
|
|
77
|
-
export interface
|
|
78
|
-
readonly result: Result;
|
|
75
|
+
export interface QueryOperation {
|
|
79
76
|
readonly info: Promise<QueryInfo>;
|
|
80
77
|
}
|
|
78
|
+
export interface QueryPromise<Result> extends Promise<Result>, QueryOperation {
|
|
79
|
+
}
|
|
80
|
+
export interface QueryStreamIPC extends AsyncIterable<Uint8Array>, QueryOperation {
|
|
81
|
+
}
|
|
81
82
|
export declare class HyperDBError extends Error {
|
|
82
83
|
readonly sqlState: string;
|
|
83
84
|
readonly errorSource: HyperDBErrorSource;
|
|
@@ -112,14 +113,15 @@ export declare class HyperDBConnection {
|
|
|
112
113
|
private closing;
|
|
113
114
|
constructor(client: HyperDBClient, connection: number, onClose?: () => void);
|
|
114
115
|
close(): Promise<void>;
|
|
115
|
-
|
|
116
|
-
queryIPC(sql: string):
|
|
117
|
-
|
|
116
|
+
queryStreamIPC(sql: string): QueryStreamIPC;
|
|
117
|
+
queryIPC(sql: string): QueryPromise<Uint8Array>;
|
|
118
|
+
queryStream<T extends TypeMap = {
|
|
118
119
|
[key: string]: DataType;
|
|
119
|
-
}>(sql: string):
|
|
120
|
+
}>(sql: string): QueryPromise<AsyncRecordBatchStreamReader<T>>;
|
|
120
121
|
query<T extends TypeMap = {
|
|
121
122
|
[key: string]: DataType;
|
|
122
|
-
}>(sql: string):
|
|
123
|
+
}>(sql: string): QueryPromise<Table<T>>;
|
|
124
|
+
execute(sql: string): QueryPromise<bigint | null>;
|
|
123
125
|
insertArrowTable(table: Table, options: ArrowInsertOptions): Promise<void>;
|
|
124
126
|
insertArrowIPCFromPath(path: string, options: ArrowInsertOptions): Promise<void>;
|
|
125
127
|
private insertArrowIPCFromPathInternal;
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HyperDBEngineClient } from './client.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { EngineRequest, SetupProgress, WorkerTransport } from './protocol.js';
|
|
3
3
|
type BrowserListener = (event: unknown) => void;
|
|
4
4
|
export interface BrowserWorkerLike {
|
|
5
5
|
postMessage(message: unknown, transfer: ArrayBuffer[]): void;
|
|
@@ -14,7 +14,6 @@ export interface BrowserClientOptions {
|
|
|
14
14
|
/** OPFS-relative directory mounted as the durable filesystem root. */
|
|
15
15
|
readonly storagePath?: string;
|
|
16
16
|
readonly onSetupProgress?: (progress: SetupProgress) => void;
|
|
17
|
-
readonly unaryRpc?: UnaryRpcHandler;
|
|
18
17
|
}
|
|
19
18
|
type BrowserEnvironment = {
|
|
20
19
|
readonly WebAssembly?: typeof WebAssembly;
|
|
@@ -33,12 +32,12 @@ export declare function assertBrowserSupport(environment?: BrowserEnvironment):
|
|
|
33
32
|
export declare class BrowserWorker implements WorkerTransport {
|
|
34
33
|
private readonly worker;
|
|
35
34
|
constructor(worker: BrowserWorkerLike);
|
|
36
|
-
postMessage(message:
|
|
35
|
+
postMessage(message: EngineRequest, transfer?: readonly ArrayBuffer[]): void;
|
|
37
36
|
onMessage(listener: (message: unknown) => void): () => void;
|
|
38
37
|
onError(listener: (error: Error) => void): () => void;
|
|
39
38
|
onClose(): () => void;
|
|
40
39
|
terminate(): void;
|
|
41
40
|
}
|
|
42
|
-
export declare function resolveBrowserWorkerUrl(workerUrl: string | URL, engineUrl: string | URL, wasmUrl?: string | URL, storagePath?: string): URL;
|
|
41
|
+
export declare function resolveBrowserWorkerUrl(workerUrl: string | URL, engineUrl: string | URL, wasmUrl?: string | URL, storagePath?: string, baseUrl?: string | URL): URL;
|
|
43
42
|
export declare function createBrowserClient(options?: BrowserClientOptions): HyperDBEngineClient;
|
|
44
43
|
export {};
|