@query-farm/vgi 0.23.0 → 0.24.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.
@@ -163,4 +163,22 @@ export interface CatalogDescriptor {
163
163
  * advertises a null `source_url`.
164
164
  */
165
165
  sourceUrl?: string;
166
+ /**
167
+ * Functions this catalog asks the client to *additionally* publish into its
168
+ * global (DuckDB `system.main`) function namespace, on top of the normal
169
+ * schema-qualified registration. Surfaced as IPC-serialized `FunctionInfo`
170
+ * records on `catalog_attach.global_functions`.
171
+ *
172
+ * Every entry must also be declared in exactly one of this catalog's
173
+ * schemas — the `FunctionInfo.schema_name` it carries is the bind-dispatch
174
+ * key, not a sentinel. Mirrors vgi-python's `Catalog.global_functions`.
175
+ */
176
+ globalFunctions?: VgiFunction[];
177
+ /**
178
+ * Prefix applied client-side to every `globalFunctions` entry's name when it
179
+ * is published globally (e.g. prefix `vgi_example` + `global_scalar` →
180
+ * `vgi_example_global_scalar`). The advertised `FunctionInfo.name` stays
181
+ * unprefixed. Surfaced as `catalog_attach.global_function_prefix`.
182
+ */
183
+ globalFunctionPrefix?: string;
166
184
  }
@@ -22,6 +22,26 @@ export declare class ReadOnlyCatalogInterface extends CatalogInterface {
22
22
  } | null;
23
23
  schemaContentsViews(attachOpaqueData: AttachOpaqueData, name: string, transactionOpaqueData?: TransactionOpaqueData): ViewInfo[];
24
24
  schemaContentsFunctions(attachOpaqueData: AttachOpaqueData, name: string, type: string, transactionOpaqueData?: TransactionOpaqueData): FunctionInfo[];
25
+ /**
26
+ * Build the wire `FunctionInfo` for one declared function.
27
+ *
28
+ * `schemaName` is the schema the function actually lives in — it is the
29
+ * bind-dispatch key, so a function advertised through more than one route
30
+ * (schema contents *and* `global_functions`) must carry the same value in
31
+ * both. Shared by `schemaContentsFunctions` and `_globalFunctionInfos`.
32
+ */
33
+ private _functionToInfo;
34
+ /**
35
+ * Build `FunctionInfo` records for `CatalogDescriptor.globalFunctions`.
36
+ *
37
+ * Each entry's `schema_name` is the schema it actually lives in — the
38
+ * globally visible name is derived client-side from
39
+ * `global_function_prefix`, so `name` stays unprefixed here. An entry not
40
+ * declared in any schema is a descriptor bug, so it throws rather than
41
+ * advertising a function no bind can resolve. Mirrors vgi-python's
42
+ * `_global_function_infos`.
43
+ */
44
+ private _globalFunctionInfos;
25
45
  schemaContentsMacros(attachOpaqueData: AttachOpaqueData, name: string, type: string, transactionOpaqueData?: TransactionOpaqueData): MacroInfo[];
26
46
  schemaContentsIndexes(attachOpaqueData: AttachOpaqueData, name: string, transactionOpaqueData?: TransactionOpaqueData): IndexInfo[];
27
47
  indexGet(attachOpaqueData: AttachOpaqueData, schemaName: string, name: string, transactionOpaqueData?: TransactionOpaqueData): IndexInfo | null;
@@ -2465,6 +2465,8 @@ var CatalogAttachResultSchema = schema2([
2465
2465
  field2("comment", utf82(), true),
2466
2466
  field2("tags", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), false),
2467
2467
  field2("supports_column_statistics", bool2(), false),
2468
+ field2("global_functions", list2(field2("item", binary2(), true)), false),
2469
+ field2("global_function_prefix", utf82(), false),
2468
2470
  field2("resolved_data_version", utf82(), true),
2469
2471
  field2("resolved_implementation_version", utf82(), true)
2470
2472
  ]);
@@ -3373,6 +3375,8 @@ class VgiClient {
3373
3375
  comment: inner.comment ?? null,
3374
3376
  tags: deserializeTags(inner.tags),
3375
3377
  supports_column_statistics: inner.supports_column_statistics ?? false,
3378
+ global_functions: inner.global_functions ? (Array.isArray(inner.global_functions) ? inner.global_functions : [...inner.global_functions]).map(toUint8Array) : [],
3379
+ global_function_prefix: inner.global_function_prefix ?? "",
3376
3380
  resolved_data_version: inner.resolved_data_version ?? null,
3377
3381
  resolved_implementation_version: inner.resolved_implementation_version ?? null
3378
3382
  };
@@ -3923,4 +3927,4 @@ export {
3923
3927
  ArgumentValidationError
3924
3928
  };
3925
3929
 
3926
- //# debugId=FCC2DEE998E0D9AC64756E2164756E21
3930
+ //# debugId=34D58DEB536066C064756E2164756E21