hyperdb-wasm 0.0.26862-dev.wasm.g42f1012b → 0.0.26862-dev.wasm.g8c0876f6

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 CHANGED
@@ -17,7 +17,6 @@ export interface HyperDBClient {
17
17
  attachDatabase(connection: number, databaseName: string, alias: string): Promise<WasmResult>;
18
18
  detachDatabase(connection: number, alias: string): Promise<WasmResult>;
19
19
  startQuery(connection: number, sql: string): Promise<WasmResult>;
20
- startQueryWithInfo(connection: number, sql: string): Promise<WasmResult>;
21
20
  insertArrowIPCFromPath(connection: number, path: string, name: string, schema: string | null, create: boolean, internal?: boolean): Promise<WasmResult>;
22
21
  createTemporaryFile(bytes: Uint8Array): Promise<WasmResult>;
23
22
  removeFile(path: string): Promise<WasmResult>;
@@ -27,8 +26,7 @@ export interface HyperDBClient {
27
26
  removeExternalRegistration(path: string): Promise<WasmResult>;
28
27
  pollQuery(query: number): Promise<WasmResult>;
29
28
  cancelQuery(query: number): Promise<WasmResult>;
30
- releaseQuery(query: number): Promise<WasmResult>;
31
- releaseQueryWithInfo(query: number): Promise<WasmResult>;
29
+ finishQuery(query: number): Promise<WasmResult>;
32
30
  shutdown(): Promise<WasmResult>;
33
31
  terminate(): Promise<void>;
34
32
  }
@@ -149,8 +147,7 @@ export declare class HyperDBConnection {
149
147
  insertArrowIPCFromPath(path: string, options: ArrowInsertOptions): Promise<void>;
150
148
  private insertArrowIPCFromPathInternal;
151
149
  private ensureAvailable;
152
- private release;
153
- private releaseWithInfo;
150
+ private finishQuery;
154
151
  closeForTermination(): Promise<void>;
155
152
  }
156
153
  export type { HyperDBEngineClient };
package/dist/browser.js CHANGED
@@ -133,9 +133,6 @@ var init_client = __esm({
133
133
  startQuery(connection, sql, sqlTestMode = false) {
134
134
  return this.request({ id: this.nextId++, type: "startQuery", connection, sql, ...sqlTestMode && { sqlTestMode } });
135
135
  }
136
- startQueryWithInfo(connection, sql) {
137
- return this.request({ id: this.nextId++, type: "startQueryWithInfo", connection, sql });
138
- }
139
136
  insertArrowIPCFromPath(connection, path, name, schema, create, internal = false) {
140
137
  return this.request({ id: this.nextId++, type: "insertArrowIPCFromPath", connection, path, name, schema, create, internal });
141
138
  }
@@ -161,11 +158,8 @@ var init_client = __esm({
161
158
  cancelQuery(query) {
162
159
  return this.request({ id: this.nextId++, type: "cancelQuery", query });
163
160
  }
164
- releaseQuery(query) {
165
- return this.request({ id: this.nextId++, type: "releaseQuery", query });
166
- }
167
- releaseQueryWithInfo(query) {
168
- return this.request({ id: this.nextId++, type: "releaseQueryWithInfo", query });
161
+ finishQuery(query) {
162
+ return this.request({ id: this.nextId++, type: "finishQuery", query });
169
163
  }
170
164
  async terminate() {
171
165
  await this.transport.terminate();
@@ -12532,7 +12526,7 @@ var HyperDBConnection = class {
12532
12526
  try {
12533
12527
  connection.ensureAvailable();
12534
12528
  acquired = true;
12535
- query = readHandleFromResult(await connection.client.startQueryWithInfo(connection.connection, sql), "start query");
12529
+ query = readHandleFromResult(await connection.client.startQuery(connection.connection, sql), "start query");
12536
12530
  for (; ; ) {
12537
12531
  let result2 = prefetched ? await prefetched : await connection.client.pollQuery(query);
12538
12532
  prefetched = void 0;
@@ -12574,7 +12568,7 @@ var HyperDBConnection = class {
12574
12568
  }
12575
12569
  }
12576
12570
  try {
12577
- info = await connection.releaseWithInfo(query);
12571
+ info = decodeQueryInfo(await connection.finishQuery(query));
12578
12572
  } catch (error) {
12579
12573
  cleanupError ??= error;
12580
12574
  }
@@ -12667,7 +12661,7 @@ var HyperDBConnection = class {
12667
12661
  }
12668
12662
  } finally {
12669
12663
  try {
12670
- if (query !== void 0) await this.release(query);
12664
+ if (query !== void 0) await this.finishQuery(query);
12671
12665
  } finally {
12672
12666
  if (acquire) this.active = false;
12673
12667
  }
@@ -12681,22 +12675,12 @@ var HyperDBConnection = class {
12681
12675
  }
12682
12676
  this.active = true;
12683
12677
  }
12684
- async release(query) {
12685
- let delay = 1;
12686
- for (; ; ) {
12687
- const result = await this.client.releaseQuery(query);
12688
- if (result.state === "ok") return;
12689
- if (result.state !== "pending") throw readErrorFromResult(result, "release query");
12690
- await new Promise((resolve) => setTimeout(resolve, delay));
12691
- delay = Math.min(delay * 2, 32);
12692
- }
12693
- }
12694
- async releaseWithInfo(query) {
12678
+ async finishQuery(query) {
12695
12679
  let delay = 1;
12696
12680
  for (; ; ) {
12697
- const result = await this.client.releaseQueryWithInfo(query);
12698
- if (result.state === "ok") return decodeQueryInfo(result.payload);
12699
- if (result.state !== "pending") throw readErrorFromResult(result, "release query");
12681
+ const result = await this.client.finishQuery(query);
12682
+ if (result.state === "ok") return result.payload;
12683
+ if (result.state !== "pending") throw readErrorFromResult(result, "finish query");
12700
12684
  await new Promise((resolve) => setTimeout(resolve, delay));
12701
12685
  delay = Math.min(delay * 2, 32);
12702
12686
  }
@@ -60,12 +60,10 @@
60
60
  attachDatabase;
61
61
  detachDatabase;
62
62
  startQuery;
63
- startQueryWithInfo;
64
63
  insertArrowIPCFromPath;
65
64
  pollQuery;
66
65
  cancelQuery;
67
- releaseQuery;
68
- releaseQueryWithInfo;
66
+ finishQuery;
69
67
  resultState;
70
68
  resultPayloadLength;
71
69
  free;
@@ -87,12 +85,10 @@
87
85
  this.attachDatabase = module.cwrap("hyperdb_wasm_attach_database", "pointer", ["number", "string", "string"]);
88
86
  this.detachDatabase = module.cwrap("hyperdb_wasm_detach_database", "pointer", ["number", "string"]);
89
87
  this.startQuery = module.cwrap("hyperdb_wasm_query_start", "pointer", ["number", "string", "number"]);
90
- this.startQueryWithInfo = module.cwrap("hyperdb_wasm_query_start_with_info", "pointer", ["number", "string"]);
91
88
  this.insertArrowIPCFromPath = module.cwrap("hyperdb_wasm_arrow_insert_from_path", "pointer", ["number", "string", "string", "string", "number"]);
92
89
  this.pollQuery = module.cwrap("hyperdb_wasm_query_poll", "pointer", ["number"]);
93
90
  this.cancelQuery = module.cwrap("hyperdb_wasm_query_cancel", "pointer", ["number"]);
94
- this.releaseQuery = module.cwrap("hyperdb_wasm_query_release", "pointer", ["number"]);
95
- this.releaseQueryWithInfo = module.cwrap("hyperdb_wasm_query_release_with_info", "pointer", ["number"]);
91
+ this.finishQuery = module.cwrap("hyperdb_wasm_query_finish", "pointer", ["number"]);
96
92
  this.resultState = module.cwrap("hyperdb_wasm_result_state", "number", ["number"]);
97
93
  this.resultPayloadLength = module.cwrap("hyperdb_wasm_result_payload_len", "number", ["number"]);
98
94
  this.free = module.cwrap("hyperdb_wasm_free", null, ["pointer"]);
@@ -241,8 +237,6 @@
241
237
  return this.removeExternalRegistration(request.path);
242
238
  case "startQuery":
243
239
  return this.startQuery(request.connection, request.sql, Number(request.sqlTestMode ?? false));
244
- case "startQueryWithInfo":
245
- return this.startQueryWithInfo(request.connection, request.sql);
246
240
  case "insertArrowIPCFromPath": {
247
241
  const path = request.internal ? request.path : this.module.resolveHyperDBPath?.(request.path) ?? request.path;
248
242
  return this.insertArrowIPCFromPath(request.connection, path, request.name, request.schema ?? "", Number(request.create));
@@ -251,10 +245,8 @@
251
245
  return this.pollQuery(request.query);
252
246
  case "cancelQuery":
253
247
  return this.cancelQuery(request.query);
254
- case "releaseQuery":
255
- return this.releaseQuery(request.query);
256
- case "releaseQueryWithInfo":
257
- return this.releaseQueryWithInfo(request.query);
248
+ case "finishQuery":
249
+ return this.finishQuery(request.query);
258
250
  }
259
251
  }
260
252
  decodeResult(pointer) {
@@ -326,8 +318,6 @@
326
318
  return hasKeys(value, ["id", "type", "connection", "alias"]) && Number.isSafeInteger(value.connection) && typeof value.alias === "string";
327
319
  case "startQuery":
328
320
  return (hasKeys(value, ["id", "type", "connection", "sql"]) || hasKeys(value, ["id", "type", "connection", "sql", "sqlTestMode"])) && Number.isSafeInteger(value.connection) && typeof value.sql === "string" && (value.sqlTestMode === void 0 || typeof value.sqlTestMode === "boolean");
329
- case "startQueryWithInfo":
330
- return hasKeys(value, ["id", "type", "connection", "sql"]) && Number.isSafeInteger(value.connection) && typeof value.sql === "string";
331
321
  case "insertArrowIPCFromPath":
332
322
  return hasKeys(value, ["id", "type", "connection", "path", "name", "schema", "create", "internal"]) && Number.isSafeInteger(value.connection) && typeof value.path === "string" && typeof value.name === "string" && (typeof value.schema === "string" || value.schema === null) && typeof value.create === "boolean" && typeof value.internal === "boolean";
333
323
  case "createTemporaryFile":
@@ -342,8 +332,7 @@
342
332
  return hasKeys(value, ["id", "type", "path"]) && typeof value.path === "string";
343
333
  case "pollQuery":
344
334
  case "cancelQuery":
345
- case "releaseQuery":
346
- case "releaseQueryWithInfo":
335
+ case "finishQuery":
347
336
  return hasKeys(value, ["id", "type", "query"]) && Number.isSafeInteger(value.query);
348
337
  default:
349
338
  return false;
package/dist/client.d.ts CHANGED
@@ -23,7 +23,6 @@ export declare class HyperDBEngineClient {
23
23
  detachDatabase(connection: number, alias: string): Promise<WasmResult>;
24
24
  shutdown(): Promise<WasmResult>;
25
25
  startQuery(connection: number, sql: string, sqlTestMode?: boolean): Promise<WasmResult>;
26
- startQueryWithInfo(connection: number, sql: string): Promise<WasmResult>;
27
26
  insertArrowIPCFromPath(connection: number, path: string, name: string, schema: string | null, create: boolean, internal?: boolean): Promise<WasmResult>;
28
27
  createTemporaryFile(bytes: Uint8Array): Promise<WasmResult>;
29
28
  removeFile(path: string): Promise<WasmResult>;
@@ -33,8 +32,7 @@ export declare class HyperDBEngineClient {
33
32
  removeExternalRegistration(path: string): Promise<WasmResult>;
34
33
  pollQuery(query: number): Promise<WasmResult>;
35
34
  cancelQuery(query: number): Promise<WasmResult>;
36
- releaseQuery(query: number): Promise<WasmResult>;
37
- releaseQueryWithInfo(query: number): Promise<WasmResult>;
35
+ finishQuery(query: number): Promise<WasmResult>;
38
36
  terminate(): Promise<void>;
39
37
  private request;
40
38
  private onMessage;