hyperdb-wasm 0.0.26862-dev.wasm.g89537caa → 0.0.26978-dev.wasm.g29b852db
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 +17 -19
- package/dist/browser.d.ts +4 -3
- package/dist/browser.js +4337 -2958
- package/dist/browser_external_directory.d.ts +13 -0
- package/dist/browser_worker.js +294 -112
- package/dist/client.d.ts +8 -6
- 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 +10 -9
- package/dist/index.node.d.ts +5 -4
- package/dist/node.d.ts +3 -2
- package/dist/node.js +4371 -3007
- package/dist/node_external_directory.d.ts +11 -0
- package/dist/node_worker.js +329 -126
- package/dist/protocol.d.ts +71 -19
- package/dist/raw.browser.js +242 -81
- package/dist/raw.d.ts +2 -1
- package/dist/raw.node.js +237 -77
- package/dist/wasm_bindings.d.ts +21 -1
- package/dist/worker_setup.d.ts +8 -2
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -2,8 +2,9 @@ import { DataType, Table } from 'apache-arrow';
|
|
|
2
2
|
import type { AsyncRecordBatchStreamReader, TypeMap } from 'apache-arrow';
|
|
3
3
|
import type { HyperDBEngineClient } from './client.js';
|
|
4
4
|
import type { BrowserClientOptions } from './browser.js';
|
|
5
|
-
import type { WasmResult } from './protocol.js';
|
|
5
|
+
import type { MountSource, WasmResult } from './protocol.js';
|
|
6
6
|
import type { HyperDBErrorSource } from './protocol.js';
|
|
7
|
+
import type { UnaryRpcHandler } from './protocol.js';
|
|
7
8
|
export interface HyperDBClient {
|
|
8
9
|
ready(): Promise<void>;
|
|
9
10
|
initialize(settings: string): Promise<WasmResult>;
|
|
@@ -13,10 +14,8 @@ export interface HyperDBClient {
|
|
|
13
14
|
insertArrowIPCFromPath(connection: number, path: string, name: string, schema: string | null, create: boolean, internal?: boolean): Promise<WasmResult>;
|
|
14
15
|
createTemporaryFile(bytes: Uint8Array): Promise<WasmResult>;
|
|
15
16
|
removeFile(path: string): Promise<WasmResult>;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
registerExternalDirectory(handle: unknown, mode: 'read' | 'readwrite'): Promise<WasmResult>;
|
|
19
|
-
removeExternalRegistration(path: string): Promise<WasmResult>;
|
|
17
|
+
mount(source: MountSource, path: string, mode: MountAccessMode): Promise<WasmResult>;
|
|
18
|
+
unmount(path: string): Promise<WasmResult>;
|
|
20
19
|
pollQuery(query: number): Promise<WasmResult>;
|
|
21
20
|
cancelQuery(query: number): Promise<WasmResult>;
|
|
22
21
|
finishQuery(query: number): Promise<WasmResult>;
|
|
@@ -28,24 +27,23 @@ export interface ArrowInsertOptions {
|
|
|
28
27
|
readonly schema?: string;
|
|
29
28
|
readonly create?: boolean;
|
|
30
29
|
}
|
|
31
|
-
export
|
|
32
|
-
|
|
33
|
-
readonly
|
|
34
|
-
readonly
|
|
30
|
+
export type MountAccessMode = 'read' | 'readwrite';
|
|
31
|
+
export interface MountOptions {
|
|
32
|
+
readonly path: string;
|
|
33
|
+
readonly mode?: MountAccessMode;
|
|
35
34
|
}
|
|
36
|
-
export
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
export interface MountedResource {
|
|
36
|
+
readonly path: string;
|
|
37
|
+
close(): Promise<void>;
|
|
39
38
|
}
|
|
40
|
-
|
|
41
|
-
type NodeExternalFileArguments = readonly [path: string];
|
|
42
|
-
export type ExternalFileArguments = BrowserExternalFileArguments | NodeExternalFileArguments;
|
|
39
|
+
export declare function validateMountPath(path: unknown): asserts path is string;
|
|
43
40
|
export type HyperDBSettingValue = string | number | boolean | null | readonly HyperDBSettingValue[] | {
|
|
44
41
|
readonly [key: string]: HyperDBSettingValue;
|
|
45
42
|
};
|
|
46
43
|
export type HyperDBSettings = Readonly<Record<string, HyperDBSettingValue>>;
|
|
47
44
|
export interface HyperDBCreateOptions {
|
|
48
45
|
readonly settings?: HyperDBSettings;
|
|
46
|
+
readonly unaryRpc?: UnaryRpcHandler;
|
|
49
47
|
}
|
|
50
48
|
export type BrowserCreateOptions = BrowserClientOptions & HyperDBCreateOptions;
|
|
51
49
|
export type QueryMetricValue = null | boolean | number | string | readonly QueryMetricValue[] | {
|
|
@@ -88,22 +86,22 @@ export declare class HyperDBError extends Error {
|
|
|
88
86
|
constructor(message: string, sqlState: string, errorSource: HyperDBErrorSource, detail?: string, hint?: string);
|
|
89
87
|
}
|
|
90
88
|
declare function initializeHyperDB(client: HyperDBClient, settings: HyperDBSettings | undefined): Promise<void>;
|
|
91
|
-
export declare class HyperDB
|
|
89
|
+
export declare class HyperDB {
|
|
92
90
|
protected readonly client: HyperDBClient;
|
|
93
91
|
private terminated;
|
|
94
92
|
private termination;
|
|
95
93
|
private activeDatabaseOperations;
|
|
96
94
|
private readonly connections;
|
|
95
|
+
private readonly mountedResources;
|
|
97
96
|
constructor(client: HyperDBClient);
|
|
98
97
|
static create(options?: BrowserCreateOptions): Promise<HyperDB>;
|
|
99
98
|
ready(): Promise<void>;
|
|
100
99
|
connect(): Promise<HyperDBConnection>;
|
|
101
|
-
|
|
102
|
-
removeExternalRegistration(path: string): Promise<void>;
|
|
103
|
-
protected registerExternalDirectorySource(source: unknown, mode: ExternalDirectoryMode): Promise<string>;
|
|
100
|
+
protected mountSource(source: MountSource, path: string, mode: MountAccessMode, cleanup?: () => void): Promise<MountedResource>;
|
|
104
101
|
terminate(): Promise<void>;
|
|
105
102
|
private ensureRunning;
|
|
106
103
|
protected runDatabaseOperation<Result>(operation: () => Promise<Result>): Promise<Result>;
|
|
104
|
+
private unmount;
|
|
107
105
|
}
|
|
108
106
|
export declare class HyperDBConnection {
|
|
109
107
|
private readonly client;
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HyperDBEngineClient } from './client.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { SetupProgress, UnaryRpcHandler, WorkerRequest, 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,6 +14,7 @@ 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;
|
|
17
18
|
}
|
|
18
19
|
type BrowserEnvironment = {
|
|
19
20
|
readonly WebAssembly?: typeof WebAssembly;
|
|
@@ -32,12 +33,12 @@ export declare function assertBrowserSupport(environment?: BrowserEnvironment):
|
|
|
32
33
|
export declare class BrowserWorker implements WorkerTransport {
|
|
33
34
|
private readonly worker;
|
|
34
35
|
constructor(worker: BrowserWorkerLike);
|
|
35
|
-
postMessage(message:
|
|
36
|
+
postMessage(message: WorkerRequest, transfer?: readonly ArrayBuffer[]): void;
|
|
36
37
|
onMessage(listener: (message: unknown) => void): () => void;
|
|
37
38
|
onError(listener: (error: Error) => void): () => void;
|
|
38
39
|
onClose(): () => void;
|
|
39
40
|
terminate(): void;
|
|
40
41
|
}
|
|
41
|
-
export declare function resolveBrowserWorkerUrl(workerUrl: string | URL, engineUrl: string | URL, wasmUrl?: string | URL, storagePath?: string): URL;
|
|
42
|
+
export declare function resolveBrowserWorkerUrl(workerUrl: string | URL, engineUrl: string | URL, wasmUrl?: string | URL, storagePath?: string, baseUrl?: string | URL): URL;
|
|
42
43
|
export declare function createBrowserClient(options?: BrowserClientOptions): HyperDBEngineClient;
|
|
43
44
|
export {};
|