@query-farm/vgi 0.42.0 → 0.44.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 +5 -2
- package/dist/attach-ticket.d.ts +18 -7
- package/dist/client-entry.js +215 -91
- package/dist/client-entry.js.map +10 -9
- package/dist/codec/asd.d.ts +3 -1
- package/dist/codec/conform.d.ts +51 -0
- package/dist/errors.d.ts +5 -1
- package/dist/generated/vgi-service.d.ts +1315 -0
- package/dist/index.core.d.ts +1 -1
- package/dist/index.js +2143 -932
- package/dist/index.js.map +29 -28
- package/dist/protocol/dispatch.d.ts +14 -5
- package/dist/protocol/handlers/aggregate.d.ts +3 -2
- package/dist/protocol/handlers/catalog/admin.d.ts +2 -2
- package/dist/protocol/handlers/catalog/index.d.ts +3 -2
- package/dist/protocol/handlers/catalog/index_methods.d.ts +2 -2
- package/dist/protocol/handlers/catalog/macro.d.ts +2 -2
- package/dist/protocol/handlers/catalog/shared.d.ts +7 -14
- package/dist/protocol/handlers/catalog/table.d.ts +2 -2
- package/dist/protocol/handlers/catalog/view.d.ts +2 -2
- package/dist/protocol/handlers/function.d.ts +3 -2
- package/dist/protocol/handlers/shared.d.ts +2 -2
- package/dist/protocol/handlers/table-buffering.d.ts +3 -2
- package/dist/protocol/handlers/unimplemented.d.ts +4 -17
- package/dist/protocol/serializers/shared.d.ts +2 -1
- package/dist/rpc-server.d.ts +2 -2
- package/dist/serve-entry.js +2104 -903
- package/dist/serve-entry.js.map +25 -24
- package/dist/worker-cf-entry.js +2045 -842
- package/dist/worker-cf-entry.js.map +29 -28
- package/package.json +3 -3
- package/src/attach-ticket.ts +41 -13
- package/src/catalog/composite.ts +2 -1
- package/src/catalog/interface.ts +5 -4
- package/src/catalog/read-only.ts +8 -6
- package/src/client/client.ts +13 -5
- package/src/codec/asd.ts +5 -2
- package/src/codec/conform.ts +193 -0
- package/src/errors.ts +27 -7
- package/src/functions/registry.ts +3 -2
- package/src/generated/vgi-service.ts +2678 -0
- package/src/http/fetch.ts +1 -1
- package/src/index.core.ts +3 -1
- package/src/protocol/dispatch.ts +40 -29
- package/src/protocol/handlers/aggregate.ts +205 -232
- package/src/protocol/handlers/catalog/admin.ts +228 -299
- package/src/protocol/handlers/catalog/index.ts +17 -16
- package/src/protocol/handlers/catalog/index_methods.ts +26 -36
- package/src/protocol/handlers/catalog/macro.ts +54 -77
- package/src/protocol/handlers/catalog/shared.ts +30 -47
- package/src/protocol/handlers/catalog/table.ts +205 -270
- package/src/protocol/handlers/catalog/view.ts +59 -85
- package/src/protocol/handlers/function.ts +127 -156
- package/src/protocol/handlers/shared.ts +8 -6
- package/src/protocol/handlers/table-buffering.ts +53 -71
- package/src/protocol/handlers/unimplemented.ts +18 -62
- package/src/protocol/serializers/bind.ts +3 -1
- package/src/protocol/serializers/shared.ts +5 -2
- package/src/rpc-server.ts +7 -7
package/dist/worker-cf-entry.js
CHANGED
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
function __accessProp(key) {
|
|
6
|
+
return this[key];
|
|
7
|
+
}
|
|
8
|
+
var __toCommonJS = (from) => {
|
|
9
|
+
var entry = (__moduleCache ??= new WeakMap).get(from), desc;
|
|
10
|
+
if (entry)
|
|
11
|
+
return entry;
|
|
12
|
+
entry = __defProp({}, "__esModule", { value: true });
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (var key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(entry, key))
|
|
16
|
+
__defProp(entry, key, {
|
|
17
|
+
get: __accessProp.bind(from, key),
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
__moduleCache.set(from, entry);
|
|
22
|
+
return entry;
|
|
23
|
+
};
|
|
24
|
+
var __moduleCache;
|
|
2
25
|
var __returnValue = (v) => v;
|
|
3
26
|
function __exportSetter(name, newValue) {
|
|
4
27
|
this[name] = __returnValue.bind(null, newValue);
|
|
@@ -1978,6 +2001,11 @@ var init_arrow = __esm(() => {
|
|
|
1978
2001
|
});
|
|
1979
2002
|
|
|
1980
2003
|
// src/functions/storage-cf-do.ts
|
|
2004
|
+
var exports_storage_cf_do = {};
|
|
2005
|
+
__export(exports_storage_cf_do, {
|
|
2006
|
+
FunctionStorageCfDo: () => FunctionStorageCfDo
|
|
2007
|
+
});
|
|
2008
|
+
|
|
1981
2009
|
class FunctionStorageCfDo {
|
|
1982
2010
|
_baseUrl;
|
|
1983
2011
|
_token;
|
|
@@ -2423,7 +2451,7 @@ function resolveStorageFromEnv() {
|
|
|
2423
2451
|
return new FunctionStorageSqlite;
|
|
2424
2452
|
}
|
|
2425
2453
|
if (backend === "cloudflare-do") {
|
|
2426
|
-
init_storage_cf_do();
|
|
2454
|
+
const { FunctionStorageCfDo } = (init_storage_cf_do(), __toCommonJS(exports_storage_cf_do));
|
|
2427
2455
|
return FunctionStorageCfDo.fromEnv();
|
|
2428
2456
|
}
|
|
2429
2457
|
throw new Error(`Unknown VGI_WORKER_SHARED_STORAGE backend: '${backend}'. Supported: 'memory', 'sqlite', 'cloudflare-do'.`);
|
|
@@ -4138,6 +4166,135 @@ var VGI_RANGE_KEY = "vgi_range";
|
|
|
4138
4166
|
var VGI_PATTERN_KEY = "vgi_pattern";
|
|
4139
4167
|
var DEFAULT_MAX_WORKERS = 99999;
|
|
4140
4168
|
|
|
4169
|
+
// src/codec/conform.ts
|
|
4170
|
+
init_arrow();
|
|
4171
|
+
var OPTIONAL_ITEM_FIELDS = new Set(["argument_names"]);
|
|
4172
|
+
function children(type) {
|
|
4173
|
+
return type.children ?? [];
|
|
4174
|
+
}
|
|
4175
|
+
function mapValueType(type) {
|
|
4176
|
+
const entries = children(type)[0].type;
|
|
4177
|
+
return children(entries)[1].type;
|
|
4178
|
+
}
|
|
4179
|
+
function mapPairs(raw) {
|
|
4180
|
+
if (Array.isArray(raw))
|
|
4181
|
+
return raw.map((e) => Array.isArray(e) ? [e[0], e[1]] : [e?.key, e?.value]);
|
|
4182
|
+
if (raw instanceof Map)
|
|
4183
|
+
return Array.from(raw.entries());
|
|
4184
|
+
if (typeof raw[Symbol.iterator] === "function")
|
|
4185
|
+
return Array.from(raw);
|
|
4186
|
+
return Object.entries(raw);
|
|
4187
|
+
}
|
|
4188
|
+
function zeroValue(type) {
|
|
4189
|
+
if (isUtf8(type) || isDictionary(type))
|
|
4190
|
+
return "";
|
|
4191
|
+
if (isBinary(type))
|
|
4192
|
+
return new Uint8Array(0);
|
|
4193
|
+
if (isBool(type))
|
|
4194
|
+
return false;
|
|
4195
|
+
if (isInt(type))
|
|
4196
|
+
return type.bitWidth === 64 ? 0n : 0;
|
|
4197
|
+
if (isFloat(type))
|
|
4198
|
+
return 0;
|
|
4199
|
+
if (isList(type) || isMap(type))
|
|
4200
|
+
return [];
|
|
4201
|
+
if (isStruct(type)) {
|
|
4202
|
+
const out = {};
|
|
4203
|
+
for (const c of children(type))
|
|
4204
|
+
out[c.name] = c.nullable ? null : conformValue(c.type, undefined, false, c.name);
|
|
4205
|
+
return out;
|
|
4206
|
+
}
|
|
4207
|
+
return null;
|
|
4208
|
+
}
|
|
4209
|
+
var HAS_CONTAINER = new WeakMap;
|
|
4210
|
+
function hasContainer(type) {
|
|
4211
|
+
const cached = HAS_CONTAINER.get(type);
|
|
4212
|
+
if (cached !== undefined)
|
|
4213
|
+
return cached;
|
|
4214
|
+
let has = isList(type) || isMap(type);
|
|
4215
|
+
if (!has && isStruct(type))
|
|
4216
|
+
has = children(type).some((c) => hasContainer(c.type));
|
|
4217
|
+
HAS_CONTAINER.set(type, has);
|
|
4218
|
+
return has;
|
|
4219
|
+
}
|
|
4220
|
+
function conformValue(type, value, nullable, name) {
|
|
4221
|
+
if (value == null) {
|
|
4222
|
+
if (nullable)
|
|
4223
|
+
return value ?? null;
|
|
4224
|
+
if (isList(type) || isMap(type))
|
|
4225
|
+
return [];
|
|
4226
|
+
return value;
|
|
4227
|
+
}
|
|
4228
|
+
if (!hasContainer(type))
|
|
4229
|
+
return value;
|
|
4230
|
+
if (isList(type)) {
|
|
4231
|
+
const itemType = children(type)[0].type;
|
|
4232
|
+
const itemsNullable = OPTIONAL_ITEM_FIELDS.has(name);
|
|
4233
|
+
const items = Array.isArray(value) ? value : Array.from(value);
|
|
4234
|
+
let changed = !Array.isArray(value);
|
|
4235
|
+
const out = items.map((item) => {
|
|
4236
|
+
const next = item == null && !itemsNullable ? zeroValue(itemType) : conformValue(itemType, item, true, name);
|
|
4237
|
+
if (next !== item)
|
|
4238
|
+
changed = true;
|
|
4239
|
+
return next;
|
|
4240
|
+
});
|
|
4241
|
+
return changed ? out : value;
|
|
4242
|
+
}
|
|
4243
|
+
if (isMap(type)) {
|
|
4244
|
+
const valueType = mapValueType(type);
|
|
4245
|
+
const pairs = mapPairs(value);
|
|
4246
|
+
let changed = false;
|
|
4247
|
+
const out = pairs.map(([k, v]) => {
|
|
4248
|
+
const next = v == null ? zeroValue(valueType) : conformValue(valueType, v, true, name);
|
|
4249
|
+
if (next !== v)
|
|
4250
|
+
changed = true;
|
|
4251
|
+
return [k, next];
|
|
4252
|
+
});
|
|
4253
|
+
return changed ? out : value;
|
|
4254
|
+
}
|
|
4255
|
+
if (isStruct(type)) {
|
|
4256
|
+
let out = null;
|
|
4257
|
+
for (const c of children(type)) {
|
|
4258
|
+
const v = value[c.name];
|
|
4259
|
+
const next = conformValue(c.type, v, c.nullable, c.name);
|
|
4260
|
+
if (next !== v) {
|
|
4261
|
+
(out ??= { ...value })[c.name] = next;
|
|
4262
|
+
}
|
|
4263
|
+
}
|
|
4264
|
+
return out ?? value;
|
|
4265
|
+
}
|
|
4266
|
+
return value;
|
|
4267
|
+
}
|
|
4268
|
+
function conformRecord(schema, obj) {
|
|
4269
|
+
let out = null;
|
|
4270
|
+
for (const f of schema.fields) {
|
|
4271
|
+
const v = obj[f.name];
|
|
4272
|
+
const next = conformValue(f.type, v, f.nullable, f.name);
|
|
4273
|
+
if (next !== v) {
|
|
4274
|
+
(out ??= { ...obj })[f.name] = next;
|
|
4275
|
+
}
|
|
4276
|
+
}
|
|
4277
|
+
return out ?? obj;
|
|
4278
|
+
}
|
|
4279
|
+
function conformColumns(schema, columns) {
|
|
4280
|
+
let out = null;
|
|
4281
|
+
for (const f of schema.fields) {
|
|
4282
|
+
const col = columns[f.name];
|
|
4283
|
+
const rows = col ?? [undefined];
|
|
4284
|
+
let changed = col === undefined;
|
|
4285
|
+
const next = rows.map((v) => {
|
|
4286
|
+
const c = conformValue(f.type, v, f.nullable, f.name);
|
|
4287
|
+
if (c !== v)
|
|
4288
|
+
changed = true;
|
|
4289
|
+
return c;
|
|
4290
|
+
});
|
|
4291
|
+
if (changed) {
|
|
4292
|
+
(out ??= { ...columns })[f.name] = next;
|
|
4293
|
+
}
|
|
4294
|
+
}
|
|
4295
|
+
return out ?? columns;
|
|
4296
|
+
}
|
|
4297
|
+
|
|
4141
4298
|
// src/protocol/serializers/shared.ts
|
|
4142
4299
|
function toUint8Array2(val) {
|
|
4143
4300
|
if (typeof val === "string")
|
|
@@ -4675,8 +4832,1260 @@ var arrowStateSerializer = {
|
|
|
4675
4832
|
}
|
|
4676
4833
|
};
|
|
4677
4834
|
|
|
4678
|
-
// src/
|
|
4679
|
-
|
|
4835
|
+
// src/generated/vgi-service.ts
|
|
4836
|
+
init_arrow();
|
|
4837
|
+
import {
|
|
4838
|
+
MethodNotImplementedError,
|
|
4839
|
+
Protocol
|
|
4840
|
+
} from "@query-farm/vgi-rpc";
|
|
4841
|
+
var VGI_PROTOCOL_NAME = "vgi.v2";
|
|
4842
|
+
var VGI_PROTOCOL_VERSION = "2.1.0";
|
|
4843
|
+
function exchangeStream(callbacks) {
|
|
4844
|
+
return { kind: "exchange", ...callbacks };
|
|
4845
|
+
}
|
|
4846
|
+
function producerStream(callbacks) {
|
|
4847
|
+
return { kind: "producer", ...callbacks };
|
|
4848
|
+
}
|
|
4849
|
+
var VGI_V2_METHODS = [
|
|
4850
|
+
{
|
|
4851
|
+
name: "aggregate_bind",
|
|
4852
|
+
key: "aggregateBind",
|
|
4853
|
+
type: "unary",
|
|
4854
|
+
params: schema2([
|
|
4855
|
+
field2("request", binary2(), false)
|
|
4856
|
+
]),
|
|
4857
|
+
result: schema2([
|
|
4858
|
+
field2("result", binary2(), false)
|
|
4859
|
+
]),
|
|
4860
|
+
doc: "Bind an aggregate function, return output schema and execution_id."
|
|
4861
|
+
},
|
|
4862
|
+
{
|
|
4863
|
+
name: "aggregate_combine",
|
|
4864
|
+
key: "aggregateCombine",
|
|
4865
|
+
type: "unary",
|
|
4866
|
+
params: schema2([
|
|
4867
|
+
field2("request", binary2(), false)
|
|
4868
|
+
]),
|
|
4869
|
+
result: schema2([
|
|
4870
|
+
field2("result", binary2(), false)
|
|
4871
|
+
]),
|
|
4872
|
+
doc: "Merge source states into target states."
|
|
4873
|
+
},
|
|
4874
|
+
{
|
|
4875
|
+
name: "aggregate_destructor",
|
|
4876
|
+
key: "aggregateDestructor",
|
|
4877
|
+
type: "unary",
|
|
4878
|
+
params: schema2([
|
|
4879
|
+
field2("request", binary2(), false)
|
|
4880
|
+
]),
|
|
4881
|
+
result: schema2([
|
|
4882
|
+
field2("result", binary2(), false)
|
|
4883
|
+
]),
|
|
4884
|
+
doc: "Best-effort cleanup of aggregate states. Must not raise."
|
|
4885
|
+
},
|
|
4886
|
+
{
|
|
4887
|
+
name: "aggregate_finalize",
|
|
4888
|
+
key: "aggregateFinalize",
|
|
4889
|
+
type: "unary",
|
|
4890
|
+
params: schema2([
|
|
4891
|
+
field2("request", binary2(), false)
|
|
4892
|
+
]),
|
|
4893
|
+
result: schema2([
|
|
4894
|
+
field2("result", binary2(), false)
|
|
4895
|
+
]),
|
|
4896
|
+
doc: "Produce results for a chunk of group_ids."
|
|
4897
|
+
},
|
|
4898
|
+
{
|
|
4899
|
+
name: "aggregate_streaming_chunk",
|
|
4900
|
+
key: "aggregateStreamingChunk",
|
|
4901
|
+
type: "unary",
|
|
4902
|
+
params: schema2([
|
|
4903
|
+
field2("request", binary2(), false)
|
|
4904
|
+
]),
|
|
4905
|
+
result: schema2([
|
|
4906
|
+
field2("result", binary2(), false)
|
|
4907
|
+
]),
|
|
4908
|
+
doc: "Process one input chunk; returns one output row per input row."
|
|
4909
|
+
},
|
|
4910
|
+
{
|
|
4911
|
+
name: "aggregate_streaming_close",
|
|
4912
|
+
key: "aggregateStreamingClose",
|
|
4913
|
+
type: "unary",
|
|
4914
|
+
params: schema2([
|
|
4915
|
+
field2("request", binary2(), false)
|
|
4916
|
+
]),
|
|
4917
|
+
result: schema2([
|
|
4918
|
+
field2("result", binary2(), false)
|
|
4919
|
+
]),
|
|
4920
|
+
doc: "End the streaming session, free per-session state."
|
|
4921
|
+
},
|
|
4922
|
+
{
|
|
4923
|
+
name: "aggregate_streaming_open",
|
|
4924
|
+
key: "aggregateStreamingOpen",
|
|
4925
|
+
type: "unary",
|
|
4926
|
+
params: schema2([
|
|
4927
|
+
field2("request", binary2(), false)
|
|
4928
|
+
]),
|
|
4929
|
+
result: schema2([
|
|
4930
|
+
field2("result", binary2(), false)
|
|
4931
|
+
]),
|
|
4932
|
+
doc: "Start a streaming-partitioned aggregate session."
|
|
4933
|
+
},
|
|
4934
|
+
{
|
|
4935
|
+
name: "aggregate_update",
|
|
4936
|
+
key: "aggregateUpdate",
|
|
4937
|
+
type: "unary",
|
|
4938
|
+
params: schema2([
|
|
4939
|
+
field2("request", binary2(), false)
|
|
4940
|
+
]),
|
|
4941
|
+
result: schema2([
|
|
4942
|
+
field2("result", binary2(), false)
|
|
4943
|
+
]),
|
|
4944
|
+
doc: "Accumulate rows from a `DataChunk` into per-group state."
|
|
4945
|
+
},
|
|
4946
|
+
{
|
|
4947
|
+
name: "aggregate_window",
|
|
4948
|
+
key: "aggregateWindow",
|
|
4949
|
+
type: "unary",
|
|
4950
|
+
params: schema2([
|
|
4951
|
+
field2("request", binary2(), false)
|
|
4952
|
+
]),
|
|
4953
|
+
result: schema2([
|
|
4954
|
+
field2("result", binary2(), false)
|
|
4955
|
+
]),
|
|
4956
|
+
doc: "Compute an aggregate value for one output row of the window."
|
|
4957
|
+
},
|
|
4958
|
+
{
|
|
4959
|
+
name: "aggregate_window_batch",
|
|
4960
|
+
key: "aggregateWindowBatch",
|
|
4961
|
+
type: "unary",
|
|
4962
|
+
params: schema2([
|
|
4963
|
+
field2("request", binary2(), false)
|
|
4964
|
+
]),
|
|
4965
|
+
result: schema2([
|
|
4966
|
+
field2("result", binary2(), false)
|
|
4967
|
+
]),
|
|
4968
|
+
doc: "Compute ``count`` window output rows in one batched RPC."
|
|
4969
|
+
},
|
|
4970
|
+
{
|
|
4971
|
+
name: "aggregate_window_destructor",
|
|
4972
|
+
key: "aggregateWindowDestructor",
|
|
4973
|
+
type: "unary",
|
|
4974
|
+
params: schema2([
|
|
4975
|
+
field2("request", binary2(), false)
|
|
4976
|
+
]),
|
|
4977
|
+
result: schema2([
|
|
4978
|
+
field2("result", binary2(), false)
|
|
4979
|
+
]),
|
|
4980
|
+
doc: "Evict a cached partition from storage."
|
|
4981
|
+
},
|
|
4982
|
+
{
|
|
4983
|
+
name: "aggregate_window_init",
|
|
4984
|
+
key: "aggregateWindowInit",
|
|
4985
|
+
type: "unary",
|
|
4986
|
+
params: schema2([
|
|
4987
|
+
field2("request", binary2(), false)
|
|
4988
|
+
]),
|
|
4989
|
+
result: schema2([
|
|
4990
|
+
field2("result", binary2(), false)
|
|
4991
|
+
]),
|
|
4992
|
+
doc: "Ship a partition to the worker for windowed aggregation."
|
|
4993
|
+
},
|
|
4994
|
+
{
|
|
4995
|
+
name: "bind",
|
|
4996
|
+
key: "bind",
|
|
4997
|
+
type: "unary",
|
|
4998
|
+
params: schema2([
|
|
4999
|
+
field2("request", binary2(), false)
|
|
5000
|
+
]),
|
|
5001
|
+
result: schema2([
|
|
5002
|
+
field2("result", binary2(), false)
|
|
5003
|
+
]),
|
|
5004
|
+
doc: "Resolve output schema and validate arguments."
|
|
5005
|
+
},
|
|
5006
|
+
{
|
|
5007
|
+
name: "catalog_attach",
|
|
5008
|
+
key: "catalogAttach",
|
|
5009
|
+
type: "unary",
|
|
5010
|
+
params: schema2([
|
|
5011
|
+
field2("request", binary2(), false)
|
|
5012
|
+
]),
|
|
5013
|
+
result: schema2([
|
|
5014
|
+
field2("result", binary2(), false)
|
|
5015
|
+
]),
|
|
5016
|
+
doc: "Attach to a catalog with options."
|
|
5017
|
+
},
|
|
5018
|
+
{
|
|
5019
|
+
name: "catalog_catalogs",
|
|
5020
|
+
key: "catalogCatalogs",
|
|
5021
|
+
type: "unary",
|
|
5022
|
+
params: schema2([]),
|
|
5023
|
+
result: schema2([
|
|
5024
|
+
field2("result", binary2(), false)
|
|
5025
|
+
]),
|
|
5026
|
+
doc: "List available catalog names."
|
|
5027
|
+
},
|
|
5028
|
+
{
|
|
5029
|
+
name: "catalog_contents",
|
|
5030
|
+
key: "catalogContents",
|
|
5031
|
+
type: "unary",
|
|
5032
|
+
params: schema2([
|
|
5033
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5034
|
+
field2("if_none_match", utf82(), true)
|
|
5035
|
+
]),
|
|
5036
|
+
result: schema2([
|
|
5037
|
+
field2("result", binary2(), false)
|
|
5038
|
+
]),
|
|
5039
|
+
doc: "Return every schema and all of its contents in one result."
|
|
5040
|
+
},
|
|
5041
|
+
{
|
|
5042
|
+
name: "catalog_copy_from_formats",
|
|
5043
|
+
key: "catalogCopyFromFormats",
|
|
5044
|
+
type: "unary",
|
|
5045
|
+
params: schema2([
|
|
5046
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5047
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5048
|
+
]),
|
|
5049
|
+
result: schema2([
|
|
5050
|
+
field2("result", binary2(), false)
|
|
5051
|
+
]),
|
|
5052
|
+
doc: "List custom ``COPY ... FROM`` formats advertised by this catalog."
|
|
5053
|
+
},
|
|
5054
|
+
{
|
|
5055
|
+
name: "catalog_create",
|
|
5056
|
+
key: "catalogCreate",
|
|
5057
|
+
type: "unary",
|
|
5058
|
+
params: schema2([
|
|
5059
|
+
field2("request", binary2(), false)
|
|
5060
|
+
]),
|
|
5061
|
+
result: schema2([]),
|
|
5062
|
+
doc: "Create a new catalog."
|
|
5063
|
+
},
|
|
5064
|
+
{
|
|
5065
|
+
name: "catalog_detach",
|
|
5066
|
+
key: "catalogDetach",
|
|
5067
|
+
type: "unary",
|
|
5068
|
+
params: schema2([
|
|
5069
|
+
field2("attach_opaque_data", binary2(), false)
|
|
5070
|
+
]),
|
|
5071
|
+
result: schema2([]),
|
|
5072
|
+
doc: "Detach from a catalog."
|
|
5073
|
+
},
|
|
5074
|
+
{
|
|
5075
|
+
name: "catalog_drop",
|
|
5076
|
+
key: "catalogDrop",
|
|
5077
|
+
type: "unary",
|
|
5078
|
+
params: schema2([
|
|
5079
|
+
field2("name", utf82(), false)
|
|
5080
|
+
]),
|
|
5081
|
+
result: schema2([]),
|
|
5082
|
+
doc: "Drop a catalog."
|
|
5083
|
+
},
|
|
5084
|
+
{
|
|
5085
|
+
name: "catalog_index_create",
|
|
5086
|
+
key: "catalogIndexCreate",
|
|
5087
|
+
type: "unary",
|
|
5088
|
+
params: schema2([
|
|
5089
|
+
field2("request", binary2(), false)
|
|
5090
|
+
]),
|
|
5091
|
+
result: schema2([]),
|
|
5092
|
+
doc: "Create a new index."
|
|
5093
|
+
},
|
|
5094
|
+
{
|
|
5095
|
+
name: "catalog_index_drop",
|
|
5096
|
+
key: "catalogIndexDrop",
|
|
5097
|
+
type: "unary",
|
|
5098
|
+
params: schema2([
|
|
5099
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5100
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
5101
|
+
field2("name", utf82(), false),
|
|
5102
|
+
field2("ignore_not_found", bool2(), false),
|
|
5103
|
+
field2("cascade", bool2(), false),
|
|
5104
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5105
|
+
]),
|
|
5106
|
+
result: schema2([]),
|
|
5107
|
+
doc: "Drop an index."
|
|
5108
|
+
},
|
|
5109
|
+
{
|
|
5110
|
+
name: "catalog_index_get",
|
|
5111
|
+
key: "catalogIndexGet",
|
|
5112
|
+
type: "unary",
|
|
5113
|
+
params: schema2([
|
|
5114
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5115
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
5116
|
+
field2("name", utf82(), false),
|
|
5117
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5118
|
+
]),
|
|
5119
|
+
result: schema2([
|
|
5120
|
+
field2("result", binary2(), false)
|
|
5121
|
+
]),
|
|
5122
|
+
doc: "Get information about an index. Returns 0 or 1 items."
|
|
5123
|
+
},
|
|
5124
|
+
{
|
|
5125
|
+
name: "catalog_macro_create",
|
|
5126
|
+
key: "catalogMacroCreate",
|
|
5127
|
+
type: "unary",
|
|
5128
|
+
params: schema2([
|
|
5129
|
+
field2("request", binary2(), false)
|
|
5130
|
+
]),
|
|
5131
|
+
result: schema2([]),
|
|
5132
|
+
doc: "Create a new macro."
|
|
5133
|
+
},
|
|
5134
|
+
{
|
|
5135
|
+
name: "catalog_macro_drop",
|
|
5136
|
+
key: "catalogMacroDrop",
|
|
5137
|
+
type: "unary",
|
|
5138
|
+
params: schema2([
|
|
5139
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5140
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
5141
|
+
field2("name", utf82(), false),
|
|
5142
|
+
field2("ignore_not_found", bool2(), false),
|
|
5143
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5144
|
+
]),
|
|
5145
|
+
result: schema2([]),
|
|
5146
|
+
doc: "Drop a macro."
|
|
5147
|
+
},
|
|
5148
|
+
{
|
|
5149
|
+
name: "catalog_macro_get",
|
|
5150
|
+
key: "catalogMacroGet",
|
|
5151
|
+
type: "unary",
|
|
5152
|
+
params: schema2([
|
|
5153
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5154
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
5155
|
+
field2("name", utf82(), false),
|
|
5156
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5157
|
+
]),
|
|
5158
|
+
result: schema2([
|
|
5159
|
+
field2("result", binary2(), false)
|
|
5160
|
+
]),
|
|
5161
|
+
doc: "Get information about a macro. Returns 0 or 1 items."
|
|
5162
|
+
},
|
|
5163
|
+
{
|
|
5164
|
+
name: "catalog_schema_contents_functions",
|
|
5165
|
+
key: "catalogSchemaContentsFunctions",
|
|
5166
|
+
type: "unary",
|
|
5167
|
+
params: schema2([
|
|
5168
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5169
|
+
field2("path", list2(field2("item", utf82(), true)), false),
|
|
5170
|
+
field2("type", dictionary2(utf82(), int162()), false),
|
|
5171
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5172
|
+
]),
|
|
5173
|
+
result: schema2([
|
|
5174
|
+
field2("result", binary2(), false)
|
|
5175
|
+
]),
|
|
5176
|
+
doc: "List functions in a schema (scalar or table)."
|
|
5177
|
+
},
|
|
5178
|
+
{
|
|
5179
|
+
name: "catalog_schema_contents_indexes",
|
|
5180
|
+
key: "catalogSchemaContentsIndexes",
|
|
5181
|
+
type: "unary",
|
|
5182
|
+
params: schema2([
|
|
5183
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5184
|
+
field2("path", list2(field2("item", utf82(), true)), false),
|
|
5185
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5186
|
+
]),
|
|
5187
|
+
result: schema2([
|
|
5188
|
+
field2("result", binary2(), false)
|
|
5189
|
+
]),
|
|
5190
|
+
doc: "List indexes in a schema."
|
|
5191
|
+
},
|
|
5192
|
+
{
|
|
5193
|
+
name: "catalog_schema_contents_macros",
|
|
5194
|
+
key: "catalogSchemaContentsMacros",
|
|
5195
|
+
type: "unary",
|
|
5196
|
+
params: schema2([
|
|
5197
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5198
|
+
field2("path", list2(field2("item", utf82(), true)), false),
|
|
5199
|
+
field2("type", dictionary2(utf82(), int162()), false),
|
|
5200
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5201
|
+
]),
|
|
5202
|
+
result: schema2([
|
|
5203
|
+
field2("result", binary2(), false)
|
|
5204
|
+
]),
|
|
5205
|
+
doc: "List macros in a schema (scalar or table)."
|
|
5206
|
+
},
|
|
5207
|
+
{
|
|
5208
|
+
name: "catalog_schema_contents_tables",
|
|
5209
|
+
key: "catalogSchemaContentsTables",
|
|
5210
|
+
type: "unary",
|
|
5211
|
+
params: schema2([
|
|
5212
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5213
|
+
field2("path", list2(field2("item", utf82(), true)), false),
|
|
5214
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5215
|
+
]),
|
|
5216
|
+
result: schema2([
|
|
5217
|
+
field2("result", binary2(), false)
|
|
5218
|
+
]),
|
|
5219
|
+
doc: "List tables in a schema."
|
|
5220
|
+
},
|
|
5221
|
+
{
|
|
5222
|
+
name: "catalog_schema_contents_views",
|
|
5223
|
+
key: "catalogSchemaContentsViews",
|
|
5224
|
+
type: "unary",
|
|
5225
|
+
params: schema2([
|
|
5226
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5227
|
+
field2("path", list2(field2("item", utf82(), true)), false),
|
|
5228
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5229
|
+
]),
|
|
5230
|
+
result: schema2([
|
|
5231
|
+
field2("result", binary2(), false)
|
|
5232
|
+
]),
|
|
5233
|
+
doc: "List views in a schema."
|
|
5234
|
+
},
|
|
5235
|
+
{
|
|
5236
|
+
name: "catalog_schema_create",
|
|
5237
|
+
key: "catalogSchemaCreate",
|
|
5238
|
+
type: "unary",
|
|
5239
|
+
params: schema2([
|
|
5240
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5241
|
+
field2("path", list2(field2("item", utf82(), true)), false),
|
|
5242
|
+
field2("on_conflict", dictionary2(utf82(), int162()), false),
|
|
5243
|
+
field2("comment", utf82(), true),
|
|
5244
|
+
field2("tags", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), true),
|
|
5245
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5246
|
+
]),
|
|
5247
|
+
result: schema2([]),
|
|
5248
|
+
doc: "Create a new schema."
|
|
5249
|
+
},
|
|
5250
|
+
{
|
|
5251
|
+
name: "catalog_schema_drop",
|
|
5252
|
+
key: "catalogSchemaDrop",
|
|
5253
|
+
type: "unary",
|
|
5254
|
+
params: schema2([
|
|
5255
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5256
|
+
field2("path", list2(field2("item", utf82(), true)), false),
|
|
5257
|
+
field2("ignore_not_found", bool2(), false),
|
|
5258
|
+
field2("cascade", bool2(), false),
|
|
5259
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5260
|
+
]),
|
|
5261
|
+
result: schema2([]),
|
|
5262
|
+
doc: "Drop a schema."
|
|
5263
|
+
},
|
|
5264
|
+
{
|
|
5265
|
+
name: "catalog_schema_get",
|
|
5266
|
+
key: "catalogSchemaGet",
|
|
5267
|
+
type: "unary",
|
|
5268
|
+
params: schema2([
|
|
5269
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5270
|
+
field2("path", list2(field2("item", utf82(), true)), false),
|
|
5271
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5272
|
+
]),
|
|
5273
|
+
result: schema2([
|
|
5274
|
+
field2("result", binary2(), false)
|
|
5275
|
+
]),
|
|
5276
|
+
doc: "Get information about a schema. Returns 0 or 1 items."
|
|
5277
|
+
},
|
|
5278
|
+
{
|
|
5279
|
+
name: "catalog_schemas",
|
|
5280
|
+
key: "catalogSchemas",
|
|
5281
|
+
type: "unary",
|
|
5282
|
+
params: schema2([
|
|
5283
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5284
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5285
|
+
]),
|
|
5286
|
+
result: schema2([
|
|
5287
|
+
field2("result", binary2(), false)
|
|
5288
|
+
]),
|
|
5289
|
+
doc: "List schemas in the catalog."
|
|
5290
|
+
},
|
|
5291
|
+
{
|
|
5292
|
+
name: "catalog_table_column_add",
|
|
5293
|
+
key: "catalogTableColumnAdd",
|
|
5294
|
+
type: "unary",
|
|
5295
|
+
params: schema2([
|
|
5296
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5297
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
5298
|
+
field2("name", utf82(), false),
|
|
5299
|
+
field2("column_definition", binary2(), false),
|
|
5300
|
+
field2("ignore_not_found", bool2(), false),
|
|
5301
|
+
field2("if_column_not_exists", bool2(), false),
|
|
5302
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5303
|
+
]),
|
|
5304
|
+
result: schema2([]),
|
|
5305
|
+
doc: "Add a new column to a table."
|
|
5306
|
+
},
|
|
5307
|
+
{
|
|
5308
|
+
name: "catalog_table_column_comment_set",
|
|
5309
|
+
key: "catalogTableColumnCommentSet",
|
|
5310
|
+
type: "unary",
|
|
5311
|
+
params: schema2([
|
|
5312
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5313
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
5314
|
+
field2("name", utf82(), false),
|
|
5315
|
+
field2("column_name", utf82(), false),
|
|
5316
|
+
field2("comment", utf82(), true),
|
|
5317
|
+
field2("ignore_not_found", bool2(), false),
|
|
5318
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5319
|
+
]),
|
|
5320
|
+
result: schema2([]),
|
|
5321
|
+
doc: "Set or clear the comment on a table column."
|
|
5322
|
+
},
|
|
5323
|
+
{
|
|
5324
|
+
name: "catalog_table_column_default_drop",
|
|
5325
|
+
key: "catalogTableColumnDefaultDrop",
|
|
5326
|
+
type: "unary",
|
|
5327
|
+
params: schema2([
|
|
5328
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5329
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
5330
|
+
field2("name", utf82(), false),
|
|
5331
|
+
field2("column_name", utf82(), false),
|
|
5332
|
+
field2("ignore_not_found", bool2(), false),
|
|
5333
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5334
|
+
]),
|
|
5335
|
+
result: schema2([]),
|
|
5336
|
+
doc: "Remove the default value from a column."
|
|
5337
|
+
},
|
|
5338
|
+
{
|
|
5339
|
+
name: "catalog_table_column_default_set",
|
|
5340
|
+
key: "catalogTableColumnDefaultSet",
|
|
5341
|
+
type: "unary",
|
|
5342
|
+
params: schema2([
|
|
5343
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5344
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
5345
|
+
field2("name", utf82(), false),
|
|
5346
|
+
field2("column_name", utf82(), false),
|
|
5347
|
+
field2("expression", utf82(), false),
|
|
5348
|
+
field2("ignore_not_found", bool2(), false),
|
|
5349
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5350
|
+
]),
|
|
5351
|
+
result: schema2([]),
|
|
5352
|
+
doc: "Set the default value expression for a column."
|
|
5353
|
+
},
|
|
5354
|
+
{
|
|
5355
|
+
name: "catalog_table_column_drop",
|
|
5356
|
+
key: "catalogTableColumnDrop",
|
|
5357
|
+
type: "unary",
|
|
5358
|
+
params: schema2([
|
|
5359
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5360
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
5361
|
+
field2("name", utf82(), false),
|
|
5362
|
+
field2("column_name", utf82(), false),
|
|
5363
|
+
field2("ignore_not_found", bool2(), false),
|
|
5364
|
+
field2("if_column_exists", bool2(), false),
|
|
5365
|
+
field2("cascade", bool2(), false),
|
|
5366
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5367
|
+
]),
|
|
5368
|
+
result: schema2([]),
|
|
5369
|
+
doc: "Drop a column from a table."
|
|
5370
|
+
},
|
|
5371
|
+
{
|
|
5372
|
+
name: "catalog_table_column_rename",
|
|
5373
|
+
key: "catalogTableColumnRename",
|
|
5374
|
+
type: "unary",
|
|
5375
|
+
params: schema2([
|
|
5376
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5377
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
5378
|
+
field2("name", utf82(), false),
|
|
5379
|
+
field2("column_name", utf82(), false),
|
|
5380
|
+
field2("new_column_name", utf82(), false),
|
|
5381
|
+
field2("ignore_not_found", bool2(), false),
|
|
5382
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5383
|
+
]),
|
|
5384
|
+
result: schema2([]),
|
|
5385
|
+
doc: "Rename a column."
|
|
5386
|
+
},
|
|
5387
|
+
{
|
|
5388
|
+
name: "catalog_table_column_statistics_get",
|
|
5389
|
+
key: "catalogTableColumnStatisticsGet",
|
|
5390
|
+
type: "unary",
|
|
5391
|
+
params: schema2([
|
|
5392
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5393
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
5394
|
+
field2("name", utf82(), false),
|
|
5395
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5396
|
+
]),
|
|
5397
|
+
result: schema2([
|
|
5398
|
+
field2("result", binary2(), true)
|
|
5399
|
+
]),
|
|
5400
|
+
doc: "Get column statistics for a table."
|
|
5401
|
+
},
|
|
5402
|
+
{
|
|
5403
|
+
name: "catalog_table_column_type_change",
|
|
5404
|
+
key: "catalogTableColumnTypeChange",
|
|
5405
|
+
type: "unary",
|
|
5406
|
+
params: schema2([
|
|
5407
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5408
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
5409
|
+
field2("name", utf82(), false),
|
|
5410
|
+
field2("column_definition", binary2(), false),
|
|
5411
|
+
field2("expression", utf82(), true),
|
|
5412
|
+
field2("ignore_not_found", bool2(), false),
|
|
5413
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5414
|
+
]),
|
|
5415
|
+
result: schema2([]),
|
|
5416
|
+
doc: "Change the type of a column."
|
|
5417
|
+
},
|
|
5418
|
+
{
|
|
5419
|
+
name: "catalog_table_comment_set",
|
|
5420
|
+
key: "catalogTableCommentSet",
|
|
5421
|
+
type: "unary",
|
|
5422
|
+
params: schema2([
|
|
5423
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5424
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
5425
|
+
field2("name", utf82(), false),
|
|
5426
|
+
field2("comment", utf82(), true),
|
|
5427
|
+
field2("ignore_not_found", bool2(), false),
|
|
5428
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5429
|
+
]),
|
|
5430
|
+
result: schema2([]),
|
|
5431
|
+
doc: "Set or clear the comment on a table."
|
|
5432
|
+
},
|
|
5433
|
+
{
|
|
5434
|
+
name: "catalog_table_create",
|
|
5435
|
+
key: "catalogTableCreate",
|
|
5436
|
+
type: "unary",
|
|
5437
|
+
params: schema2([
|
|
5438
|
+
field2("request", binary2(), false)
|
|
5439
|
+
]),
|
|
5440
|
+
result: schema2([]),
|
|
5441
|
+
doc: "Create a new table."
|
|
5442
|
+
},
|
|
5443
|
+
{
|
|
5444
|
+
name: "catalog_table_delete_function_get",
|
|
5445
|
+
key: "catalogTableDeleteFunctionGet",
|
|
5446
|
+
type: "unary",
|
|
5447
|
+
params: schema2([
|
|
5448
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5449
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
5450
|
+
field2("name", utf82(), false),
|
|
5451
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5452
|
+
]),
|
|
5453
|
+
result: schema2([
|
|
5454
|
+
field2("result", binary2(), false)
|
|
5455
|
+
]),
|
|
5456
|
+
doc: "Get the delete function for a table. Returns `WriteFunctionResult` as IPC bytes."
|
|
5457
|
+
},
|
|
5458
|
+
{
|
|
5459
|
+
name: "catalog_table_drop",
|
|
5460
|
+
key: "catalogTableDrop",
|
|
5461
|
+
type: "unary",
|
|
5462
|
+
params: schema2([
|
|
5463
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5464
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
5465
|
+
field2("name", utf82(), false),
|
|
5466
|
+
field2("ignore_not_found", bool2(), false),
|
|
5467
|
+
field2("cascade", bool2(), false),
|
|
5468
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5469
|
+
]),
|
|
5470
|
+
result: schema2([]),
|
|
5471
|
+
doc: "Drop a table."
|
|
5472
|
+
},
|
|
5473
|
+
{
|
|
5474
|
+
name: "catalog_table_get",
|
|
5475
|
+
key: "catalogTableGet",
|
|
5476
|
+
type: "unary",
|
|
5477
|
+
params: schema2([
|
|
5478
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5479
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
5480
|
+
field2("name", utf82(), false),
|
|
5481
|
+
field2("at_unit", utf82(), true),
|
|
5482
|
+
field2("at_value", utf82(), true),
|
|
5483
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5484
|
+
]),
|
|
5485
|
+
result: schema2([
|
|
5486
|
+
field2("result", binary2(), false)
|
|
5487
|
+
]),
|
|
5488
|
+
doc: "Get information about a table. Returns 0 or 1 items."
|
|
5489
|
+
},
|
|
5490
|
+
{
|
|
5491
|
+
name: "catalog_table_insert_function_get",
|
|
5492
|
+
key: "catalogTableInsertFunctionGet",
|
|
5493
|
+
type: "unary",
|
|
5494
|
+
params: schema2([
|
|
5495
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5496
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
5497
|
+
field2("name", utf82(), false),
|
|
5498
|
+
field2("transaction_opaque_data", binary2(), true),
|
|
5499
|
+
field2("writable_branch_function_name", utf82(), true)
|
|
5500
|
+
]),
|
|
5501
|
+
result: schema2([
|
|
5502
|
+
field2("result", binary2(), false)
|
|
5503
|
+
]),
|
|
5504
|
+
doc: "Get the insert function for a table. Returns `WriteFunctionResult` as IPC bytes."
|
|
5505
|
+
},
|
|
5506
|
+
{
|
|
5507
|
+
name: "catalog_table_not_null_drop",
|
|
5508
|
+
key: "catalogTableNotNullDrop",
|
|
5509
|
+
type: "unary",
|
|
5510
|
+
params: schema2([
|
|
5511
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5512
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
5513
|
+
field2("name", utf82(), false),
|
|
5514
|
+
field2("column_name", utf82(), false),
|
|
5515
|
+
field2("ignore_not_found", bool2(), false),
|
|
5516
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5517
|
+
]),
|
|
5518
|
+
result: schema2([]),
|
|
5519
|
+
doc: "Remove NOT NULL constraint from a column."
|
|
5520
|
+
},
|
|
5521
|
+
{
|
|
5522
|
+
name: "catalog_table_not_null_set",
|
|
5523
|
+
key: "catalogTableNotNullSet",
|
|
5524
|
+
type: "unary",
|
|
5525
|
+
params: schema2([
|
|
5526
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5527
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
5528
|
+
field2("name", utf82(), false),
|
|
5529
|
+
field2("column_name", utf82(), false),
|
|
5530
|
+
field2("ignore_not_found", bool2(), false),
|
|
5531
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5532
|
+
]),
|
|
5533
|
+
result: schema2([]),
|
|
5534
|
+
doc: "Add NOT NULL constraint to a column."
|
|
5535
|
+
},
|
|
5536
|
+
{
|
|
5537
|
+
name: "catalog_table_rename",
|
|
5538
|
+
key: "catalogTableRename",
|
|
5539
|
+
type: "unary",
|
|
5540
|
+
params: schema2([
|
|
5541
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5542
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
5543
|
+
field2("name", utf82(), false),
|
|
5544
|
+
field2("new_name", utf82(), false),
|
|
5545
|
+
field2("ignore_not_found", bool2(), false),
|
|
5546
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5547
|
+
]),
|
|
5548
|
+
result: schema2([]),
|
|
5549
|
+
doc: "Rename a table."
|
|
5550
|
+
},
|
|
5551
|
+
{
|
|
5552
|
+
name: "catalog_table_scan_branches_get",
|
|
5553
|
+
key: "catalogTableScanBranchesGet",
|
|
5554
|
+
type: "unary",
|
|
5555
|
+
params: schema2([
|
|
5556
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5557
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
5558
|
+
field2("name", utf82(), false),
|
|
5559
|
+
field2("at_unit", utf82(), true),
|
|
5560
|
+
field2("at_value", utf82(), true),
|
|
5561
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5562
|
+
]),
|
|
5563
|
+
result: schema2([
|
|
5564
|
+
field2("result", binary2(), false)
|
|
5565
|
+
]),
|
|
5566
|
+
doc: "Get the list of scan branches for a multi-branch table. Returns `ScanBranchesResult` as IPC bytes."
|
|
5567
|
+
},
|
|
5568
|
+
{
|
|
5569
|
+
name: "catalog_table_scan_function_get",
|
|
5570
|
+
key: "catalogTableScanFunctionGet",
|
|
5571
|
+
type: "unary",
|
|
5572
|
+
params: schema2([
|
|
5573
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5574
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
5575
|
+
field2("name", utf82(), false),
|
|
5576
|
+
field2("at_unit", utf82(), true),
|
|
5577
|
+
field2("at_value", utf82(), true),
|
|
5578
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5579
|
+
]),
|
|
5580
|
+
result: schema2([
|
|
5581
|
+
field2("result", binary2(), false)
|
|
5582
|
+
]),
|
|
5583
|
+
doc: "Get the scan function for a table. Returns `ScanFunctionResult` as IPC bytes."
|
|
5584
|
+
},
|
|
5585
|
+
{
|
|
5586
|
+
name: "catalog_table_update_function_get",
|
|
5587
|
+
key: "catalogTableUpdateFunctionGet",
|
|
5588
|
+
type: "unary",
|
|
5589
|
+
params: schema2([
|
|
5590
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5591
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
5592
|
+
field2("name", utf82(), false),
|
|
5593
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5594
|
+
]),
|
|
5595
|
+
result: schema2([
|
|
5596
|
+
field2("result", binary2(), false)
|
|
5597
|
+
]),
|
|
5598
|
+
doc: "Get the update function for a table. Returns `WriteFunctionResult` as IPC bytes."
|
|
5599
|
+
},
|
|
5600
|
+
{
|
|
5601
|
+
name: "catalog_transaction_begin",
|
|
5602
|
+
key: "catalogTransactionBegin",
|
|
5603
|
+
type: "unary",
|
|
5604
|
+
params: schema2([
|
|
5605
|
+
field2("attach_opaque_data", binary2(), false)
|
|
5606
|
+
]),
|
|
5607
|
+
result: schema2([
|
|
5608
|
+
field2("result", binary2(), false)
|
|
5609
|
+
]),
|
|
5610
|
+
doc: "Begin a new transaction."
|
|
5611
|
+
},
|
|
5612
|
+
{
|
|
5613
|
+
name: "catalog_transaction_commit",
|
|
5614
|
+
key: "catalogTransactionCommit",
|
|
5615
|
+
type: "unary",
|
|
5616
|
+
params: schema2([
|
|
5617
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5618
|
+
field2("transaction_opaque_data", binary2(), false)
|
|
5619
|
+
]),
|
|
5620
|
+
result: schema2([]),
|
|
5621
|
+
doc: "Commit a transaction."
|
|
5622
|
+
},
|
|
5623
|
+
{
|
|
5624
|
+
name: "catalog_transaction_rollback",
|
|
5625
|
+
key: "catalogTransactionRollback",
|
|
5626
|
+
type: "unary",
|
|
5627
|
+
params: schema2([
|
|
5628
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5629
|
+
field2("transaction_opaque_data", binary2(), false)
|
|
5630
|
+
]),
|
|
5631
|
+
result: schema2([]),
|
|
5632
|
+
doc: "Rollback a transaction."
|
|
5633
|
+
},
|
|
5634
|
+
{
|
|
5635
|
+
name: "catalog_version",
|
|
5636
|
+
key: "catalogVersion",
|
|
5637
|
+
type: "unary",
|
|
5638
|
+
params: schema2([
|
|
5639
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5640
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5641
|
+
]),
|
|
5642
|
+
result: schema2([
|
|
5643
|
+
field2("result", binary2(), false)
|
|
5644
|
+
]),
|
|
5645
|
+
doc: "Get the current catalog version."
|
|
5646
|
+
},
|
|
5647
|
+
{
|
|
5648
|
+
name: "catalog_view_comment_set",
|
|
5649
|
+
key: "catalogViewCommentSet",
|
|
5650
|
+
type: "unary",
|
|
5651
|
+
params: schema2([
|
|
5652
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5653
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
5654
|
+
field2("name", utf82(), false),
|
|
5655
|
+
field2("comment", utf82(), true),
|
|
5656
|
+
field2("ignore_not_found", bool2(), false),
|
|
5657
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5658
|
+
]),
|
|
5659
|
+
result: schema2([]),
|
|
5660
|
+
doc: "Set or clear the comment on a view."
|
|
5661
|
+
},
|
|
5662
|
+
{
|
|
5663
|
+
name: "catalog_view_create",
|
|
5664
|
+
key: "catalogViewCreate",
|
|
5665
|
+
type: "unary",
|
|
5666
|
+
params: schema2([
|
|
5667
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5668
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
5669
|
+
field2("name", utf82(), false),
|
|
5670
|
+
field2("definition", utf82(), false),
|
|
5671
|
+
field2("on_conflict", dictionary2(utf82(), int162()), false),
|
|
5672
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5673
|
+
]),
|
|
5674
|
+
result: schema2([]),
|
|
5675
|
+
doc: "Create a new view."
|
|
5676
|
+
},
|
|
5677
|
+
{
|
|
5678
|
+
name: "catalog_view_drop",
|
|
5679
|
+
key: "catalogViewDrop",
|
|
5680
|
+
type: "unary",
|
|
5681
|
+
params: schema2([
|
|
5682
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5683
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
5684
|
+
field2("name", utf82(), false),
|
|
5685
|
+
field2("ignore_not_found", bool2(), false),
|
|
5686
|
+
field2("cascade", bool2(), false),
|
|
5687
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5688
|
+
]),
|
|
5689
|
+
result: schema2([]),
|
|
5690
|
+
doc: "Drop a view."
|
|
5691
|
+
},
|
|
5692
|
+
{
|
|
5693
|
+
name: "catalog_view_get",
|
|
5694
|
+
key: "catalogViewGet",
|
|
5695
|
+
type: "unary",
|
|
5696
|
+
params: schema2([
|
|
5697
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5698
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
5699
|
+
field2("name", utf82(), false),
|
|
5700
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5701
|
+
]),
|
|
5702
|
+
result: schema2([
|
|
5703
|
+
field2("result", binary2(), false)
|
|
5704
|
+
]),
|
|
5705
|
+
doc: "Get information about a view. Returns 0 or 1 items."
|
|
5706
|
+
},
|
|
5707
|
+
{
|
|
5708
|
+
name: "catalog_view_rename",
|
|
5709
|
+
key: "catalogViewRename",
|
|
5710
|
+
type: "unary",
|
|
5711
|
+
params: schema2([
|
|
5712
|
+
field2("attach_opaque_data", binary2(), false),
|
|
5713
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
5714
|
+
field2("name", utf82(), false),
|
|
5715
|
+
field2("new_name", utf82(), false),
|
|
5716
|
+
field2("ignore_not_found", bool2(), false),
|
|
5717
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
5718
|
+
]),
|
|
5719
|
+
result: schema2([]),
|
|
5720
|
+
doc: "Rename a view."
|
|
5721
|
+
},
|
|
5722
|
+
{
|
|
5723
|
+
name: "init",
|
|
5724
|
+
key: "init",
|
|
5725
|
+
type: "stream",
|
|
5726
|
+
params: schema2([
|
|
5727
|
+
field2("request", binary2(), false)
|
|
5728
|
+
]),
|
|
5729
|
+
header: schema2([
|
|
5730
|
+
field2("execution_id", binary2(), false),
|
|
5731
|
+
field2("opaque_data", binary2(), true),
|
|
5732
|
+
field2("max_workers", int642(), false)
|
|
5733
|
+
]),
|
|
5734
|
+
doc: "Initialize a function execution and return a processing stream."
|
|
5735
|
+
},
|
|
5736
|
+
{
|
|
5737
|
+
name: "table_buffering_combine",
|
|
5738
|
+
key: "tableBufferingCombine",
|
|
5739
|
+
type: "unary",
|
|
5740
|
+
params: schema2([
|
|
5741
|
+
field2("request", binary2(), false)
|
|
5742
|
+
]),
|
|
5743
|
+
result: schema2([
|
|
5744
|
+
field2("result", binary2(), false)
|
|
5745
|
+
]),
|
|
5746
|
+
doc: "Once-per-query end-of-input signal. Returns finalize_state_ids."
|
|
5747
|
+
},
|
|
5748
|
+
{
|
|
5749
|
+
name: "table_buffering_destructor",
|
|
5750
|
+
key: "tableBufferingDestructor",
|
|
5751
|
+
type: "unary",
|
|
5752
|
+
params: schema2([
|
|
5753
|
+
field2("request", binary2(), false)
|
|
5754
|
+
]),
|
|
5755
|
+
result: schema2([
|
|
5756
|
+
field2("result", binary2(), false)
|
|
5757
|
+
]),
|
|
5758
|
+
doc: "Best-effort end-of-query cleanup. Must not raise."
|
|
5759
|
+
},
|
|
5760
|
+
{
|
|
5761
|
+
name: "table_buffering_process",
|
|
5762
|
+
key: "tableBufferingProcess",
|
|
5763
|
+
type: "unary",
|
|
5764
|
+
params: schema2([
|
|
5765
|
+
field2("request", binary2(), false)
|
|
5766
|
+
]),
|
|
5767
|
+
result: schema2([
|
|
5768
|
+
field2("result", binary2(), false)
|
|
5769
|
+
]),
|
|
5770
|
+
doc: "Sink one input batch; return the worker-chosen state_id."
|
|
5771
|
+
},
|
|
5772
|
+
{
|
|
5773
|
+
name: "table_function_cardinality",
|
|
5774
|
+
key: "tableFunctionCardinality",
|
|
5775
|
+
type: "unary",
|
|
5776
|
+
params: schema2([
|
|
5777
|
+
field2("request", binary2(), false)
|
|
5778
|
+
]),
|
|
5779
|
+
result: schema2([
|
|
5780
|
+
field2("result", binary2(), false)
|
|
5781
|
+
]),
|
|
5782
|
+
doc: "Estimate the cardinality of a table function's output."
|
|
5783
|
+
},
|
|
5784
|
+
{
|
|
5785
|
+
name: "table_function_dynamic_to_string",
|
|
5786
|
+
key: "tableFunctionDynamicToString",
|
|
5787
|
+
type: "unary",
|
|
5788
|
+
params: schema2([
|
|
5789
|
+
field2("request", binary2(), false)
|
|
5790
|
+
]),
|
|
5791
|
+
result: schema2([
|
|
5792
|
+
field2("result", binary2(), false)
|
|
5793
|
+
]),
|
|
5794
|
+
doc: "Return user-defined diagnostics for EXPLAIN ANALYZE Extra Info."
|
|
5795
|
+
},
|
|
5796
|
+
{
|
|
5797
|
+
name: "table_function_plan",
|
|
5798
|
+
key: "tableFunctionPlan",
|
|
5799
|
+
type: "unary",
|
|
5800
|
+
params: schema2([
|
|
5801
|
+
field2("request", binary2(), false)
|
|
5802
|
+
]),
|
|
5803
|
+
result: schema2([
|
|
5804
|
+
field2("result", binary2(), false)
|
|
5805
|
+
]),
|
|
5806
|
+
doc: "Plan a table-function scan into named, independently redeemable splits."
|
|
5807
|
+
},
|
|
5808
|
+
{
|
|
5809
|
+
name: "table_function_statistics",
|
|
5810
|
+
key: "tableFunctionStatistics",
|
|
5811
|
+
type: "unary",
|
|
5812
|
+
params: schema2([
|
|
5813
|
+
field2("request", binary2(), false)
|
|
5814
|
+
]),
|
|
5815
|
+
result: schema2([
|
|
5816
|
+
field2("result", binary2(), true)
|
|
5817
|
+
]),
|
|
5818
|
+
doc: "Return per-column statistics for a table function's output."
|
|
5819
|
+
}
|
|
5820
|
+
];
|
|
5821
|
+
var UNIMPLEMENTED_VGI_SERVICE = Object.freeze({
|
|
5822
|
+
aggregateBind: async () => {
|
|
5823
|
+
throw notImplemented("aggregate_bind");
|
|
5824
|
+
},
|
|
5825
|
+
aggregateCombine: async () => {
|
|
5826
|
+
throw notImplemented("aggregate_combine");
|
|
5827
|
+
},
|
|
5828
|
+
aggregateDestructor: async () => {
|
|
5829
|
+
throw notImplemented("aggregate_destructor");
|
|
5830
|
+
},
|
|
5831
|
+
aggregateFinalize: async () => {
|
|
5832
|
+
throw notImplemented("aggregate_finalize");
|
|
5833
|
+
},
|
|
5834
|
+
aggregateStreamingChunk: async () => {
|
|
5835
|
+
throw notImplemented("aggregate_streaming_chunk");
|
|
5836
|
+
},
|
|
5837
|
+
aggregateStreamingClose: async () => {
|
|
5838
|
+
throw notImplemented("aggregate_streaming_close");
|
|
5839
|
+
},
|
|
5840
|
+
aggregateStreamingOpen: async () => {
|
|
5841
|
+
throw notImplemented("aggregate_streaming_open");
|
|
5842
|
+
},
|
|
5843
|
+
aggregateUpdate: async () => {
|
|
5844
|
+
throw notImplemented("aggregate_update");
|
|
5845
|
+
},
|
|
5846
|
+
aggregateWindow: async () => {
|
|
5847
|
+
throw notImplemented("aggregate_window");
|
|
5848
|
+
},
|
|
5849
|
+
aggregateWindowBatch: async () => {
|
|
5850
|
+
throw notImplemented("aggregate_window_batch");
|
|
5851
|
+
},
|
|
5852
|
+
aggregateWindowDestructor: async () => {
|
|
5853
|
+
throw notImplemented("aggregate_window_destructor");
|
|
5854
|
+
},
|
|
5855
|
+
aggregateWindowInit: async () => {
|
|
5856
|
+
throw notImplemented("aggregate_window_init");
|
|
5857
|
+
},
|
|
5858
|
+
bind: async () => {
|
|
5859
|
+
throw notImplemented("bind");
|
|
5860
|
+
},
|
|
5861
|
+
catalogAttach: async () => {
|
|
5862
|
+
throw notImplemented("catalog_attach");
|
|
5863
|
+
},
|
|
5864
|
+
catalogCatalogs: async () => {
|
|
5865
|
+
throw notImplemented("catalog_catalogs");
|
|
5866
|
+
},
|
|
5867
|
+
catalogContents: async () => {
|
|
5868
|
+
throw notImplemented("catalog_contents");
|
|
5869
|
+
},
|
|
5870
|
+
catalogCopyFromFormats: async () => {
|
|
5871
|
+
throw notImplemented("catalog_copy_from_formats");
|
|
5872
|
+
},
|
|
5873
|
+
catalogCreate: async () => {
|
|
5874
|
+
throw notImplemented("catalog_create");
|
|
5875
|
+
},
|
|
5876
|
+
catalogDetach: async () => {
|
|
5877
|
+
throw notImplemented("catalog_detach");
|
|
5878
|
+
},
|
|
5879
|
+
catalogDrop: async () => {
|
|
5880
|
+
throw notImplemented("catalog_drop");
|
|
5881
|
+
},
|
|
5882
|
+
catalogIndexCreate: async () => {
|
|
5883
|
+
throw notImplemented("catalog_index_create");
|
|
5884
|
+
},
|
|
5885
|
+
catalogIndexDrop: async () => {
|
|
5886
|
+
throw notImplemented("catalog_index_drop");
|
|
5887
|
+
},
|
|
5888
|
+
catalogIndexGet: async () => {
|
|
5889
|
+
throw notImplemented("catalog_index_get");
|
|
5890
|
+
},
|
|
5891
|
+
catalogMacroCreate: async () => {
|
|
5892
|
+
throw notImplemented("catalog_macro_create");
|
|
5893
|
+
},
|
|
5894
|
+
catalogMacroDrop: async () => {
|
|
5895
|
+
throw notImplemented("catalog_macro_drop");
|
|
5896
|
+
},
|
|
5897
|
+
catalogMacroGet: async () => {
|
|
5898
|
+
throw notImplemented("catalog_macro_get");
|
|
5899
|
+
},
|
|
5900
|
+
catalogSchemaContentsFunctions: async () => {
|
|
5901
|
+
throw notImplemented("catalog_schema_contents_functions");
|
|
5902
|
+
},
|
|
5903
|
+
catalogSchemaContentsIndexes: async () => {
|
|
5904
|
+
throw notImplemented("catalog_schema_contents_indexes");
|
|
5905
|
+
},
|
|
5906
|
+
catalogSchemaContentsMacros: async () => {
|
|
5907
|
+
throw notImplemented("catalog_schema_contents_macros");
|
|
5908
|
+
},
|
|
5909
|
+
catalogSchemaContentsTables: async () => {
|
|
5910
|
+
throw notImplemented("catalog_schema_contents_tables");
|
|
5911
|
+
},
|
|
5912
|
+
catalogSchemaContentsViews: async () => {
|
|
5913
|
+
throw notImplemented("catalog_schema_contents_views");
|
|
5914
|
+
},
|
|
5915
|
+
catalogSchemaCreate: async () => {
|
|
5916
|
+
throw notImplemented("catalog_schema_create");
|
|
5917
|
+
},
|
|
5918
|
+
catalogSchemaDrop: async () => {
|
|
5919
|
+
throw notImplemented("catalog_schema_drop");
|
|
5920
|
+
},
|
|
5921
|
+
catalogSchemaGet: async () => {
|
|
5922
|
+
throw notImplemented("catalog_schema_get");
|
|
5923
|
+
},
|
|
5924
|
+
catalogSchemas: async () => {
|
|
5925
|
+
throw notImplemented("catalog_schemas");
|
|
5926
|
+
},
|
|
5927
|
+
catalogTableColumnAdd: async () => {
|
|
5928
|
+
throw notImplemented("catalog_table_column_add");
|
|
5929
|
+
},
|
|
5930
|
+
catalogTableColumnCommentSet: async () => {
|
|
5931
|
+
throw notImplemented("catalog_table_column_comment_set");
|
|
5932
|
+
},
|
|
5933
|
+
catalogTableColumnDefaultDrop: async () => {
|
|
5934
|
+
throw notImplemented("catalog_table_column_default_drop");
|
|
5935
|
+
},
|
|
5936
|
+
catalogTableColumnDefaultSet: async () => {
|
|
5937
|
+
throw notImplemented("catalog_table_column_default_set");
|
|
5938
|
+
},
|
|
5939
|
+
catalogTableColumnDrop: async () => {
|
|
5940
|
+
throw notImplemented("catalog_table_column_drop");
|
|
5941
|
+
},
|
|
5942
|
+
catalogTableColumnRename: async () => {
|
|
5943
|
+
throw notImplemented("catalog_table_column_rename");
|
|
5944
|
+
},
|
|
5945
|
+
catalogTableColumnStatisticsGet: async () => {
|
|
5946
|
+
throw notImplemented("catalog_table_column_statistics_get");
|
|
5947
|
+
},
|
|
5948
|
+
catalogTableColumnTypeChange: async () => {
|
|
5949
|
+
throw notImplemented("catalog_table_column_type_change");
|
|
5950
|
+
},
|
|
5951
|
+
catalogTableCommentSet: async () => {
|
|
5952
|
+
throw notImplemented("catalog_table_comment_set");
|
|
5953
|
+
},
|
|
5954
|
+
catalogTableCreate: async () => {
|
|
5955
|
+
throw notImplemented("catalog_table_create");
|
|
5956
|
+
},
|
|
5957
|
+
catalogTableDeleteFunctionGet: async () => {
|
|
5958
|
+
throw notImplemented("catalog_table_delete_function_get");
|
|
5959
|
+
},
|
|
5960
|
+
catalogTableDrop: async () => {
|
|
5961
|
+
throw notImplemented("catalog_table_drop");
|
|
5962
|
+
},
|
|
5963
|
+
catalogTableGet: async () => {
|
|
5964
|
+
throw notImplemented("catalog_table_get");
|
|
5965
|
+
},
|
|
5966
|
+
catalogTableInsertFunctionGet: async () => {
|
|
5967
|
+
throw notImplemented("catalog_table_insert_function_get");
|
|
5968
|
+
},
|
|
5969
|
+
catalogTableNotNullDrop: async () => {
|
|
5970
|
+
throw notImplemented("catalog_table_not_null_drop");
|
|
5971
|
+
},
|
|
5972
|
+
catalogTableNotNullSet: async () => {
|
|
5973
|
+
throw notImplemented("catalog_table_not_null_set");
|
|
5974
|
+
},
|
|
5975
|
+
catalogTableRename: async () => {
|
|
5976
|
+
throw notImplemented("catalog_table_rename");
|
|
5977
|
+
},
|
|
5978
|
+
catalogTableScanBranchesGet: async () => {
|
|
5979
|
+
throw notImplemented("catalog_table_scan_branches_get");
|
|
5980
|
+
},
|
|
5981
|
+
catalogTableScanFunctionGet: async () => {
|
|
5982
|
+
throw notImplemented("catalog_table_scan_function_get");
|
|
5983
|
+
},
|
|
5984
|
+
catalogTableUpdateFunctionGet: async () => {
|
|
5985
|
+
throw notImplemented("catalog_table_update_function_get");
|
|
5986
|
+
},
|
|
5987
|
+
catalogTransactionBegin: async () => {
|
|
5988
|
+
throw notImplemented("catalog_transaction_begin");
|
|
5989
|
+
},
|
|
5990
|
+
catalogTransactionCommit: async () => {
|
|
5991
|
+
throw notImplemented("catalog_transaction_commit");
|
|
5992
|
+
},
|
|
5993
|
+
catalogTransactionRollback: async () => {
|
|
5994
|
+
throw notImplemented("catalog_transaction_rollback");
|
|
5995
|
+
},
|
|
5996
|
+
catalogVersion: async () => {
|
|
5997
|
+
throw notImplemented("catalog_version");
|
|
5998
|
+
},
|
|
5999
|
+
catalogViewCommentSet: async () => {
|
|
6000
|
+
throw notImplemented("catalog_view_comment_set");
|
|
6001
|
+
},
|
|
6002
|
+
catalogViewCreate: async () => {
|
|
6003
|
+
throw notImplemented("catalog_view_create");
|
|
6004
|
+
},
|
|
6005
|
+
catalogViewDrop: async () => {
|
|
6006
|
+
throw notImplemented("catalog_view_drop");
|
|
6007
|
+
},
|
|
6008
|
+
catalogViewGet: async () => {
|
|
6009
|
+
throw notImplemented("catalog_view_get");
|
|
6010
|
+
},
|
|
6011
|
+
catalogViewRename: async () => {
|
|
6012
|
+
throw notImplemented("catalog_view_rename");
|
|
6013
|
+
},
|
|
6014
|
+
init: unimplementedStream("init"),
|
|
6015
|
+
tableBufferingCombine: async () => {
|
|
6016
|
+
throw notImplemented("table_buffering_combine");
|
|
6017
|
+
},
|
|
6018
|
+
tableBufferingDestructor: async () => {
|
|
6019
|
+
throw notImplemented("table_buffering_destructor");
|
|
6020
|
+
},
|
|
6021
|
+
tableBufferingProcess: async () => {
|
|
6022
|
+
throw notImplemented("table_buffering_process");
|
|
6023
|
+
},
|
|
6024
|
+
tableFunctionCardinality: async () => {
|
|
6025
|
+
throw notImplemented("table_function_cardinality");
|
|
6026
|
+
},
|
|
6027
|
+
tableFunctionDynamicToString: async () => {
|
|
6028
|
+
throw notImplemented("table_function_dynamic_to_string");
|
|
6029
|
+
},
|
|
6030
|
+
tableFunctionPlan: async () => {
|
|
6031
|
+
throw notImplemented("table_function_plan");
|
|
6032
|
+
},
|
|
6033
|
+
tableFunctionStatistics: async () => {
|
|
6034
|
+
throw notImplemented("table_function_statistics");
|
|
6035
|
+
}
|
|
6036
|
+
});
|
|
6037
|
+
function unimplementedMessage(method) {
|
|
6038
|
+
return `${method} is not implemented by this worker`;
|
|
6039
|
+
}
|
|
6040
|
+
function notImplemented(method) {
|
|
6041
|
+
return new MethodNotImplementedError(unimplementedMessage(method));
|
|
6042
|
+
}
|
|
6043
|
+
function unimplementedStream(method) {
|
|
6044
|
+
return producerStream({
|
|
6045
|
+
outputSchema: schema2([]),
|
|
6046
|
+
init: () => {
|
|
6047
|
+
throw notImplemented(method);
|
|
6048
|
+
},
|
|
6049
|
+
produce: () => {}
|
|
6050
|
+
});
|
|
6051
|
+
}
|
|
6052
|
+
function registerVgiService(protocol, service) {
|
|
6053
|
+
for (const m of VGI_V2_METHODS) {
|
|
6054
|
+
if (m.type === "unary") {
|
|
6055
|
+
const handler = service[m.key];
|
|
6056
|
+
protocol.unary(m.name, {
|
|
6057
|
+
params: m.params,
|
|
6058
|
+
result: m.result,
|
|
6059
|
+
doc: m.doc,
|
|
6060
|
+
handler: (params, ctx) => handler.call(service, params, ctx)
|
|
6061
|
+
});
|
|
6062
|
+
continue;
|
|
6063
|
+
}
|
|
6064
|
+
const stream = service[m.key];
|
|
6065
|
+
const common = {
|
|
6066
|
+
params: m.params,
|
|
6067
|
+
outputSchema: stream.outputSchema,
|
|
6068
|
+
headerSchema: m.header ?? undefined,
|
|
6069
|
+
headerInit: stream.headerInit,
|
|
6070
|
+
onCancel: stream.onCancel,
|
|
6071
|
+
doc: m.doc
|
|
6072
|
+
};
|
|
6073
|
+
if (stream.kind === "exchange") {
|
|
6074
|
+
protocol.exchange(m.name, {
|
|
6075
|
+
...common,
|
|
6076
|
+
inputSchema: stream.inputSchema,
|
|
6077
|
+
init: stream.init,
|
|
6078
|
+
exchange: stream.exchange
|
|
6079
|
+
});
|
|
6080
|
+
} else {
|
|
6081
|
+
protocol.producer(m.name, { ...common, init: stream.init, produce: stream.produce });
|
|
6082
|
+
}
|
|
6083
|
+
}
|
|
6084
|
+
return protocol;
|
|
6085
|
+
}
|
|
6086
|
+
function createVgiProtocol(service) {
|
|
6087
|
+
return registerVgiService(new Protocol(VGI_PROTOCOL_NAME, { protocolVersion: VGI_PROTOCOL_VERSION }), service);
|
|
6088
|
+
}
|
|
4680
6089
|
|
|
4681
6090
|
// src/protocol/handlers/function.ts
|
|
4682
6091
|
init_arrow();
|
|
@@ -5686,9 +7095,6 @@ var RESULT_BINARY_SCHEMA = schema2([
|
|
|
5686
7095
|
var REQUEST_PARAMS_SCHEMA = schema2([
|
|
5687
7096
|
field2("request", binary2(), false)
|
|
5688
7097
|
]);
|
|
5689
|
-
var RESULT_BINARY_NULLABLE_SCHEMA = schema2([
|
|
5690
|
-
field2("result", binary2(), true)
|
|
5691
|
-
]);
|
|
5692
7098
|
function unwrapRequest(requestBytes) {
|
|
5693
7099
|
const bytes = toUint8Array(requestBytes);
|
|
5694
7100
|
const innerBatch = deserializeBatch(bytes);
|
|
@@ -5704,7 +7110,8 @@ function normalizeRequestSchemaPaths(params) {
|
|
|
5704
7110
|
}
|
|
5705
7111
|
function wrapResult(values, innerSchema) {
|
|
5706
7112
|
const a = innerSchema;
|
|
5707
|
-
const
|
|
7113
|
+
const row = conformRecord(a, values);
|
|
7114
|
+
const batch = batchFromColumns(Object.fromEntries(a.fields.map((f) => [f.name, [row[f.name] ?? null]])), a);
|
|
5708
7115
|
return { result: serializeBatch(batch) };
|
|
5709
7116
|
}
|
|
5710
7117
|
function overloadContext(req, catalogInterface) {
|
|
@@ -5730,9 +7137,12 @@ init_arrow();
|
|
|
5730
7137
|
|
|
5731
7138
|
// src/errors.ts
|
|
5732
7139
|
class VgiError extends Error {
|
|
5733
|
-
|
|
7140
|
+
errorCode;
|
|
7141
|
+
constructor(message, code) {
|
|
5734
7142
|
super(message);
|
|
5735
7143
|
this.name = "VgiError";
|
|
7144
|
+
if (code !== undefined)
|
|
7145
|
+
this.errorCode = code;
|
|
5736
7146
|
}
|
|
5737
7147
|
}
|
|
5738
7148
|
|
|
@@ -5745,27 +7155,27 @@ class RowCountMismatchError extends VgiError {
|
|
|
5745
7155
|
|
|
5746
7156
|
class FunctionNotFoundError extends VgiError {
|
|
5747
7157
|
constructor(name, available) {
|
|
5748
|
-
super(`Unknown function '${name}'
|
|
7158
|
+
super(`Unknown function '${name}'`, "NOT_FOUND");
|
|
5749
7159
|
this.name = "FunctionNotFoundError";
|
|
5750
7160
|
}
|
|
5751
7161
|
}
|
|
5752
7162
|
|
|
5753
7163
|
class CatalogReadOnlyError extends VgiError {
|
|
5754
7164
|
constructor(operation) {
|
|
5755
|
-
super(`catalog is read-only: ${operation} is not supported
|
|
7165
|
+
super(`catalog is read-only: ${operation} is not supported`, "FAILED_PRECONDITION");
|
|
5756
7166
|
this.name = "CatalogReadOnlyError";
|
|
5757
7167
|
}
|
|
5758
7168
|
}
|
|
5759
7169
|
class ArgumentValidationError extends VgiError {
|
|
5760
7170
|
constructor(message) {
|
|
5761
|
-
super(message);
|
|
7171
|
+
super(message, "INVALID_ARGUMENT");
|
|
5762
7172
|
this.name = "ArgumentValidationError";
|
|
5763
7173
|
}
|
|
5764
7174
|
}
|
|
5765
7175
|
|
|
5766
7176
|
class NoCatalogError extends VgiError {
|
|
5767
7177
|
constructor() {
|
|
5768
|
-
super("No catalog is configured for this worker");
|
|
7178
|
+
super("No catalog is configured for this worker", "UNIMPLEMENTED");
|
|
5769
7179
|
this.name = "NoCatalogError";
|
|
5770
7180
|
}
|
|
5771
7181
|
}
|
|
@@ -6600,20 +8010,16 @@ async function unwrapParamsOpaque(params, ctx, signingKey) {
|
|
|
6600
8010
|
}
|
|
6601
8011
|
}
|
|
6602
8012
|
}
|
|
6603
|
-
function
|
|
6604
|
-
|
|
6605
|
-
params
|
|
6606
|
-
|
|
6607
|
-
|
|
6608
|
-
handler: async (params, ctx) => {
|
|
6609
|
-
if (params.request != null && params.attach_opaque_data === undefined && params.name === undefined) {
|
|
6610
|
-
params = unwrapRequest(params.request);
|
|
6611
|
-
}
|
|
6612
|
-
normalizeRequestSchemaPaths(params);
|
|
6613
|
-
await unwrapParamsOpaque(params, ctx, signingKey);
|
|
6614
|
-
return config.handler(params, ctx);
|
|
8013
|
+
function catalogHandler(signingKey, handler) {
|
|
8014
|
+
return async (wire, ctx) => {
|
|
8015
|
+
let params = wire;
|
|
8016
|
+
if (params.request != null && params.attach_opaque_data === undefined && params.name === undefined) {
|
|
8017
|
+
params = unwrapRequest(params.request);
|
|
6615
8018
|
}
|
|
6616
|
-
|
|
8019
|
+
normalizeRequestSchemaPaths(params);
|
|
8020
|
+
await unwrapParamsOpaque(params, ctx, signingKey);
|
|
8021
|
+
return handler(params, ctx);
|
|
8022
|
+
};
|
|
6617
8023
|
}
|
|
6618
8024
|
function makeGetCatalog(catalog) {
|
|
6619
8025
|
return () => {
|
|
@@ -6634,7 +8040,6 @@ function decodeOptionsBatch(bytes) {
|
|
|
6634
8040
|
const row = iterRows(batch).next().value;
|
|
6635
8041
|
return row ?? {};
|
|
6636
8042
|
}
|
|
6637
|
-
var emptyResultSchema = schema2([]);
|
|
6638
8043
|
|
|
6639
8044
|
// src/request-auth.ts
|
|
6640
8045
|
var scope;
|
|
@@ -6864,7 +8269,7 @@ async function resolveSplitPayloads(request, innerParams, opts) {
|
|
|
6864
8269
|
}));
|
|
6865
8270
|
}
|
|
6866
8271
|
}
|
|
6867
|
-
function
|
|
8272
|
+
function functionHandlers(config) {
|
|
6868
8273
|
const { registry, signingKey, catalogInterface } = config;
|
|
6869
8274
|
async function stripAttach(attach, ctx) {
|
|
6870
8275
|
if (attach == null)
|
|
@@ -6883,26 +8288,20 @@ function registerFunctionMethods(protocol, config) {
|
|
|
6883
8288
|
}
|
|
6884
8289
|
return overloadContext({ ...bindCall, attach_opaque_data: attach }, catalogInterface);
|
|
6885
8290
|
}
|
|
6886
|
-
const initHeaderSchema = GLOBAL_INIT_RESPONSE_SCHEMA;
|
|
6887
8291
|
const emptySchema = schema2([]);
|
|
6888
8292
|
const dummyInputSchema = schema2([
|
|
6889
8293
|
field2("_tick", binary2(), true)
|
|
6890
8294
|
]);
|
|
6891
|
-
|
|
6892
|
-
params
|
|
6893
|
-
|
|
6894
|
-
|
|
6895
|
-
|
|
6896
|
-
|
|
6897
|
-
|
|
6898
|
-
|
|
6899
|
-
|
|
6900
|
-
|
|
6901
|
-
return wrapResult(serialized, BindResultSchema);
|
|
6902
|
-
}
|
|
6903
|
-
});
|
|
6904
|
-
protocol.exchange("init", {
|
|
6905
|
-
params: InitParamsSchema,
|
|
8295
|
+
const bind = async (params, ctx) => {
|
|
8296
|
+
const innerParams = unwrapRequest(params.request);
|
|
8297
|
+
const request = deserializeBindRequest(innerParams);
|
|
8298
|
+
request.attach_opaque_data = await stripAttach(request.attach_opaque_data, ctx);
|
|
8299
|
+
const func = registry.get(request.function_name, overloadContext(request, catalogInterface));
|
|
8300
|
+
const response = await func.bind(request);
|
|
8301
|
+
const serialized = serializeBindResponse(response);
|
|
8302
|
+
return wrapResult(serialized, BindResultSchema);
|
|
8303
|
+
};
|
|
8304
|
+
const init = exchangeStream({
|
|
6906
8305
|
inputSchema: dummyInputSchema,
|
|
6907
8306
|
outputSchema: emptySchema,
|
|
6908
8307
|
init: async (params, ctx) => {
|
|
@@ -6995,7 +8394,6 @@ function registerFunctionMethods(protocol, config) {
|
|
|
6995
8394
|
}
|
|
6996
8395
|
state.filterHistory = handlerState?.filterHistory ?? null;
|
|
6997
8396
|
},
|
|
6998
|
-
headerSchema: initHeaderSchema,
|
|
6999
8397
|
headerInit: (params, state, ctx) => {
|
|
7000
8398
|
if (!state._initResponse) {
|
|
7001
8399
|
throw new Error("headerInit called on deserialized state: _initResponse not available");
|
|
@@ -7003,83 +8401,75 @@ function registerFunctionMethods(protocol, config) {
|
|
|
7003
8401
|
return serializeGlobalInitResponse(state._initResponse);
|
|
7004
8402
|
}
|
|
7005
8403
|
});
|
|
7006
|
-
|
|
7007
|
-
params
|
|
7008
|
-
|
|
7009
|
-
|
|
7010
|
-
|
|
7011
|
-
|
|
7012
|
-
|
|
7013
|
-
|
|
7014
|
-
|
|
7015
|
-
cardResult = serializeTableCardinality(await func.cardinality(request));
|
|
7016
|
-
} else {
|
|
7017
|
-
cardResult = { estimate: null, max: null };
|
|
7018
|
-
}
|
|
7019
|
-
return wrapResult(cardResult, TableFunctionCardinalityResultSchema);
|
|
7020
|
-
}
|
|
7021
|
-
});
|
|
7022
|
-
protocol.unary("table_function_plan", {
|
|
7023
|
-
params: TableFunctionPlanParamsSchema,
|
|
7024
|
-
result: RESULT_BINARY_SCHEMA,
|
|
7025
|
-
handler: async (params, ctx) => {
|
|
7026
|
-
const innerParams = unwrapRequest(params.request);
|
|
7027
|
-
const request = deserializePlanRequest(innerParams);
|
|
7028
|
-
const func = registry.get(request.bind_call.function_name, await strippedContext(request.bind_call));
|
|
7029
|
-
const plan = func.plan ? await func.plan(request) : { splits: [{ payload: new Uint8Array(0) }] };
|
|
7030
|
-
const fp = fingerprintInputs(toUint8Array(innerParams.bind_call));
|
|
7031
|
-
const fingerprint = await bindFingerprint(fp.schemaPath, fp.functionName, fp.args, fp.settings, new Uint8Array(0));
|
|
7032
|
-
const anchor = plan.catalogVersion != null ? splitAnchor(plan.catalogVersion) : await liveSplitAnchor(catalogInterface, request.bind_call, ctx?.auth, signingKey) ?? splitAnchor(0);
|
|
7033
|
-
const blobs = [];
|
|
7034
|
-
for (const split of plan.splits) {
|
|
7035
|
-
const token = await buildSplitToken({
|
|
7036
|
-
payload: split.payload,
|
|
7037
|
-
fingerprint,
|
|
7038
|
-
anchor,
|
|
7039
|
-
signingKey,
|
|
7040
|
-
auth: ctx?.auth
|
|
7041
|
-
});
|
|
7042
|
-
blobs.push(serializeBatch(batchFromColumns(Object.fromEntries(SCAN_SPLIT_SCHEMA.fields.map((f) => [
|
|
7043
|
-
f.name,
|
|
7044
|
-
[scanSplitRow(split, token)[f.name] ?? null]
|
|
7045
|
-
])), SCAN_SPLIT_SCHEMA)));
|
|
7046
|
-
}
|
|
7047
|
-
return wrapResult(planResponseRow(plan, blobs), PLAN_RESPONSE_SCHEMA);
|
|
7048
|
-
}
|
|
7049
|
-
});
|
|
7050
|
-
protocol.unary("table_function_statistics", {
|
|
7051
|
-
params: TableFunctionStatisticsParamsSchema,
|
|
7052
|
-
result: RESULT_BINARY_NULLABLE_SCHEMA,
|
|
7053
|
-
handler: async (params) => {
|
|
7054
|
-
const innerParams = unwrapRequest(params.request);
|
|
7055
|
-
const request = deserializeCardinalityRequest(innerParams);
|
|
7056
|
-
const func = registry.get(request.bind_call.function_name, await strippedContext(request.bind_call));
|
|
7057
|
-
if (!func.statistics)
|
|
7058
|
-
return { result: null };
|
|
7059
|
-
const stats = func.statistics(request);
|
|
7060
|
-
if (!stats || stats.length === 0)
|
|
7061
|
-
return { result: null };
|
|
7062
|
-
return { result: serializeColumnStatistics(stats) };
|
|
8404
|
+
const tableFunctionCardinality = async (params) => {
|
|
8405
|
+
const innerParams = unwrapRequest(params.request);
|
|
8406
|
+
const request = deserializeCardinalityRequest(innerParams);
|
|
8407
|
+
const func = registry.get(request.bind_call.function_name, await strippedContext(request.bind_call));
|
|
8408
|
+
let cardResult;
|
|
8409
|
+
if (func.cardinality) {
|
|
8410
|
+
cardResult = serializeTableCardinality(await func.cardinality(request));
|
|
8411
|
+
} else {
|
|
8412
|
+
cardResult = { estimate: null, max: null };
|
|
7063
8413
|
}
|
|
7064
|
-
|
|
7065
|
-
|
|
7066
|
-
|
|
7067
|
-
|
|
7068
|
-
|
|
7069
|
-
|
|
7070
|
-
|
|
7071
|
-
|
|
7072
|
-
|
|
7073
|
-
|
|
7074
|
-
|
|
7075
|
-
|
|
7076
|
-
const
|
|
7077
|
-
|
|
7078
|
-
|
|
7079
|
-
|
|
7080
|
-
|
|
8414
|
+
return wrapResult(cardResult, TableFunctionCardinalityResultSchema);
|
|
8415
|
+
};
|
|
8416
|
+
const tableFunctionPlan = async (params, ctx) => {
|
|
8417
|
+
const innerParams = unwrapRequest(params.request);
|
|
8418
|
+
const request = deserializePlanRequest(innerParams);
|
|
8419
|
+
const func = registry.get(request.bind_call.function_name, await strippedContext(request.bind_call));
|
|
8420
|
+
const plan = func.plan ? await func.plan(request) : { splits: [{ payload: new Uint8Array(0) }] };
|
|
8421
|
+
const fp = fingerprintInputs(toUint8Array(innerParams.bind_call));
|
|
8422
|
+
const fingerprint = await bindFingerprint(fp.schemaPath, fp.functionName, fp.args, fp.settings, new Uint8Array(0));
|
|
8423
|
+
const anchor = plan.catalogVersion != null ? splitAnchor(plan.catalogVersion) : await liveSplitAnchor(catalogInterface, request.bind_call, ctx?.auth, signingKey) ?? splitAnchor(0);
|
|
8424
|
+
const blobs = [];
|
|
8425
|
+
for (const split of plan.splits) {
|
|
8426
|
+
const token = await buildSplitToken({
|
|
8427
|
+
payload: split.payload,
|
|
8428
|
+
fingerprint,
|
|
8429
|
+
anchor,
|
|
8430
|
+
signingKey,
|
|
8431
|
+
auth: ctx?.auth
|
|
8432
|
+
});
|
|
8433
|
+
blobs.push(serializeBatch(batchFromColumns(Object.fromEntries(SCAN_SPLIT_SCHEMA.fields.map((f) => [
|
|
8434
|
+
f.name,
|
|
8435
|
+
[scanSplitRow(split, token)[f.name] ?? null]
|
|
8436
|
+
])), SCAN_SPLIT_SCHEMA)));
|
|
7081
8437
|
}
|
|
7082
|
-
|
|
8438
|
+
return wrapResult(planResponseRow(plan, blobs), PLAN_RESPONSE_SCHEMA);
|
|
8439
|
+
};
|
|
8440
|
+
const tableFunctionStatistics = async (params) => {
|
|
8441
|
+
const innerParams = unwrapRequest(params.request);
|
|
8442
|
+
const request = deserializeCardinalityRequest(innerParams);
|
|
8443
|
+
const func = registry.get(request.bind_call.function_name, await strippedContext(request.bind_call));
|
|
8444
|
+
if (!func.statistics)
|
|
8445
|
+
return { result: null };
|
|
8446
|
+
const stats = func.statistics(request);
|
|
8447
|
+
if (!stats || stats.length === 0)
|
|
8448
|
+
return { result: null };
|
|
8449
|
+
return { result: serializeColumnStatistics(stats) };
|
|
8450
|
+
};
|
|
8451
|
+
const tableFunctionDynamicToString = async (params) => {
|
|
8452
|
+
const innerParams = unwrapRequest(params.request);
|
|
8453
|
+
const bindCallBytes = toUint8Array(innerParams.bind_call);
|
|
8454
|
+
const bindCallBatch = deserializeBatch(bindCallBytes);
|
|
8455
|
+
const bindParams = batchToScalarDict(bindCallBatch);
|
|
8456
|
+
const bindCall = deserializeBindRequest(bindParams);
|
|
8457
|
+
const globalExecutionId = toUint8Array(innerParams.global_execution_id);
|
|
8458
|
+
const bindOpaqueData = innerParams.bind_opaque_data ? toUint8Array(innerParams.bind_opaque_data) : null;
|
|
8459
|
+
const func = registry.get(bindCall.function_name, await strippedContext(bindCall));
|
|
8460
|
+
const map = func.dynamicToString ? await func.dynamicToString({ bindCall, bindOpaqueData, globalExecutionId }) : {};
|
|
8461
|
+
const keys = Object.keys(map);
|
|
8462
|
+
const values = keys.map((k) => map[k] ?? "");
|
|
8463
|
+
return wrapResult({ keys, values }, TableFunctionDynamicToStringResultSchema);
|
|
8464
|
+
};
|
|
8465
|
+
return {
|
|
8466
|
+
bind,
|
|
8467
|
+
init,
|
|
8468
|
+
tableFunctionCardinality,
|
|
8469
|
+
tableFunctionPlan,
|
|
8470
|
+
tableFunctionStatistics,
|
|
8471
|
+
tableFunctionDynamicToString
|
|
8472
|
+
};
|
|
7083
8473
|
}
|
|
7084
8474
|
|
|
7085
8475
|
// src/protocol/handlers/aggregate.ts
|
|
@@ -7457,7 +8847,7 @@ function defineAggregate(config) {
|
|
|
7457
8847
|
}
|
|
7458
8848
|
|
|
7459
8849
|
// src/protocol/handlers/aggregate.ts
|
|
7460
|
-
function
|
|
8850
|
+
function aggregateHandlers(registry) {
|
|
7461
8851
|
function resolveAggregate(name, schemaPath) {
|
|
7462
8852
|
const func = registry.get(name, {
|
|
7463
8853
|
arguments: new Arguments,
|
|
@@ -7470,199 +8860,180 @@ function registerAggregateMethods(protocol, registry) {
|
|
|
7470
8860
|
}
|
|
7471
8861
|
return func.aggregateConfig;
|
|
7472
8862
|
}
|
|
7473
|
-
|
|
7474
|
-
params
|
|
7475
|
-
|
|
7476
|
-
|
|
7477
|
-
|
|
7478
|
-
|
|
7479
|
-
|
|
7480
|
-
|
|
7481
|
-
|
|
7482
|
-
|
|
7483
|
-
|
|
7484
|
-
|
|
7485
|
-
|
|
7486
|
-
|
|
7487
|
-
|
|
7488
|
-
|
|
7489
|
-
|
|
7490
|
-
|
|
7491
|
-
|
|
7492
|
-
|
|
7493
|
-
|
|
7494
|
-
|
|
7495
|
-
|
|
7496
|
-
|
|
7497
|
-
|
|
7498
|
-
|
|
7499
|
-
|
|
7500
|
-
|
|
7501
|
-
|
|
7502
|
-
|
|
7503
|
-
|
|
7504
|
-
|
|
7505
|
-
|
|
7506
|
-
|
|
7507
|
-
|
|
7508
|
-
|
|
7509
|
-
handler: (params) => {
|
|
7510
|
-
const innerParams = unwrapRequest(params.request);
|
|
7511
|
-
const functionName = innerParams.function_name;
|
|
7512
|
-
const executionId = toUint8Array(innerParams.execution_id);
|
|
7513
|
-
const cfg = resolveAggregate(functionName, innerParams.schema_path ?? null);
|
|
7514
|
-
const batch = readSingleBatch(toUint8Array(innerParams.input_batch));
|
|
7515
|
-
if (!batch || batch.numRows === 0)
|
|
7516
|
-
return wrapResult({}, schema2([]));
|
|
7517
|
-
const gidIdx = batch.schema.fields.findIndex((f) => f.name === GROUP_COLUMN_NAME);
|
|
7518
|
-
if (gidIdx < 0) {
|
|
7519
|
-
throw new Error(`aggregate_update: input batch missing ${GROUP_COLUMN_NAME} column`);
|
|
7520
|
-
}
|
|
7521
|
-
const gidCol = batch.getChildAt(gidIdx);
|
|
7522
|
-
const groupIds = [];
|
|
7523
|
-
const uniqueGids = new Set;
|
|
7524
|
-
for (let i = 0;i < batch.numRows; i++) {
|
|
7525
|
-
const v = gidCol.get(i);
|
|
7526
|
-
const g = typeof v === "bigint" ? v : BigInt(v);
|
|
7527
|
-
groupIds.push(g);
|
|
7528
|
-
uniqueGids.add(g);
|
|
7529
|
-
}
|
|
7530
|
-
const exec = getExecutionState(executionId, uniqueGids);
|
|
7531
|
-
if (!exec) {
|
|
7532
|
-
throw new Error(`aggregate_update: unknown execution_id for '${functionName}' (bind missing or state dropped)`);
|
|
7533
|
-
}
|
|
7534
|
-
const columns = [];
|
|
7535
|
-
for (let i = 0;i < batch.schema.fields.length; i++) {
|
|
7536
|
-
if (i === gidIdx)
|
|
7537
|
-
continue;
|
|
7538
|
-
columns.push(batch.getChildAt(i));
|
|
7539
|
-
}
|
|
7540
|
-
const ensureState = (gid) => {
|
|
7541
|
-
let s = exec.states.get(gid);
|
|
7542
|
-
if (s === undefined) {
|
|
7543
|
-
s = cfg.initialState(exec.bindParams);
|
|
7544
|
-
exec.states.set(gid, s);
|
|
7545
|
-
}
|
|
7546
|
-
return s;
|
|
7547
|
-
};
|
|
7548
|
-
cfg.update({
|
|
7549
|
-
states: exec.states,
|
|
7550
|
-
groupIds,
|
|
7551
|
-
columns,
|
|
7552
|
-
args: exec.bindParams.args,
|
|
7553
|
-
ensureState
|
|
7554
|
-
});
|
|
7555
|
-
persistGroupStates(executionId, uniqueGids);
|
|
8863
|
+
const aggregateBind = async (params) => {
|
|
8864
|
+
const innerParams = unwrapRequest(params.request);
|
|
8865
|
+
const functionName = innerParams.function_name;
|
|
8866
|
+
const cfg = resolveAggregate(functionName, innerParams.schema_path ?? null);
|
|
8867
|
+
const argBytes = toUint8Array(innerParams.arguments);
|
|
8868
|
+
const args = deserializeArguments(argBytes);
|
|
8869
|
+
const inputSchema = innerParams.input_schema ? deserializeSchema(toUint8Array(innerParams.input_schema)) : null;
|
|
8870
|
+
const secretsBytes = innerParams.secrets ? toUint8Array(innerParams.secrets) : null;
|
|
8871
|
+
const secretsBatch = secretsBytes && secretsBytes.length > 0 ? deserializeBatch(secretsBytes) : null;
|
|
8872
|
+
const secrets = secretsBatch ? batchToSecretDict(secretsBatch) : {};
|
|
8873
|
+
const bindParams = {
|
|
8874
|
+
args: extractArgMap(cfg, args),
|
|
8875
|
+
arguments: args,
|
|
8876
|
+
inputSchema,
|
|
8877
|
+
settings: {},
|
|
8878
|
+
secrets,
|
|
8879
|
+
argumentNames: innerParams.argument_names ? (Array.isArray(innerParams.argument_names) ? innerParams.argument_names : [...innerParams.argument_names]).map((value) => value == null ? null : String(value)) : null
|
|
8880
|
+
};
|
|
8881
|
+
const executionId = new Uint8Array(16);
|
|
8882
|
+
crypto.getRandomValues(executionId);
|
|
8883
|
+
setExecutionState(executionId, {
|
|
8884
|
+
states: new Map,
|
|
8885
|
+
bindArgs: args,
|
|
8886
|
+
bindParams
|
|
8887
|
+
});
|
|
8888
|
+
const outType = cfg.onBind ? await cfg.onBind(bindParams) : cfg.outputType;
|
|
8889
|
+
const outSchema = schema2([field2("result", outType, true)]);
|
|
8890
|
+
return wrapResult({ output_schema: serializeSchema(outSchema), execution_id: executionId }, AggregateBindResultSchema);
|
|
8891
|
+
};
|
|
8892
|
+
const aggregateUpdate = (params) => {
|
|
8893
|
+
const innerParams = unwrapRequest(params.request);
|
|
8894
|
+
const functionName = innerParams.function_name;
|
|
8895
|
+
const executionId = toUint8Array(innerParams.execution_id);
|
|
8896
|
+
const cfg = resolveAggregate(functionName, innerParams.schema_path ?? null);
|
|
8897
|
+
const batch = readSingleBatch(toUint8Array(innerParams.input_batch));
|
|
8898
|
+
if (!batch || batch.numRows === 0)
|
|
7556
8899
|
return wrapResult({}, schema2([]));
|
|
8900
|
+
const gidIdx = batch.schema.fields.findIndex((f) => f.name === GROUP_COLUMN_NAME);
|
|
8901
|
+
if (gidIdx < 0) {
|
|
8902
|
+
throw new Error(`aggregate_update: input batch missing ${GROUP_COLUMN_NAME} column`);
|
|
8903
|
+
}
|
|
8904
|
+
const gidCol = batch.getChildAt(gidIdx);
|
|
8905
|
+
const groupIds = [];
|
|
8906
|
+
const uniqueGids = new Set;
|
|
8907
|
+
for (let i = 0;i < batch.numRows; i++) {
|
|
8908
|
+
const v = gidCol.get(i);
|
|
8909
|
+
const g = typeof v === "bigint" ? v : BigInt(v);
|
|
8910
|
+
groupIds.push(g);
|
|
8911
|
+
uniqueGids.add(g);
|
|
8912
|
+
}
|
|
8913
|
+
const exec = getExecutionState(executionId, uniqueGids);
|
|
8914
|
+
if (!exec) {
|
|
8915
|
+
throw new Error(`aggregate_update: unknown execution_id for '${functionName}' (bind missing or state dropped)`);
|
|
8916
|
+
}
|
|
8917
|
+
const columns = [];
|
|
8918
|
+
for (let i = 0;i < batch.schema.fields.length; i++) {
|
|
8919
|
+
if (i === gidIdx)
|
|
8920
|
+
continue;
|
|
8921
|
+
columns.push(batch.getChildAt(i));
|
|
7557
8922
|
}
|
|
7558
|
-
|
|
7559
|
-
|
|
7560
|
-
|
|
7561
|
-
|
|
7562
|
-
|
|
7563
|
-
const innerParams = unwrapRequest(params.request);
|
|
7564
|
-
const functionName = innerParams.function_name;
|
|
7565
|
-
const executionId = toUint8Array(innerParams.execution_id);
|
|
7566
|
-
const cfg = resolveAggregate(functionName, innerParams.schema_path ?? null);
|
|
7567
|
-
const batch = readSingleBatch(toUint8Array(innerParams.merge_batch));
|
|
7568
|
-
if (!batch || batch.numRows === 0)
|
|
7569
|
-
return wrapResult({}, schema2([]));
|
|
7570
|
-
const srcCol = batch.getChild("source_group_id");
|
|
7571
|
-
const tgtCol = batch.getChild("target_group_id");
|
|
7572
|
-
const referencedGids = new Set;
|
|
7573
|
-
const srcIds = [];
|
|
7574
|
-
const tgtIds = [];
|
|
7575
|
-
for (let i = 0;i < batch.numRows; i++) {
|
|
7576
|
-
const src = BigInt(srcCol.get(i));
|
|
7577
|
-
const tgt = BigInt(tgtCol.get(i));
|
|
7578
|
-
srcIds.push(src);
|
|
7579
|
-
tgtIds.push(tgt);
|
|
7580
|
-
referencedGids.add(src);
|
|
7581
|
-
referencedGids.add(tgt);
|
|
7582
|
-
}
|
|
7583
|
-
const exec = getExecutionState(executionId, referencedGids);
|
|
7584
|
-
if (!exec) {
|
|
7585
|
-
throw new Error(`aggregate_combine: unknown execution_id for '${functionName}' ` + `(context missing on disk — bind may have failed or been cleaned up)`);
|
|
7586
|
-
}
|
|
7587
|
-
const touchedTargets = new Set;
|
|
7588
|
-
for (let i = 0;i < batch.numRows; i++) {
|
|
7589
|
-
const src = srcIds[i];
|
|
7590
|
-
const tgt = tgtIds[i];
|
|
7591
|
-
const srcHas = exec.states.has(src);
|
|
7592
|
-
const tgtHas = exec.states.has(tgt);
|
|
7593
|
-
if (!srcHas && !tgtHas)
|
|
7594
|
-
continue;
|
|
7595
|
-
const srcState = srcHas ? exec.states.get(src) : cfg.initialState(exec.bindParams);
|
|
7596
|
-
const tgtState = tgtHas ? exec.states.get(tgt) : cfg.initialState(exec.bindParams);
|
|
7597
|
-
exec.states.set(tgt, cfg.combine(srcState, tgtState, exec.bindParams));
|
|
7598
|
-
touchedTargets.add(tgt);
|
|
8923
|
+
const ensureState = (gid) => {
|
|
8924
|
+
let s = exec.states.get(gid);
|
|
8925
|
+
if (s === undefined) {
|
|
8926
|
+
s = cfg.initialState(exec.bindParams);
|
|
8927
|
+
exec.states.set(gid, s);
|
|
7599
8928
|
}
|
|
7600
|
-
|
|
8929
|
+
return s;
|
|
8930
|
+
};
|
|
8931
|
+
cfg.update({
|
|
8932
|
+
states: exec.states,
|
|
8933
|
+
groupIds,
|
|
8934
|
+
columns,
|
|
8935
|
+
args: exec.bindParams.args,
|
|
8936
|
+
ensureState
|
|
8937
|
+
});
|
|
8938
|
+
persistGroupStates(executionId, uniqueGids);
|
|
8939
|
+
return wrapResult({}, schema2([]));
|
|
8940
|
+
};
|
|
8941
|
+
const aggregateCombine = (params) => {
|
|
8942
|
+
const innerParams = unwrapRequest(params.request);
|
|
8943
|
+
const functionName = innerParams.function_name;
|
|
8944
|
+
const executionId = toUint8Array(innerParams.execution_id);
|
|
8945
|
+
const cfg = resolveAggregate(functionName, innerParams.schema_path ?? null);
|
|
8946
|
+
const batch = readSingleBatch(toUint8Array(innerParams.merge_batch));
|
|
8947
|
+
if (!batch || batch.numRows === 0)
|
|
7601
8948
|
return wrapResult({}, schema2([]));
|
|
8949
|
+
const srcCol = batch.getChild("source_group_id");
|
|
8950
|
+
const tgtCol = batch.getChild("target_group_id");
|
|
8951
|
+
const referencedGids = new Set;
|
|
8952
|
+
const srcIds = [];
|
|
8953
|
+
const tgtIds = [];
|
|
8954
|
+
for (let i = 0;i < batch.numRows; i++) {
|
|
8955
|
+
const src = BigInt(srcCol.get(i));
|
|
8956
|
+
const tgt = BigInt(tgtCol.get(i));
|
|
8957
|
+
srcIds.push(src);
|
|
8958
|
+
tgtIds.push(tgt);
|
|
8959
|
+
referencedGids.add(src);
|
|
8960
|
+
referencedGids.add(tgt);
|
|
8961
|
+
}
|
|
8962
|
+
const exec = getExecutionState(executionId, referencedGids);
|
|
8963
|
+
if (!exec) {
|
|
8964
|
+
throw new Error(`aggregate_combine: unknown execution_id for '${functionName}' ` + `(context missing on disk — bind may have failed or been cleaned up)`);
|
|
8965
|
+
}
|
|
8966
|
+
const touchedTargets = new Set;
|
|
8967
|
+
for (let i = 0;i < batch.numRows; i++) {
|
|
8968
|
+
const src = srcIds[i];
|
|
8969
|
+
const tgt = tgtIds[i];
|
|
8970
|
+
const srcHas = exec.states.has(src);
|
|
8971
|
+
const tgtHas = exec.states.has(tgt);
|
|
8972
|
+
if (!srcHas && !tgtHas)
|
|
8973
|
+
continue;
|
|
8974
|
+
const srcState = srcHas ? exec.states.get(src) : cfg.initialState(exec.bindParams);
|
|
8975
|
+
const tgtState = tgtHas ? exec.states.get(tgt) : cfg.initialState(exec.bindParams);
|
|
8976
|
+
exec.states.set(tgt, cfg.combine(srcState, tgtState, exec.bindParams));
|
|
8977
|
+
touchedTargets.add(tgt);
|
|
7602
8978
|
}
|
|
7603
|
-
|
|
7604
|
-
|
|
7605
|
-
|
|
7606
|
-
|
|
7607
|
-
|
|
7608
|
-
|
|
7609
|
-
|
|
7610
|
-
|
|
7611
|
-
|
|
7612
|
-
|
|
7613
|
-
|
|
7614
|
-
|
|
7615
|
-
|
|
7616
|
-
if (gidBatch) {
|
|
7617
|
-
const col = gidBatch.getChild("group_id");
|
|
7618
|
-
for (let i = 0;i < gidBatch.numRows; i++) {
|
|
7619
|
-
const v = col.get(i);
|
|
7620
|
-
const g = typeof v === "bigint" ? v : BigInt(v);
|
|
7621
|
-
groupIds.push(g);
|
|
7622
|
-
uniqueGids.add(g);
|
|
7623
|
-
}
|
|
7624
|
-
}
|
|
7625
|
-
const exec = getExecutionState(executionId, uniqueGids);
|
|
7626
|
-
if (!exec) {
|
|
7627
|
-
throw new Error(`aggregate_finalize: unknown execution_id for '${functionName}'`);
|
|
7628
|
-
}
|
|
7629
|
-
const states = new Map;
|
|
7630
|
-
for (const gid of groupIds) {
|
|
7631
|
-
states.set(gid, exec.states.has(gid) ? exec.states.get(gid) : null);
|
|
7632
|
-
}
|
|
7633
|
-
const resultBatch = cfg.finalize({
|
|
7634
|
-
groupIds,
|
|
7635
|
-
states,
|
|
7636
|
-
outputSchema,
|
|
7637
|
-
args: exec.bindParams.args
|
|
7638
|
-
});
|
|
7639
|
-
return wrapResult({ result_batch: serializeBatchWithSchema(resultBatch) }, AggregateFinalizeResultSchema);
|
|
7640
|
-
}
|
|
7641
|
-
});
|
|
7642
|
-
protocol.unary("aggregate_destructor", {
|
|
7643
|
-
params: AggregateDestructorParamsSchema,
|
|
7644
|
-
result: RESULT_BINARY_SCHEMA,
|
|
7645
|
-
handler: (params) => {
|
|
7646
|
-
const innerParams = unwrapRequest(params.request);
|
|
7647
|
-
const executionId = toUint8Array(innerParams.execution_id);
|
|
7648
|
-
const exec = getExecutionState(executionId);
|
|
7649
|
-
if (!exec)
|
|
7650
|
-
return wrapResult({}, schema2([]));
|
|
7651
|
-
const gidBatch = readSingleBatch(toUint8Array(innerParams.group_ids_batch));
|
|
7652
|
-
if (!gidBatch || gidBatch.numRows === 0)
|
|
7653
|
-
return wrapResult({}, schema2([]));
|
|
8979
|
+
persistGroupStates(executionId, touchedTargets);
|
|
8980
|
+
return wrapResult({}, schema2([]));
|
|
8981
|
+
};
|
|
8982
|
+
const aggregateFinalize = (params) => {
|
|
8983
|
+
const innerParams = unwrapRequest(params.request);
|
|
8984
|
+
const functionName = innerParams.function_name;
|
|
8985
|
+
const executionId = toUint8Array(innerParams.execution_id);
|
|
8986
|
+
const cfg = resolveAggregate(functionName, innerParams.schema_path ?? null);
|
|
8987
|
+
const outputSchema = deserializeSchema(toUint8Array(innerParams.output_schema));
|
|
8988
|
+
const gidBatch = readSingleBatch(toUint8Array(innerParams.group_ids_batch));
|
|
8989
|
+
const groupIds = [];
|
|
8990
|
+
const uniqueGids = new Set;
|
|
8991
|
+
if (gidBatch) {
|
|
7654
8992
|
const col = gidBatch.getChild("group_id");
|
|
7655
|
-
const toDrop = new Set;
|
|
7656
8993
|
for (let i = 0;i < gidBatch.numRows; i++) {
|
|
7657
8994
|
const v = col.get(i);
|
|
7658
8995
|
const g = typeof v === "bigint" ? v : BigInt(v);
|
|
7659
|
-
|
|
7660
|
-
|
|
8996
|
+
groupIds.push(g);
|
|
8997
|
+
uniqueGids.add(g);
|
|
7661
8998
|
}
|
|
7662
|
-
persistGroupStates(executionId, toDrop);
|
|
7663
|
-
return wrapResult({}, schema2([]));
|
|
7664
8999
|
}
|
|
7665
|
-
|
|
9000
|
+
const exec = getExecutionState(executionId, uniqueGids);
|
|
9001
|
+
if (!exec) {
|
|
9002
|
+
throw new Error(`aggregate_finalize: unknown execution_id for '${functionName}'`);
|
|
9003
|
+
}
|
|
9004
|
+
const states = new Map;
|
|
9005
|
+
for (const gid of groupIds) {
|
|
9006
|
+
states.set(gid, exec.states.has(gid) ? exec.states.get(gid) : null);
|
|
9007
|
+
}
|
|
9008
|
+
const resultBatch = cfg.finalize({
|
|
9009
|
+
groupIds,
|
|
9010
|
+
states,
|
|
9011
|
+
outputSchema,
|
|
9012
|
+
args: exec.bindParams.args
|
|
9013
|
+
});
|
|
9014
|
+
return wrapResult({ result_batch: serializeBatchWithSchema(resultBatch) }, AggregateFinalizeResultSchema);
|
|
9015
|
+
};
|
|
9016
|
+
const aggregateDestructor = (params) => {
|
|
9017
|
+
const innerParams = unwrapRequest(params.request);
|
|
9018
|
+
const executionId = toUint8Array(innerParams.execution_id);
|
|
9019
|
+
const exec = getExecutionState(executionId);
|
|
9020
|
+
if (!exec)
|
|
9021
|
+
return wrapResult({}, schema2([]));
|
|
9022
|
+
const gidBatch = readSingleBatch(toUint8Array(innerParams.group_ids_batch));
|
|
9023
|
+
if (!gidBatch || gidBatch.numRows === 0)
|
|
9024
|
+
return wrapResult({}, schema2([]));
|
|
9025
|
+
const col = gidBatch.getChild("group_id");
|
|
9026
|
+
const toDrop = new Set;
|
|
9027
|
+
for (let i = 0;i < gidBatch.numRows; i++) {
|
|
9028
|
+
const v = col.get(i);
|
|
9029
|
+
const g = typeof v === "bigint" ? v : BigInt(v);
|
|
9030
|
+
exec.states.delete(g);
|
|
9031
|
+
toDrop.add(g);
|
|
9032
|
+
}
|
|
9033
|
+
persistGroupStates(executionId, toDrop);
|
|
9034
|
+
return wrapResult({}, schema2([]));
|
|
9035
|
+
};
|
|
9036
|
+
return { aggregateBind, aggregateUpdate, aggregateCombine, aggregateFinalize, aggregateDestructor };
|
|
7666
9037
|
}
|
|
7667
9038
|
function extractArgMap(cfg, args) {
|
|
7668
9039
|
const out = {};
|
|
@@ -7792,7 +9163,7 @@ function splitLenPrefixed(buf, count) {
|
|
|
7792
9163
|
}
|
|
7793
9164
|
|
|
7794
9165
|
// src/protocol/handlers/table-buffering.ts
|
|
7795
|
-
function
|
|
9166
|
+
function tableBufferingHandlers(registry, signingKey) {
|
|
7796
9167
|
function resolveBuffering(name, schemaPath) {
|
|
7797
9168
|
const func = registry.get(name, {
|
|
7798
9169
|
arguments: new Arguments,
|
|
@@ -7837,55 +9208,44 @@ function registerTableBufferingMethods(protocol, registry, signingKey) {
|
|
|
7837
9208
|
};
|
|
7838
9209
|
return { func, params };
|
|
7839
9210
|
}
|
|
7840
|
-
|
|
7841
|
-
|
|
7842
|
-
|
|
7843
|
-
|
|
7844
|
-
|
|
7845
|
-
|
|
7846
|
-
const { func, params } = await loadParams(inner, clientLog, ctx);
|
|
7847
|
-
if (inner.batch_index != null) {
|
|
7848
|
-
params.batchIndex = Number(inner.batch_index);
|
|
7849
|
-
}
|
|
7850
|
-
const batch = deserializeBatch(toUint8Array(inner.input_batch));
|
|
7851
|
-
const stateId = await func.bufferingConfig.process(batch, params);
|
|
7852
|
-
if (!(stateId instanceof Uint8Array)) {
|
|
7853
|
-
throw new Error(`${func.meta.name}.process() must return Uint8Array (the opaque state_id)`);
|
|
7854
|
-
}
|
|
7855
|
-
return wrapResult({ state_id: stateId }, TableBufferingProcessResultSchema);
|
|
9211
|
+
const tableBufferingProcess = async (rpcParams, ctx) => {
|
|
9212
|
+
const inner = unwrapRequest(rpcParams.request);
|
|
9213
|
+
const clientLog = makeClientLog(ctx);
|
|
9214
|
+
const { func, params } = await loadParams(inner, clientLog, ctx);
|
|
9215
|
+
if (inner.batch_index != null) {
|
|
9216
|
+
params.batchIndex = Number(inner.batch_index);
|
|
7856
9217
|
}
|
|
7857
|
-
|
|
7858
|
-
|
|
7859
|
-
|
|
7860
|
-
|
|
7861
|
-
handler: async (rpcParams, ctx) => {
|
|
7862
|
-
const inner = unwrapRequest(rpcParams.request);
|
|
7863
|
-
const clientLog = makeClientLog(ctx);
|
|
7864
|
-
const { func, params } = await loadParams(inner, clientLog, ctx);
|
|
7865
|
-
const stateIds = decodeBytesList(inner.state_ids);
|
|
7866
|
-
const finalizeStateIds = await func.bufferingConfig.combine(stateIds, params);
|
|
7867
|
-
const out = finalizeStateIds.map((fid, i) => {
|
|
7868
|
-
if (!(fid instanceof Uint8Array)) {
|
|
7869
|
-
throw new Error(`${func.meta.name}.combine() returned non-Uint8Array finalize_state_id at index ${i}`);
|
|
7870
|
-
}
|
|
7871
|
-
return fid;
|
|
7872
|
-
});
|
|
7873
|
-
return wrapResult({ finalize_state_ids: out }, TableBufferingCombineResultSchema);
|
|
9218
|
+
const batch = deserializeBatch(toUint8Array(inner.input_batch));
|
|
9219
|
+
const stateId = await func.bufferingConfig.process(batch, params);
|
|
9220
|
+
if (!(stateId instanceof Uint8Array)) {
|
|
9221
|
+
throw new Error(`${func.meta.name}.process() must return Uint8Array (the opaque state_id)`);
|
|
7874
9222
|
}
|
|
7875
|
-
|
|
7876
|
-
|
|
7877
|
-
|
|
7878
|
-
|
|
7879
|
-
|
|
7880
|
-
|
|
7881
|
-
|
|
7882
|
-
|
|
7883
|
-
|
|
7884
|
-
|
|
7885
|
-
|
|
7886
|
-
|
|
7887
|
-
|
|
7888
|
-
|
|
9223
|
+
return wrapResult({ state_id: stateId }, TableBufferingProcessResultSchema);
|
|
9224
|
+
};
|
|
9225
|
+
const tableBufferingCombine = async (rpcParams, ctx) => {
|
|
9226
|
+
const inner = unwrapRequest(rpcParams.request);
|
|
9227
|
+
const clientLog = makeClientLog(ctx);
|
|
9228
|
+
const { func, params } = await loadParams(inner, clientLog, ctx);
|
|
9229
|
+
const stateIds = decodeBytesList(inner.state_ids);
|
|
9230
|
+
const finalizeStateIds = await func.bufferingConfig.combine(stateIds, params);
|
|
9231
|
+
const out = finalizeStateIds.map((fid, i) => {
|
|
9232
|
+
if (!(fid instanceof Uint8Array)) {
|
|
9233
|
+
throw new Error(`${func.meta.name}.combine() returned non-Uint8Array finalize_state_id at index ${i}`);
|
|
9234
|
+
}
|
|
9235
|
+
return fid;
|
|
9236
|
+
});
|
|
9237
|
+
return wrapResult({ finalize_state_ids: out }, TableBufferingCombineResultSchema);
|
|
9238
|
+
};
|
|
9239
|
+
const tableBufferingDestructor = async (rpcParams) => {
|
|
9240
|
+
try {
|
|
9241
|
+
const inner = unwrapRequest(rpcParams.request);
|
|
9242
|
+
const executionId = toUint8Array(inner.execution_id);
|
|
9243
|
+
const bound = new BoundStorage(storage, executionId);
|
|
9244
|
+
await bound.executionClear();
|
|
9245
|
+
} catch {}
|
|
9246
|
+
return wrapResult({}, TableBufferingDestructorResultSchema);
|
|
9247
|
+
};
|
|
9248
|
+
return { tableBufferingProcess, tableBufferingCombine, tableBufferingDestructor };
|
|
7889
9249
|
}
|
|
7890
9250
|
function makeClientLog(ctx) {
|
|
7891
9251
|
if (ctx && typeof ctx.clientLog === "function") {
|
|
@@ -7912,7 +9272,7 @@ function hex(buf) {
|
|
|
7912
9272
|
// src/codec/asd.ts
|
|
7913
9273
|
init_arrow();
|
|
7914
9274
|
function encodeASD(schema, obj) {
|
|
7915
|
-
return serializeBatch(batchFromRows([sortMapsForSchema(schema, obj)], schema));
|
|
9275
|
+
return serializeBatch(batchFromRows([sortMapsForSchema(schema, conformRecord(schema, obj))], schema));
|
|
7916
9276
|
}
|
|
7917
9277
|
function compareCodePoints(a, b) {
|
|
7918
9278
|
const n = Math.min(a.length, b.length);
|
|
@@ -7929,7 +9289,7 @@ function compareCodePoints(a, b) {
|
|
|
7929
9289
|
}
|
|
7930
9290
|
return a.length - b.length;
|
|
7931
9291
|
}
|
|
7932
|
-
function
|
|
9292
|
+
function mapPairs2(raw) {
|
|
7933
9293
|
if (Array.isArray(raw))
|
|
7934
9294
|
return raw.map((e) => Array.isArray(e) ? [e[0], e[1]] : [e?.key, e?.value]);
|
|
7935
9295
|
if (raw instanceof Map)
|
|
@@ -7964,7 +9324,7 @@ function sortMapsForType(type, value) {
|
|
|
7964
9324
|
if (isMap(type)) {
|
|
7965
9325
|
const entries = type.children[0].type;
|
|
7966
9326
|
const valueType = entries.children[1].type;
|
|
7967
|
-
return
|
|
9327
|
+
return mapPairs2(value).map(([k, v]) => [k, sortMapsForType(valueType, v)]).sort((x, y) => compareKeys(x[0], y[0]));
|
|
7968
9328
|
}
|
|
7969
9329
|
if (isList(type)) {
|
|
7970
9330
|
const child = type.children[0].type;
|
|
@@ -8222,12 +9582,12 @@ var encodeAttachCatalogInfo = (v) => encodeASD(AttachCatalogInfoSchema, {
|
|
|
8222
9582
|
secret_ref: v.secret_ref ?? ""
|
|
8223
9583
|
});
|
|
8224
9584
|
function encodeScanFunctionResult(functionName, argumentsBytes, requiredExtensions = [], schemaPath = null) {
|
|
8225
|
-
return serializeBatch(batchFromColumns({
|
|
9585
|
+
return serializeBatch(batchFromColumns(conformColumns(ScanFunctionResultSchema, {
|
|
8226
9586
|
function_name: [functionName],
|
|
8227
9587
|
arguments: [argumentsBytes],
|
|
8228
9588
|
required_extensions: [requiredExtensions],
|
|
8229
9589
|
schema_path: [schemaPath]
|
|
8230
|
-
}, ScanFunctionResultSchema));
|
|
9590
|
+
}), ScanFunctionResultSchema));
|
|
8231
9591
|
}
|
|
8232
9592
|
function singleBranchResult(legacy) {
|
|
8233
9593
|
return {
|
|
@@ -8242,7 +9602,7 @@ function singleBranchResult(legacy) {
|
|
|
8242
9602
|
};
|
|
8243
9603
|
}
|
|
8244
9604
|
function encodeScanBranch(cols) {
|
|
8245
|
-
return serializeBatch(batchFromColumns({
|
|
9605
|
+
return serializeBatch(batchFromColumns(conformColumns(ScanBranchSchema, {
|
|
8246
9606
|
function_name: [cols.function_name],
|
|
8247
9607
|
arguments: [cols.arguments],
|
|
8248
9608
|
branch_filter: [cols.branch_filter ?? null],
|
|
@@ -8254,7 +9614,7 @@ function encodeScanBranch(cols) {
|
|
|
8254
9614
|
format_locations: [cols.format_locations ?? null],
|
|
8255
9615
|
format_options: [cols.format_options ?? null],
|
|
8256
9616
|
schema_path: [cols.schema_path ?? null]
|
|
8257
|
-
}, ScanBranchSchema));
|
|
9617
|
+
}), ScanBranchSchema));
|
|
8258
9618
|
}
|
|
8259
9619
|
function isPromise(v) {
|
|
8260
9620
|
return v != null && typeof v.then === "function";
|
|
@@ -8427,7 +9787,7 @@ class CatalogInterface {
|
|
|
8427
9787
|
// src/attach-ticket.ts
|
|
8428
9788
|
init_arrow();
|
|
8429
9789
|
import {
|
|
8430
|
-
Protocol,
|
|
9790
|
+
Protocol as Protocol2,
|
|
8431
9791
|
badRequest,
|
|
8432
9792
|
errorInfo,
|
|
8433
9793
|
preconditionFailure
|
|
@@ -8563,7 +9923,7 @@ async function checkReservedAttachOptions(catalog) {
|
|
|
8563
9923
|
var ATTACH_TICKET_PREFIX = "vgia1.";
|
|
8564
9924
|
var ATTACH_TICKET_OPTION = RESERVED_ATTACH_OPTION;
|
|
8565
9925
|
var ATTACH_TICKETS_PROTOCOL_NAME = "vgi.attach_tickets.v1";
|
|
8566
|
-
var ATTACH_TICKETS_PROTOCOL_VERSION = "
|
|
9926
|
+
var ATTACH_TICKETS_PROTOCOL_VERSION = "2.0.0";
|
|
8567
9927
|
var TICKET_ENVELOPE_VERSION = 1;
|
|
8568
9928
|
var MAX_OPTIONS_BYTES = 16 * 1024;
|
|
8569
9929
|
var MAX_TICKET_CHARS = 32 * 1024;
|
|
@@ -8838,8 +10198,19 @@ var SEAL_ATTACH_REQUEST_SCHEMA = schema2([
|
|
|
8838
10198
|
]);
|
|
8839
10199
|
var ATTACH_TICKET_SCHEMA = schema2([
|
|
8840
10200
|
field2("ticket", utf82(), false),
|
|
8841
|
-
field2("expires_at",
|
|
10201
|
+
field2("expires_at", timestamp2(TimeUnit2.MICROSECOND, "UTC"), true)
|
|
8842
10202
|
]);
|
|
10203
|
+
function expiresAtMicros(value) {
|
|
10204
|
+
if (value === null)
|
|
10205
|
+
return null;
|
|
10206
|
+
const ms = value.getTime();
|
|
10207
|
+
if (!Number.isFinite(ms))
|
|
10208
|
+
throw new TypeError("AttachTicket.expires_at must be a valid Date or null");
|
|
10209
|
+
return BigInt(ms) * 1000n;
|
|
10210
|
+
}
|
|
10211
|
+
function encodeAttachTicket(ticket) {
|
|
10212
|
+
return serializeBatch(batchFromColumns({ ticket: [ticket.ticket], expires_at: [expiresAtMicros(ticket.expires_at)] }, ATTACH_TICKET_SCHEMA));
|
|
10213
|
+
}
|
|
8843
10214
|
function resolveTicketMaxTtl(grantKeys, env) {
|
|
8844
10215
|
if (grantKeys)
|
|
8845
10216
|
return Math.trunc(grantKeys.maxTtlSeconds);
|
|
@@ -8926,10 +10297,10 @@ async function sealAttach2(config, request, auth) {
|
|
|
8926
10297
|
} catch (e) {
|
|
8927
10298
|
throw new AttachTicketRequestError("seal_attach request is invalid", [["request", e.message]]);
|
|
8928
10299
|
}
|
|
8929
|
-
return { ticket: token, expires_at: expiresAt === 0 ?
|
|
10300
|
+
return { ticket: token, expires_at: expiresAt === 0 ? null : new Date(expiresAt * 1000) };
|
|
8930
10301
|
}
|
|
8931
10302
|
function buildAttachTicketsProtocol(config) {
|
|
8932
|
-
const p = new
|
|
10303
|
+
const p = new Protocol2(ATTACH_TICKETS_PROTOCOL_NAME, { protocolVersion: ATTACH_TICKETS_PROTOCOL_VERSION });
|
|
8933
10304
|
p.unary("seal_attach", {
|
|
8934
10305
|
params: REQUEST_PARAMS_SCHEMA,
|
|
8935
10306
|
result: RESULT_BINARY_SCHEMA,
|
|
@@ -8937,544 +10308,376 @@ function buildAttachTicketsProtocol(config) {
|
|
|
8937
10308
|
handler: async (params, ctx) => {
|
|
8938
10309
|
const request = unwrapRequest(params.request);
|
|
8939
10310
|
const sealed = await sealAttach2(config, request, ctx?.auth);
|
|
8940
|
-
|
|
8941
|
-
return { result: serializeBatch(batch) };
|
|
10311
|
+
return { result: encodeAttachTicket(sealed) };
|
|
8942
10312
|
}
|
|
8943
10313
|
});
|
|
8944
10314
|
return p;
|
|
8945
10315
|
}
|
|
8946
10316
|
|
|
8947
10317
|
// src/protocol/handlers/catalog/admin.ts
|
|
8948
|
-
function
|
|
8949
|
-
|
|
8950
|
-
|
|
8951
|
-
|
|
8952
|
-
|
|
8953
|
-
|
|
8954
|
-
|
|
8955
|
-
|
|
8956
|
-
|
|
8957
|
-
|
|
8958
|
-
|
|
8959
|
-
|
|
8960
|
-
}));
|
|
8961
|
-
const items = infos.map((info) => encodeCatalogInfo(info));
|
|
8962
|
-
return wrapResult({ items }, CatalogCatalogsResultSchema);
|
|
8963
|
-
}
|
|
10318
|
+
function catalogAdminHandlers(getCatalog, signingKey) {
|
|
10319
|
+
const catalogCatalogs = catalogHandler(signingKey, async () => {
|
|
10320
|
+
const cat = getCatalog();
|
|
10321
|
+
const infos = cat.catalogsInfo ? await cat.catalogsInfo() : cat.catalogs().map((name) => ({
|
|
10322
|
+
name,
|
|
10323
|
+
implementation_version: null,
|
|
10324
|
+
data_version_spec: null,
|
|
10325
|
+
attach_option_specs: [],
|
|
10326
|
+
releases: []
|
|
10327
|
+
}));
|
|
10328
|
+
const items = infos.map((info) => encodeCatalogInfo(info));
|
|
10329
|
+
return wrapResult({ items }, CatalogCatalogsResultSchema);
|
|
8964
10330
|
});
|
|
8965
|
-
|
|
8966
|
-
params
|
|
8967
|
-
|
|
8968
|
-
|
|
8969
|
-
|
|
8970
|
-
|
|
8971
|
-
|
|
8972
|
-
|
|
8973
|
-
|
|
8974
|
-
|
|
8975
|
-
|
|
8976
|
-
|
|
8977
|
-
|
|
8978
|
-
|
|
8979
|
-
|
|
8980
|
-
|
|
8981
|
-
|
|
8982
|
-
|
|
8983
|
-
|
|
8984
|
-
|
|
8985
|
-
|
|
8986
|
-
|
|
8987
|
-
|
|
10331
|
+
const catalogAttach = async (params, ctx) => {
|
|
10332
|
+
const innerParams = unwrapRequest(params.request);
|
|
10333
|
+
const cat = getCatalog();
|
|
10334
|
+
let optionsDict = decodeOptionsBatch(innerParams.options);
|
|
10335
|
+
const restored = await redeemAttachTicket(optionsDict, signingKey, ctx?.auth ?? currentRequestAuth());
|
|
10336
|
+
if (restored !== null) {
|
|
10337
|
+
innerParams.name = restored.name;
|
|
10338
|
+
innerParams.options = restored.optionsIpc;
|
|
10339
|
+
innerParams.data_version_spec = restored.dataVersionSpec;
|
|
10340
|
+
innerParams.implementation_version = restored.implementationVersion;
|
|
10341
|
+
optionsDict = restored.options;
|
|
10342
|
+
}
|
|
10343
|
+
const result = await cat.attach(innerParams.name, optionsDict, innerParams.data_version_spec ?? null, innerParams.implementation_version ?? null);
|
|
10344
|
+
const sealedAttach = await sealAttach(toUint8Array(result.attach_opaque_data), ctx?.auth, signingKey);
|
|
10345
|
+
return wrapResult(buildCatalogAttachResult({
|
|
10346
|
+
...result,
|
|
10347
|
+
attach_opaque_data: sealedAttach,
|
|
10348
|
+
supports_column_statistics: result.supports_column_statistics ?? true
|
|
10349
|
+
}), CatalogAttachResultSchema);
|
|
10350
|
+
};
|
|
10351
|
+
const catalogDetach = catalogHandler(signingKey, async (params) => {
|
|
10352
|
+
const cat = getCatalog();
|
|
10353
|
+
await cat.detach(toUint8Array(params.attach_opaque_data));
|
|
10354
|
+
return {};
|
|
8988
10355
|
});
|
|
8989
|
-
|
|
8990
|
-
|
|
8991
|
-
|
|
8992
|
-
|
|
8993
|
-
const cat = getCatalog();
|
|
8994
|
-
await cat.detach(toUint8Array(params.attach_opaque_data));
|
|
8995
|
-
return {};
|
|
8996
|
-
}
|
|
10356
|
+
const catalogCreate = catalogHandler(signingKey, async (params) => {
|
|
10357
|
+
const cat = getCatalog();
|
|
10358
|
+
await cat.create(params.name, params.on_conflict, params.options);
|
|
10359
|
+
return {};
|
|
8997
10360
|
});
|
|
8998
|
-
|
|
8999
|
-
|
|
9000
|
-
|
|
9001
|
-
|
|
9002
|
-
const cat = getCatalog();
|
|
9003
|
-
await cat.create(params.name, params.on_conflict, params.options);
|
|
9004
|
-
return {};
|
|
9005
|
-
}
|
|
10361
|
+
const catalogDrop = catalogHandler(signingKey, async (params) => {
|
|
10362
|
+
const cat = getCatalog();
|
|
10363
|
+
await cat.drop(params.name);
|
|
10364
|
+
return {};
|
|
9006
10365
|
});
|
|
9007
|
-
|
|
9008
|
-
|
|
9009
|
-
|
|
9010
|
-
|
|
9011
|
-
const cat = getCatalog();
|
|
9012
|
-
await cat.drop(params.name);
|
|
9013
|
-
return {};
|
|
9014
|
-
}
|
|
10366
|
+
const catalogVersion = catalogHandler(signingKey, async (params) => {
|
|
10367
|
+
const cat = getCatalog();
|
|
10368
|
+
const version = await cat.version(toUint8Array(params.attach_opaque_data), params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10369
|
+
return wrapResult({ version }, CatalogVersionResultSchema);
|
|
9015
10370
|
});
|
|
9016
|
-
|
|
9017
|
-
|
|
9018
|
-
|
|
9019
|
-
|
|
9020
|
-
|
|
9021
|
-
|
|
9022
|
-
|
|
9023
|
-
}
|
|
10371
|
+
const catalogTransactionBegin = async (params, ctx) => {
|
|
10372
|
+
const auth = ctx?.auth;
|
|
10373
|
+
const sealedAttach = params.attach_opaque_data != null ? toUint8Array(params.attach_opaque_data) : new Uint8Array(0);
|
|
10374
|
+
const attachPlain = await openAttach(sealedAttach, auth, signingKey);
|
|
10375
|
+
const cat = getCatalog();
|
|
10376
|
+
const txPlain = await cat.transactionBegin(attachPlain);
|
|
10377
|
+
const transaction_opaque_data = txPlain != null ? await sealTransaction(toUint8Array(txPlain), sealedAttach, auth, signingKey) : null;
|
|
10378
|
+
return wrapResult({ transaction_opaque_data }, CatalogTransactionBeginResultSchema);
|
|
10379
|
+
};
|
|
10380
|
+
const catalogTransactionCommit = catalogHandler(signingKey, async (params) => {
|
|
10381
|
+
const cat = getCatalog();
|
|
10382
|
+
await cat.transactionCommit(toUint8Array(params.attach_opaque_data), toUint8Array(params.transaction_opaque_data));
|
|
10383
|
+
return {};
|
|
9024
10384
|
});
|
|
9025
|
-
|
|
9026
|
-
|
|
9027
|
-
|
|
9028
|
-
|
|
9029
|
-
const auth = ctx?.auth;
|
|
9030
|
-
const sealedAttach = params.attach_opaque_data != null ? toUint8Array(params.attach_opaque_data) : new Uint8Array(0);
|
|
9031
|
-
const attachPlain = await openAttach(sealedAttach, auth, signingKey);
|
|
9032
|
-
const cat = getCatalog();
|
|
9033
|
-
const txPlain = await cat.transactionBegin(attachPlain);
|
|
9034
|
-
const transaction_opaque_data = txPlain != null ? await sealTransaction(toUint8Array(txPlain), sealedAttach, auth, signingKey) : null;
|
|
9035
|
-
return wrapResult({ transaction_opaque_data }, CatalogTransactionBeginResultSchema);
|
|
9036
|
-
}
|
|
10385
|
+
const catalogTransactionRollback = catalogHandler(signingKey, async (params) => {
|
|
10386
|
+
const cat = getCatalog();
|
|
10387
|
+
await cat.transactionRollback(toUint8Array(params.attach_opaque_data), toUint8Array(params.transaction_opaque_data));
|
|
10388
|
+
return {};
|
|
9037
10389
|
});
|
|
9038
|
-
|
|
9039
|
-
|
|
9040
|
-
|
|
9041
|
-
|
|
9042
|
-
|
|
9043
|
-
|
|
9044
|
-
return {};
|
|
9045
|
-
}
|
|
10390
|
+
const catalogSchemas = catalogHandler(signingKey, async (params) => {
|
|
10391
|
+
const cat = getCatalog();
|
|
10392
|
+
const schemas = await cat.schemas(toUint8Array(params.attach_opaque_data), params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10393
|
+
return wrapResult({
|
|
10394
|
+
items: schemas.map((s) => encodeSchemaInfo(s))
|
|
10395
|
+
}, CatalogSchemasResultSchema);
|
|
9046
10396
|
});
|
|
9047
|
-
|
|
9048
|
-
params:
|
|
9049
|
-
|
|
9050
|
-
handler: async (params) => {
|
|
9051
|
-
const cat = getCatalog();
|
|
9052
|
-
await cat.transactionRollback(toUint8Array(params.attach_opaque_data), toUint8Array(params.transaction_opaque_data));
|
|
9053
|
-
return {};
|
|
9054
|
-
}
|
|
10397
|
+
const catalogContents = catalogHandler(signingKey, async (params) => {
|
|
10398
|
+
const ifNoneMatch = params.if_none_match == null ? null : String(params.if_none_match);
|
|
10399
|
+
return serveCatalogContents(getCatalog(), toUint8Array(params.attach_opaque_data), ifNoneMatch);
|
|
9055
10400
|
});
|
|
9056
|
-
|
|
9057
|
-
|
|
9058
|
-
|
|
9059
|
-
|
|
9060
|
-
|
|
9061
|
-
|
|
9062
|
-
return wrapResult({
|
|
9063
|
-
items: schemas.map((s) => encodeSchemaInfo(s))
|
|
9064
|
-
}, CatalogSchemasResultSchema);
|
|
9065
|
-
}
|
|
10401
|
+
const catalogCopyFromFormats = catalogHandler(signingKey, async (params) => {
|
|
10402
|
+
const cat = getCatalog();
|
|
10403
|
+
const formats = await cat.copyFromFormats(toUint8Array(params.attach_opaque_data), params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10404
|
+
return wrapResult({
|
|
10405
|
+
items: formats.map((f) => encodeCopyFromFormatInfo(f))
|
|
10406
|
+
}, CatalogCopyFromFormatsResultSchema);
|
|
9066
10407
|
});
|
|
9067
|
-
|
|
9068
|
-
|
|
9069
|
-
|
|
9070
|
-
|
|
9071
|
-
|
|
9072
|
-
|
|
9073
|
-
}
|
|
10408
|
+
const catalogSchemaGet = catalogHandler(signingKey, async (params) => {
|
|
10409
|
+
const cat = getCatalog();
|
|
10410
|
+
const info = await cat.schemaGet(toUint8Array(params.attach_opaque_data), params.path, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10411
|
+
return wrapResult({
|
|
10412
|
+
items: info ? [encodeSchemaInfo(info)] : []
|
|
10413
|
+
}, CatalogSchemaGetResultSchema);
|
|
9074
10414
|
});
|
|
9075
|
-
|
|
9076
|
-
|
|
9077
|
-
|
|
9078
|
-
|
|
9079
|
-
const cat = getCatalog();
|
|
9080
|
-
const formats = await cat.copyFromFormats(toUint8Array(params.attach_opaque_data), params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
9081
|
-
return wrapResult({
|
|
9082
|
-
items: formats.map((f) => encodeCopyFromFormatInfo(f))
|
|
9083
|
-
}, CatalogCopyFromFormatsResultSchema);
|
|
9084
|
-
}
|
|
9085
|
-
});
|
|
9086
|
-
catalogUnary(protocol, signingKey, "catalog_schema_get", {
|
|
9087
|
-
params: CatalogSchemaGetParamsSchema,
|
|
9088
|
-
result: RESULT_BINARY_SCHEMA,
|
|
9089
|
-
handler: async (params) => {
|
|
9090
|
-
const cat = getCatalog();
|
|
9091
|
-
const info = await cat.schemaGet(toUint8Array(params.attach_opaque_data), params.path, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
9092
|
-
return wrapResult({
|
|
9093
|
-
items: info ? [encodeSchemaInfo(info)] : []
|
|
9094
|
-
}, CatalogSchemaGetResultSchema);
|
|
9095
|
-
}
|
|
9096
|
-
});
|
|
9097
|
-
catalogUnary(protocol, signingKey, "catalog_schema_create", {
|
|
9098
|
-
params: CatalogSchemaCreateParamsSchema,
|
|
9099
|
-
result: emptyResultSchema,
|
|
9100
|
-
handler: async (params) => {
|
|
9101
|
-
const cat = getCatalog();
|
|
9102
|
-
await cat.schemaCreate(toUint8Array(params.attach_opaque_data), params.path, params.comment, null, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
9103
|
-
return {};
|
|
9104
|
-
}
|
|
10415
|
+
const catalogSchemaCreate = catalogHandler(signingKey, async (params) => {
|
|
10416
|
+
const cat = getCatalog();
|
|
10417
|
+
await cat.schemaCreate(toUint8Array(params.attach_opaque_data), params.path, params.comment, null, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10418
|
+
return {};
|
|
9105
10419
|
});
|
|
9106
|
-
|
|
9107
|
-
|
|
9108
|
-
|
|
9109
|
-
|
|
9110
|
-
const cat = getCatalog();
|
|
9111
|
-
await cat.schemaDrop(toUint8Array(params.attach_opaque_data), params.path, params.ignore_not_found, params.cascade, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
9112
|
-
return {};
|
|
9113
|
-
}
|
|
10420
|
+
const catalogSchemaDrop = catalogHandler(signingKey, async (params) => {
|
|
10421
|
+
const cat = getCatalog();
|
|
10422
|
+
await cat.schemaDrop(toUint8Array(params.attach_opaque_data), params.path, params.ignore_not_found, params.cascade, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10423
|
+
return {};
|
|
9114
10424
|
});
|
|
9115
|
-
|
|
9116
|
-
|
|
9117
|
-
|
|
9118
|
-
|
|
9119
|
-
|
|
9120
|
-
|
|
9121
|
-
return wrapResult({
|
|
9122
|
-
items: tables.map((t) => encodeTableInfo(t))
|
|
9123
|
-
}, CatalogSchemaContentsTablesResultSchema);
|
|
9124
|
-
}
|
|
10425
|
+
const catalogSchemaContentsTables = catalogHandler(signingKey, async (params) => {
|
|
10426
|
+
const cat = getCatalog();
|
|
10427
|
+
const tables = await cat.schemaContentsTables(toUint8Array(params.attach_opaque_data), params.path, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10428
|
+
return wrapResult({
|
|
10429
|
+
items: tables.map((t) => encodeTableInfo(t))
|
|
10430
|
+
}, CatalogSchemaContentsTablesResultSchema);
|
|
9125
10431
|
});
|
|
9126
|
-
|
|
9127
|
-
|
|
9128
|
-
|
|
9129
|
-
|
|
9130
|
-
|
|
9131
|
-
|
|
9132
|
-
return wrapResult({
|
|
9133
|
-
items: views.map((v) => encodeViewInfo(v))
|
|
9134
|
-
}, CatalogSchemaContentsViewsResultSchema);
|
|
9135
|
-
}
|
|
10432
|
+
const catalogSchemaContentsViews = catalogHandler(signingKey, async (params) => {
|
|
10433
|
+
const cat = getCatalog();
|
|
10434
|
+
const views = await cat.schemaContentsViews(toUint8Array(params.attach_opaque_data), params.path, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10435
|
+
return wrapResult({
|
|
10436
|
+
items: views.map((v) => encodeViewInfo(v))
|
|
10437
|
+
}, CatalogSchemaContentsViewsResultSchema);
|
|
9136
10438
|
});
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
|
|
9143
|
-
return wrapResult({
|
|
9144
|
-
items: funcs.map((f) => encodeFunctionInfoOnce(f))
|
|
9145
|
-
}, CatalogSchemaContentsFunctionsResultSchema);
|
|
9146
|
-
}
|
|
10439
|
+
const catalogSchemaContentsFunctions = catalogHandler(signingKey, async (params) => {
|
|
10440
|
+
const cat = getCatalog();
|
|
10441
|
+
const funcs = await cat.schemaContentsFunctions(toUint8Array(params.attach_opaque_data), params.path, decodeDictValue(params.type), params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10442
|
+
return wrapResult({
|
|
10443
|
+
items: funcs.map((f) => encodeFunctionInfoOnce(f))
|
|
10444
|
+
}, CatalogSchemaContentsFunctionsResultSchema);
|
|
9147
10445
|
});
|
|
10446
|
+
return {
|
|
10447
|
+
catalogCatalogs,
|
|
10448
|
+
catalogAttach,
|
|
10449
|
+
catalogDetach,
|
|
10450
|
+
catalogCreate,
|
|
10451
|
+
catalogDrop,
|
|
10452
|
+
catalogVersion,
|
|
10453
|
+
catalogTransactionBegin,
|
|
10454
|
+
catalogTransactionCommit,
|
|
10455
|
+
catalogTransactionRollback,
|
|
10456
|
+
catalogSchemas,
|
|
10457
|
+
catalogContents,
|
|
10458
|
+
catalogCopyFromFormats,
|
|
10459
|
+
catalogSchemaGet,
|
|
10460
|
+
catalogSchemaCreate,
|
|
10461
|
+
catalogSchemaDrop,
|
|
10462
|
+
catalogSchemaContentsTables,
|
|
10463
|
+
catalogSchemaContentsViews,
|
|
10464
|
+
catalogSchemaContentsFunctions
|
|
10465
|
+
};
|
|
9148
10466
|
}
|
|
9149
10467
|
|
|
9150
10468
|
// src/protocol/handlers/catalog/table.ts
|
|
9151
|
-
function
|
|
9152
|
-
|
|
9153
|
-
|
|
9154
|
-
|
|
9155
|
-
|
|
9156
|
-
|
|
9157
|
-
|
|
9158
|
-
return wrapResult({
|
|
9159
|
-
items: info ? [encodeTableInfo(info)] : []
|
|
9160
|
-
}, CatalogTableGetResultSchema);
|
|
9161
|
-
}
|
|
10469
|
+
function catalogTableHandlers(getCatalog, signingKey) {
|
|
10470
|
+
const catalogTableGet = catalogHandler(signingKey, async (params) => {
|
|
10471
|
+
const cat = getCatalog();
|
|
10472
|
+
const info = await cat.tableGet(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.at_unit, params.at_value, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10473
|
+
return wrapResult({
|
|
10474
|
+
items: info ? [encodeTableInfo(info)] : []
|
|
10475
|
+
}, CatalogTableGetResultSchema);
|
|
9162
10476
|
});
|
|
9163
|
-
|
|
9164
|
-
|
|
9165
|
-
|
|
9166
|
-
|
|
9167
|
-
const cat = getCatalog();
|
|
9168
|
-
await cat.tableCreate(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, toUint8Array(params.columns), params.on_conflict, params.not_null_constraints ?? [], params.unique_constraints ?? [], params.check_constraints ?? [], params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
9169
|
-
return {};
|
|
9170
|
-
}
|
|
10477
|
+
const catalogTableCreate = catalogHandler(signingKey, async (params) => {
|
|
10478
|
+
const cat = getCatalog();
|
|
10479
|
+
await cat.tableCreate(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, toUint8Array(params.columns), params.on_conflict, params.not_null_constraints ?? [], params.unique_constraints ?? [], params.check_constraints ?? [], params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10480
|
+
return {};
|
|
9171
10481
|
});
|
|
9172
|
-
|
|
9173
|
-
|
|
9174
|
-
|
|
9175
|
-
|
|
9176
|
-
const cat = getCatalog();
|
|
9177
|
-
await cat.tableDrop(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.ignore_not_found, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
9178
|
-
return {};
|
|
9179
|
-
}
|
|
10482
|
+
const catalogTableDrop = catalogHandler(signingKey, async (params) => {
|
|
10483
|
+
const cat = getCatalog();
|
|
10484
|
+
await cat.tableDrop(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.ignore_not_found, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10485
|
+
return {};
|
|
9180
10486
|
});
|
|
9181
|
-
|
|
9182
|
-
|
|
9183
|
-
|
|
9184
|
-
|
|
9185
|
-
const cat = getCatalog();
|
|
9186
|
-
const stats = await cat.tableColumnStatisticsGet(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
9187
|
-
return { result: stats?.bytes ?? null };
|
|
9188
|
-
}
|
|
10487
|
+
const catalogTableColumnStatisticsGet = catalogHandler(signingKey, async (params) => {
|
|
10488
|
+
const cat = getCatalog();
|
|
10489
|
+
const stats = await cat.tableColumnStatisticsGet(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10490
|
+
return { result: stats?.bytes ?? null };
|
|
9189
10491
|
});
|
|
9190
|
-
|
|
9191
|
-
|
|
9192
|
-
|
|
9193
|
-
|
|
9194
|
-
const cat = getCatalog();
|
|
9195
|
-
const scanResult = await cat.tableScanFunctionGet(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.at_unit, params.at_value, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
9196
|
-
return wrapResult(scanResult, ScanFunctionResultSchema);
|
|
9197
|
-
}
|
|
10492
|
+
const catalogTableScanFunctionGet = catalogHandler(signingKey, async (params) => {
|
|
10493
|
+
const cat = getCatalog();
|
|
10494
|
+
const scanResult = await cat.tableScanFunctionGet(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.at_unit, params.at_value, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10495
|
+
return wrapResult(scanResult, ScanFunctionResultSchema);
|
|
9198
10496
|
});
|
|
9199
|
-
|
|
9200
|
-
|
|
9201
|
-
|
|
9202
|
-
|
|
9203
|
-
const cat = getCatalog();
|
|
9204
|
-
const branchesResult = await cat.tableScanBranchesGet(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.at_unit, params.at_value, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
9205
|
-
return wrapResult(branchesResult, ScanBranchesResultSchema);
|
|
9206
|
-
}
|
|
10497
|
+
const catalogTableScanBranchesGet = catalogHandler(signingKey, async (params) => {
|
|
10498
|
+
const cat = getCatalog();
|
|
10499
|
+
const branchesResult = await cat.tableScanBranchesGet(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.at_unit, params.at_value, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10500
|
+
return wrapResult(branchesResult, ScanBranchesResultSchema);
|
|
9207
10501
|
});
|
|
9208
|
-
|
|
9209
|
-
|
|
9210
|
-
|
|
9211
|
-
|
|
9212
|
-
const cat = getCatalog();
|
|
9213
|
-
await cat.tableCommentSet(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.comment, params.ignore_not_found, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
9214
|
-
return {};
|
|
9215
|
-
}
|
|
10502
|
+
const catalogTableCommentSet = catalogHandler(signingKey, async (params) => {
|
|
10503
|
+
const cat = getCatalog();
|
|
10504
|
+
await cat.tableCommentSet(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.comment, params.ignore_not_found, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10505
|
+
return {};
|
|
9216
10506
|
});
|
|
9217
|
-
|
|
9218
|
-
|
|
9219
|
-
|
|
9220
|
-
|
|
9221
|
-
const cat = getCatalog();
|
|
9222
|
-
await cat.tableRename(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.new_name, params.ignore_not_found, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
9223
|
-
return {};
|
|
9224
|
-
}
|
|
10507
|
+
const catalogTableRename = catalogHandler(signingKey, async (params) => {
|
|
10508
|
+
const cat = getCatalog();
|
|
10509
|
+
await cat.tableRename(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.new_name, params.ignore_not_found, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10510
|
+
return {};
|
|
9225
10511
|
});
|
|
9226
|
-
|
|
9227
|
-
|
|
9228
|
-
|
|
9229
|
-
|
|
9230
|
-
const cat = getCatalog();
|
|
9231
|
-
await cat.tableColumnAdd(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.column_name, params.column_type, params.default_value, params.ignore_not_found, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
9232
|
-
return {};
|
|
9233
|
-
}
|
|
10512
|
+
const catalogTableColumnAdd = catalogHandler(signingKey, async (params) => {
|
|
10513
|
+
const cat = getCatalog();
|
|
10514
|
+
await cat.tableColumnAdd(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.column_name, params.column_type, params.default_value, params.ignore_not_found, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10515
|
+
return {};
|
|
9234
10516
|
});
|
|
9235
|
-
|
|
9236
|
-
|
|
9237
|
-
|
|
9238
|
-
|
|
9239
|
-
const cat = getCatalog();
|
|
9240
|
-
await cat.tableColumnDrop(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.column_name, params.ignore_not_found, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
9241
|
-
return {};
|
|
9242
|
-
}
|
|
10517
|
+
const catalogTableColumnDrop = catalogHandler(signingKey, async (params) => {
|
|
10518
|
+
const cat = getCatalog();
|
|
10519
|
+
await cat.tableColumnDrop(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.column_name, params.ignore_not_found, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10520
|
+
return {};
|
|
9243
10521
|
});
|
|
9244
|
-
|
|
9245
|
-
|
|
9246
|
-
|
|
9247
|
-
|
|
9248
|
-
const cat = getCatalog();
|
|
9249
|
-
await cat.tableColumnRename(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.column_name, params.new_name, params.ignore_not_found, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
9250
|
-
return {};
|
|
9251
|
-
}
|
|
10522
|
+
const catalogTableColumnRename = catalogHandler(signingKey, async (params) => {
|
|
10523
|
+
const cat = getCatalog();
|
|
10524
|
+
await cat.tableColumnRename(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.column_name, params.new_name, params.ignore_not_found, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10525
|
+
return {};
|
|
9252
10526
|
});
|
|
9253
|
-
|
|
9254
|
-
|
|
9255
|
-
|
|
9256
|
-
|
|
9257
|
-
const cat = getCatalog();
|
|
9258
|
-
await cat.tableColumnDefaultSet(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.column_name, params.default_value, params.ignore_not_found, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
9259
|
-
return {};
|
|
9260
|
-
}
|
|
10527
|
+
const catalogTableColumnDefaultSet = catalogHandler(signingKey, async (params) => {
|
|
10528
|
+
const cat = getCatalog();
|
|
10529
|
+
await cat.tableColumnDefaultSet(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.column_name, params.default_value, params.ignore_not_found, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10530
|
+
return {};
|
|
9261
10531
|
});
|
|
9262
|
-
|
|
9263
|
-
|
|
9264
|
-
|
|
9265
|
-
|
|
9266
|
-
const cat = getCatalog();
|
|
9267
|
-
await cat.tableColumnDefaultDrop(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.column_name, params.ignore_not_found, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
9268
|
-
return {};
|
|
9269
|
-
}
|
|
10532
|
+
const catalogTableColumnDefaultDrop = catalogHandler(signingKey, async (params) => {
|
|
10533
|
+
const cat = getCatalog();
|
|
10534
|
+
await cat.tableColumnDefaultDrop(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.column_name, params.ignore_not_found, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10535
|
+
return {};
|
|
9270
10536
|
});
|
|
9271
|
-
|
|
9272
|
-
|
|
9273
|
-
|
|
9274
|
-
|
|
9275
|
-
const cat = getCatalog();
|
|
9276
|
-
await cat.tableColumnTypeChange(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.column_name, params.new_type, params.ignore_not_found, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
9277
|
-
return {};
|
|
9278
|
-
}
|
|
10537
|
+
const catalogTableColumnTypeChange = catalogHandler(signingKey, async (params) => {
|
|
10538
|
+
const cat = getCatalog();
|
|
10539
|
+
await cat.tableColumnTypeChange(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.column_name, params.new_type, params.ignore_not_found, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10540
|
+
return {};
|
|
9279
10541
|
});
|
|
9280
|
-
|
|
9281
|
-
|
|
9282
|
-
|
|
9283
|
-
|
|
9284
|
-
const cat = getCatalog();
|
|
9285
|
-
await cat.tableNotNullSet(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.column_name, params.ignore_not_found, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
9286
|
-
return {};
|
|
9287
|
-
}
|
|
10542
|
+
const catalogTableNotNullSet = catalogHandler(signingKey, async (params) => {
|
|
10543
|
+
const cat = getCatalog();
|
|
10544
|
+
await cat.tableNotNullSet(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.column_name, params.ignore_not_found, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10545
|
+
return {};
|
|
9288
10546
|
});
|
|
9289
|
-
|
|
9290
|
-
|
|
9291
|
-
|
|
9292
|
-
|
|
9293
|
-
const cat = getCatalog();
|
|
9294
|
-
await cat.tableNotNullDrop(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.column_name, params.ignore_not_found, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
9295
|
-
return {};
|
|
9296
|
-
}
|
|
10547
|
+
const catalogTableNotNullDrop = catalogHandler(signingKey, async (params) => {
|
|
10548
|
+
const cat = getCatalog();
|
|
10549
|
+
await cat.tableNotNullDrop(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.column_name, params.ignore_not_found, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10550
|
+
return {};
|
|
9297
10551
|
});
|
|
10552
|
+
return {
|
|
10553
|
+
catalogTableGet,
|
|
10554
|
+
catalogTableCreate,
|
|
10555
|
+
catalogTableDrop,
|
|
10556
|
+
catalogTableColumnStatisticsGet,
|
|
10557
|
+
catalogTableScanFunctionGet,
|
|
10558
|
+
catalogTableScanBranchesGet,
|
|
10559
|
+
catalogTableCommentSet,
|
|
10560
|
+
catalogTableRename,
|
|
10561
|
+
catalogTableColumnAdd,
|
|
10562
|
+
catalogTableColumnDrop,
|
|
10563
|
+
catalogTableColumnRename,
|
|
10564
|
+
catalogTableColumnDefaultSet,
|
|
10565
|
+
catalogTableColumnDefaultDrop,
|
|
10566
|
+
catalogTableColumnTypeChange,
|
|
10567
|
+
catalogTableNotNullSet,
|
|
10568
|
+
catalogTableNotNullDrop
|
|
10569
|
+
};
|
|
9298
10570
|
}
|
|
9299
10571
|
|
|
9300
10572
|
// src/protocol/handlers/catalog/view.ts
|
|
9301
|
-
function
|
|
9302
|
-
|
|
9303
|
-
|
|
9304
|
-
|
|
9305
|
-
|
|
9306
|
-
|
|
9307
|
-
|
|
9308
|
-
return wrapResult({
|
|
9309
|
-
items: info ? [encodeViewInfo(info)] : []
|
|
9310
|
-
}, CatalogViewGetResultSchema);
|
|
9311
|
-
}
|
|
10573
|
+
function catalogViewHandlers(getCatalog, signingKey) {
|
|
10574
|
+
const catalogViewGet = catalogHandler(signingKey, async (params) => {
|
|
10575
|
+
const cat = getCatalog();
|
|
10576
|
+
const info = await cat.viewGet(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10577
|
+
return wrapResult({
|
|
10578
|
+
items: info ? [encodeViewInfo(info)] : []
|
|
10579
|
+
}, CatalogViewGetResultSchema);
|
|
9312
10580
|
});
|
|
9313
|
-
|
|
9314
|
-
|
|
9315
|
-
|
|
9316
|
-
|
|
9317
|
-
const cat = getCatalog();
|
|
9318
|
-
await cat.viewCreate(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.definition, params.on_conflict, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
9319
|
-
return {};
|
|
9320
|
-
}
|
|
10581
|
+
const catalogViewCreate = catalogHandler(signingKey, async (params) => {
|
|
10582
|
+
const cat = getCatalog();
|
|
10583
|
+
await cat.viewCreate(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.definition, params.on_conflict, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10584
|
+
return {};
|
|
9321
10585
|
});
|
|
9322
|
-
|
|
9323
|
-
|
|
9324
|
-
|
|
9325
|
-
|
|
9326
|
-
const cat = getCatalog();
|
|
9327
|
-
await cat.viewDrop(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.ignore_not_found, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
9328
|
-
return {};
|
|
9329
|
-
}
|
|
10586
|
+
const catalogViewDrop = catalogHandler(signingKey, async (params) => {
|
|
10587
|
+
const cat = getCatalog();
|
|
10588
|
+
await cat.viewDrop(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.ignore_not_found, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10589
|
+
return {};
|
|
9330
10590
|
});
|
|
9331
|
-
|
|
9332
|
-
|
|
9333
|
-
|
|
9334
|
-
|
|
9335
|
-
const cat = getCatalog();
|
|
9336
|
-
await cat.viewRename(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.new_name, params.ignore_not_found, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
9337
|
-
return {};
|
|
9338
|
-
}
|
|
10591
|
+
const catalogViewRename = catalogHandler(signingKey, async (params) => {
|
|
10592
|
+
const cat = getCatalog();
|
|
10593
|
+
await cat.viewRename(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.new_name, params.ignore_not_found, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10594
|
+
return {};
|
|
9339
10595
|
});
|
|
9340
|
-
|
|
9341
|
-
|
|
9342
|
-
|
|
9343
|
-
|
|
9344
|
-
const cat = getCatalog();
|
|
9345
|
-
await cat.viewCommentSet(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.comment, params.ignore_not_found, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
9346
|
-
return {};
|
|
9347
|
-
}
|
|
10596
|
+
const catalogViewCommentSet = catalogHandler(signingKey, async (params) => {
|
|
10597
|
+
const cat = getCatalog();
|
|
10598
|
+
await cat.viewCommentSet(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.comment, params.ignore_not_found, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10599
|
+
return {};
|
|
9348
10600
|
});
|
|
10601
|
+
return { catalogViewGet, catalogViewCreate, catalogViewDrop, catalogViewRename, catalogViewCommentSet };
|
|
9349
10602
|
}
|
|
9350
10603
|
|
|
9351
10604
|
// src/protocol/handlers/catalog/macro.ts
|
|
9352
|
-
function
|
|
9353
|
-
|
|
9354
|
-
|
|
9355
|
-
|
|
9356
|
-
|
|
9357
|
-
|
|
9358
|
-
|
|
9359
|
-
return wrapResult({
|
|
9360
|
-
items: info ? [encodeMacroInfo(info)] : []
|
|
9361
|
-
}, CatalogMacroGetResultSchema);
|
|
9362
|
-
}
|
|
10605
|
+
function catalogMacroHandlers(getCatalog, signingKey) {
|
|
10606
|
+
const catalogMacroGet = catalogHandler(signingKey, async (params) => {
|
|
10607
|
+
const cat = getCatalog();
|
|
10608
|
+
const info = await cat.macroGet(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10609
|
+
return wrapResult({
|
|
10610
|
+
items: info ? [encodeMacroInfo(info)] : []
|
|
10611
|
+
}, CatalogMacroGetResultSchema);
|
|
9363
10612
|
});
|
|
9364
|
-
|
|
9365
|
-
|
|
9366
|
-
|
|
9367
|
-
|
|
9368
|
-
|
|
9369
|
-
const innerParams = params;
|
|
9370
|
-
await cat.macroCreate(toUint8Array(innerParams.attach_opaque_data), innerParams.schema_path, innerParams.name, innerParams.macro_type, innerParams.parameters ? Array.isArray(innerParams.parameters) ? innerParams.parameters : [...innerParams.parameters] : [], innerParams.definition, innerParams.on_conflict, innerParams.parameter_default_values ? toUint8Array(innerParams.parameter_default_values) : null, innerParams.arguments_schema ? toUint8Array(innerParams.arguments_schema) : null, innerParams.transaction_opaque_data ? toUint8Array(innerParams.transaction_opaque_data) : undefined);
|
|
9371
|
-
return {};
|
|
9372
|
-
}
|
|
10613
|
+
const catalogMacroCreate = catalogHandler(signingKey, async (params) => {
|
|
10614
|
+
const cat = getCatalog();
|
|
10615
|
+
const innerParams = params;
|
|
10616
|
+
await cat.macroCreate(toUint8Array(innerParams.attach_opaque_data), innerParams.schema_path, innerParams.name, innerParams.macro_type, innerParams.parameters ? Array.isArray(innerParams.parameters) ? innerParams.parameters : [...innerParams.parameters] : [], innerParams.definition, innerParams.on_conflict, innerParams.parameter_default_values ? toUint8Array(innerParams.parameter_default_values) : null, innerParams.arguments_schema ? toUint8Array(innerParams.arguments_schema) : null, innerParams.transaction_opaque_data ? toUint8Array(innerParams.transaction_opaque_data) : undefined);
|
|
10617
|
+
return {};
|
|
9373
10618
|
});
|
|
9374
|
-
|
|
9375
|
-
|
|
9376
|
-
|
|
9377
|
-
|
|
9378
|
-
const cat = getCatalog();
|
|
9379
|
-
await cat.macroDrop(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.ignore_not_found, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
9380
|
-
return {};
|
|
9381
|
-
}
|
|
10619
|
+
const catalogMacroDrop = catalogHandler(signingKey, async (params) => {
|
|
10620
|
+
const cat = getCatalog();
|
|
10621
|
+
await cat.macroDrop(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.ignore_not_found, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10622
|
+
return {};
|
|
9382
10623
|
});
|
|
9383
|
-
|
|
9384
|
-
|
|
9385
|
-
|
|
9386
|
-
|
|
9387
|
-
|
|
9388
|
-
|
|
9389
|
-
return wrapResult({
|
|
9390
|
-
items: macros.map((m) => encodeMacroInfo(m))
|
|
9391
|
-
}, CatalogSchemaContentsMacrosResultSchema);
|
|
9392
|
-
}
|
|
10624
|
+
const catalogSchemaContentsMacros = catalogHandler(signingKey, async (params) => {
|
|
10625
|
+
const cat = getCatalog();
|
|
10626
|
+
const macros = await cat.schemaContentsMacros(toUint8Array(params.attach_opaque_data), params.path, decodeDictValue(params.type), params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10627
|
+
return wrapResult({
|
|
10628
|
+
items: macros.map((m) => encodeMacroInfo(m))
|
|
10629
|
+
}, CatalogSchemaContentsMacrosResultSchema);
|
|
9393
10630
|
});
|
|
10631
|
+
return { catalogMacroGet, catalogMacroCreate, catalogMacroDrop, catalogSchemaContentsMacros };
|
|
9394
10632
|
}
|
|
9395
10633
|
|
|
9396
10634
|
// src/protocol/handlers/catalog/index_methods.ts
|
|
9397
|
-
function
|
|
9398
|
-
|
|
9399
|
-
|
|
9400
|
-
|
|
9401
|
-
|
|
9402
|
-
|
|
9403
|
-
|
|
9404
|
-
return wrapResult({
|
|
9405
|
-
items: indexes.map((i) => encodeIndexInfo(i))
|
|
9406
|
-
}, CatalogSchemaContentsIndexesResultSchema);
|
|
9407
|
-
}
|
|
10635
|
+
function catalogIndexHandlers(getCatalog, signingKey) {
|
|
10636
|
+
const catalogSchemaContentsIndexes = catalogHandler(signingKey, async (params) => {
|
|
10637
|
+
const cat = getCatalog();
|
|
10638
|
+
const indexes = await cat.schemaContentsIndexes(toUint8Array(params.attach_opaque_data), params.path, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10639
|
+
return wrapResult({
|
|
10640
|
+
items: indexes.map((i) => encodeIndexInfo(i))
|
|
10641
|
+
}, CatalogSchemaContentsIndexesResultSchema);
|
|
9408
10642
|
});
|
|
9409
|
-
|
|
9410
|
-
|
|
9411
|
-
|
|
9412
|
-
|
|
9413
|
-
|
|
9414
|
-
|
|
9415
|
-
return wrapResult({
|
|
9416
|
-
items: info ? [encodeIndexInfo(info)] : []
|
|
9417
|
-
}, CatalogIndexGetResultSchema);
|
|
9418
|
-
}
|
|
10643
|
+
const catalogIndexGet = catalogHandler(signingKey, async (params) => {
|
|
10644
|
+
const cat = getCatalog();
|
|
10645
|
+
const info = await cat.indexGet(toUint8Array(params.attach_opaque_data), params.schema_path, params.name, params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined);
|
|
10646
|
+
return wrapResult({
|
|
10647
|
+
items: info ? [encodeIndexInfo(info)] : []
|
|
10648
|
+
}, CatalogIndexGetResultSchema);
|
|
9419
10649
|
});
|
|
10650
|
+
return { catalogSchemaContentsIndexes, catalogIndexGet };
|
|
9420
10651
|
}
|
|
9421
10652
|
|
|
9422
10653
|
// src/protocol/handlers/catalog/index.ts
|
|
9423
|
-
function
|
|
10654
|
+
function catalogHandlers(catalog, signingKey) {
|
|
9424
10655
|
const getCatalog = makeGetCatalog(catalog);
|
|
9425
|
-
|
|
9426
|
-
|
|
9427
|
-
|
|
9428
|
-
|
|
9429
|
-
|
|
9430
|
-
|
|
9431
|
-
|
|
9432
|
-
// src/protocol/handlers/unimplemented.ts
|
|
9433
|
-
import { MethodNotImplementedError } from "@query-farm/vgi-rpc";
|
|
9434
|
-
var UNIMPLEMENTED_METHODS = [
|
|
9435
|
-
{ name: "aggregate_streaming_open", params: REQUEST_PARAMS_SCHEMA, result: RESULT_BINARY_SCHEMA },
|
|
9436
|
-
{ name: "aggregate_streaming_chunk", params: REQUEST_PARAMS_SCHEMA, result: RESULT_BINARY_SCHEMA },
|
|
9437
|
-
{ name: "aggregate_streaming_close", params: REQUEST_PARAMS_SCHEMA, result: RESULT_BINARY_SCHEMA },
|
|
9438
|
-
{ name: "aggregate_window_init", params: REQUEST_PARAMS_SCHEMA, result: RESULT_BINARY_SCHEMA },
|
|
9439
|
-
{ name: "aggregate_window", params: REQUEST_PARAMS_SCHEMA, result: RESULT_BINARY_SCHEMA },
|
|
9440
|
-
{ name: "aggregate_window_batch", params: REQUEST_PARAMS_SCHEMA, result: RESULT_BINARY_SCHEMA },
|
|
9441
|
-
{ name: "aggregate_window_destructor", params: REQUEST_PARAMS_SCHEMA, result: RESULT_BINARY_SCHEMA },
|
|
9442
|
-
{ name: "catalog_index_create", params: CatalogIndexCreateParamsSchema, result: emptyResultSchema },
|
|
9443
|
-
{ name: "catalog_index_drop", params: CatalogIndexDropParamsSchema, result: emptyResultSchema },
|
|
9444
|
-
{ name: "catalog_table_column_comment_set", params: CatalogTableColumnCommentSetParamsSchema, result: emptyResultSchema },
|
|
9445
|
-
{ name: "catalog_table_insert_function_get", params: CatalogTableInsertFunctionGetParamsSchema, result: RESULT_BINARY_SCHEMA },
|
|
9446
|
-
{ name: "catalog_table_update_function_get", params: CatalogTableUpdateFunctionGetParamsSchema, result: RESULT_BINARY_SCHEMA },
|
|
9447
|
-
{ name: "catalog_table_delete_function_get", params: CatalogTableDeleteFunctionGetParamsSchema, result: RESULT_BINARY_SCHEMA }
|
|
9448
|
-
];
|
|
9449
|
-
function unimplementedMessage(method) {
|
|
9450
|
-
return `${method} is not implemented by this worker`;
|
|
9451
|
-
}
|
|
9452
|
-
function registerUnimplementedMethods(protocol) {
|
|
9453
|
-
for (const m of UNIMPLEMENTED_METHODS) {
|
|
9454
|
-
protocol.unary(m.name, {
|
|
9455
|
-
params: m.params,
|
|
9456
|
-
result: m.result,
|
|
9457
|
-
handler: async () => {
|
|
9458
|
-
throw new MethodNotImplementedError(unimplementedMessage(m.name));
|
|
9459
|
-
}
|
|
9460
|
-
});
|
|
9461
|
-
}
|
|
10656
|
+
return {
|
|
10657
|
+
...catalogAdminHandlers(getCatalog, signingKey),
|
|
10658
|
+
...catalogTableHandlers(getCatalog, signingKey),
|
|
10659
|
+
...catalogViewHandlers(getCatalog, signingKey),
|
|
10660
|
+
...catalogMacroHandlers(getCatalog, signingKey),
|
|
10661
|
+
...catalogIndexHandlers(getCatalog, signingKey)
|
|
10662
|
+
};
|
|
9462
10663
|
}
|
|
9463
10664
|
|
|
9464
10665
|
// src/protocol/dispatch.ts
|
|
9465
|
-
|
|
10666
|
+
function buildVgiService(config) {
|
|
10667
|
+
return {
|
|
10668
|
+
...UNIMPLEMENTED_VGI_SERVICE,
|
|
10669
|
+
...functionHandlers({
|
|
10670
|
+
registry: config.registry,
|
|
10671
|
+
signingKey: config.signingKey,
|
|
10672
|
+
catalogInterface: config.catalogInterface
|
|
10673
|
+
}),
|
|
10674
|
+
...aggregateHandlers(config.registry),
|
|
10675
|
+
...tableBufferingHandlers(config.registry, config.signingKey),
|
|
10676
|
+
...catalogHandlers(config.catalogInterface, config.signingKey)
|
|
10677
|
+
};
|
|
10678
|
+
}
|
|
9466
10679
|
function buildVgiProtocol(config) {
|
|
9467
|
-
|
|
9468
|
-
registerFunctionMethods(protocol, {
|
|
9469
|
-
registry: config.registry,
|
|
9470
|
-
signingKey: config.signingKey,
|
|
9471
|
-
catalogInterface: config.catalogInterface
|
|
9472
|
-
});
|
|
9473
|
-
registerAggregateMethods(protocol, config.registry);
|
|
9474
|
-
registerTableBufferingMethods(protocol, config.registry, config.signingKey);
|
|
9475
|
-
registerCatalogMethods(protocol, config.catalogInterface, config.catalogName, config.signingKey);
|
|
9476
|
-
registerUnimplementedMethods(protocol);
|
|
9477
|
-
return protocol;
|
|
10680
|
+
return createVgiProtocol(buildVgiService(config));
|
|
9478
10681
|
}
|
|
9479
10682
|
|
|
9480
10683
|
// src/http/landing-html.ts
|
|
@@ -9632,7 +10835,7 @@ function validatedHostedProtocols(hosting, primary) {
|
|
|
9632
10835
|
}
|
|
9633
10836
|
const name = p.name;
|
|
9634
10837
|
if (name.startsWith(RESERVED_PREFIX)) {
|
|
9635
|
-
throw new Error(`${owner} entry ${index} is named '${name}', which claims the reserved '${RESERVED_PREFIX}' prefix. ` + "Framework protocols are not supplied through this hook: reflection is hosted automatically, and " + "vgi_rpc.Identity.
|
|
10838
|
+
throw new Error(`${owner} entry ${index} is named '${name}', which claims the reserved '${RESERVED_PREFIX}' prefix. ` + "Framework protocols are not supplied through this hook: reflection is hosted automatically, and " + "vgi_rpc.Identity.v2 is enabled by supplying resolveToken and/or mintGrant.");
|
|
9636
10839
|
}
|
|
9637
10840
|
if (!/^[A-Za-z_][A-Za-z0-9_.]*$/.test(name)) {
|
|
9638
10841
|
throw new Error(`${owner} entry ${index}: protocol name '${name}' is not an identifier, optionally dot-qualified ` + "(e.g. 'acme.Reports.v1').");
|
|
@@ -9682,7 +10885,7 @@ function resolveIntrospectPrincipals(explicit, env) {
|
|
|
9682
10885
|
principals = raw.split(",").map((p) => p.trim()).filter((p) => p !== "");
|
|
9683
10886
|
}
|
|
9684
10887
|
if (principals.length === 0) {
|
|
9685
|
-
throw new Error("This worker supplies resolveToken, which hosts the vgi_rpc.Identity.
|
|
10888
|
+
throw new Error("This worker supplies resolveToken, which hosts the vgi_rpc.Identity.v2 protocol, but no " + `introspector allowlist was configured. Set ${INTROSPECT_PRINCIPALS_ENV} (comma-separated) or pass ` + `introspectPrincipals.
|
|
9686
10889
|
|
|
9687
10890
|
` + "There is no permissive default on purpose: introspection is a separate capability from " + "authentication, and allowing every authenticated caller lets any user resolve any other user's " + "credential to its owner. Remove resolveToken to leave the protocol unhosted entirely.");
|
|
9688
10891
|
}
|
|
@@ -10968,7 +12171,7 @@ class ReadOnlyCatalogInterface extends CatalogInterface {
|
|
|
10968
12171
|
}
|
|
10969
12172
|
attach(name, options, dataVersionSpec, implementationVersion) {
|
|
10970
12173
|
if (!this.catalogs().includes(name)) {
|
|
10971
|
-
throw new
|
|
12174
|
+
throw new VgiError(`No worker handles catalog '${name}'`, "NOT_FOUND");
|
|
10972
12175
|
}
|
|
10973
12176
|
validateRequiredAttachOptions(name, this.attachOptionSpecs(name), options ?? {});
|
|
10974
12177
|
const attachOpaqueData = new Uint8Array(16);
|
|
@@ -11368,11 +12571,11 @@ class ReadOnlyCatalogInterface extends CatalogInterface {
|
|
|
11368
12571
|
validateAtParams(atUnit, atValue);
|
|
11369
12572
|
const schema = this._descriptor.schemas.find((s) => schemaPathsEqual(schemaDescriptorPath(s), schemaPath));
|
|
11370
12573
|
if (!schema || !schema.tables) {
|
|
11371
|
-
throw new
|
|
12574
|
+
throw new VgiError(`Table '${name}' not found in schema ${schemaPathDisplay(schemaPath)}`, "NOT_FOUND");
|
|
11372
12575
|
}
|
|
11373
12576
|
const table = schema.tables.find((t) => t.name === name);
|
|
11374
12577
|
if (!table) {
|
|
11375
|
-
throw new
|
|
12578
|
+
throw new VgiError(`Table '${name}' not found in schema ${schemaPathDisplay(schemaPath)}`, "NOT_FOUND");
|
|
11376
12579
|
}
|
|
11377
12580
|
if (atUnit && !table.supportsTimeTravel) {
|
|
11378
12581
|
throw new Error(`Table ${schemaPathDisplay(schemaPath)}.${name} does not support time travel queries`);
|
|
@@ -11457,12 +12660,12 @@ function resolveIndexGroups(schema, groups) {
|
|
|
11457
12660
|
function serializeForeignKeys(fks, schemaPath) {
|
|
11458
12661
|
if (!fks || fks.length === 0)
|
|
11459
12662
|
return [];
|
|
11460
|
-
return fks.map((fk) => serializeBatch(batchFromColumns({
|
|
12663
|
+
return fks.map((fk) => serializeBatch(batchFromColumns(conformColumns(ForeignKeyInfoSchema, {
|
|
11461
12664
|
fk_columns: [fk.columns],
|
|
11462
12665
|
pk_columns: [fk.referencedColumns],
|
|
11463
12666
|
referenced_table: [fk.referencedTable],
|
|
11464
12667
|
referenced_schema_path: [fk.referencedSchemaPath ?? schemaPath ?? ["main"]]
|
|
11465
|
-
}, ForeignKeyInfoSchema)));
|
|
12668
|
+
}), ForeignKeyInfoSchema)));
|
|
11466
12669
|
}
|
|
11467
12670
|
function defaultToSql(value) {
|
|
11468
12671
|
if (value === null || value === undefined)
|
|
@@ -11602,7 +12805,7 @@ function serializeArgsBatch(args, argSpecSchema) {
|
|
|
11602
12805
|
}
|
|
11603
12806
|
function validateAtParams(atUnit, atValue) {
|
|
11604
12807
|
if (Boolean(atUnit) !== Boolean(atValue)) {
|
|
11605
|
-
throw new
|
|
12808
|
+
throw new VgiError("at_unit and at_value must both be provided or both be absent", "INVALID_ARGUMENT");
|
|
11606
12809
|
}
|
|
11607
12810
|
}
|
|
11608
12811
|
function inferScalarType(val) {
|
|
@@ -11700,7 +12903,7 @@ class CompositeCatalogInterface extends CatalogInterface {
|
|
|
11700
12903
|
return result;
|
|
11701
12904
|
}
|
|
11702
12905
|
}
|
|
11703
|
-
throw new
|
|
12906
|
+
throw new VgiError(`No worker handles catalog '${name}'`, "NOT_FOUND");
|
|
11704
12907
|
}
|
|
11705
12908
|
async detach(attachOpaqueData) {
|
|
11706
12909
|
await this._route(attachOpaqueData).detach(attachOpaqueData);
|
|
@@ -12024,7 +13227,7 @@ class FunctionRegistry {
|
|
|
12024
13227
|
} else if (candidates && candidates.length > 0) {
|
|
12025
13228
|
const schemas = this.schemasFor(name);
|
|
12026
13229
|
if (schemas.length > 0) {
|
|
12027
|
-
throw new
|
|
13230
|
+
throw new VgiError(`Function '${name}' is not registered in schema ${schemaPathDisplay(schemaPath)}. ` + `It is available in: [${schemas.map(schemaPathDisplay).join(", ")}]`, "NOT_FOUND");
|
|
12028
13231
|
}
|
|
12029
13232
|
}
|
|
12030
13233
|
}
|
|
@@ -12245,4 +13448,4 @@ export {
|
|
|
12245
13448
|
utf82 as utf8
|
|
12246
13449
|
};
|
|
12247
13450
|
|
|
12248
|
-
//# debugId=
|
|
13451
|
+
//# debugId=FC599621AC5B851964756E2164756E21
|