@query-farm/vgi 0.49.0 → 0.49.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": "@query-farm/vgi",
3
- "version": "0.49.0",
3
+ "version": "0.49.1",
4
4
  "description": "TypeScript framework for extending DuckDB with user-defined functions via the Vector Gateway Interface (VGI) over Arrow IPC.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Query Farm LLC (https://query.farm)",
@@ -93,12 +93,12 @@
93
93
  },
94
94
  "peerDependencies": {
95
95
  "@query-farm/apache-arrow": "^21.1.1",
96
- "@query-farm/vgi-rpc": "^0.29.6"
96
+ "@query-farm/vgi-rpc": "^0.29.7"
97
97
  },
98
98
  "devDependencies": {
99
99
  "@duckdb/node-api": "^1.5.5-r.4",
100
100
  "@query-farm/apache-arrow": "^21.1.1",
101
- "@query-farm/vgi-rpc": "^0.29.6",
101
+ "@query-farm/vgi-rpc": "^0.29.7",
102
102
  "@types/bun": "latest",
103
103
  "typescript": "^7.0.2"
104
104
  },
@@ -27,6 +27,11 @@ import { serializeColumnStatistics } from "../util/statistics.js";
27
27
  import { SCAN_PLANNING_BIND, SCAN_PLANNING_FILTERED, validateScanPlanning } from "./scan-planning.js";
28
28
  import type { VgiFunction } from "../functions/types.js";
29
29
  import type { FunctionRegistry } from "../functions/registry.js";
30
+
31
+ // Schema and view lookups may be overridden with async implementations, for a
32
+ // catalog that discovers them from a remote service; the dispatcher awaits
33
+ // them. (schemaContentsTables/tableGet are async already.)
34
+ type Awaitable<T> = T | Promise<T>;
30
35
  import { argumentSpecsToSchema } from "../arguments/argument-spec.js";
31
36
  import { serializeSchema, serializeBatch, emptyBatch, batchFromColumns } from "../util/arrow/index.js";
32
37
  import { resolveMetadata } from "../metadata/resolve.js";
@@ -330,7 +335,7 @@ export class ReadOnlyCatalogInterface extends CatalogInterface {
330
335
  return super.catalogContentsCacheable() && !this.perAttachItemIds;
331
336
  }
332
337
 
333
- schemas(attachOpaqueData: AttachOpaqueData, transactionOpaqueData?: TransactionOpaqueData): SchemaInfo[] {
338
+ schemas(attachOpaqueData: AttachOpaqueData, transactionOpaqueData?: TransactionOpaqueData): Awaitable<SchemaInfo[]> {
334
339
  return this._descriptor.schemas.map((s) => ({
335
340
  path: schemaDescriptorPath(s),
336
341
  comment: s.comment ?? null,
@@ -365,7 +370,7 @@ export class ReadOnlyCatalogInterface extends CatalogInterface {
365
370
  attachOpaqueData: AttachOpaqueData,
366
371
  path: string[],
367
372
  transactionOpaqueData?: TransactionOpaqueData
368
- ): SchemaInfo | null {
373
+ ): Awaitable<SchemaInfo | null> {
369
374
  const desc = this._descriptor.schemas.find((s) => schemaPathsEqual(schemaDescriptorPath(s), path));
370
375
  if (!desc) return null;
371
376
  return {
@@ -548,7 +553,7 @@ export class ReadOnlyCatalogInterface extends CatalogInterface {
548
553
  attachOpaqueData: AttachOpaqueData,
549
554
  path: string[],
550
555
  transactionOpaqueData?: TransactionOpaqueData
551
- ): ViewInfo[] {
556
+ ): Awaitable<ViewInfo[]> {
552
557
  const schema = this._descriptor.schemas.find((s) => schemaPathsEqual(schemaDescriptorPath(s), path));
553
558
  if (!schema || !schema.views) return [];
554
559
 
@@ -1011,13 +1016,13 @@ export class ReadOnlyCatalogInterface extends CatalogInterface {
1011
1016
  return tables.find((t) => t.name === name) ?? null;
1012
1017
  }
1013
1018
 
1014
- override viewGet(
1019
+ override async viewGet(
1015
1020
  attachOpaqueData: AttachOpaqueData,
1016
1021
  schemaPath: string[],
1017
1022
  name: string,
1018
1023
  transactionOpaqueData?: TransactionOpaqueData
1019
- ): ViewInfo | null {
1020
- const views = this.schemaContentsViews(attachOpaqueData, schemaPath, transactionOpaqueData);
1024
+ ): Promise<ViewInfo | null> {
1025
+ const views = await this.schemaContentsViews(attachOpaqueData, schemaPath, transactionOpaqueData);
1021
1026
  return views.find((v) => v.name === name) ?? null;
1022
1027
  }
1023
1028