@query-farm/vgi 0.29.0 → 0.29.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/README.md +26 -1
- package/dist/arguments/argument-spec.d.ts +4 -2
- package/dist/catalog/composite.d.ts +13 -13
- package/dist/catalog/descriptors.d.ts +7 -3
- package/dist/catalog/interface.d.ts +67 -40
- package/dist/catalog/read-only.d.ts +32 -15
- package/dist/client/client.d.ts +36 -29
- package/dist/client/types.d.ts +2 -0
- package/dist/client-entry.d.ts +1 -1
- package/dist/client-entry.js +441 -279
- package/dist/client-entry.js.map +12 -11
- package/dist/filter-pushdown/capabilities.d.ts +3 -0
- package/dist/filter-pushdown/deserialize.d.ts +14 -15
- package/dist/filter-pushdown/evaluate.d.ts +14 -44
- package/dist/filter-pushdown/index.d.ts +2 -2
- package/dist/filter-pushdown/types.d.ts +120 -68
- package/dist/functions/aggregate.d.ts +4 -0
- package/dist/functions/registry.d.ts +5 -5
- package/dist/functions/scalar.d.ts +6 -1
- package/dist/functions/table-buffering.d.ts +9 -0
- package/dist/functions/table-in-out.d.ts +13 -0
- package/dist/functions/table.d.ts +9 -2
- package/dist/functions/types.d.ts +22 -2
- package/dist/generated/vgi-client.d.ts +56 -27
- package/dist/generated/vgi-protocol-schemas.d.ts +15 -0
- package/dist/http/fetch.d.ts +7 -1
- package/dist/index.core.d.ts +2 -1
- package/dist/index.js +2317 -1354
- package/dist/index.js.map +43 -40
- package/dist/metadata/types.d.ts +15 -2
- package/dist/protocol/handlers/shared.d.ts +3 -1
- package/dist/protocol/serializers/splits.d.ts +1 -1
- package/dist/protocol/types.d.ts +9 -3
- package/dist/schema-path.d.ts +7 -0
- package/dist/serve-entry.d.ts +22 -1
- package/dist/serve-entry.js +412 -238
- package/dist/serve-entry.js.map +27 -26
- package/dist/split-token.d.ts +1 -1
- package/dist/types.d.ts +8 -0
- package/dist/worker-cf-entry.js +2030 -1201
- package/dist/worker-cf-entry.js.map +40 -36
- package/dist/worker.d.ts +1 -1
- package/package.json +3 -3
- package/src/arguments/argument-spec.ts +12 -4
- package/src/catalog/composite.ts +26 -26
- package/src/catalog/descriptors.ts +12 -3
- package/src/catalog/interface.ts +98 -48
- package/src/catalog/read-only.ts +124 -67
- package/src/client/client.ts +92 -72
- package/src/client/types.ts +2 -0
- package/src/client-entry.ts +2 -1
- package/src/filter-pushdown/capabilities.ts +13 -0
- package/src/filter-pushdown/collector.ts +22 -35
- package/src/filter-pushdown/deserialize.ts +657 -221
- package/src/filter-pushdown/evaluate.ts +410 -499
- package/src/filter-pushdown/index.ts +16 -2
- package/src/filter-pushdown/types.ts +88 -71
- package/src/functions/aggregate.ts +9 -1
- package/src/functions/registry.ts +24 -22
- package/src/functions/scalar.ts +26 -0
- package/src/functions/table-buffering.ts +46 -7
- package/src/functions/table-in-out.ts +187 -30
- package/src/functions/table.ts +58 -20
- package/src/functions/types.ts +24 -1
- package/src/generated/vgi-client.ts +61 -29
- package/src/generated/vgi-protocol-schemas.ts +225 -54
- package/src/http/fetch.ts +12 -0
- package/src/index.core.ts +2 -0
- package/src/metadata/resolve.ts +43 -1
- package/src/metadata/serialize.ts +43 -5
- package/src/metadata/types.ts +17 -1
- package/src/protocol/dispatch.ts +1 -1
- package/src/protocol/handlers/aggregate.ts +13 -7
- package/src/protocol/handlers/catalog/admin.ts +6 -6
- package/src/protocol/handlers/catalog/index_methods.ts +2 -2
- package/src/protocol/handlers/catalog/macro.ts +4 -4
- package/src/protocol/handlers/catalog/shared.ts +2 -0
- package/src/protocol/handlers/catalog/table.ts +16 -16
- package/src/protocol/handlers/catalog/view.ts +5 -5
- package/src/protocol/handlers/function.ts +2 -2
- package/src/protocol/handlers/shared.ts +12 -3
- package/src/protocol/handlers/table-buffering.ts +4 -4
- package/src/protocol/serializers/bind.ts +15 -6
- package/src/protocol/serializers/splits.ts +4 -2
- package/src/protocol/types.ts +9 -3
- package/src/schema-path.ts +25 -0
- package/src/serve-entry.ts +65 -3
- package/src/split-token.ts +2 -2
- package/src/types.ts +9 -0
- package/src/worker.ts +49 -4
package/README.md
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/Query-farm/vgi-typescript/main/docs/vgi-logo.png" alt="Vector Gateway Interface logo" width="320">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">VGI for TypeScript</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
Add your own functions and tables to DuckDB with TypeScript and Apache Arrow.<br>
|
|
9
|
+
Built by <a href="https://query.farm">🚜 Query.Farm</a>
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
<p align="center">
|
|
13
|
+
<a href="https://github.com/Query-farm/vgi-typescript/actions/workflows/ci.yml"><img src="https://github.com/Query-farm/vgi-typescript/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
14
|
+
<a href="https://www.npmjs.com/package/@query-farm/vgi"><img src="https://img.shields.io/npm/v/%40query-farm%2Fvgi" alt="npm"></a>
|
|
15
|
+
<a href="https://www.npmjs.com/package/@query-farm/vgi"><img src="https://img.shields.io/npm/dm/%40query-farm%2Fvgi" alt="npm downloads"></a>
|
|
16
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-Query%20Farm%20Source--Available-blue" alt="License"></a>
|
|
17
|
+
</p>
|
|
2
18
|
|
|
3
19
|
TypeScript framework for extending [DuckDB](https://duckdb.org) with user-defined
|
|
4
20
|
functions written in TypeScript, served to DuckDB over the **Vector Gateway
|
|
@@ -95,6 +111,7 @@ const upperCase = defineScalarFunction({
|
|
|
95
111
|
},
|
|
96
112
|
|
|
97
113
|
// Other optional fields: constParams, nullHandling, stability (volatility),
|
|
114
|
+
// argumentMonotonicity,
|
|
98
115
|
// examples, categories, tags, requiredSettings, requiredSecrets, maxWorkers.
|
|
99
116
|
});
|
|
100
117
|
|
|
@@ -361,6 +378,11 @@ const addHour = defineScalarFunction({
|
|
|
361
378
|
});
|
|
362
379
|
```
|
|
363
380
|
|
|
381
|
+
`argumentMonotonicity` is optional and scalar-only. If supplied, it must have
|
|
382
|
+
one entry per ordered parameter declaration. Fixed, defaulted, and constant
|
|
383
|
+
parameters each use one slot; a vararg declaration uses one slot regardless of
|
|
384
|
+
call-time expansion. Named invocation order does not reorder the metadata.
|
|
385
|
+
|
|
364
386
|
```ts
|
|
365
387
|
import {
|
|
366
388
|
Worker, defineScalarFunction, timestampMicros,
|
|
@@ -549,6 +571,9 @@ Subpath exports:
|
|
|
549
571
|
- **`vgi-python`** — the reference implementation. This package is a wire-compatible
|
|
550
572
|
TypeScript port; workers from either side interoperate.
|
|
551
573
|
|
|
574
|
+
See [Iroh operations](docs/iroh.md) for native Node/Bun and browser clients,
|
|
575
|
+
and identity-preserving worker bridge setup.
|
|
576
|
+
|
|
552
577
|
## Development
|
|
553
578
|
|
|
554
579
|
```bash
|
|
@@ -55,9 +55,11 @@ export declare function formatRange(ge?: number, le?: number, gt?: number, lt?:
|
|
|
55
55
|
/**
|
|
56
56
|
* Encode raw {@link ArgumentConstraints} into the pre-computed constraint
|
|
57
57
|
* fields of an {@link ArgumentSpec} (presence-only — absent constraints yield
|
|
58
|
-
* no field).
|
|
58
|
+
* no field). `runtimeDefault`, when present, is authoritative for
|
|
59
|
+
* `defaultJson`, keeping runtime binding and discovery metadata in sync.
|
|
60
|
+
* Mirrors Python's `_constraint_kwargs`.
|
|
59
61
|
*/
|
|
60
|
-
export declare function constraintSpecFields(constraints: ArgumentConstraints | undefined): Pick<ArgumentSpec, "defaultJson" | "choicesJson" | "rangeNotation" | "pattern">;
|
|
62
|
+
export declare function constraintSpecFields(constraints: ArgumentConstraints | undefined, runtimeDefault?: unknown): Pick<ArgumentSpec, "defaultJson" | "choicesJson" | "rangeNotation" | "pattern">;
|
|
61
63
|
/**
|
|
62
64
|
* Narrow a bind-time argument value from Arrow's bigint to a plain number.
|
|
63
65
|
*
|
|
@@ -12,22 +12,22 @@ export declare class CompositeCatalogInterface extends CatalogInterface {
|
|
|
12
12
|
detach(attachOpaqueData: AttachOpaqueData): Promise<void>;
|
|
13
13
|
version(attachOpaqueData: AttachOpaqueData, transactionOpaqueData?: TransactionOpaqueData): Promise<number>;
|
|
14
14
|
schemas(attachOpaqueData: AttachOpaqueData, transactionOpaqueData?: TransactionOpaqueData): Promise<SchemaInfo[]>;
|
|
15
|
-
schemaGet(attachOpaqueData: AttachOpaqueData,
|
|
16
|
-
schemaContentsTables(attachOpaqueData: AttachOpaqueData,
|
|
17
|
-
schemaContentsViews(attachOpaqueData: AttachOpaqueData,
|
|
18
|
-
schemaContentsFunctions(attachOpaqueData: AttachOpaqueData,
|
|
19
|
-
schemaContentsMacros(attachOpaqueData: AttachOpaqueData,
|
|
20
|
-
schemaContentsIndexes(attachOpaqueData: AttachOpaqueData,
|
|
21
|
-
indexGet(attachOpaqueData: AttachOpaqueData,
|
|
22
|
-
tableGet(attachOpaqueData: AttachOpaqueData,
|
|
23
|
-
tableScanFunctionGet(attachOpaqueData: AttachOpaqueData,
|
|
24
|
-
tableScanBranchesGet(attachOpaqueData: AttachOpaqueData,
|
|
25
|
-
tableColumnStatisticsGet(attachOpaqueData: AttachOpaqueData,
|
|
15
|
+
schemaGet(attachOpaqueData: AttachOpaqueData, path: string[], transactionOpaqueData?: TransactionOpaqueData): Promise<SchemaInfo | null>;
|
|
16
|
+
schemaContentsTables(attachOpaqueData: AttachOpaqueData, path: string[], transactionOpaqueData?: TransactionOpaqueData): Promise<TableInfo[]>;
|
|
17
|
+
schemaContentsViews(attachOpaqueData: AttachOpaqueData, path: string[], transactionOpaqueData?: TransactionOpaqueData): Promise<ViewInfo[]>;
|
|
18
|
+
schemaContentsFunctions(attachOpaqueData: AttachOpaqueData, path: string[], type: string, transactionOpaqueData?: TransactionOpaqueData): Promise<FunctionInfo[]>;
|
|
19
|
+
schemaContentsMacros(attachOpaqueData: AttachOpaqueData, path: string[], type: string, transactionOpaqueData?: TransactionOpaqueData): Promise<MacroInfo[]>;
|
|
20
|
+
schemaContentsIndexes(attachOpaqueData: AttachOpaqueData, path: string[], transactionOpaqueData?: TransactionOpaqueData): Promise<IndexInfo[]>;
|
|
21
|
+
indexGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, transactionOpaqueData?: TransactionOpaqueData): Promise<IndexInfo | null>;
|
|
22
|
+
tableGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, atUnit?: string, atValue?: string, transactionOpaqueData?: TransactionOpaqueData): Promise<TableInfo | null>;
|
|
23
|
+
tableScanFunctionGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, atUnit?: string, atValue?: string, transactionOpaqueData?: TransactionOpaqueData): Promise<any>;
|
|
24
|
+
tableScanBranchesGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, atUnit?: string, atValue?: string, transactionOpaqueData?: TransactionOpaqueData): Promise<any>;
|
|
25
|
+
tableColumnStatisticsGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, transactionOpaqueData?: TransactionOpaqueData): Promise<{
|
|
26
26
|
bytes: Uint8Array;
|
|
27
27
|
cacheMaxAgeSeconds: number | null;
|
|
28
28
|
} | null>;
|
|
29
|
-
viewGet(attachOpaqueData: AttachOpaqueData,
|
|
30
|
-
macroGet(attachOpaqueData: AttachOpaqueData,
|
|
29
|
+
viewGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, transactionOpaqueData?: TransactionOpaqueData): Promise<ViewInfo | null>;
|
|
30
|
+
macroGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, transactionOpaqueData?: TransactionOpaqueData): Promise<MacroInfo | null>;
|
|
31
31
|
copyFromFormats(attachOpaqueData: AttachOpaqueData, transactionOpaqueData?: TransactionOpaqueData): Promise<CopyFromFormatInfo[]>;
|
|
32
32
|
transactionBegin(attachOpaqueData: AttachOpaqueData): Promise<Uint8Array | null>;
|
|
33
33
|
transactionCommit(attachOpaqueData: AttachOpaqueData, transactionOpaqueData: TransactionOpaqueData): Promise<void>;
|
|
@@ -14,7 +14,7 @@ export interface ForeignKeyDef {
|
|
|
14
14
|
columns: string[];
|
|
15
15
|
referencedTable: string;
|
|
16
16
|
referencedColumns: string[];
|
|
17
|
-
|
|
17
|
+
referencedSchemaPath?: string[];
|
|
18
18
|
}
|
|
19
19
|
export type DefaultValue = string | number | boolean | null;
|
|
20
20
|
export interface TableDescriptor {
|
|
@@ -129,7 +129,10 @@ export interface IndexDescriptor {
|
|
|
129
129
|
tags?: Record<string, string>;
|
|
130
130
|
}
|
|
131
131
|
export interface SchemaDescriptor {
|
|
132
|
-
|
|
132
|
+
/** Raw identifier components, from the catalog root to this schema. */
|
|
133
|
+
path?: string[];
|
|
134
|
+
/** @deprecated Protocol 1.x compatibility; prefer `path: [name]`. */
|
|
135
|
+
name?: string;
|
|
133
136
|
tables?: TableDescriptor[];
|
|
134
137
|
views?: ViewDescriptor[];
|
|
135
138
|
macros?: MacroDescriptor[];
|
|
@@ -138,6 +141,7 @@ export interface SchemaDescriptor {
|
|
|
138
141
|
comment?: string;
|
|
139
142
|
tags?: Record<string, string>;
|
|
140
143
|
}
|
|
144
|
+
export declare function schemaDescriptorPath(schema: SchemaDescriptor): string[];
|
|
141
145
|
export interface SecretTypeDescriptor {
|
|
142
146
|
name: string;
|
|
143
147
|
description: string;
|
|
@@ -170,7 +174,7 @@ export interface CatalogDescriptor {
|
|
|
170
174
|
* records on `catalog_attach.global_functions`.
|
|
171
175
|
*
|
|
172
176
|
* Every entry must also be declared in exactly one of this catalog's
|
|
173
|
-
* schemas — the `FunctionInfo.
|
|
177
|
+
* schemas — the `FunctionInfo.schema_path` it carries is the bind-dispatch
|
|
174
178
|
* key, not a sentinel. Mirrors vgi-python's `Catalog.global_functions`.
|
|
175
179
|
*/
|
|
176
180
|
globalFunctions?: VgiFunction[];
|
|
@@ -95,10 +95,19 @@ export interface ScanFunctionResult {
|
|
|
95
95
|
namedArguments: Record<string, unknown>;
|
|
96
96
|
/** DuckDB extensions to load before calling the function. */
|
|
97
97
|
requiredExtensions: string[];
|
|
98
|
+
/**
|
|
99
|
+
* Catalog schema path `functionName` is registered in (protocol 2.0.0). A function
|
|
100
|
+
* name is unique only within a schema, so a client that doesn't know this
|
|
101
|
+
* cannot tell which implementation a colliding name refers to — set it
|
|
102
|
+
* whenever the resolving code already knows the schema. `null` for a
|
|
103
|
+
* pre-1.5.0 peer, or when the resolved function is a native DuckDB function
|
|
104
|
+
* with no VGI-side schema of its own (e.g. `read_parquet`).
|
|
105
|
+
*/
|
|
106
|
+
schemaPath: string[] | null;
|
|
98
107
|
}
|
|
99
108
|
/**
|
|
100
109
|
* Encode a ScanFunctionResult wire record — the single-row batch shape
|
|
101
|
-
* `{ function_name, arguments, required_extensions }` that
|
|
110
|
+
* `{ function_name, arguments, required_extensions, schema_path }` that
|
|
102
111
|
* `catalog_table_scan_function_get` returns and that a function-backed table
|
|
103
112
|
* inlines into `TableInfo.scan_function`.
|
|
104
113
|
*
|
|
@@ -109,15 +118,19 @@ export interface ScanFunctionResult {
|
|
|
109
118
|
*
|
|
110
119
|
* `argumentsBytes` is the already-serialized inner arguments batch (one column
|
|
111
120
|
* per argument: `arg_<index>` positional, bare name for named).
|
|
121
|
+
*
|
|
122
|
+
* `schemaPath` (protocol 2.0.0) identifies the schema that registers `functionName`;
|
|
123
|
+
* leave it null when the caller has no VGI-side schema to report.
|
|
112
124
|
*/
|
|
113
|
-
export declare function encodeScanFunctionResult(functionName: string, argumentsBytes: Uint8Array, requiredExtensions?: string[]): Uint8Array;
|
|
125
|
+
export declare function encodeScanFunctionResult(functionName: string, argumentsBytes: Uint8Array, requiredExtensions?: string[], schemaPath?: string[] | null): Uint8Array;
|
|
114
126
|
/**
|
|
115
127
|
* Decode a ScanFunctionResult from a wire-shape inner result dict.
|
|
116
128
|
*
|
|
117
129
|
* The wire shape (per ScanFunctionResultSchema) is
|
|
118
|
-
* `{ function_name: utf8, arguments: binary, required_extensions: list<utf8
|
|
119
|
-
* where `arguments` is a serialized single-row batch
|
|
120
|
-
* argument: `arg_<index>` for positional args, the bare
|
|
130
|
+
* `{ function_name: utf8, arguments: binary, required_extensions: list<utf8>,
|
|
131
|
+
* schema_path: list<utf8>? }`, where `arguments` is a serialized single-row batch
|
|
132
|
+
* with one column per argument: `arg_<index>` for positional args, the bare
|
|
133
|
+
* name for named args.
|
|
121
134
|
*/
|
|
122
135
|
export declare function decodeScanFunctionResult(inner: Record<string, unknown>): ScanFunctionResult;
|
|
123
136
|
/**
|
|
@@ -134,6 +147,7 @@ export declare function singleBranchResult(legacy: {
|
|
|
134
147
|
function_name: string;
|
|
135
148
|
arguments: unknown;
|
|
136
149
|
required_extensions?: string[];
|
|
150
|
+
schema_path?: string[] | null;
|
|
137
151
|
}): {
|
|
138
152
|
branches: Uint8Array[];
|
|
139
153
|
required_extensions: string[];
|
|
@@ -177,12 +191,25 @@ export interface ScanBranchInput {
|
|
|
177
191
|
/**
|
|
178
192
|
* Catalog-table branch (lakehouse federation): leave `functionName` empty and
|
|
179
193
|
* set these to scan the base table
|
|
180
|
-
* `sourceCatalog.
|
|
194
|
+
* `sourceCatalog.sourceSchemaPath.sourceTable` in a companion catalog instead of
|
|
181
195
|
* calling a table function.
|
|
182
196
|
*/
|
|
183
197
|
sourceCatalog?: string | null;
|
|
184
|
-
|
|
198
|
+
sourceSchemaPath?: string[] | null;
|
|
185
199
|
sourceTable?: string | null;
|
|
200
|
+
/**
|
|
201
|
+
* Function branch only — the catalog schema that registers `functionName`
|
|
202
|
+
* (protocol 2.0.0). Without it a client has to guess (the table's own
|
|
203
|
+
* schema, then the catalog's default schema) which implementation
|
|
204
|
+
* `functionName` refers to when the same name is registered in more than
|
|
205
|
+
* one schema. Leave unset for a catalog-table or FORMAT branch, and for a
|
|
206
|
+
* branch that delegates straight to a native DuckDB function
|
|
207
|
+
* (`read_parquet`, `read_csv_auto`, `iceberg_scan`, …) — neither has a
|
|
208
|
+
* VGI-side schema of its own to report, which is why the field is optional
|
|
209
|
+
* rather than required. Not to be confused with `sourceSchemaPath` above, which
|
|
210
|
+
* names a catalog-table branch's *source table's* schema.
|
|
211
|
+
*/
|
|
212
|
+
schemaPath?: string[] | null;
|
|
186
213
|
}
|
|
187
214
|
/**
|
|
188
215
|
* Serialize a single branch's arguments to the nested-IPC form `ScanBranch`
|
|
@@ -256,23 +283,23 @@ export declare abstract class CatalogInterface {
|
|
|
256
283
|
abstract schemas(attachOpaqueData: AttachOpaqueData, transactionOpaqueData?: TransactionOpaqueData): Awaitable<SchemaInfo[]>;
|
|
257
284
|
create(name: string, onConflict: string, options?: any): Awaitable<void>;
|
|
258
285
|
drop(name: string): Awaitable<void>;
|
|
259
|
-
schemaGet(attachOpaqueData: AttachOpaqueData,
|
|
260
|
-
schemaCreate(attachOpaqueData: AttachOpaqueData,
|
|
261
|
-
schemaDrop(attachOpaqueData: AttachOpaqueData,
|
|
262
|
-
schemaContentsTables(attachOpaqueData: AttachOpaqueData,
|
|
263
|
-
schemaContentsViews(attachOpaqueData: AttachOpaqueData,
|
|
264
|
-
schemaContentsFunctions(attachOpaqueData: AttachOpaqueData,
|
|
265
|
-
tableGet(attachOpaqueData: AttachOpaqueData,
|
|
266
|
-
tableCreate(attachOpaqueData: AttachOpaqueData,
|
|
267
|
-
tableDrop(attachOpaqueData: AttachOpaqueData,
|
|
268
|
-
tableScanFunctionGet(attachOpaqueData: AttachOpaqueData,
|
|
286
|
+
schemaGet(attachOpaqueData: AttachOpaqueData, path: string[], transactionOpaqueData?: TransactionOpaqueData): Awaitable<SchemaInfo | null>;
|
|
287
|
+
schemaCreate(attachOpaqueData: AttachOpaqueData, path: string[], comment?: string | null, tags?: any, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
288
|
+
schemaDrop(attachOpaqueData: AttachOpaqueData, path: string[], ignoreNotFound?: boolean, cascade?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
289
|
+
schemaContentsTables(attachOpaqueData: AttachOpaqueData, path: string[], transactionOpaqueData?: TransactionOpaqueData): Awaitable<TableInfo[]>;
|
|
290
|
+
schemaContentsViews(attachOpaqueData: AttachOpaqueData, path: string[], transactionOpaqueData?: TransactionOpaqueData): Awaitable<ViewInfo[]>;
|
|
291
|
+
schemaContentsFunctions(attachOpaqueData: AttachOpaqueData, path: string[], type: string, transactionOpaqueData?: TransactionOpaqueData): Awaitable<FunctionInfo[]>;
|
|
292
|
+
tableGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, atUnit?: string, atValue?: string, transactionOpaqueData?: TransactionOpaqueData): Awaitable<TableInfo | null>;
|
|
293
|
+
tableCreate(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, columns: Uint8Array, onConflict: string, notNullConstraints?: number[], uniqueConstraints?: number[][], checkConstraints?: string[], transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
294
|
+
tableDrop(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
295
|
+
tableScanFunctionGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, atUnit?: string, atValue?: string, transactionOpaqueData?: TransactionOpaqueData): Awaitable<any>;
|
|
269
296
|
/**
|
|
270
297
|
* Return the scan branches for a (possibly multi-source) table. Default
|
|
271
298
|
* delegates to `tableScanFunctionGet` and wraps the single result as a
|
|
272
299
|
* one-branch list, so every single-source catalog is compatible with the
|
|
273
300
|
* branches-aware C++ extension. Override for genuine multi-source tables.
|
|
274
301
|
*/
|
|
275
|
-
tableScanBranchesGet(attachOpaqueData: AttachOpaqueData,
|
|
302
|
+
tableScanBranchesGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, atUnit?: string, atValue?: string, transactionOpaqueData?: TransactionOpaqueData): Awaitable<any>;
|
|
276
303
|
/**
|
|
277
304
|
* Return serialized column statistics for a table, or null if none are
|
|
278
305
|
* available. The result is the IPC bytes of a ColumnStatistics RecordBatch
|
|
@@ -281,27 +308,27 @@ export declare abstract class CatalogInterface {
|
|
|
281
308
|
* descriptor. Returning null signals "no stats" so DuckDB falls back to
|
|
282
309
|
* the function-level `table_function_statistics` path.
|
|
283
310
|
*/
|
|
284
|
-
tableColumnStatisticsGet(attachOpaqueData: AttachOpaqueData,
|
|
311
|
+
tableColumnStatisticsGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, transactionOpaqueData?: TransactionOpaqueData): Awaitable<{
|
|
285
312
|
bytes: Uint8Array;
|
|
286
313
|
cacheMaxAgeSeconds: number | null;
|
|
287
314
|
} | null>;
|
|
288
|
-
tableCommentSet(attachOpaqueData: AttachOpaqueData,
|
|
289
|
-
tableRename(attachOpaqueData: AttachOpaqueData,
|
|
290
|
-
tableColumnAdd(attachOpaqueData: AttachOpaqueData,
|
|
291
|
-
tableColumnDrop(attachOpaqueData: AttachOpaqueData,
|
|
292
|
-
tableColumnRename(attachOpaqueData: AttachOpaqueData,
|
|
293
|
-
tableColumnDefaultSet(attachOpaqueData: AttachOpaqueData,
|
|
294
|
-
tableColumnDefaultDrop(attachOpaqueData: AttachOpaqueData,
|
|
295
|
-
tableColumnTypeChange(attachOpaqueData: AttachOpaqueData,
|
|
296
|
-
tableNotNullSet(attachOpaqueData: AttachOpaqueData,
|
|
297
|
-
tableNotNullDrop(attachOpaqueData: AttachOpaqueData,
|
|
298
|
-
viewGet(attachOpaqueData: AttachOpaqueData,
|
|
299
|
-
viewCreate(attachOpaqueData: AttachOpaqueData,
|
|
300
|
-
viewDrop(attachOpaqueData: AttachOpaqueData,
|
|
301
|
-
viewRename(attachOpaqueData: AttachOpaqueData,
|
|
302
|
-
viewCommentSet(attachOpaqueData: AttachOpaqueData,
|
|
303
|
-
macroGet(attachOpaqueData: AttachOpaqueData,
|
|
304
|
-
macroCreate(attachOpaqueData: AttachOpaqueData,
|
|
315
|
+
tableCommentSet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, comment?: string | null, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
316
|
+
tableRename(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, newName: string, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
317
|
+
tableColumnAdd(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, columnName: string, columnType: string, defaultValue?: string, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
318
|
+
tableColumnDrop(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, columnName: string, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
319
|
+
tableColumnRename(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, columnName: string, newName: string, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
320
|
+
tableColumnDefaultSet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, columnName: string, defaultValue: string, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
321
|
+
tableColumnDefaultDrop(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, columnName: string, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
322
|
+
tableColumnTypeChange(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, columnName: string, newType: string, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
323
|
+
tableNotNullSet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, columnName: string, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
324
|
+
tableNotNullDrop(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, columnName: string, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
325
|
+
viewGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, transactionOpaqueData?: TransactionOpaqueData): Awaitable<ViewInfo | null>;
|
|
326
|
+
viewCreate(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, definition: string, onConflict: string, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
327
|
+
viewDrop(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
328
|
+
viewRename(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, newName: string, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
329
|
+
viewCommentSet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, comment?: string | null, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
330
|
+
macroGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, transactionOpaqueData?: TransactionOpaqueData): Awaitable<MacroInfo | null>;
|
|
331
|
+
macroCreate(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, macroType: MacroType, parameters: string[], definition: string, onConflict: string, parameterDefaultValues?: Uint8Array | null,
|
|
305
332
|
/**
|
|
306
333
|
* Optional Arrow schema (one nullable field per parameter, in `parameters`
|
|
307
334
|
* order) serialized as IPC bytes, carrying per-parameter descriptions via the
|
|
@@ -309,10 +336,10 @@ export declare abstract class CatalogInterface {
|
|
|
309
336
|
* supplied. Build with `macroArgumentsSchema` + `serializeSchema`.
|
|
310
337
|
*/
|
|
311
338
|
argumentsSchema?: Uint8Array | null, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
312
|
-
macroDrop(attachOpaqueData: AttachOpaqueData,
|
|
313
|
-
schemaContentsMacros(attachOpaqueData: AttachOpaqueData,
|
|
314
|
-
schemaContentsIndexes(attachOpaqueData: AttachOpaqueData,
|
|
315
|
-
indexGet(attachOpaqueData: AttachOpaqueData,
|
|
339
|
+
macroDrop(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
340
|
+
schemaContentsMacros(attachOpaqueData: AttachOpaqueData, path: string[], type: string, transactionOpaqueData?: TransactionOpaqueData): Awaitable<MacroInfo[]>;
|
|
341
|
+
schemaContentsIndexes(attachOpaqueData: AttachOpaqueData, path: string[], transactionOpaqueData?: TransactionOpaqueData): Awaitable<IndexInfo[]>;
|
|
342
|
+
indexGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, transactionOpaqueData?: TransactionOpaqueData): Awaitable<IndexInfo | null>;
|
|
316
343
|
/**
|
|
317
344
|
* List custom `COPY ... FROM` formats advertised by this catalog. Catalog-level
|
|
318
345
|
* (not schema-scoped). The default returns an empty list, so catalogs that
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CatalogInterface, type AttachOpaqueData, type TransactionOpaqueData, type CatalogAttachResult, type SchemaInfo, type CatalogInfo, type TableInfo, type ViewInfo, type FunctionInfo, type MacroInfo, type IndexInfo, type CopyFromFormatInfo } from "./interface.js";
|
|
2
|
-
import type
|
|
2
|
+
import { type CatalogDescriptor } from "./descriptors.js";
|
|
3
3
|
import type { FunctionRegistry } from "../functions/registry.js";
|
|
4
4
|
import { type AttachOptionSpec } from "./attach-option.js";
|
|
5
5
|
export declare class ReadOnlyCatalogInterface extends CatalogInterface {
|
|
@@ -8,6 +8,23 @@ export declare class ReadOnlyCatalogInterface extends CatalogInterface {
|
|
|
8
8
|
private _attachments;
|
|
9
9
|
private _version;
|
|
10
10
|
constructor(descriptor: CatalogDescriptor, registry: FunctionRegistry);
|
|
11
|
+
/**
|
|
12
|
+
* Which schema declares `fn`, by object identity, or null if no schema does.
|
|
13
|
+
*
|
|
14
|
+
* A table's backing function is NOT necessarily declared in the table's own
|
|
15
|
+
* schema — `data.large_sequence` scans via `sequence`, which the example
|
|
16
|
+
* catalog declares in `main`. Populating `ScanFunctionResult.schemaPath` /
|
|
17
|
+
* `ScanBranch.schemaPath` (protocol 2.0.0) correctly needs this reverse
|
|
18
|
+
* lookup, not the `schemaPath` parameter of the call being served.
|
|
19
|
+
*
|
|
20
|
+
* Identity, not name: the whole point of the field is to disambiguate one
|
|
21
|
+
* name declared in several schemas, so a name match would answer the very
|
|
22
|
+
* question being asked. Null when the function is deliberately unadvertised
|
|
23
|
+
* (`cache_multicol`) — it has no schema to report and the client falls back
|
|
24
|
+
* to its own heuristic, which is exactly the pre-1.5.0 behaviour.
|
|
25
|
+
* Mirrors vgi-python's `ReadOnlyCatalogInterface._schema_for_function`.
|
|
26
|
+
*/
|
|
27
|
+
private _schemaForFunction;
|
|
11
28
|
catalogs(): string[];
|
|
12
29
|
/**
|
|
13
30
|
* Attach-time options this catalog declares, for the named catalog.
|
|
@@ -25,18 +42,18 @@ export declare class ReadOnlyCatalogInterface extends CatalogInterface {
|
|
|
25
42
|
version(attachOpaqueData: AttachOpaqueData, transactionOpaqueData?: TransactionOpaqueData): number | Promise<number>;
|
|
26
43
|
schemas(attachOpaqueData: AttachOpaqueData, transactionOpaqueData?: TransactionOpaqueData): SchemaInfo[];
|
|
27
44
|
private _estimatedObjectCount;
|
|
28
|
-
schemaGet(attachOpaqueData: AttachOpaqueData,
|
|
29
|
-
schemaContentsTables(attachOpaqueData: AttachOpaqueData,
|
|
30
|
-
tableColumnStatisticsGet(attachOpaqueData: AttachOpaqueData,
|
|
45
|
+
schemaGet(attachOpaqueData: AttachOpaqueData, path: string[], transactionOpaqueData?: TransactionOpaqueData): SchemaInfo | null;
|
|
46
|
+
schemaContentsTables(attachOpaqueData: AttachOpaqueData, path: string[], transactionOpaqueData?: TransactionOpaqueData): Promise<TableInfo[]>;
|
|
47
|
+
tableColumnStatisticsGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, transactionOpaqueData?: TransactionOpaqueData): {
|
|
31
48
|
bytes: Uint8Array;
|
|
32
49
|
cacheMaxAgeSeconds: number | null;
|
|
33
50
|
} | null;
|
|
34
|
-
schemaContentsViews(attachOpaqueData: AttachOpaqueData,
|
|
35
|
-
schemaContentsFunctions(attachOpaqueData: AttachOpaqueData,
|
|
51
|
+
schemaContentsViews(attachOpaqueData: AttachOpaqueData, path: string[], transactionOpaqueData?: TransactionOpaqueData): ViewInfo[];
|
|
52
|
+
schemaContentsFunctions(attachOpaqueData: AttachOpaqueData, path: string[], type: string, transactionOpaqueData?: TransactionOpaqueData): FunctionInfo[];
|
|
36
53
|
/**
|
|
37
54
|
* Build the wire `FunctionInfo` for one declared function.
|
|
38
55
|
*
|
|
39
|
-
* `
|
|
56
|
+
* `schemaPath` is the schema the function actually lives in — it is the
|
|
40
57
|
* bind-dispatch key, so a function advertised through more than one route
|
|
41
58
|
* (schema contents *and* `global_functions`) must carry the same value in
|
|
42
59
|
* both. Shared by `schemaContentsFunctions` and `_globalFunctionInfos`.
|
|
@@ -45,7 +62,7 @@ export declare class ReadOnlyCatalogInterface extends CatalogInterface {
|
|
|
45
62
|
/**
|
|
46
63
|
* Build `FunctionInfo` records for `CatalogDescriptor.globalFunctions`.
|
|
47
64
|
*
|
|
48
|
-
* Each entry's `
|
|
65
|
+
* Each entry's `schema_path` is the schema it actually lives in — the
|
|
49
66
|
* globally visible name is derived client-side from
|
|
50
67
|
* `global_function_prefix`, so `name` stays unprefixed here. An entry not
|
|
51
68
|
* declared in any schema is a descriptor bug, so it throws rather than
|
|
@@ -53,12 +70,12 @@ export declare class ReadOnlyCatalogInterface extends CatalogInterface {
|
|
|
53
70
|
* `_global_function_infos`.
|
|
54
71
|
*/
|
|
55
72
|
private _globalFunctionInfos;
|
|
56
|
-
schemaContentsMacros(attachOpaqueData: AttachOpaqueData,
|
|
57
|
-
schemaContentsIndexes(attachOpaqueData: AttachOpaqueData,
|
|
58
|
-
indexGet(attachOpaqueData: AttachOpaqueData,
|
|
59
|
-
macroGet(attachOpaqueData: AttachOpaqueData,
|
|
60
|
-
tableScanFunctionGet(attachOpaqueData: AttachOpaqueData,
|
|
61
|
-
tableGet(attachOpaqueData: AttachOpaqueData,
|
|
62
|
-
viewGet(attachOpaqueData: AttachOpaqueData,
|
|
73
|
+
schemaContentsMacros(attachOpaqueData: AttachOpaqueData, path: string[], type: string, transactionOpaqueData?: TransactionOpaqueData): MacroInfo[];
|
|
74
|
+
schemaContentsIndexes(attachOpaqueData: AttachOpaqueData, path: string[], transactionOpaqueData?: TransactionOpaqueData): IndexInfo[];
|
|
75
|
+
indexGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, transactionOpaqueData?: TransactionOpaqueData): IndexInfo | null;
|
|
76
|
+
macroGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, transactionOpaqueData?: TransactionOpaqueData): MacroInfo | null;
|
|
77
|
+
tableScanFunctionGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, atUnit?: string, atValue?: string, transactionOpaqueData?: TransactionOpaqueData): any;
|
|
78
|
+
tableGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, atUnit?: string, atValue?: string, transactionOpaqueData?: TransactionOpaqueData): Promise<TableInfo | null>;
|
|
79
|
+
viewGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, transactionOpaqueData?: TransactionOpaqueData): ViewInfo | null;
|
|
63
80
|
copyFromFormats(attachOpaqueData: AttachOpaqueData, transactionOpaqueData?: TransactionOpaqueData): CopyFromFormatInfo[];
|
|
64
81
|
}
|
package/dist/client/client.d.ts
CHANGED
|
@@ -37,6 +37,13 @@ export declare class VgiClient {
|
|
|
37
37
|
* attached catalogs.
|
|
38
38
|
*/
|
|
39
39
|
constructor(rpc: RpcClient, options?: VgiClientOptions);
|
|
40
|
+
/**
|
|
41
|
+
* Connect the high-level client to a canonical `iroh://` or `httpi://`
|
|
42
|
+
* endpoint. Native Node/Bun connectors are selected from the URI scheme.
|
|
43
|
+
* Browser callers may inject the connector exported by the browser Iroh
|
|
44
|
+
* package without changing the VGI client API.
|
|
45
|
+
*/
|
|
46
|
+
static fromIroh(endpoint: string, options?: Record<string, unknown>, clientOptions?: VgiClientOptions, connector?: (endpoint: string, options: Record<string, unknown>) => Promise<RpcClient>): Promise<VgiClient>;
|
|
40
47
|
private _doBind;
|
|
41
48
|
private _doInit;
|
|
42
49
|
/** Call a table function, yielding output as RecordBatch instances. */
|
|
@@ -112,48 +119,48 @@ export declare class VgiClient {
|
|
|
112
119
|
/** List schemas in an attached catalog. */
|
|
113
120
|
schemas(attachOpaqueData: AttachOpaqueData, transactionOpaqueData?: TransactionOpaqueData): Promise<SchemaInfo[]>;
|
|
114
121
|
/** Get a schema by name, or null if not found. */
|
|
115
|
-
schemaGet(attachOpaqueData: AttachOpaqueData,
|
|
122
|
+
schemaGet(attachOpaqueData: AttachOpaqueData, path: string[] | string, transactionOpaqueData?: TransactionOpaqueData): Promise<SchemaInfo | null>;
|
|
116
123
|
/** Create a new schema. */
|
|
117
|
-
schemaCreate(attachOpaqueData: AttachOpaqueData,
|
|
124
|
+
schemaCreate(attachOpaqueData: AttachOpaqueData, path: string[] | string, opts?: {
|
|
118
125
|
onConflict?: OnCreateConflict;
|
|
119
126
|
comment?: string | null;
|
|
120
127
|
tags?: Record<string, string> | null;
|
|
121
128
|
transactionOpaqueData?: TransactionOpaqueData;
|
|
122
129
|
}): Promise<void>;
|
|
123
130
|
/** Drop a schema by name. */
|
|
124
|
-
schemaDrop(attachOpaqueData: AttachOpaqueData,
|
|
131
|
+
schemaDrop(attachOpaqueData: AttachOpaqueData, path: string[] | string, ignoreNotFound?: boolean, cascade?: boolean, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
125
132
|
/** List tables in a schema. */
|
|
126
|
-
schemaContentsTables(attachOpaqueData: AttachOpaqueData,
|
|
133
|
+
schemaContentsTables(attachOpaqueData: AttachOpaqueData, path: string[] | string, transactionOpaqueData?: TransactionOpaqueData): Promise<TableInfo[]>;
|
|
127
134
|
/** List views in a schema. */
|
|
128
|
-
schemaContentsViews(attachOpaqueData: AttachOpaqueData,
|
|
135
|
+
schemaContentsViews(attachOpaqueData: AttachOpaqueData, path: string[] | string, transactionOpaqueData?: TransactionOpaqueData): Promise<ViewInfo[]>;
|
|
129
136
|
/** List functions in a schema, filtered by type. */
|
|
130
|
-
schemaContentsFunctions(attachOpaqueData: AttachOpaqueData,
|
|
137
|
+
schemaContentsFunctions(attachOpaqueData: AttachOpaqueData, path: string[] | string, type: CatalogFunctionType, transactionOpaqueData?: TransactionOpaqueData): Promise<FunctionInfo[]>;
|
|
131
138
|
/** Get a table by name, or null if not found. */
|
|
132
|
-
tableGet(attachOpaqueData: AttachOpaqueData,
|
|
139
|
+
tableGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, transactionOpaqueData?: TransactionOpaqueData): Promise<TableInfo | null>;
|
|
133
140
|
/** Create a new table. */
|
|
134
|
-
tableCreate(attachOpaqueData: AttachOpaqueData,
|
|
141
|
+
tableCreate(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, columns: Uint8Array, onConflict: OnCreateConflict, notNullConstraints?: number[], uniqueConstraints?: number[][], checkConstraints?: string[], transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
135
142
|
/** Drop a table by name. */
|
|
136
|
-
tableDrop(attachOpaqueData: AttachOpaqueData,
|
|
143
|
+
tableDrop(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, ignoreNotFound?: boolean, cascade?: boolean, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
137
144
|
/**
|
|
138
145
|
* Get the scan function for a table — tells DuckDB which function to call
|
|
139
146
|
* to read the table data (e.g. `read_parquet` with a path argument). Used
|
|
140
147
|
* by the VGI extension during query planning.
|
|
141
148
|
*/
|
|
142
|
-
tableScanFunctionGet(attachOpaqueData: AttachOpaqueData,
|
|
149
|
+
tableScanFunctionGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, atUnit?: string | null, atValue?: string | null, transactionOpaqueData?: TransactionOpaqueData): Promise<ScanFunctionResult>;
|
|
143
150
|
/** Set or clear the comment on a table. */
|
|
144
|
-
tableCommentSet(attachOpaqueData: AttachOpaqueData,
|
|
151
|
+
tableCommentSet(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, comment?: string | null, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
145
152
|
/** Rename a table. */
|
|
146
|
-
tableRename(attachOpaqueData: AttachOpaqueData,
|
|
153
|
+
tableRename(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, newName: string, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
147
154
|
/** Add a column to a table. */
|
|
148
|
-
tableColumnAdd(attachOpaqueData: AttachOpaqueData,
|
|
155
|
+
tableColumnAdd(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, columnName: string, columnType: string, defaultValue?: string | null, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
149
156
|
/** Drop a column from a table. */
|
|
150
|
-
tableColumnDrop(attachOpaqueData: AttachOpaqueData,
|
|
157
|
+
tableColumnDrop(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, columnName: string, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
151
158
|
/** Rename a column in a table. */
|
|
152
|
-
tableColumnRename(attachOpaqueData: AttachOpaqueData,
|
|
159
|
+
tableColumnRename(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, columnName: string, newName: string, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
153
160
|
/** Set the default value for a column. */
|
|
154
|
-
tableColumnDefaultSet(attachOpaqueData: AttachOpaqueData,
|
|
161
|
+
tableColumnDefaultSet(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, columnName: string, defaultValue: string, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
155
162
|
/** Remove the default value from a column. */
|
|
156
|
-
tableColumnDefaultDrop(attachOpaqueData: AttachOpaqueData,
|
|
163
|
+
tableColumnDefaultDrop(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, columnName: string, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
157
164
|
/**
|
|
158
165
|
* Change the type of a column.
|
|
159
166
|
*
|
|
@@ -161,29 +168,29 @@ export declare class VgiClient {
|
|
|
161
168
|
* name identifies the target column and whose type is the new column type.
|
|
162
169
|
* `expression` is an optional SQL expression used to convert existing values.
|
|
163
170
|
*/
|
|
164
|
-
tableColumnTypeChange(attachOpaqueData: AttachOpaqueData,
|
|
171
|
+
tableColumnTypeChange(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, columnDefinition: Uint8Array, expression?: string | null, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
165
172
|
/** Set a NOT NULL constraint on a column. */
|
|
166
|
-
tableNotNullSet(attachOpaqueData: AttachOpaqueData,
|
|
173
|
+
tableNotNullSet(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, columnName: string, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
167
174
|
/** Remove a NOT NULL constraint from a column. */
|
|
168
|
-
tableNotNullDrop(attachOpaqueData: AttachOpaqueData,
|
|
175
|
+
tableNotNullDrop(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, columnName: string, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
169
176
|
/** Get a view by name, or null if not found. */
|
|
170
|
-
viewGet(attachOpaqueData: AttachOpaqueData,
|
|
177
|
+
viewGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, transactionOpaqueData?: TransactionOpaqueData): Promise<ViewInfo | null>;
|
|
171
178
|
/** Create a new view. */
|
|
172
|
-
viewCreate(attachOpaqueData: AttachOpaqueData,
|
|
179
|
+
viewCreate(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, definition: string, onConflict: OnCreateConflict, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
173
180
|
/** Drop a view by name. */
|
|
174
|
-
viewDrop(attachOpaqueData: AttachOpaqueData,
|
|
181
|
+
viewDrop(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, ignoreNotFound?: boolean, cascade?: boolean, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
175
182
|
/** Rename a view. */
|
|
176
|
-
viewRename(attachOpaqueData: AttachOpaqueData,
|
|
183
|
+
viewRename(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, newName: string, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
177
184
|
/** Set or clear the comment on a view. */
|
|
178
|
-
viewCommentSet(attachOpaqueData: AttachOpaqueData,
|
|
185
|
+
viewCommentSet(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, comment?: string | null, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
179
186
|
/** Get a macro by name, or null if not found. */
|
|
180
|
-
macroGet(attachOpaqueData: AttachOpaqueData,
|
|
187
|
+
macroGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, transactionOpaqueData?: TransactionOpaqueData): Promise<MacroInfo | null>;
|
|
181
188
|
/** List macros in a schema, filtered by type. */
|
|
182
|
-
schemaContentsMacros(attachOpaqueData: AttachOpaqueData,
|
|
189
|
+
schemaContentsMacros(attachOpaqueData: AttachOpaqueData, path: string[] | string, type: CatalogMacroType, transactionOpaqueData?: TransactionOpaqueData): Promise<MacroInfo[]>;
|
|
183
190
|
/** Create a new macro. */
|
|
184
|
-
macroCreate(attachOpaqueData: AttachOpaqueData,
|
|
191
|
+
macroCreate(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, macroType: MacroType, parameters: string[], definition: string, onConflict: OnCreateConflict, parameterDefaultValues?: Uint8Array | null, argumentsSchema?: Uint8Array | null, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
185
192
|
/** Drop a macro by name. */
|
|
186
|
-
macroDrop(attachOpaqueData: AttachOpaqueData,
|
|
193
|
+
macroDrop(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
187
194
|
/** Close the underlying RPC connection. */
|
|
188
195
|
close(): void;
|
|
189
196
|
}
|
package/dist/client/types.d.ts
CHANGED
|
@@ -40,6 +40,8 @@ export interface CatalogAttachOptions {
|
|
|
40
40
|
optionsBytes?: Uint8Array;
|
|
41
41
|
dataVersionSpec?: string | null;
|
|
42
42
|
implementationVersion?: string | null;
|
|
43
|
+
/** Engine capabilities serialized into the protocol's named inner record. */
|
|
44
|
+
clientCapabilities?: import("../generated/vgi-client.js").ClientCapabilities | null;
|
|
43
45
|
}
|
|
44
46
|
/** Conflict resolution strategy for create operations. */
|
|
45
47
|
export type OnCreateConflict = "error" | "ignore" | "replace";
|
package/dist/client-entry.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { VgiClient, VgiClientError } from "./client/client.js";
|
|
|
2
2
|
export type { VgiClientOptions, TableFunctionOptions, ScalarFunctionOptions, TableInOutFunctionOptions, OnCreateConflict, CatalogFunctionType, } from "./client/types.js";
|
|
3
3
|
export { Arguments } from "./arguments/arguments.js";
|
|
4
4
|
export { type ArgumentSpec, argumentSpecsToSchema, schemaToArgumentSpecs, } from "./arguments/argument-spec.js";
|
|
5
|
-
export { FunctionType, FunctionStability, NullHandling, OrderPreservation, OrderDependence, DistinctDependence, TableInOutPhase, } from "./types.js";
|
|
5
|
+
export { FunctionType, FunctionStability, NullHandling, ArgumentMonotonicity, OrderPreservation, OrderDependence, DistinctDependence, TableInOutPhase, } from "./types.js";
|
|
6
6
|
export type { BindRequest, BindResponse, InitRequest, GlobalInitResponse, TableCardinality, } from "./protocol/types.js";
|
|
7
7
|
export { type SchemaInfo, encodeSchemaInfo, decodeSchemaInfo, type TableInfo, encodeTableInfo, decodeTableInfo, type ViewInfo, encodeViewInfo, decodeViewInfo, type FunctionInfo, encodeFunctionInfo, decodeFunctionInfo, type MacroInfo, encodeMacroInfo, decodeMacroInfo, type CatalogAttachResult, type AttachOpaqueData, type TransactionOpaqueData, } from "./catalog/interface.js";
|
|
8
8
|
export { VgiError, RowCountMismatchError, FunctionNotFoundError, CatalogReadOnlyError, CatalogNotFoundError, CatalogAlreadyExistsError, ArgumentValidationError, NoCatalogError, } from "./errors.js";
|