@query-farm/vgi 0.46.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 +11 -5
- 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/index.d.ts +1 -1
- package/dist/arrow/impl-flechette/iterate.d.ts +2 -0
- 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 +18 -13
- package/dist/client-entry.js +753 -103
- package/dist/client-entry.js.map +16 -14
- package/dist/functions/projection.d.ts +18 -0
- package/dist/functions/table.d.ts +6 -1
- package/dist/functions/types.d.ts +1 -0
- package/dist/generated/vgi-client.d.ts +177 -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 +2 -1
- package/dist/index.js +1480 -238
- package/dist/index.js.map +40 -34
- 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 +1593 -452
- package/dist/serve-entry.js.map +31 -26
- package/dist/util/arrow/index.d.ts +1 -1
- package/dist/worker-cf-entry.js +1814 -589
- package/dist/worker-cf-entry.js.map +39 -33
- package/dist/worker.d.ts +1 -1
- package/package.json +5 -4
- 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/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 +63 -71
- package/src/catalog/unconstrained-columns.ts +23 -0
- package/src/client/client.ts +100 -58
- package/src/codec/asd.ts +3 -1
- package/src/functions/projection.ts +207 -0
- package/src/functions/table.ts +10 -0
- package/src/functions/types.ts +1 -0
- package/src/generated/vgi-client.ts +199 -37
- package/src/generated/vgi-protocol-schemas.ts +455 -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 +4 -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 +67 -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/types.ts +6 -0
- package/src/rpc-server.ts +9 -9
- package/src/util/arrow/index.ts +1 -1
- package/src/worker.ts +1 -1
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { type VgiSchema, schema, field, type VgiBatch, type VgiDataType, utf8, binary, bool, struct, dictionary, int16, list } from "../../arrow/index.js";
|
|
7
7
|
import { Arguments } from "../../arguments/arguments.js";
|
|
8
8
|
import { FunctionType } from "../../types.js";
|
|
9
|
-
import type { BindRequest, BindResponse, CopyFromContext, CopyToContext } from "../types.js";
|
|
9
|
+
import type { BindRequest, BindResponse, BindRepeatability, CopyFromContext, CopyToContext } from "../types.js";
|
|
10
10
|
import {
|
|
11
11
|
serializeSchema,
|
|
12
12
|
deserializeSchema,
|
|
@@ -184,15 +184,29 @@ export function deserializeBindRequest(
|
|
|
184
184
|
};
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
+
/** Validate required wire enum values, including rejecting NULL and absent values. */
|
|
188
|
+
export function parseBindRepeatability(value: unknown): BindRepeatability {
|
|
189
|
+
if (value !== "UNKNOWN" && value !== "STABLE_WITHIN_QUERY")
|
|
190
|
+
throw new Error("invalid bind repeatability");
|
|
191
|
+
return value;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/** Only omitted provider declarations default; explicit NULL remains invalid. */
|
|
195
|
+
export function normalizeBindRepeatability(value: unknown): BindRepeatability {
|
|
196
|
+
return parseBindRepeatability(value === undefined ? "UNKNOWN" : value);
|
|
197
|
+
}
|
|
198
|
+
|
|
187
199
|
export function serializeBindResponse(
|
|
188
200
|
resp: BindResponse
|
|
189
201
|
): Record<string, any> {
|
|
190
202
|
return {
|
|
191
203
|
output_schema: serializeSchema(resp.output_schema),
|
|
192
204
|
opaque_data: resp.opaque_data ?? null,
|
|
205
|
+
projection_expression_profiles: resp.projection_expression_profiles ?? [],
|
|
193
206
|
lookup_secret_types: resp.lookup_secret_types ?? [],
|
|
194
207
|
lookup_scopes: resp.lookup_scopes ?? [],
|
|
195
208
|
lookup_names: resp.lookup_names ?? [],
|
|
209
|
+
repeatability: normalizeBindRepeatability(resp.repeatability),
|
|
196
210
|
};
|
|
197
211
|
}
|
|
198
212
|
|
|
@@ -206,10 +220,12 @@ export function deserializeBindResponse(
|
|
|
206
220
|
};
|
|
207
221
|
return {
|
|
208
222
|
output_schema: deserializeSchema(toUint8Array(params.output_schema)),
|
|
223
|
+
projection_expression_profiles: toStrArray(params.projection_expression_profiles),
|
|
209
224
|
opaque_data: params.opaque_data ? toUint8Array(params.opaque_data) : null,
|
|
210
225
|
lookup_secret_types: toStrArray(params.lookup_secret_types),
|
|
211
226
|
lookup_scopes: toStrArray(params.lookup_scopes),
|
|
212
227
|
lookup_names: toStrArray(params.lookup_names),
|
|
228
|
+
repeatability: parseBindRepeatability(params.repeatability),
|
|
213
229
|
};
|
|
214
230
|
}
|
|
215
231
|
|
package/src/protocol/types.ts
CHANGED
|
@@ -104,7 +104,13 @@ export interface BindRequest {
|
|
|
104
104
|
argument_names?: (string | null)[] | null;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
/** Equivalent scans of one bound state within a query; independent binds may differ. */
|
|
108
|
+
export type BindRepeatability = "UNKNOWN" | "STABLE_WITHIN_QUERY";
|
|
109
|
+
|
|
107
110
|
export interface BindResponse {
|
|
111
|
+
/** Omitted provider values serialize as UNKNOWN. Wire values are required. */
|
|
112
|
+
repeatability?: BindRepeatability;
|
|
113
|
+
projection_expression_profiles?: string[];
|
|
108
114
|
output_schema: VgiSchema;
|
|
109
115
|
opaque_data: Uint8Array | null;
|
|
110
116
|
lookup_secret_types?: string[];
|
package/src/rpc-server.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
//
|
|
10
10
|
// What a server hosts, in reflection order:
|
|
11
11
|
//
|
|
12
|
-
// 1. The worker's own protocol, `vgi.
|
|
12
|
+
// 1. The worker's own protocol, `vgi.v3`.
|
|
13
13
|
// 2. The worker's `hostedProtocols()`, in the order returned -- on EVERY
|
|
14
14
|
// transport.
|
|
15
15
|
// 3. `vgi_rpc.Reflection.v1` -- on every transport.
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
// configured explicitly (never a generated one) *and* the worker can
|
|
20
20
|
// issue grants. See `attach-ticket.ts`.
|
|
21
21
|
//
|
|
22
|
-
// Extra protocols cannot change `vgi.
|
|
22
|
+
// Extra protocols cannot change `vgi.v3` behaviour: vgi-rpc routes every
|
|
23
23
|
// request on its `vgi_rpc.protocol` key with no fallback to the primary, so a
|
|
24
|
-
// client that only ever names `vgi.
|
|
24
|
+
// client that only ever names `vgi.v3` (the DuckDB extension) dispatches
|
|
25
25
|
// exactly as it would against a single-protocol server.
|
|
26
26
|
|
|
27
27
|
import {
|
|
@@ -55,7 +55,7 @@ const RESERVED_PREFIX = "vgi_rpc.";
|
|
|
55
55
|
export const INTROSPECT_PRINCIPALS_ENV = "VGI_INTROSPECT_PRINCIPALS";
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
|
-
* What a worker hosts beyond `vgi.
|
|
58
|
+
* What a worker hosts beyond `vgi.v3`, and whether it opts into identity.
|
|
59
59
|
*
|
|
60
60
|
* Accepted by `new Worker({...})`, `serveVgiWorker`, `createVgiWorkerFetch`
|
|
61
61
|
* and `createVgiFetch` (Cloudflare Workers) alike, so one worker definition
|
|
@@ -63,20 +63,20 @@ export const INTROSPECT_PRINCIPALS_ENV = "VGI_INTROSPECT_PRINCIPALS";
|
|
|
63
63
|
*/
|
|
64
64
|
export interface HostingOptions {
|
|
65
65
|
/**
|
|
66
|
-
* Additional vgi-rpc protocols to host beside `vgi.
|
|
66
|
+
* Additional vgi-rpc protocols to host beside `vgi.v3`, on the **same**
|
|
67
67
|
* listener, whatever the transport.
|
|
68
68
|
*
|
|
69
69
|
* A vgi-rpc `Protocol` carries its handlers, so each entry is a whole
|
|
70
70
|
* `(protocol, implementation)` pair. Called **once**, when the server is
|
|
71
71
|
* built; it may consult configuration or the environment, but the answer is
|
|
72
72
|
* fixed for the life of the process, so reflection output and protocol
|
|
73
|
-
* hashes stay stable. Hosted after `vgi.
|
|
73
|
+
* hashes stay stable. Hosted after `vgi.v3`, in the order returned.
|
|
74
74
|
*
|
|
75
75
|
* The protocol is the unit of optionality: there is no way to host a subset
|
|
76
76
|
* of a protocol's methods. A capability that is optional is its own
|
|
77
77
|
* protocol, returned here or not.
|
|
78
78
|
*
|
|
79
|
-
* Each needs a distinct wire name, which may not be `vgi.
|
|
79
|
+
* Each needs a distinct wire name, which may not be `vgi.v3` and may not
|
|
80
80
|
* use the reserved `vgi_rpc.` prefix: reflection is hosted automatically and
|
|
81
81
|
* `vgi_rpc.Identity.v2` is enabled through {@link resolveToken} /
|
|
82
82
|
* {@link mintGrant}. Violations are a startup error naming this hook.
|
|
@@ -164,14 +164,14 @@ export interface BuildRpcServerOptions {
|
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
/**
|
|
167
|
-
* Build the vgi-rpc server for a worker's `vgi.
|
|
167
|
+
* Build the vgi-rpc server for a worker's `vgi.v3` protocol on `transport`.
|
|
168
168
|
*
|
|
169
169
|
* Calls `hosting.hostedProtocols()` exactly once and hosts the result beside
|
|
170
170
|
* `primary`; see the module comment for the full hosted set.
|
|
171
171
|
*
|
|
172
172
|
* @throws TypeError `hostedProtocols()` returned something other than an
|
|
173
173
|
* iterable of vgi-rpc `Protocol`s.
|
|
174
|
-
* @throws Error A hosted protocol's name is invalid, reserved, `vgi.
|
|
174
|
+
* @throws Error A hosted protocol's name is invalid, reserved, `vgi.v3`'s, or
|
|
175
175
|
* repeated; the transport is unknown; or the worker supplies `resolveToken`
|
|
176
176
|
* on HTTP with no introspector allowlist.
|
|
177
177
|
*/
|
package/src/util/arrow/index.ts
CHANGED
package/src/worker.ts
CHANGED
|
@@ -282,7 +282,7 @@ export class Worker {
|
|
|
282
282
|
}
|
|
283
283
|
|
|
284
284
|
/**
|
|
285
|
-
* Build the vgi-rpc server for one transport: `vgi.
|
|
285
|
+
* Build the vgi-rpc server for one transport: `vgi.v3`, the worker's
|
|
286
286
|
* `hostedProtocols()` and reflection everywhere; identity on HTTP only. The
|
|
287
287
|
* one construction path every transport uses (see `rpc-server.ts`).
|
|
288
288
|
*/
|