@query-farm/vgi 0.45.0 → 0.47.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.
- package/README.md +19 -6
- package/dist/arrow/impl-arrowjs/index.d.ts +1 -1
- package/dist/arrow/impl-arrowjs/iterate.d.ts +2 -0
- package/dist/arrow/impl-flechette/canonical.d.ts +1 -1
- package/dist/arrow/impl-flechette/index.d.ts +1 -1
- package/dist/arrow/impl-flechette/iterate.d.ts +2 -0
- package/dist/arrow/impl-flechette/schema.d.ts +19 -5
- package/dist/arrow/index.d.ts +1 -1
- package/dist/catalog/column-expressions.d.ts +8 -0
- package/dist/catalog/column-metadata.d.ts +11 -0
- package/dist/catalog/composite.d.ts +2 -1
- package/dist/catalog/descriptors.d.ts +21 -29
- package/dist/catalog/interface.d.ts +15 -20
- package/dist/catalog/macro-overloads.d.ts +4 -0
- package/dist/catalog/read-only.d.ts +1 -1
- package/dist/catalog/unconstrained-columns.d.ts +2 -0
- package/dist/client/client.d.ts +38 -14
- package/dist/client-entry.js +806 -115
- package/dist/client-entry.js.map +18 -14
- package/dist/functions/continuation.d.ts +69 -0
- package/dist/functions/projection.d.ts +18 -0
- package/dist/functions/table-in-out.d.ts +51 -7
- package/dist/functions/table.d.ts +6 -1
- package/dist/functions/types.d.ts +21 -0
- package/dist/generated/vgi-client.d.ts +178 -36
- package/dist/generated/vgi-protocol-schemas.d.ts +51 -1
- package/dist/generated/vgi-protocol-types.d.ts +317 -3
- package/dist/generated/vgi-service.d.ts +266 -29
- package/dist/index.core.d.ts +3 -1
- package/dist/index.js +1747 -320
- package/dist/index.js.map +45 -37
- package/dist/protocol/dispatch.d.ts +9 -9
- package/dist/protocol/handlers/aggregate.d.ts +1 -1
- package/dist/protocol/handlers/catalog/index.d.ts +1 -1
- package/dist/protocol/handlers/catalog/metadata.d.ts +1 -0
- package/dist/protocol/handlers/function.d.ts +1 -1
- package/dist/protocol/handlers/table-buffering.d.ts +1 -1
- package/dist/protocol/handlers/unimplemented.d.ts +1 -1
- package/dist/protocol/serializers/bind.d.ts +5 -1
- package/dist/protocol/types.d.ts +5 -0
- package/dist/rpc-server.d.ts +6 -6
- package/dist/serve-entry.js +1607 -436
- package/dist/serve-entry.js.map +33 -27
- package/dist/util/arrow/index.d.ts +1 -1
- package/dist/util/parent-rows.d.ts +8 -0
- package/dist/worker-cf-entry.d.ts +1 -1
- package/dist/worker-cf-entry.js +1901 -526
- package/dist/worker-cf-entry.js.map +45 -37
- package/dist/worker.d.ts +1 -1
- package/package.json +8 -7
- package/src/arrow/impl-arrowjs/index.ts +1 -1
- package/src/arrow/impl-arrowjs/iterate.ts +9 -1
- package/src/arrow/impl-arrowjs/project.ts +1 -1
- package/src/arrow/impl-flechette/canonical.ts +7 -5
- package/src/arrow/impl-flechette/index.ts +1 -1
- package/src/arrow/impl-flechette/ipc.ts +12 -0
- package/src/arrow/impl-flechette/iterate.ts +5 -0
- package/src/arrow/impl-flechette/project.ts +6 -8
- package/src/arrow/index.ts +1 -1
- package/src/catalog/column-expressions.ts +224 -0
- package/src/catalog/column-metadata.ts +151 -0
- package/src/catalog/composite.ts +5 -1
- package/src/catalog/contents-codec.ts +6 -1
- package/src/catalog/descriptors.ts +21 -29
- package/src/catalog/interface.ts +70 -55
- package/src/catalog/macro-overloads.ts +44 -0
- package/src/catalog/read-only.ts +69 -71
- package/src/catalog/unconstrained-columns.ts +23 -0
- package/src/client/client.ts +180 -69
- package/src/codec/asd.ts +3 -1
- package/src/filter-pushdown/collector.ts +17 -1
- package/src/functions/continuation.ts +202 -0
- package/src/functions/projection.ts +207 -0
- package/src/functions/table-in-out.ts +131 -56
- package/src/functions/table.ts +10 -0
- package/src/functions/types.ts +21 -0
- package/src/generated/vgi-client.ts +200 -37
- package/src/generated/vgi-protocol-schemas.ts +456 -41
- package/src/generated/vgi-protocol-types.ts +879 -5
- package/src/generated/vgi-service.ts +514 -42
- package/src/http/client-bundle.ts +1 -1
- package/src/http/fetch.ts +1 -1
- package/src/index.core.ts +10 -0
- package/src/protocol/dispatch.ts +9 -9
- package/src/protocol/handlers/aggregate.ts +1 -1
- package/src/protocol/handlers/catalog/admin.ts +10 -5
- package/src/protocol/handlers/catalog/index.ts +2 -2
- package/src/protocol/handlers/catalog/macro.ts +6 -5
- package/src/protocol/handlers/catalog/metadata.ts +16 -0
- package/src/protocol/handlers/catalog/table.ts +72 -26
- package/src/protocol/handlers/catalog/view.ts +24 -3
- package/src/protocol/handlers/function.ts +79 -1
- package/src/protocol/handlers/table-buffering.ts +1 -1
- package/src/protocol/handlers/unimplemented.ts +6 -6
- package/src/protocol/serializers/bind.ts +17 -1
- package/src/protocol/state-serializer.ts +7 -1
- package/src/protocol/types.ts +6 -0
- package/src/rpc-server.ts +9 -9
- package/src/util/arrow/index.ts +1 -1
- package/src/util/parent-rows.ts +41 -0
- package/src/worker-cf-entry.ts +3 -0
- package/src/worker.ts +1 -1
package/README.md
CHANGED
|
@@ -40,8 +40,14 @@ npm install @query-farm/vgi
|
|
|
40
40
|
|
|
41
41
|
Requires **Node.js ≥ 22.15** or **Bun**.
|
|
42
42
|
|
|
43
|
+
Version 0.47.0 uses **`vgi.v3` / `3.0.0`** and requires a matching VGI
|
|
44
|
+
extension. Existing `vgi.v2` extensions need SDK 0.46.x; upgrade the engine-side
|
|
45
|
+
extension and workers together. This release prepares the shared protocol for
|
|
46
|
+
DuckDB 2.0; it does not require upgrading DuckDB itself. See
|
|
47
|
+
[the migration notes](MIGRATION.md#0470--vgiv3).
|
|
48
|
+
|
|
43
49
|
> **Peer dependencies (since 0.3.0).** `@query-farm/apache-arrow` (`^21.1.1`) and
|
|
44
|
-
> `@query-farm/vgi-rpc` (`^0.
|
|
50
|
+
> `@query-farm/vgi-rpc` (`^0.29.2`) are **peerDependencies** — install them directly
|
|
45
51
|
> alongside `@query-farm/vgi`:
|
|
46
52
|
>
|
|
47
53
|
> ```bash
|
|
@@ -226,7 +232,14 @@ Five factories, each mapping to a DuckDB function shape with its own lifecycle:
|
|
|
226
232
|
- **`defineTableInOutFunction`** — table-in / table-out
|
|
227
233
|
(`SELECT * FROM f(TABLE t, …)`). Per-partition `state`, a streaming `process` per
|
|
228
234
|
input batch, and a `finalize` that sees every worker's state — for windowing,
|
|
229
|
-
reshaping, enrichment, sessionization.
|
|
235
|
+
reshaping, enrichment, sessionization. `defineRowTransformFunction` is its
|
|
236
|
+
blended form, whose positional args are per-row input columns
|
|
237
|
+
(`FROM t, f(t.x)`); `inputRowsPerCall` caps the input rows one call receives.
|
|
238
|
+
Either can answer one input with several replies (an upstream API read a page
|
|
239
|
+
at a time): emit each reply but the last with `moreOutputMetadata(true)`, and
|
|
240
|
+
implement `resume(params, state, out)`, which the framework calls for each
|
|
241
|
+
next reply. It continues from `initialState`'s state alone, which over HTTP
|
|
242
|
+
rides the stream's state token, so keep positions there, not rows.
|
|
230
243
|
- **`defineTableBufferingFunction`** — table-in / table-out that must observe **all**
|
|
231
244
|
input before producing output (global sort, top-N, pivot). Sink (`process`) →
|
|
232
245
|
`combine` → source (`finalize`), with explicit sink/source ordering controls.
|
|
@@ -545,7 +558,7 @@ explicitly. Without it there is no landing page and no `/vgi-client.js`; see
|
|
|
545
558
|
### Hosting additional protocols
|
|
546
559
|
|
|
547
560
|
A worker can serve other [vgi-rpc](https://www.npmjs.com/package/@query-farm/vgi-rpc)
|
|
548
|
-
protocols beside `vgi.
|
|
561
|
+
protocols beside `vgi.v3`, on the same listener, through the `hostedProtocols` hook:
|
|
549
562
|
|
|
550
563
|
```ts
|
|
551
564
|
import { Protocol, str } from "@query-farm/vgi-rpc";
|
|
@@ -564,12 +577,12 @@ new Worker({ functions, hostedProtocols: () => [reports] }).run();
|
|
|
564
577
|
- The hook is called **once**, when the server is built; it may read configuration,
|
|
565
578
|
but its answer is fixed for the life of the process.
|
|
566
579
|
- Its protocols are hosted on **every** transport (stdio, AF_UNIX, TCP, the Iroh raw
|
|
567
|
-
upstream, `serveStream`, HTTP), after `vgi.
|
|
580
|
+
upstream, `serveStream`, HTTP), after `vgi.v3`, in the order returned. Every
|
|
568
581
|
transport builds its server through one function, `buildRpcServer`.
|
|
569
|
-
- Each needs a distinct name, which may not be `vgi.
|
|
582
|
+
- Each needs a distinct name, which may not be `vgi.v3` or start with the reserved
|
|
570
583
|
`vgi_rpc.`. Violations are a startup error naming `hostedProtocols()`.
|
|
571
584
|
- Requests route on their `vgi_rpc.protocol` key, so hosting more protocols never
|
|
572
|
-
changes how DuckDB's `vgi.
|
|
585
|
+
changes how DuckDB's `vgi.v3` calls are dispatched.
|
|
573
586
|
- The protocol is the unit of optionality: an optional capability is its own protocol.
|
|
574
587
|
|
|
575
588
|
### Token introspection and grants (`vgi_rpc.Identity.v2`)
|
|
@@ -3,7 +3,7 @@ export declare const backend: VgiBackendInfo;
|
|
|
3
3
|
export { schema, field, nullType, bool, int, int8, int16, int32, int64, uint8, uint16, uint32, uint64, float16, float32, float64, utf8, largeUtf8, binary, largeBinary, fixedSizeBinary, decimal, decimal128, decimal256, date, dateDay, dateMillisecond, time, timeSecond, timeMillisecond, timeMicrosecond, timeNanosecond, timestamp, duration, interval, list, fixedSizeList, struct, map, dictionary, union, sparseUnion, denseUnion, TimeUnit, DateUnit, IntervalUnit, UnionMode, } from "./schema.js";
|
|
4
4
|
export { emptyBatch } from "./empty.js";
|
|
5
5
|
export { batchFromRows, batchFromColumns, columnFromArray } from "./build.js";
|
|
6
|
-
export { iterRows, batchToScalarDict, batchToSecretDict, safeNumber, decodeDictValue, } from "./iterate.js";
|
|
6
|
+
export { iterRows, batchToScalarDict, batchToSecretDict, safeNumber, decodeDictValue, decodeMapValue, } from "./iterate.js";
|
|
7
7
|
export { filterBatch } from "./filter.js";
|
|
8
8
|
export { projectSchema, projectBatch } from "./project.js";
|
|
9
9
|
export { readCanonicalValue } from "./canonical.js";
|
|
@@ -46,3 +46,5 @@ export declare function batchToSecretDict(batch: RecordBatch | VgiBatch | null):
|
|
|
46
46
|
* from mismatched output weeks later.
|
|
47
47
|
*/
|
|
48
48
|
export declare function safeNumber(value: any): number;
|
|
49
|
+
/** Decode a map parameter carried as opaque Arrow Data by the RPC reader. */
|
|
50
|
+
export declare function decodeMapValue(value: any, index?: number): any;
|
|
@@ -9,7 +9,7 @@ export declare function writeCanonicalColumn(type: VgiDataType, canonical: unkno
|
|
|
9
9
|
export declare function writeCanonicalBatch(columns: Record<string, unknown[]>, schema: VgiSchema, numRows: number, maxBatchRows?: number): VgiBatch;
|
|
10
10
|
/**
|
|
11
11
|
* Convert canonical values into the shape flechette's columnFromArray needs.
|
|
12
|
-
*
|
|
12
|
+
* Date32 columns: canonical day-number -> JS Date; Date64 stays ms-bigint. Map columns:
|
|
13
13
|
* canonical Array<[k,v]> -> Map. Struct/List recurse. Everything else passes
|
|
14
14
|
* through.
|
|
15
15
|
*/
|
|
@@ -4,7 +4,7 @@ export declare const backend: VgiBackendInfo;
|
|
|
4
4
|
export { schema, field, nullType, bool, int, int8, int16, int32, int64, uint8, uint16, uint32, uint64, float16, float32, float64, utf8, largeUtf8, binary, largeBinary, fixedSizeBinary, decimal, decimal128, decimal256, date, dateDay, dateMillisecond, time, timeSecond, timeMillisecond, timeMicrosecond, timeNanosecond, timestamp, duration, interval, list, fixedSizeList, struct, map, dictionary, union, sparseUnion, denseUnion, TimeUnit, DateUnit, IntervalUnit, UnionMode, } from "./schema.js";
|
|
5
5
|
export { emptyBatch } from "./empty.js";
|
|
6
6
|
export { batchFromRows, batchFromColumns, columnFromArray } from "./build.js";
|
|
7
|
-
export { iterRows, batchToScalarDict, batchToSecretDict, safeNumber, decodeDictValue, } from "./iterate.js";
|
|
7
|
+
export { iterRows, batchToScalarDict, batchToSecretDict, safeNumber, decodeDictValue, decodeMapValue, } from "./iterate.js";
|
|
8
8
|
export { filterBatch } from "./filter.js";
|
|
9
9
|
export { projectSchema, projectBatch } from "./project.js";
|
|
10
10
|
export { readCanonicalValue } from "./canonical.js";
|
|
@@ -36,3 +36,5 @@ export declare function batchToSecretDict(batch: VgiBatch | null): Record<string
|
|
|
36
36
|
* from mismatched output weeks later.
|
|
37
37
|
*/
|
|
38
38
|
export declare function safeNumber(value: any): number;
|
|
39
|
+
/** Flechette already extracts map parameters as ordinary values. */
|
|
40
|
+
export declare function decodeMapValue(value: any, _index?: number): any;
|
|
@@ -1,9 +1,23 @@
|
|
|
1
|
-
import { TimeUnit as F_TimeUnit, DateUnit as F_DateUnit, IntervalUnit as F_IntervalUnit, UnionMode as F_UnionMode } from "@query-farm/flechette";
|
|
2
1
|
import type { VgiField, VgiSchema, VgiDataType } from "../types.js";
|
|
3
|
-
export declare const TimeUnit:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
export declare const TimeUnit: {
|
|
3
|
+
readonly SECOND: 0;
|
|
4
|
+
readonly MILLISECOND: 1;
|
|
5
|
+
readonly MICROSECOND: 2;
|
|
6
|
+
readonly NANOSECOND: 3;
|
|
7
|
+
};
|
|
8
|
+
export declare const DateUnit: {
|
|
9
|
+
readonly DAY: 0;
|
|
10
|
+
readonly MILLISECOND: 1;
|
|
11
|
+
};
|
|
12
|
+
export declare const IntervalUnit: {
|
|
13
|
+
readonly YEAR_MONTH: 0;
|
|
14
|
+
readonly DAY_TIME: 1;
|
|
15
|
+
readonly MONTH_DAY_NANO: 2;
|
|
16
|
+
};
|
|
17
|
+
export declare const UnionMode: {
|
|
18
|
+
readonly Sparse: 0;
|
|
19
|
+
readonly Dense: 1;
|
|
20
|
+
};
|
|
7
21
|
export declare function schema(fields: readonly VgiField[], metadata?: Map<string, string>): VgiSchema;
|
|
8
22
|
export declare function field(name: string, type: VgiDataType, nullable?: boolean, metadata?: Map<string, string>): VgiField;
|
|
9
23
|
export declare const nullType: () => VgiDataType;
|
package/dist/arrow/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type { VgiTypeId, VgiDataType, VgiField, VgiSchema, VgiColumn, VgiColumnData, VgiBatch, VgiBackendInfo, TaggedUnion, } from "./types.js";
|
|
2
2
|
export { TypeId, isNull, isInt, isFloat, isBinary, isUtf8, isBool, isDecimal, isDate, isTime, isTimestamp, isInterval, isList, isStruct, isUnion, isFixedSizeBinary, isFixedSizeList, isMap, isDuration, isDictionary, isBatch, typeSignature, } from "./predicates.js";
|
|
3
|
-
export { backend, emptyBatch, batchFromRows, batchFromColumns, columnFromArray, iterRows, batchToScalarDict, batchToSecretDict, safeNumber, decodeDictValue, filterBatch, projectSchema, projectBatch, withBatchMetadata, adoptArrowJsShape, readCanonicalValue, serializeSchema, deserializeSchema, serializeBatch, deserializeBatch, deserializeBatches, serializeBatches, serializeCollectionRows, buildStatisticsBatch, } from "#arrow-impl";
|
|
3
|
+
export { backend, emptyBatch, batchFromRows, batchFromColumns, columnFromArray, iterRows, batchToScalarDict, batchToSecretDict, safeNumber, decodeDictValue, decodeMapValue, filterBatch, projectSchema, projectBatch, withBatchMetadata, adoptArrowJsShape, readCanonicalValue, serializeSchema, deserializeSchema, serializeBatch, deserializeBatch, deserializeBatches, serializeBatches, serializeCollectionRows, buildStatisticsBatch, } from "#arrow-impl";
|
|
4
4
|
export type { ColumnStatistics } from "#arrow-impl";
|
|
5
5
|
export { schema, field, nullType, bool, int, int8, int16, int32, int64, uint8, uint16, uint32, uint64, float16, float32, float64, utf8, largeUtf8, binary, largeBinary, fixedSizeBinary, decimal, decimal128, decimal256, date, dateDay, dateMillisecond, time, timeSecond, timeMillisecond, timeMicrosecond, timeNanosecond, timestamp, duration, interval, timestampSeconds, timestampMillis, timestampMicros, timestampNanos, durationSeconds, durationMillis, durationMicros, durationNanos, list, fixedSizeList, struct, map, dictionary, union, sparseUnion, denseUnion, TimeUnit, DateUnit, IntervalUnit, UnionMode, } from "./schema-types.js";
|
|
6
6
|
export type { NullDescriptor, BoolType, IntType, Int8Type, Int16Type, Int32Type, Int64Type, Uint8Type, Uint16Type, Uint32Type, Uint64Type, FloatType, Utf8Type, LargeUtf8Type, BinaryType, LargeBinaryType, FixedSizeBinaryType, DecimalType, Date32Type, Date64Type, Time32Type, Time64Type, TimestampType, DurationType, IntervalType, ListType, FixedSizeListType, StructType, MapType, DictionaryType, UnionType, TypedField, TUnit, } from "./codec/type-descriptors.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type VgiSchema } from "../arrow/index.js";
|
|
2
|
+
export declare const GENERATED_EXPRESSION_KEY = "vgi.column.generated.v1";
|
|
3
|
+
export declare const GENERATION_KEY = "vgi.column.generation.v1";
|
|
4
|
+
export declare function validateEncoded(encoded: string, owner: string[]): void;
|
|
5
|
+
export declare function generatedExpressionMetadata(sql: string, owner: string[]): string;
|
|
6
|
+
/** Validate canonical VIRTUAL metadata without evaluating or rewriting SQL. */
|
|
7
|
+
export declare function validateColumnExpressions(schema: VgiSchema, owner: string[], allowGenerated?: boolean): void;
|
|
8
|
+
export declare function validateColumnExpressionsIpc(bytes: Uint8Array, owner: string[], allowGenerated?: boolean): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { VgiSchema } from "../arrow/index.js";
|
|
2
|
+
import { type TableInfo } from "../generated/vgi-client.js";
|
|
3
|
+
/** Validate reserved metadata without replacing the original schema or values. */
|
|
4
|
+
export declare function validateColumnMetadata(schema: VgiSchema): void;
|
|
5
|
+
/** Inspect raw schema-message metadata before Arrow can replace malformed UTF-8.
|
|
6
|
+
* FlatBuffer slots come from Arrow's Message, Schema, Field and KeyValue tables.
|
|
7
|
+
* Only reserved field values are interpreted; all original IPC bytes stay intact.
|
|
8
|
+
*/
|
|
9
|
+
export declare function validateColumnMetadataIpc(bytes: Uint8Array): void;
|
|
10
|
+
export declare function validateTableInfoColumns(info: TableInfo): void;
|
|
11
|
+
export declare function encodeValidatedTableInfo(info: TableInfo): Uint8Array;
|
|
@@ -8,7 +8,7 @@ export declare class CompositeCatalogInterface extends CatalogInterface {
|
|
|
8
8
|
catalogNameForAttach(attachOpaqueData: Uint8Array): string | null;
|
|
9
9
|
catalogs(): string[];
|
|
10
10
|
catalogsInfo(): Promise<CatalogInfo[]>;
|
|
11
|
-
attach(name: string, options?: Record<string, unknown>, dataVersionSpec?: string | null, implementationVersion?: string | null): Promise<CatalogAttachResult>;
|
|
11
|
+
attach(name: string, options?: Record<string, unknown>, dataVersionSpec?: string | null, implementationVersion?: string | null, clientCapabilities?: Uint8Array | null): Promise<CatalogAttachResult>;
|
|
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[]>;
|
|
@@ -46,6 +46,7 @@ export declare class CompositeCatalogInterface extends CatalogInterface {
|
|
|
46
46
|
viewDrop(...args: Parameters<CatalogInterface["viewDrop"]>): Promise<void>;
|
|
47
47
|
viewRename(...args: Parameters<CatalogInterface["viewRename"]>): Promise<void>;
|
|
48
48
|
viewCommentSet(...args: Parameters<CatalogInterface["viewCommentSet"]>): Promise<void>;
|
|
49
|
+
viewColumnCommentSet(...args: Parameters<CatalogInterface["viewColumnCommentSet"]>): Promise<void>;
|
|
49
50
|
macroCreate(...args: Parameters<CatalogInterface["macroCreate"]>): Promise<void>;
|
|
50
51
|
macroDrop(...args: Parameters<CatalogInterface["macroDrop"]>): Promise<void>;
|
|
51
52
|
catalogContents(attachOpaqueData: AttachOpaqueData, ifNoneMatch?: string | null): Promise<CatalogContentsResult>;
|
|
@@ -18,6 +18,9 @@ export interface ForeignKeyDef {
|
|
|
18
18
|
}
|
|
19
19
|
export type DefaultValue = string | number | boolean | null;
|
|
20
20
|
export interface TableDescriptor {
|
|
21
|
+
/** Canonical ConstraintInfo IPC records with provider-owned stable identities. */
|
|
22
|
+
constraints?: Uint8Array[];
|
|
23
|
+
definitionRevision?: Uint8Array | null;
|
|
21
24
|
name: string;
|
|
22
25
|
columns?: VgiSchema;
|
|
23
26
|
function?: VgiFunction;
|
|
@@ -33,7 +36,7 @@ export interface TableDescriptor {
|
|
|
33
36
|
/**
|
|
34
37
|
* Generated (virtual) columns: map of column name → SQL expression computed
|
|
35
38
|
* from other physical columns. Applied as Arrow field metadata
|
|
36
|
-
*
|
|
39
|
+
* canonical SqlExpression IPC with explicit owner/context, which DuckDB reads at table
|
|
37
40
|
* registration. The backing scan function should not return these columns —
|
|
38
41
|
* DuckDB evaluates the expressions client-side.
|
|
39
42
|
*/
|
|
@@ -52,25 +55,10 @@ export interface TableDescriptor {
|
|
|
52
55
|
* (always re-fetch).
|
|
53
56
|
*/
|
|
54
57
|
statisticsCacheMaxAgeSeconds?: number | null;
|
|
55
|
-
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
|
|
59
|
-
* satisfied when any one of its paths has a filter; every group must be
|
|
60
|
-
* satisfied. So `[["accession_number"], ["ticker", "cik"]]` means
|
|
61
|
-
* "accession_number AND one of (ticker, cik)"; a single-path group
|
|
62
|
-
* `[["country"]]` is a plain mandatory filter. Paths are top-level names
|
|
63
|
-
* (`"country"`) or struct subfields (`"bbox.xmin"`, `"nested.outer.inner"`).
|
|
64
|
-
* Empty/undefined (default) means no enforcement — the zero-cost fast path
|
|
65
|
-
* for every existing table.
|
|
66
|
-
*
|
|
67
|
-
* Satisfaction is prefix-based: a present filter on a shorter path satisfies
|
|
68
|
-
* any required path it is a prefix of. So a whole-struct filter on `bbox`
|
|
69
|
-
* satisfies all of `bbox.xmin` / `.xmax` / `.ymin` / `.ymax`. The VGI DuckDB
|
|
70
|
-
* extension's optimizer pass consults this at bind time and throws a
|
|
71
|
-
* `BinderException` listing any unsatisfied groups.
|
|
72
|
-
*/
|
|
73
|
-
requiredFilters?: string[][];
|
|
58
|
+
/** AND-of-OR groups of raw component paths, e.g. `[[["bbox", "xmin"]], [["ticker"], ["cik"]]]`.
|
|
59
|
+
* Dots and quotes are literal. A present component prefix satisfies a path;
|
|
60
|
+
* a child does not satisfy its parent. Empty/undefined means no requirements. */
|
|
61
|
+
requiredFilters?: string[][][];
|
|
74
62
|
supportsTimeTravel?: boolean;
|
|
75
63
|
/**
|
|
76
64
|
* Inline cardinality estimate/max surfaced through TableInfo. When set,
|
|
@@ -87,6 +75,10 @@ export interface TableDescriptor {
|
|
|
87
75
|
}
|
|
88
76
|
export interface ViewDescriptor {
|
|
89
77
|
name: string;
|
|
78
|
+
/** Ordered raw output identifiers; empty uses query names. */
|
|
79
|
+
aliases?: string[];
|
|
80
|
+
/** Optimization barrier mode; readers must enforce or reject it. */
|
|
81
|
+
security?: "regular" | "barrier";
|
|
90
82
|
definition: string;
|
|
91
83
|
comment?: string;
|
|
92
84
|
/**
|
|
@@ -105,11 +97,12 @@ export interface MacroDescriptor {
|
|
|
105
97
|
macroType: "scalar" | "table";
|
|
106
98
|
parameters: string[];
|
|
107
99
|
parameterDefaultValues?: Uint8Array | null;
|
|
100
|
+
/** Complete canonical family; simple-definition fields must be empty when supplied. */
|
|
101
|
+
overloads?: import("../generated/vgi-client.js").MacroOverload[];
|
|
108
102
|
/**
|
|
109
103
|
* Optional mapping of parameter name to a human/agent-facing description.
|
|
110
104
|
* Keys must appear in `parameters`. Descriptions flow over the wire via the
|
|
111
|
-
*
|
|
112
|
-
* functions use for per-argument docs), so the DuckDB extension's
|
|
105
|
+
* canonical parameter's `documentation` field, so the DuckDB extension's
|
|
113
106
|
* `vgi_function_arguments()` can surface them. Empty/omitted = no docs.
|
|
114
107
|
*/
|
|
115
108
|
parameterDocs?: Record<string, string>;
|
|
@@ -119,12 +112,10 @@ export interface MacroDescriptor {
|
|
|
119
112
|
}
|
|
120
113
|
export interface IndexDescriptor {
|
|
121
114
|
name: string;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
|
|
126
|
-
indexType?: string;
|
|
127
|
-
options?: Record<string, string>;
|
|
115
|
+
/** Complete provider-authored definition; no expression strings or options are inferred. */
|
|
116
|
+
definition: Uint8Array;
|
|
117
|
+
/** Effective values and persisted override names, including explicit NULL. */
|
|
118
|
+
options: Uint8Array;
|
|
128
119
|
comment?: string;
|
|
129
120
|
tags?: Record<string, string>;
|
|
130
121
|
}
|
|
@@ -149,7 +140,8 @@ export interface SecretTypeDescriptor {
|
|
|
149
140
|
}
|
|
150
141
|
export interface CatalogDescriptor {
|
|
151
142
|
name: string;
|
|
152
|
-
|
|
143
|
+
/** One raw root identifier; null means no implicit default, omitted means main. */
|
|
144
|
+
defaultSchema?: string | null;
|
|
153
145
|
schemas: SchemaDescriptor[];
|
|
154
146
|
settings?: SettingDescriptor[];
|
|
155
147
|
secretTypes?: SecretTypeDescriptor[];
|
|
@@ -342,7 +342,7 @@ export declare abstract class CatalogInterface {
|
|
|
342
342
|
* validated, decoded `{name: value}` dict with typed column values.
|
|
343
343
|
* Use `{}` if no options were supplied.
|
|
344
344
|
*/
|
|
345
|
-
abstract attach(name: string, options?: Record<string, unknown>, dataVersionSpec?: string | null, implementationVersion?: string | null): Awaitable<CatalogAttachResult>;
|
|
345
|
+
abstract attach(name: string, options?: Record<string, unknown>, dataVersionSpec?: string | null, implementationVersion?: string | null, clientCapabilities?: Uint8Array | null): Awaitable<CatalogAttachResult>;
|
|
346
346
|
/**
|
|
347
347
|
* List the catalogs this worker exposes with their version metadata. The
|
|
348
348
|
* `implementation_version` / `data_version_spec` come from the CatalogInfo
|
|
@@ -357,13 +357,13 @@ export declare abstract class CatalogInterface {
|
|
|
357
357
|
create(name: string, onConflict: string, options?: any): Awaitable<void>;
|
|
358
358
|
drop(name: string): Awaitable<void>;
|
|
359
359
|
schemaGet(attachOpaqueData: AttachOpaqueData, path: string[], transactionOpaqueData?: TransactionOpaqueData): Awaitable<SchemaInfo | null>;
|
|
360
|
-
schemaCreate(attachOpaqueData: AttachOpaqueData, path: string[], comment?: string | null, tags?:
|
|
360
|
+
schemaCreate(attachOpaqueData: AttachOpaqueData, path: string[], comment?: string | null, tags?: Record<string, string> | null, transactionOpaqueData?: TransactionOpaqueData, onConflict?: string): Awaitable<void>;
|
|
361
361
|
schemaDrop(attachOpaqueData: AttachOpaqueData, path: string[], ignoreNotFound?: boolean, cascade?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
362
362
|
schemaContentsTables(attachOpaqueData: AttachOpaqueData, path: string[], transactionOpaqueData?: TransactionOpaqueData): Awaitable<TableInfo[]>;
|
|
363
363
|
schemaContentsViews(attachOpaqueData: AttachOpaqueData, path: string[], transactionOpaqueData?: TransactionOpaqueData): Awaitable<ViewInfo[]>;
|
|
364
364
|
schemaContentsFunctions(attachOpaqueData: AttachOpaqueData, path: string[], type: string, transactionOpaqueData?: TransactionOpaqueData): Awaitable<FunctionInfo[]>;
|
|
365
365
|
tableGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, atUnit?: string, atValue?: string, transactionOpaqueData?: TransactionOpaqueData): Awaitable<TableInfo | null>;
|
|
366
|
-
tableCreate(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, columns: Uint8Array, onConflict: string,
|
|
366
|
+
tableCreate(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, columns: Uint8Array, onConflict: string, constraintDefinitions?: Uint8Array[], transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
367
367
|
tableDrop(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
368
368
|
tableScanFunctionGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, atUnit?: string, atValue?: string, transactionOpaqueData?: TransactionOpaqueData): Awaitable<any>;
|
|
369
369
|
/**
|
|
@@ -387,28 +387,23 @@ export declare abstract class CatalogInterface {
|
|
|
387
387
|
} | null>;
|
|
388
388
|
tableCommentSet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, comment?: string | null, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
389
389
|
tableRename(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, newName: string, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
390
|
-
tableColumnAdd(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string,
|
|
391
|
-
tableColumnDrop(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string,
|
|
392
|
-
tableColumnRename(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string,
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
390
|
+
tableColumnAdd(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, columnPath: string[], columnDefinition: Uint8Array, ignoreNotFound?: boolean, ifColumnNotExists?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
391
|
+
tableColumnDrop(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, columnPath: string[], ignoreNotFound?: boolean, ifColumnExists?: boolean, cascade?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
392
|
+
tableColumnRename(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, columnPath: string[], newColumnName: string, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
393
|
+
tableColumnCommentSet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, columnPath: string[], comment: string | null, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
394
|
+
tableColumnDefaultSet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, columnPath: string[], expression: Uint8Array, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
395
|
+
tableColumnDefaultDrop(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, columnPath: string[], ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
396
|
+
tableColumnTypeChange(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, columnPath: string[], columnDefinition: Uint8Array, expression?: Uint8Array | null, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
397
|
+
tableNotNullSet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, columnPath: string[], ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
398
|
+
tableNotNullDrop(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, columnPath: string[], ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
398
399
|
viewGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, transactionOpaqueData?: TransactionOpaqueData): Awaitable<ViewInfo | null>;
|
|
399
|
-
viewCreate(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, definition: string, onConflict: string, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
400
|
+
viewCreate(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, definition: string, onConflict: string, transactionOpaqueData?: TransactionOpaqueData, aliases?: string[], comment?: string | null, tags?: Record<string, string> | null, columnComments?: Record<string, string> | null): Awaitable<void>;
|
|
400
401
|
viewDrop(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
401
402
|
viewRename(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, newName: string, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
402
403
|
viewCommentSet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, comment?: string | null, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
404
|
+
viewColumnCommentSet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, columnPath: string[], comment?: string | null, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
403
405
|
macroGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, transactionOpaqueData?: TransactionOpaqueData): Awaitable<MacroInfo | null>;
|
|
404
|
-
macroCreate(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, macroType: MacroType,
|
|
405
|
-
/**
|
|
406
|
-
* Optional Arrow schema (one nullable field per parameter, in `parameters`
|
|
407
|
-
* order) serialized as IPC bytes, carrying per-parameter descriptions via the
|
|
408
|
-
* `vgi_doc` field metadata key. `null`/omitted when no per-parameter docs are
|
|
409
|
-
* supplied. Build with `macroArgumentsSchema` + `serializeSchema`.
|
|
410
|
-
*/
|
|
411
|
-
argumentsSchema?: Uint8Array | null, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
406
|
+
macroCreate(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, macroType: MacroType, overloads: import("../generated/vgi-client.js").MacroOverload[], onConflict: string, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
412
407
|
macroDrop(attachOpaqueData: AttachOpaqueData, schemaPath: string[], name: string, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Awaitable<void>;
|
|
413
408
|
schemaContentsMacros(attachOpaqueData: AttachOpaqueData, path: string[], type: string, transactionOpaqueData?: TransactionOpaqueData): Awaitable<MacroInfo[]>;
|
|
414
409
|
schemaContentsIndexes(attachOpaqueData: AttachOpaqueData, path: string[], transactionOpaqueData?: TransactionOpaqueData): Awaitable<IndexInfo[]>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { MacroDescriptor } from "./descriptors.js";
|
|
2
|
+
import type { MacroOverload } from "../generated/vgi-client.js";
|
|
3
|
+
/** Convert a simple descriptor without treating default-value types as declarations. */
|
|
4
|
+
export declare function macroOverloads(macro: MacroDescriptor, owner: string[]): MacroOverload[];
|
|
@@ -86,7 +86,7 @@ export declare class ReadOnlyCatalogInterface extends CatalogInterface {
|
|
|
86
86
|
*/
|
|
87
87
|
attachOptionSpecs(_name: string): AttachOptionSpec[];
|
|
88
88
|
catalogsInfo(): CatalogInfo[];
|
|
89
|
-
attach(name: string, options?: Record<string, unknown>, dataVersionSpec?: string | null, implementationVersion?: string | null): CatalogAttachResult | Promise<CatalogAttachResult>;
|
|
89
|
+
attach(name: string, options?: Record<string, unknown>, dataVersionSpec?: string | null, implementationVersion?: string | null, clientCapabilities?: Uint8Array | null): CatalogAttachResult | Promise<CatalogAttachResult>;
|
|
90
90
|
detach(attachOpaqueData: AttachOpaqueData): void;
|
|
91
91
|
version(attachOpaqueData: AttachOpaqueData, transactionOpaqueData?: TransactionOpaqueData): number | Promise<number>;
|
|
92
92
|
/**
|
package/dist/client/client.d.ts
CHANGED
|
@@ -1,9 +1,28 @@
|
|
|
1
1
|
import { type VgiBatch } from "../arrow/index.js";
|
|
2
|
-
import type { RpcClient } from "@query-farm/vgi-rpc";
|
|
2
|
+
import type { RpcClient, StreamSession } from "@query-farm/vgi-rpc";
|
|
3
3
|
import { type SchemaInfo, type TableInfo, type ViewInfo, type FunctionInfo, type MacroInfo, type MacroType, type CatalogAttachResult, type SchemaContentsInfo, type IndexInfo, type AttachOpaqueData, type TransactionOpaqueData, type CatalogInfo, type ScanFunctionResult } from "../catalog/interface.js";
|
|
4
4
|
import { VgiClientError } from "./errors.js";
|
|
5
5
|
export { VgiClientError };
|
|
6
6
|
import type { VgiClientOptions, TableFunctionOptions, ScalarFunctionOptions, TableInOutFunctionOptions, OnCreateConflict, CatalogFunctionType, CatalogMacroType, CatalogAttachOptions, AttachOptionValue, CatalogSnapshot, LoadCatalogOptions } from "./types.js";
|
|
7
|
+
/**
|
|
8
|
+
* Send one input batch on a table-in-out exchange and yield the rows of every
|
|
9
|
+
* reply it gets (continued output, docs/table_in_out.md "Continued Output").
|
|
10
|
+
*
|
|
11
|
+
* A reply saying `vgi.status: HAVE_MORE_OUTPUT` has more output for the same
|
|
12
|
+
* input: ask for the next with a continuation tick (a zero-row batch of the
|
|
13
|
+
* input schema carrying `vgi.status: CONTINUE`) until a reply stops saying
|
|
14
|
+
* more. Only then may the next input go out, or the input close. The row-level
|
|
15
|
+
* `StreamSession.exchange` drops reply metadata, so this uses the raw exchange
|
|
16
|
+
* every transport's session implements.
|
|
17
|
+
*
|
|
18
|
+
* Refused, as the extension refuses them: `not_modified` on a reply that says
|
|
19
|
+
* more or answers a tick (a 304 stands for an input's whole output), and the
|
|
20
|
+
* worker ending the stream while output is pending.
|
|
21
|
+
*
|
|
22
|
+
* Exported for tests only (not re-exported from the package entry points).
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
export declare function exchangeContinued(session: StreamSession, functionName: string, input: VgiBatch): AsyncGenerator<Record<string, any>[]>;
|
|
7
26
|
/**
|
|
8
27
|
* High-level client for calling VGI worker functions and catalog API.
|
|
9
28
|
*
|
|
@@ -185,7 +204,7 @@ export declare class VgiClient {
|
|
|
185
204
|
/** Get a table by name, or null if not found. */
|
|
186
205
|
tableGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, transactionOpaqueData?: TransactionOpaqueData): Promise<TableInfo | null>;
|
|
187
206
|
/** Create a new table. */
|
|
188
|
-
tableCreate(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, columns: Uint8Array, onConflict: OnCreateConflict,
|
|
207
|
+
tableCreate(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, columns: Uint8Array, onConflict: OnCreateConflict, constraintDefinitions?: Uint8Array[], transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
189
208
|
/** Drop a table by name. */
|
|
190
209
|
tableDrop(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, ignoreNotFound?: boolean, cascade?: boolean, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
191
210
|
/**
|
|
@@ -199,43 +218,48 @@ export declare class VgiClient {
|
|
|
199
218
|
/** Rename a table. */
|
|
200
219
|
tableRename(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, newName: string, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
201
220
|
/** Add a column to a table. */
|
|
202
|
-
tableColumnAdd(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string,
|
|
221
|
+
tableColumnAdd(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, columnPath: string[], columnDefinition: Uint8Array, ignoreNotFound?: boolean, ifColumnNotExists?: boolean, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
203
222
|
/** Drop a column from a table. */
|
|
204
|
-
tableColumnDrop(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string,
|
|
223
|
+
tableColumnDrop(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, columnPath: string[], ignoreNotFound?: boolean, ifColumnExists?: boolean, cascade?: boolean, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
205
224
|
/** Rename a column in a table. */
|
|
206
|
-
tableColumnRename(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string,
|
|
207
|
-
/** Set the
|
|
208
|
-
|
|
225
|
+
tableColumnRename(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, columnPath: string[], newColumnName: string, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
226
|
+
/** Set or clear the comment on a column. */
|
|
227
|
+
tableColumnCommentSet(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, columnPath: string[], comment: string | null, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
228
|
+
/** Set the default using a serialized canonical SqlExpression record. */
|
|
229
|
+
tableColumnDefaultSet(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, columnPath: string[], expression: Uint8Array, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
209
230
|
/** Remove the default value from a column. */
|
|
210
|
-
tableColumnDefaultDrop(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string,
|
|
231
|
+
tableColumnDefaultDrop(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, columnPath: string[], ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
211
232
|
/**
|
|
212
233
|
* Change the type of a column.
|
|
213
234
|
*
|
|
214
235
|
* `columnDefinition` is a serialized Arrow Schema with a single field whose
|
|
215
236
|
* name identifies the target column and whose type is the new column type.
|
|
216
|
-
* `expression` is
|
|
237
|
+
* `expression` is a serialized canonical SqlExpression for USING, or null
|
|
238
|
+
* when no conversion expression was supplied.
|
|
217
239
|
*/
|
|
218
|
-
tableColumnTypeChange(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, columnDefinition: Uint8Array, expression?:
|
|
240
|
+
tableColumnTypeChange(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, columnPath: string[], columnDefinition: Uint8Array, expression?: Uint8Array | null, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
219
241
|
/** Set a NOT NULL constraint on a column. */
|
|
220
|
-
tableNotNullSet(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string,
|
|
242
|
+
tableNotNullSet(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, columnPath: string[], ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
221
243
|
/** Remove a NOT NULL constraint from a column. */
|
|
222
|
-
tableNotNullDrop(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string,
|
|
244
|
+
tableNotNullDrop(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, columnPath: string[], ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
223
245
|
/** Get a view by name, or null if not found. */
|
|
224
246
|
viewGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, transactionOpaqueData?: TransactionOpaqueData): Promise<ViewInfo | null>;
|
|
225
247
|
/** Create a new view. */
|
|
226
|
-
viewCreate(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, definition: string, onConflict: OnCreateConflict, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
248
|
+
viewCreate(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, definition: string, onConflict: OnCreateConflict, transactionOpaqueData?: TransactionOpaqueData, aliases?: string[], security?: "regular" | "barrier", comment?: string | null, tags?: Record<string, string> | null, columnComments?: Record<string, string> | null): Promise<void>;
|
|
227
249
|
/** Drop a view by name. */
|
|
228
250
|
viewDrop(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, ignoreNotFound?: boolean, cascade?: boolean, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
229
251
|
/** Rename a view. */
|
|
230
252
|
viewRename(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, newName: string, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
231
253
|
/** Set or clear the comment on a view. */
|
|
232
254
|
viewCommentSet(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, comment?: string | null, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
255
|
+
/** Set or clear a comment on one raw view output name. */
|
|
256
|
+
viewColumnCommentSet(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, columnPath: string[], comment?: string | null, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
233
257
|
/** Get a macro by name, or null if not found. */
|
|
234
258
|
macroGet(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, transactionOpaqueData?: TransactionOpaqueData): Promise<MacroInfo | null>;
|
|
235
259
|
/** List macros in a schema, filtered by type. */
|
|
236
260
|
schemaContentsMacros(attachOpaqueData: AttachOpaqueData, path: string[] | string, type: CatalogMacroType, transactionOpaqueData?: TransactionOpaqueData): Promise<MacroInfo[]>;
|
|
237
261
|
/** Create a new macro. */
|
|
238
|
-
macroCreate(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, macroType: MacroType,
|
|
262
|
+
macroCreate(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, macroType: MacroType, overloads: import("../generated/vgi-client.js").MacroOverload[], onConflict: OnCreateConflict, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
239
263
|
/** Drop a macro by name. */
|
|
240
264
|
macroDrop(attachOpaqueData: AttachOpaqueData, schemaPath: string[] | string, name: string, ignoreNotFound?: boolean, transactionOpaqueData?: TransactionOpaqueData): Promise<void>;
|
|
241
265
|
/** Close the underlying RPC connection. */
|