@query-farm/vgi 0.29.0 → 0.29.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -1
- package/dist/arguments/argument-spec.d.ts +4 -2
- package/dist/catalog/composite.d.ts +13 -13
- package/dist/catalog/descriptors.d.ts +7 -3
- package/dist/catalog/interface.d.ts +67 -40
- package/dist/catalog/read-only.d.ts +32 -15
- package/dist/client/client.d.ts +36 -29
- package/dist/client/types.d.ts +2 -0
- package/dist/client-entry.d.ts +1 -1
- package/dist/client-entry.js +441 -279
- package/dist/client-entry.js.map +12 -11
- package/dist/filter-pushdown/capabilities.d.ts +3 -0
- package/dist/filter-pushdown/deserialize.d.ts +14 -15
- package/dist/filter-pushdown/evaluate.d.ts +14 -44
- package/dist/filter-pushdown/index.d.ts +2 -2
- package/dist/filter-pushdown/types.d.ts +120 -68
- package/dist/functions/aggregate.d.ts +4 -0
- package/dist/functions/registry.d.ts +5 -5
- package/dist/functions/scalar.d.ts +6 -1
- package/dist/functions/table-buffering.d.ts +9 -0
- package/dist/functions/table-in-out.d.ts +13 -0
- package/dist/functions/table.d.ts +9 -2
- package/dist/functions/types.d.ts +22 -2
- package/dist/generated/vgi-client.d.ts +56 -27
- package/dist/generated/vgi-protocol-schemas.d.ts +15 -0
- package/dist/http/fetch.d.ts +7 -1
- package/dist/index.core.d.ts +2 -1
- package/dist/index.js +2317 -1354
- package/dist/index.js.map +43 -40
- package/dist/metadata/types.d.ts +15 -2
- package/dist/protocol/handlers/shared.d.ts +3 -1
- package/dist/protocol/serializers/splits.d.ts +1 -1
- package/dist/protocol/types.d.ts +9 -3
- package/dist/schema-path.d.ts +7 -0
- package/dist/serve-entry.d.ts +22 -1
- package/dist/serve-entry.js +412 -238
- package/dist/serve-entry.js.map +27 -26
- package/dist/split-token.d.ts +1 -1
- package/dist/types.d.ts +8 -0
- package/dist/worker-cf-entry.js +2030 -1201
- package/dist/worker-cf-entry.js.map +40 -36
- package/dist/worker.d.ts +1 -1
- package/package.json +3 -3
- package/src/arguments/argument-spec.ts +12 -4
- package/src/catalog/composite.ts +26 -26
- package/src/catalog/descriptors.ts +12 -3
- package/src/catalog/interface.ts +98 -48
- package/src/catalog/read-only.ts +124 -67
- package/src/client/client.ts +92 -72
- package/src/client/types.ts +2 -0
- package/src/client-entry.ts +2 -1
- package/src/filter-pushdown/capabilities.ts +13 -0
- package/src/filter-pushdown/collector.ts +22 -35
- package/src/filter-pushdown/deserialize.ts +657 -221
- package/src/filter-pushdown/evaluate.ts +410 -499
- package/src/filter-pushdown/index.ts +16 -2
- package/src/filter-pushdown/types.ts +88 -71
- package/src/functions/aggregate.ts +9 -1
- package/src/functions/registry.ts +24 -22
- package/src/functions/scalar.ts +26 -0
- package/src/functions/table-buffering.ts +46 -7
- package/src/functions/table-in-out.ts +187 -30
- package/src/functions/table.ts +58 -20
- package/src/functions/types.ts +24 -1
- package/src/generated/vgi-client.ts +61 -29
- package/src/generated/vgi-protocol-schemas.ts +225 -54
- package/src/http/fetch.ts +12 -0
- package/src/index.core.ts +2 -0
- package/src/metadata/resolve.ts +43 -1
- package/src/metadata/serialize.ts +43 -5
- package/src/metadata/types.ts +17 -1
- package/src/protocol/dispatch.ts +1 -1
- package/src/protocol/handlers/aggregate.ts +13 -7
- package/src/protocol/handlers/catalog/admin.ts +6 -6
- package/src/protocol/handlers/catalog/index_methods.ts +2 -2
- package/src/protocol/handlers/catalog/macro.ts +4 -4
- package/src/protocol/handlers/catalog/shared.ts +2 -0
- package/src/protocol/handlers/catalog/table.ts +16 -16
- package/src/protocol/handlers/catalog/view.ts +5 -5
- package/src/protocol/handlers/function.ts +2 -2
- package/src/protocol/handlers/shared.ts +12 -3
- package/src/protocol/handlers/table-buffering.ts +4 -4
- package/src/protocol/serializers/bind.ts +15 -6
- package/src/protocol/serializers/splits.ts +4 -2
- package/src/protocol/types.ts +9 -3
- package/src/schema-path.ts +25 -0
- package/src/serve-entry.ts +65 -3
- package/src/split-token.ts +2 -2
- package/src/types.ts +9 -0
- package/src/worker.ts +49 -4
package/dist/client-entry.js
CHANGED
|
@@ -333,8 +333,8 @@ import {
|
|
|
333
333
|
DataType,
|
|
334
334
|
makeData
|
|
335
335
|
} from "@query-farm/apache-arrow";
|
|
336
|
-
function emptyData(
|
|
337
|
-
const type =
|
|
336
|
+
function emptyData(field) {
|
|
337
|
+
const type = field.type;
|
|
338
338
|
if (DataType.isList(type)) {
|
|
339
339
|
const childField = type.children[0];
|
|
340
340
|
return makeData({
|
|
@@ -361,8 +361,8 @@ function emptyData(field2) {
|
|
|
361
361
|
}
|
|
362
362
|
return makeData({ type, length: 0, nullCount: 0 });
|
|
363
363
|
}
|
|
364
|
-
function emptyBatch(
|
|
365
|
-
const a =
|
|
364
|
+
function emptyBatch(schema) {
|
|
365
|
+
const a = schema;
|
|
366
366
|
const children = a.fields.map((f) => emptyData(f));
|
|
367
367
|
const structType = new Struct(a.fields);
|
|
368
368
|
const data = makeData({
|
|
@@ -1369,8 +1369,8 @@ function readUnion(type, col, data, index) {
|
|
|
1369
1369
|
const children = type.children;
|
|
1370
1370
|
const typeIds = data?.typeIds;
|
|
1371
1371
|
const tcode = typeIds ? typeIds[index] : children.length > 0 ? 0 : -1;
|
|
1372
|
-
const
|
|
1373
|
-
const childIdx =
|
|
1372
|
+
const map = type.typeIdToChildIndex;
|
|
1373
|
+
const childIdx = map && map[tcode] !== undefined ? map[tcode] : tcode;
|
|
1374
1374
|
const childField = children[childIdx];
|
|
1375
1375
|
if (!childField)
|
|
1376
1376
|
return { tag: null, value: null };
|
|
@@ -1432,19 +1432,19 @@ function readDictionary(type, col, data, index) {
|
|
|
1432
1432
|
function columnFromArray(values, type) {
|
|
1433
1433
|
return vectorFromArray2(values, type).data[0];
|
|
1434
1434
|
}
|
|
1435
|
-
function batchFromRows(rows,
|
|
1436
|
-
const a =
|
|
1435
|
+
function batchFromRows(rows, schema) {
|
|
1436
|
+
const a = schema;
|
|
1437
1437
|
if (rows.length === 0) {
|
|
1438
1438
|
return emptyBatch(a);
|
|
1439
1439
|
}
|
|
1440
1440
|
const columns = {};
|
|
1441
|
-
for (const
|
|
1442
|
-
columns[
|
|
1441
|
+
for (const field of a.fields) {
|
|
1442
|
+
columns[field.name] = rows.map((r) => r[field.name] ?? null);
|
|
1443
1443
|
}
|
|
1444
1444
|
return batchFromColumns(columns, a);
|
|
1445
1445
|
}
|
|
1446
|
-
function batchFromColumns(columns,
|
|
1447
|
-
const a =
|
|
1446
|
+
function batchFromColumns(columns, schema, repr = "rich") {
|
|
1447
|
+
const a = schema;
|
|
1448
1448
|
const numRows = a.fields.length > 0 ? columns[a.fields[0].name]?.length ?? 0 : 0;
|
|
1449
1449
|
const children = a.fields.map((f) => {
|
|
1450
1450
|
const values = columns[f.name];
|
|
@@ -1472,15 +1472,15 @@ function* iterRows(batch, repr = "rich") {
|
|
|
1472
1472
|
for (let i = 0;i < a.numRows; i++) {
|
|
1473
1473
|
const row = {};
|
|
1474
1474
|
for (let fi = 0;fi < a.schema.fields.length; fi++) {
|
|
1475
|
-
const
|
|
1476
|
-
const col = a.getChild(
|
|
1475
|
+
const field = a.schema.fields[fi];
|
|
1476
|
+
const col = a.getChild(field.name);
|
|
1477
1477
|
if (!col) {
|
|
1478
|
-
row[
|
|
1478
|
+
row[field.name] = null;
|
|
1479
1479
|
continue;
|
|
1480
1480
|
}
|
|
1481
|
-
const canonical = readCanonicalValue(
|
|
1481
|
+
const canonical = readCanonicalValue(field.type, col, i);
|
|
1482
1482
|
const codec = codecs[fi];
|
|
1483
|
-
row[
|
|
1483
|
+
row[field.name] = repr === "raw" ? codec.canonicalToRaw(canonical) : codec.canonicalToRich(canonical);
|
|
1484
1484
|
}
|
|
1485
1485
|
yield row;
|
|
1486
1486
|
}
|
|
@@ -1492,12 +1492,12 @@ function batchToScalarDict(batch) {
|
|
|
1492
1492
|
if (a.numRows === 0)
|
|
1493
1493
|
return {};
|
|
1494
1494
|
const result = {};
|
|
1495
|
-
for (const
|
|
1496
|
-
const col = a.getChild(
|
|
1495
|
+
for (const field of a.schema.fields) {
|
|
1496
|
+
const col = a.getChild(field.name);
|
|
1497
1497
|
if (col) {
|
|
1498
|
-
const type =
|
|
1498
|
+
const type = field.type;
|
|
1499
1499
|
const canonical = readCanonicalValue(type, col, 0);
|
|
1500
|
-
result[
|
|
1500
|
+
result[field.name] = codecFor(type).canonicalToRich(canonical);
|
|
1501
1501
|
}
|
|
1502
1502
|
}
|
|
1503
1503
|
return result;
|
|
@@ -1523,18 +1523,18 @@ function batchToSecretDict(batch) {
|
|
|
1523
1523
|
if (a.numRows === 0)
|
|
1524
1524
|
return {};
|
|
1525
1525
|
const result = {};
|
|
1526
|
-
for (const
|
|
1527
|
-
const col = a.getChild(
|
|
1526
|
+
for (const field of a.schema.fields) {
|
|
1527
|
+
const col = a.getChild(field.name);
|
|
1528
1528
|
if (col) {
|
|
1529
|
-
const type =
|
|
1529
|
+
const type = field.type;
|
|
1530
1530
|
const val = codecFor(type).canonicalToRich(readCanonicalValue(type, col, 0));
|
|
1531
|
-
let key =
|
|
1531
|
+
let key = field.name;
|
|
1532
1532
|
let scope;
|
|
1533
|
-
if (
|
|
1534
|
-
const secretType =
|
|
1533
|
+
if (field.name.startsWith("secret_")) {
|
|
1534
|
+
const secretType = field.metadata?.get?.("secret_type");
|
|
1535
1535
|
if (secretType) {
|
|
1536
1536
|
key = secretType;
|
|
1537
|
-
scope =
|
|
1537
|
+
scope = field.metadata?.get?.("scope") ?? undefined;
|
|
1538
1538
|
}
|
|
1539
1539
|
}
|
|
1540
1540
|
if (val && typeof val === "object" && !ArrayBuffer.isView(val)) {
|
|
@@ -1583,11 +1583,11 @@ function filterBatch(batch, mask) {
|
|
|
1583
1583
|
indices.push(i);
|
|
1584
1584
|
}
|
|
1585
1585
|
const columns = {};
|
|
1586
|
-
for (const
|
|
1587
|
-
const col = a.getChild(
|
|
1588
|
-
const type =
|
|
1586
|
+
for (const field of a.schema.fields) {
|
|
1587
|
+
const col = a.getChild(field.name);
|
|
1588
|
+
const type = field.type;
|
|
1589
1589
|
const codec = codecFor(type);
|
|
1590
|
-
columns[
|
|
1590
|
+
columns[field.name] = indices.map((i) => codec.canonicalToRich(readCanonicalValue(type, col, i)));
|
|
1591
1591
|
}
|
|
1592
1592
|
return batchFromColumns(columns, a.schema);
|
|
1593
1593
|
}
|
|
@@ -1609,8 +1609,8 @@ function validateProjectionIds(caller, projectionIds, fieldCount) {
|
|
|
1609
1609
|
}
|
|
1610
1610
|
return projectionIds.filter((i) => i >= 0 && i < fieldCount);
|
|
1611
1611
|
}
|
|
1612
|
-
function projectSchema(projectionIds,
|
|
1613
|
-
const a =
|
|
1612
|
+
function projectSchema(projectionIds, schema) {
|
|
1613
|
+
const a = schema;
|
|
1614
1614
|
if (!projectionIds)
|
|
1615
1615
|
return a;
|
|
1616
1616
|
const validIds = validateProjectionIds("projectSchema", projectionIds, a.fields.length);
|
|
@@ -1651,9 +1651,9 @@ import {
|
|
|
1651
1651
|
RecordBatchStreamWriter,
|
|
1652
1652
|
RecordBatchReader
|
|
1653
1653
|
} from "@query-farm/apache-arrow";
|
|
1654
|
-
function serializeSchema(
|
|
1654
|
+
function serializeSchema(schema) {
|
|
1655
1655
|
const writer = new RecordBatchStreamWriter;
|
|
1656
|
-
writer.reset(undefined,
|
|
1656
|
+
writer.reset(undefined, schema);
|
|
1657
1657
|
writer.close();
|
|
1658
1658
|
return writer.toUint8Array(true);
|
|
1659
1659
|
}
|
|
@@ -1721,20 +1721,20 @@ function buildTypedColumnData(values, type) {
|
|
|
1721
1721
|
function buildStatisticsBatch(stats) {
|
|
1722
1722
|
if (stats.length === 0) {
|
|
1723
1723
|
const nullField = new Field3("0", new Null, true);
|
|
1724
|
-
const
|
|
1725
|
-
const
|
|
1726
|
-
type:
|
|
1724
|
+
const unionType = new SparseUnion([0], [nullField]);
|
|
1725
|
+
const minData = makeData5({
|
|
1726
|
+
type: unionType,
|
|
1727
1727
|
length: 0,
|
|
1728
1728
|
typeIds: new Int8Array(0),
|
|
1729
1729
|
children: [makeData5({ type: new Null, length: 0, nullCount: 0 })]
|
|
1730
1730
|
});
|
|
1731
|
-
const
|
|
1732
|
-
type:
|
|
1731
|
+
const maxData = makeData5({
|
|
1732
|
+
type: unionType,
|
|
1733
1733
|
length: 0,
|
|
1734
1734
|
typeIds: new Int8Array(0),
|
|
1735
1735
|
children: [makeData5({ type: new Null, length: 0, nullCount: 0 })]
|
|
1736
1736
|
});
|
|
1737
|
-
return assemble([],
|
|
1737
|
+
return assemble([], minData, maxData, [], [], [], [], [], unionType);
|
|
1738
1738
|
}
|
|
1739
1739
|
const typeOrder = [];
|
|
1740
1740
|
const typeIdMap = new Map;
|
|
@@ -1778,7 +1778,7 @@ function buildStatisticsBatch(stats) {
|
|
|
1778
1778
|
return assemble(stats.map((s) => s.columnName), minData, maxData, stats.map((s) => s.hasNull), stats.map((s) => s.hasNotNull), stats.map((s) => s.distinctCount == null ? null : BigInt(s.distinctCount)), stats.map((s) => s.containsUnicode), stats.map((s) => s.maxStringLength == null ? null : BigInt(s.maxStringLength)), unionType);
|
|
1779
1779
|
}
|
|
1780
1780
|
function assemble(columnNames, minData, maxData, hasNull, hasNotNull, distinctCount, containsUnicode, maxStringLength, unionType) {
|
|
1781
|
-
const
|
|
1781
|
+
const schema = new Schema5([
|
|
1782
1782
|
new Field3("column_name", new Utf8, false),
|
|
1783
1783
|
new Field3("min", unionType, true),
|
|
1784
1784
|
new Field3("max", unionType, true),
|
|
@@ -1799,9 +1799,9 @@ function assemble(columnNames, minData, maxData, hasNull, hasNotNull, distinctCo
|
|
|
1799
1799
|
buildTypedColumnData(containsUnicode, new Bool),
|
|
1800
1800
|
buildTypedColumnData(maxStringLength, new Uint64)
|
|
1801
1801
|
];
|
|
1802
|
-
const structType = new Struct5(
|
|
1802
|
+
const structType = new Struct5(schema.fields);
|
|
1803
1803
|
const data = makeData5({ type: structType, length: n, children, nullCount: 0 });
|
|
1804
|
-
return new RecordBatch6(
|
|
1804
|
+
return new RecordBatch6(schema, data);
|
|
1805
1805
|
}
|
|
1806
1806
|
|
|
1807
1807
|
// src/arrow/impl-arrowjs/index.ts
|
|
@@ -1819,6 +1819,7 @@ var bool2 = () => bool();
|
|
|
1819
1819
|
var int162 = () => int16();
|
|
1820
1820
|
var int322 = () => int32();
|
|
1821
1821
|
var int642 = () => int64();
|
|
1822
|
+
var uint642 = () => uint64();
|
|
1822
1823
|
var float642 = () => float64();
|
|
1823
1824
|
var utf82 = () => utf8();
|
|
1824
1825
|
var binary2 = () => binary();
|
|
@@ -1905,47 +1906,100 @@ function unwrapScalar(val) {
|
|
|
1905
1906
|
return val;
|
|
1906
1907
|
}
|
|
1907
1908
|
|
|
1909
|
+
// src/protocol/serializers/arguments.ts
|
|
1910
|
+
function serializeArguments(args) {
|
|
1911
|
+
const structFields = [];
|
|
1912
|
+
const structValues = {};
|
|
1913
|
+
for (let i = 0;i < args.positional.length; i++) {
|
|
1914
|
+
const val = args.positional[i];
|
|
1915
|
+
const fieldName = `positional_${i}`;
|
|
1916
|
+
structFields.push(field2(fieldName, inferScalarType(val), true));
|
|
1917
|
+
structValues[fieldName] = val;
|
|
1918
|
+
}
|
|
1919
|
+
for (const [name, val] of args.named) {
|
|
1920
|
+
const fieldName = `named_${name}`;
|
|
1921
|
+
structFields.push(field2(fieldName, inferScalarType(val), true));
|
|
1922
|
+
structValues[fieldName] = val;
|
|
1923
|
+
}
|
|
1924
|
+
const structType = struct2(structFields);
|
|
1925
|
+
const sch = schema2([field2("args", structType, true)]);
|
|
1926
|
+
const structRow = {};
|
|
1927
|
+
for (const f of structFields) {
|
|
1928
|
+
let val = structValues[f.name];
|
|
1929
|
+
if (isInt(f.type) && f.type.bitWidth === 64 && typeof val === "number") {
|
|
1930
|
+
val = BigInt(val);
|
|
1931
|
+
}
|
|
1932
|
+
structRow[f.name] = val;
|
|
1933
|
+
}
|
|
1934
|
+
const batch = batchFromColumns({ args: [structRow] }, sch);
|
|
1935
|
+
return serializeBatch(batch);
|
|
1936
|
+
}
|
|
1937
|
+
function inferScalarType(val) {
|
|
1938
|
+
if (val === null || val === undefined)
|
|
1939
|
+
return nullType2();
|
|
1940
|
+
if (typeof val === "string")
|
|
1941
|
+
return utf82();
|
|
1942
|
+
if (typeof val === "boolean")
|
|
1943
|
+
return bool2();
|
|
1944
|
+
if (typeof val === "number")
|
|
1945
|
+
return int642();
|
|
1946
|
+
if (typeof val === "bigint")
|
|
1947
|
+
return int642();
|
|
1948
|
+
if (val instanceof Uint8Array || val instanceof ArrayBuffer)
|
|
1949
|
+
return binary2();
|
|
1950
|
+
return utf82();
|
|
1951
|
+
}
|
|
1952
|
+
|
|
1908
1953
|
// src/types.ts
|
|
1909
1954
|
var FunctionType;
|
|
1910
|
-
((
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1955
|
+
((FunctionType) => {
|
|
1956
|
+
FunctionType["SCALAR"] = "scalar";
|
|
1957
|
+
FunctionType["TABLE"] = "table";
|
|
1958
|
+
FunctionType["TABLE_BUFFERING"] = "table_buffering";
|
|
1959
|
+
FunctionType["AGGREGATE"] = "aggregate";
|
|
1915
1960
|
})(FunctionType ||= {});
|
|
1916
1961
|
var FunctionStability;
|
|
1917
|
-
((
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1962
|
+
((FunctionStability) => {
|
|
1963
|
+
FunctionStability["CONSISTENT"] = "CONSISTENT";
|
|
1964
|
+
FunctionStability["VOLATILE"] = "VOLATILE";
|
|
1965
|
+
FunctionStability["CONSISTENT_WITHIN_QUERY"] = "CONSISTENT_WITHIN_QUERY";
|
|
1921
1966
|
})(FunctionStability ||= {});
|
|
1922
1967
|
var NullHandling;
|
|
1923
|
-
((
|
|
1924
|
-
|
|
1925
|
-
|
|
1968
|
+
((NullHandling) => {
|
|
1969
|
+
NullHandling["DEFAULT"] = "DEFAULT";
|
|
1970
|
+
NullHandling["SPECIAL"] = "SPECIAL";
|
|
1926
1971
|
})(NullHandling ||= {});
|
|
1972
|
+
var ArgumentMonotonicity;
|
|
1973
|
+
((ArgumentMonotonicity) => {
|
|
1974
|
+
ArgumentMonotonicity["UNKNOWN"] = "UNKNOWN";
|
|
1975
|
+
ArgumentMonotonicity["CONSTANT"] = "CONSTANT";
|
|
1976
|
+
ArgumentMonotonicity["NON_DECREASING"] = "NON_DECREASING";
|
|
1977
|
+
ArgumentMonotonicity["STRICTLY_INCREASING"] = "STRICTLY_INCREASING";
|
|
1978
|
+
ArgumentMonotonicity["NON_INCREASING"] = "NON_INCREASING";
|
|
1979
|
+
ArgumentMonotonicity["STRICTLY_DECREASING"] = "STRICTLY_DECREASING";
|
|
1980
|
+
})(ArgumentMonotonicity ||= {});
|
|
1927
1981
|
var OrderPreservation;
|
|
1928
|
-
((
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1982
|
+
((OrderPreservation) => {
|
|
1983
|
+
OrderPreservation["PRESERVES_ORDER"] = "PRESERVES_ORDER";
|
|
1984
|
+
OrderPreservation["NO_ORDER_GUARANTEE"] = "NO_ORDER_GUARANTEE";
|
|
1985
|
+
OrderPreservation["FIXED_ORDER"] = "FIXED_ORDER";
|
|
1932
1986
|
})(OrderPreservation ||= {});
|
|
1933
1987
|
var OrderDependence;
|
|
1934
|
-
((
|
|
1935
|
-
|
|
1936
|
-
|
|
1988
|
+
((OrderDependence) => {
|
|
1989
|
+
OrderDependence["ORDER_DEPENDENT"] = "ORDER_DEPENDENT";
|
|
1990
|
+
OrderDependence["NOT_ORDER_DEPENDENT"] = "NOT_ORDER_DEPENDENT";
|
|
1937
1991
|
})(OrderDependence ||= {});
|
|
1938
1992
|
var DistinctDependence;
|
|
1939
|
-
((
|
|
1940
|
-
|
|
1941
|
-
|
|
1993
|
+
((DistinctDependence) => {
|
|
1994
|
+
DistinctDependence["DISTINCT_DEPENDENT"] = "DISTINCT_DEPENDENT";
|
|
1995
|
+
DistinctDependence["NOT_DISTINCT_DEPENDENT"] = "NOT_DISTINCT_DEPENDENT";
|
|
1942
1996
|
})(DistinctDependence ||= {});
|
|
1943
1997
|
var TableInOutPhase;
|
|
1944
|
-
((
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1998
|
+
((TableInOutPhase) => {
|
|
1999
|
+
TableInOutPhase["INPUT"] = "INPUT";
|
|
2000
|
+
TableInOutPhase["FINALIZE"] = "FINALIZE";
|
|
2001
|
+
TableInOutPhase["TABLE_BUFFERING"] = "TABLE_BUFFERING";
|
|
2002
|
+
TableInOutPhase["TABLE_BUFFERING_FINALIZE"] = "TABLE_BUFFERING_FINALIZE";
|
|
1949
2003
|
})(TableInOutPhase ||= {});
|
|
1950
2004
|
var VGI_ARG_KEY = "vgi_arg";
|
|
1951
2005
|
var VGI_ARG_NAMED = "named";
|
|
@@ -1985,60 +2039,16 @@ function toUint8Array2(val) {
|
|
|
1985
2039
|
}
|
|
1986
2040
|
return result;
|
|
1987
2041
|
}
|
|
1988
|
-
function buildSingleRowBatch(
|
|
2042
|
+
function buildSingleRowBatch(schema, values) {
|
|
1989
2043
|
const cols = {};
|
|
1990
|
-
for (const f of
|
|
2044
|
+
for (const f of schema.fields) {
|
|
1991
2045
|
let val = values[f.name];
|
|
1992
2046
|
if (isInt(f.type) && f.type.bitWidth === 64 && typeof val === "number") {
|
|
1993
2047
|
val = BigInt(val);
|
|
1994
2048
|
}
|
|
1995
2049
|
cols[f.name] = [val];
|
|
1996
2050
|
}
|
|
1997
|
-
return batchFromColumns(cols,
|
|
1998
|
-
}
|
|
1999
|
-
|
|
2000
|
-
// src/protocol/serializers/arguments.ts
|
|
2001
|
-
function serializeArguments(args) {
|
|
2002
|
-
const structFields = [];
|
|
2003
|
-
const structValues = {};
|
|
2004
|
-
for (let i = 0;i < args.positional.length; i++) {
|
|
2005
|
-
const val = args.positional[i];
|
|
2006
|
-
const fieldName = `positional_${i}`;
|
|
2007
|
-
structFields.push(field2(fieldName, inferScalarType(val), true));
|
|
2008
|
-
structValues[fieldName] = val;
|
|
2009
|
-
}
|
|
2010
|
-
for (const [name, val] of args.named) {
|
|
2011
|
-
const fieldName = `named_${name}`;
|
|
2012
|
-
structFields.push(field2(fieldName, inferScalarType(val), true));
|
|
2013
|
-
structValues[fieldName] = val;
|
|
2014
|
-
}
|
|
2015
|
-
const structType = struct2(structFields);
|
|
2016
|
-
const sch = schema2([field2("args", structType, true)]);
|
|
2017
|
-
const structRow = {};
|
|
2018
|
-
for (const f of structFields) {
|
|
2019
|
-
let val = structValues[f.name];
|
|
2020
|
-
if (isInt(f.type) && f.type.bitWidth === 64 && typeof val === "number") {
|
|
2021
|
-
val = BigInt(val);
|
|
2022
|
-
}
|
|
2023
|
-
structRow[f.name] = val;
|
|
2024
|
-
}
|
|
2025
|
-
const batch = batchFromColumns({ args: [structRow] }, sch);
|
|
2026
|
-
return serializeBatch(batch);
|
|
2027
|
-
}
|
|
2028
|
-
function inferScalarType(val) {
|
|
2029
|
-
if (val === null || val === undefined)
|
|
2030
|
-
return nullType2();
|
|
2031
|
-
if (typeof val === "string")
|
|
2032
|
-
return utf82();
|
|
2033
|
-
if (typeof val === "boolean")
|
|
2034
|
-
return bool2();
|
|
2035
|
-
if (typeof val === "number")
|
|
2036
|
-
return int642();
|
|
2037
|
-
if (typeof val === "bigint")
|
|
2038
|
-
return int642();
|
|
2039
|
-
if (val instanceof Uint8Array || val instanceof ArrayBuffer)
|
|
2040
|
-
return binary2();
|
|
2041
|
-
return utf82();
|
|
2051
|
+
return batchFromColumns(cols, schema);
|
|
2042
2052
|
}
|
|
2043
2053
|
|
|
2044
2054
|
// src/protocol/serializers/bind.ts
|
|
@@ -2065,7 +2075,8 @@ var BIND_REQUEST_SCHEMA = schema2([
|
|
|
2065
2075
|
field2("at_value", utf82(), true),
|
|
2066
2076
|
field2("copy_from", COPY_FROM_STRUCT_TYPE, true),
|
|
2067
2077
|
field2("copy_to", COPY_TO_STRUCT_TYPE, true),
|
|
2068
|
-
field2("
|
|
2078
|
+
field2("schema_path", list2(field2("item", utf82(), true)), true),
|
|
2079
|
+
field2("argument_names", list2(field2("item", utf82(), true)), true)
|
|
2069
2080
|
]);
|
|
2070
2081
|
function serializeBindRequest(req) {
|
|
2071
2082
|
return buildSingleRowBatch(BIND_REQUEST_SCHEMA, {
|
|
@@ -2086,7 +2097,8 @@ function serializeBindRequest(req) {
|
|
|
2086
2097
|
expected_schema: serializeSchema(req.copy_from.expected_schema)
|
|
2087
2098
|
} : null,
|
|
2088
2099
|
copy_to: req.copy_to ? { format: req.copy_to.format, file_path: req.copy_to.file_path } : null,
|
|
2089
|
-
|
|
2100
|
+
schema_path: req.schema_path ?? null,
|
|
2101
|
+
argument_names: req.argument_names ?? null
|
|
2090
2102
|
});
|
|
2091
2103
|
}
|
|
2092
2104
|
function deserializeBindResponse(params) {
|
|
@@ -2221,21 +2233,26 @@ class NoCatalogError extends VgiError {
|
|
|
2221
2233
|
}
|
|
2222
2234
|
}
|
|
2223
2235
|
|
|
2236
|
+
// src/schema-path.ts
|
|
2237
|
+
function normalizeSchemaPath(path) {
|
|
2238
|
+
return typeof path === "string" ? [path] : Array.from(path, String);
|
|
2239
|
+
}
|
|
2240
|
+
|
|
2224
2241
|
// src/codec/asd.ts
|
|
2225
|
-
function encodeASD(
|
|
2226
|
-
return serializeBatch(batchFromRows([obj],
|
|
2242
|
+
function encodeASD(schema, obj) {
|
|
2243
|
+
return serializeBatch(batchFromRows([obj], schema));
|
|
2227
2244
|
}
|
|
2228
|
-
function decodeASD(
|
|
2245
|
+
function decodeASD(schema, bytes) {
|
|
2229
2246
|
const batch = deserializeBatch(bytes);
|
|
2230
2247
|
if (batch.numRows === 0) {
|
|
2231
|
-
const names =
|
|
2248
|
+
const names = schema.fields.map((f) => f.name).join(",");
|
|
2232
2249
|
throw new Error(`decodeASD: empty batch (expected 1 row for ${names})`);
|
|
2233
2250
|
}
|
|
2234
2251
|
const out = {};
|
|
2235
|
-
for (const
|
|
2236
|
-
const col = batch.getChild(
|
|
2252
|
+
for (const field of schema.fields) {
|
|
2253
|
+
const col = batch.getChild(field.name);
|
|
2237
2254
|
const raw = col ? col.get(0) : null;
|
|
2238
|
-
out[
|
|
2255
|
+
out[field.name] = normalizeValue(raw, field.type);
|
|
2239
2256
|
}
|
|
2240
2257
|
return out;
|
|
2241
2258
|
}
|
|
@@ -2320,14 +2337,14 @@ var SchemaInfoSchema = schema2([
|
|
|
2320
2337
|
field2("comment", utf82(), true),
|
|
2321
2338
|
field2("tags", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), false),
|
|
2322
2339
|
field2("attach_opaque_data", binary2(), false),
|
|
2323
|
-
field2("
|
|
2340
|
+
field2("path", list2(field2("item", utf82(), true)), false),
|
|
2324
2341
|
field2("estimated_object_count", map2(field2("key", utf82(), false), field2("value", int642(), true), false), true)
|
|
2325
2342
|
]);
|
|
2326
2343
|
var TableInfoSchema = schema2([
|
|
2327
2344
|
field2("comment", utf82(), true),
|
|
2328
2345
|
field2("tags", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), false),
|
|
2329
2346
|
field2("name", utf82(), false),
|
|
2330
|
-
field2("
|
|
2347
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2331
2348
|
field2("columns", binary2(), false),
|
|
2332
2349
|
field2("not_null_constraints", list2(field2("item", int322(), true)), false),
|
|
2333
2350
|
field2("unique_constraints", list2(field2("item", list2(field2("item", int322(), true)), true)), false),
|
|
@@ -2353,7 +2370,7 @@ var ViewInfoSchema = schema2([
|
|
|
2353
2370
|
field2("comment", utf82(), true),
|
|
2354
2371
|
field2("tags", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), false),
|
|
2355
2372
|
field2("name", utf82(), false),
|
|
2356
|
-
field2("
|
|
2373
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2357
2374
|
field2("definition", utf82(), false),
|
|
2358
2375
|
field2("column_comments", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), false)
|
|
2359
2376
|
]);
|
|
@@ -2361,12 +2378,14 @@ var FunctionInfoSchema = schema2([
|
|
|
2361
2378
|
field2("comment", utf82(), true),
|
|
2362
2379
|
field2("tags", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), false),
|
|
2363
2380
|
field2("name", utf82(), false),
|
|
2364
|
-
field2("
|
|
2381
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2365
2382
|
field2("function_type", dictionary2(utf82(), int162()), false),
|
|
2366
2383
|
field2("arguments", binary2(), false),
|
|
2367
2384
|
field2("output_schema", binary2(), false),
|
|
2385
|
+
field2("parameter_default_values", binary2(), true),
|
|
2368
2386
|
field2("stability", dictionary2(utf82(), int162()), true),
|
|
2369
2387
|
field2("null_handling", dictionary2(utf82(), int162()), true),
|
|
2388
|
+
field2("argument_monotonicity", list2(field2("item", utf82(), true)), true),
|
|
2370
2389
|
field2("description", utf82(), false),
|
|
2371
2390
|
field2("examples", list2(field2("item", struct2([field2("sql", utf82(), false), field2("description", utf82(), false), field2("expected_output", utf82(), true)]), true)), false),
|
|
2372
2391
|
field2("categories", list2(field2("item", utf82(), true)), false),
|
|
@@ -2374,7 +2393,10 @@ var FunctionInfoSchema = schema2([
|
|
|
2374
2393
|
field2("filter_pushdown", bool2(), true),
|
|
2375
2394
|
field2("sampling_pushdown", bool2(), true),
|
|
2376
2395
|
field2("late_materialization", bool2(), true),
|
|
2377
|
-
field2("
|
|
2396
|
+
field2("filter_semantic_profiles", list2(field2("item", utf82(), true)), false),
|
|
2397
|
+
field2("additional_filter_functions", list2(field2("item", struct2([field2("namespace", utf82(), false), field2("name", utf82(), false), field2("version", uint642(), false)]), true)), false),
|
|
2398
|
+
field2("runtime_filter_algorithms", list2(field2("item", struct2([field2("namespace", utf82(), false), field2("name", utf82(), false), field2("version", uint642(), false)]), true)), false),
|
|
2399
|
+
field2("filter_evaluation_contexts", list2(field2("item", struct2([field2("profile", utf82(), false), field2("provider_fingerprint", utf82(), true)]), true)), false),
|
|
2378
2400
|
field2("order_preservation", dictionary2(utf82(), int162()), true),
|
|
2379
2401
|
field2("max_workers", int322(), true),
|
|
2380
2402
|
field2("supports_batch_index", bool2(), false),
|
|
@@ -2399,7 +2421,7 @@ var MacroInfoSchema = schema2([
|
|
|
2399
2421
|
field2("comment", utf82(), true),
|
|
2400
2422
|
field2("tags", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), false),
|
|
2401
2423
|
field2("name", utf82(), false),
|
|
2402
|
-
field2("
|
|
2424
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2403
2425
|
field2("macro_type", dictionary2(utf82(), int162()), false),
|
|
2404
2426
|
field2("parameters", list2(field2("item", utf82(), true)), false),
|
|
2405
2427
|
field2("parameter_default_values", binary2(), true),
|
|
@@ -2410,7 +2432,7 @@ var IndexInfoSchema = schema2([
|
|
|
2410
2432
|
field2("comment", utf82(), true),
|
|
2411
2433
|
field2("tags", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), false),
|
|
2412
2434
|
field2("name", utf82(), false),
|
|
2413
|
-
field2("
|
|
2435
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2414
2436
|
field2("table_name", utf82(), false),
|
|
2415
2437
|
field2("index_type", utf82(), false),
|
|
2416
2438
|
field2("constraint_type", dictionary2(utf82(), int162()), false),
|
|
@@ -2430,7 +2452,8 @@ var CopyFromFormatInfoSchema = schema2([
|
|
|
2430
2452
|
var ScanFunctionResultSchema = schema2([
|
|
2431
2453
|
field2("function_name", utf82(), false),
|
|
2432
2454
|
field2("arguments", binary2(), false),
|
|
2433
|
-
field2("required_extensions", list2(field2("item", utf82(), true)), false)
|
|
2455
|
+
field2("required_extensions", list2(field2("item", utf82(), true)), false),
|
|
2456
|
+
field2("schema_path", list2(field2("item", utf82(), true)), true)
|
|
2434
2457
|
]);
|
|
2435
2458
|
var ScanBranchesResultSchema = schema2([
|
|
2436
2459
|
field2("branches", list2(field2("item", binary2(), true)), false),
|
|
@@ -2442,11 +2465,12 @@ var ScanBranchSchema = schema2([
|
|
|
2442
2465
|
field2("branch_filter", utf82(), true),
|
|
2443
2466
|
field2("writable", bool2(), false),
|
|
2444
2467
|
field2("source_catalog", utf82(), true),
|
|
2445
|
-
field2("
|
|
2468
|
+
field2("source_schema_path", list2(field2("item", utf82(), true)), true),
|
|
2446
2469
|
field2("source_table", utf82(), true),
|
|
2447
2470
|
field2("format_name", utf82(), true),
|
|
2448
2471
|
field2("format_locations", list2(field2("item", utf82(), true)), true),
|
|
2449
|
-
field2("format_options", binary2(), true)
|
|
2472
|
+
field2("format_options", binary2(), true),
|
|
2473
|
+
field2("schema_path", list2(field2("item", utf82(), true)), true)
|
|
2450
2474
|
]);
|
|
2451
2475
|
var ScanSplitSchema = schema2([
|
|
2452
2476
|
field2("payload", binary2(), false),
|
|
@@ -2469,6 +2493,12 @@ var AttachCatalogInfoSchema = schema2([
|
|
|
2469
2493
|
field2("required", bool2(), false),
|
|
2470
2494
|
field2("secret_ref", utf82(), false)
|
|
2471
2495
|
]);
|
|
2496
|
+
var ForeignKeyInfoSchema = schema2([
|
|
2497
|
+
field2("fk_columns", list2(field2("item", utf82(), true)), false),
|
|
2498
|
+
field2("pk_columns", list2(field2("item", utf82(), true)), false),
|
|
2499
|
+
field2("referenced_table", utf82(), false),
|
|
2500
|
+
field2("referenced_schema_path", list2(field2("item", utf82(), true)), false)
|
|
2501
|
+
]);
|
|
2472
2502
|
var AggregateBindRequestSchema = schema2([
|
|
2473
2503
|
field2("function_name", utf82(), false),
|
|
2474
2504
|
field2("arguments", binary2(), false),
|
|
@@ -2476,21 +2506,22 @@ var AggregateBindRequestSchema = schema2([
|
|
|
2476
2506
|
field2("settings", binary2(), true),
|
|
2477
2507
|
field2("secrets", binary2(), true),
|
|
2478
2508
|
field2("attach_opaque_data", binary2(), true),
|
|
2479
|
-
field2("
|
|
2509
|
+
field2("schema_path", list2(field2("item", utf82(), true)), true),
|
|
2510
|
+
field2("argument_names", list2(field2("item", utf82(), true)), true)
|
|
2480
2511
|
]);
|
|
2481
2512
|
var AggregateCombineRequestSchema = schema2([
|
|
2482
2513
|
field2("function_name", utf82(), false),
|
|
2483
2514
|
field2("execution_id", binary2(), false),
|
|
2484
2515
|
field2("merge_batch", binary2(), false),
|
|
2485
2516
|
field2("attach_opaque_data", binary2(), true),
|
|
2486
|
-
field2("
|
|
2517
|
+
field2("schema_path", list2(field2("item", utf82(), true)), true)
|
|
2487
2518
|
]);
|
|
2488
2519
|
var AggregateDestructorRequestSchema = schema2([
|
|
2489
2520
|
field2("function_name", utf82(), false),
|
|
2490
2521
|
field2("execution_id", binary2(), false),
|
|
2491
2522
|
field2("group_ids_batch", binary2(), false),
|
|
2492
2523
|
field2("attach_opaque_data", binary2(), true),
|
|
2493
|
-
field2("
|
|
2524
|
+
field2("schema_path", list2(field2("item", utf82(), true)), true)
|
|
2494
2525
|
]);
|
|
2495
2526
|
var AggregateFinalizeRequestSchema = schema2([
|
|
2496
2527
|
field2("function_name", utf82(), false),
|
|
@@ -2498,14 +2529,81 @@ var AggregateFinalizeRequestSchema = schema2([
|
|
|
2498
2529
|
field2("group_ids_batch", binary2(), false),
|
|
2499
2530
|
field2("output_schema", binary2(), false),
|
|
2500
2531
|
field2("attach_opaque_data", binary2(), true),
|
|
2501
|
-
field2("
|
|
2532
|
+
field2("schema_path", list2(field2("item", utf82(), true)), true)
|
|
2533
|
+
]);
|
|
2534
|
+
var AggregateStreamingChunkRequestSchema = schema2([
|
|
2535
|
+
field2("function_name", utf82(), false),
|
|
2536
|
+
field2("execution_id", binary2(), false),
|
|
2537
|
+
field2("input_batch", binary2(), false),
|
|
2538
|
+
field2("attach_opaque_data", binary2(), true),
|
|
2539
|
+
field2("schema_path", list2(field2("item", utf82(), true)), true)
|
|
2540
|
+
]);
|
|
2541
|
+
var AggregateStreamingCloseRequestSchema = schema2([
|
|
2542
|
+
field2("function_name", utf82(), false),
|
|
2543
|
+
field2("execution_id", binary2(), false),
|
|
2544
|
+
field2("attach_opaque_data", binary2(), true),
|
|
2545
|
+
field2("schema_path", list2(field2("item", utf82(), true)), true)
|
|
2546
|
+
]);
|
|
2547
|
+
var AggregateStreamingOpenRequestSchema = schema2([
|
|
2548
|
+
field2("function_name", utf82(), false),
|
|
2549
|
+
field2("arguments", binary2(), false),
|
|
2550
|
+
field2("input_schema", binary2(), false),
|
|
2551
|
+
field2("partition_key_count", int642(), false),
|
|
2552
|
+
field2("order_key_count", int642(), false),
|
|
2553
|
+
field2("output_schema", binary2(), false),
|
|
2554
|
+
field2("settings", binary2(), true),
|
|
2555
|
+
field2("secrets", binary2(), true),
|
|
2556
|
+
field2("attach_opaque_data", binary2(), true),
|
|
2557
|
+
field2("schema_path", list2(field2("item", utf82(), true)), true)
|
|
2502
2558
|
]);
|
|
2503
2559
|
var AggregateUpdateRequestSchema = schema2([
|
|
2504
2560
|
field2("function_name", utf82(), false),
|
|
2505
2561
|
field2("execution_id", binary2(), false),
|
|
2506
2562
|
field2("input_batch", binary2(), false),
|
|
2507
2563
|
field2("attach_opaque_data", binary2(), true),
|
|
2508
|
-
field2("
|
|
2564
|
+
field2("schema_path", list2(field2("item", utf82(), true)), true)
|
|
2565
|
+
]);
|
|
2566
|
+
var AggregateWindowBatchRequestSchema = schema2([
|
|
2567
|
+
field2("function_name", utf82(), false),
|
|
2568
|
+
field2("execution_id", binary2(), false),
|
|
2569
|
+
field2("partition_id", int642(), false),
|
|
2570
|
+
field2("row_idx", int642(), false),
|
|
2571
|
+
field2("count", int642(), false),
|
|
2572
|
+
field2("frames_per_row", list2(field2("item", int642(), true)), false),
|
|
2573
|
+
field2("frame_starts", list2(field2("item", int642(), true)), false),
|
|
2574
|
+
field2("frame_ends", list2(field2("item", int642(), true)), false),
|
|
2575
|
+
field2("attach_opaque_data", binary2(), true),
|
|
2576
|
+
field2("schema_path", list2(field2("item", utf82(), true)), true)
|
|
2577
|
+
]);
|
|
2578
|
+
var AggregateWindowDestructorRequestSchema = schema2([
|
|
2579
|
+
field2("function_name", utf82(), false),
|
|
2580
|
+
field2("execution_id", binary2(), false),
|
|
2581
|
+
field2("partition_id", int642(), false),
|
|
2582
|
+
field2("attach_opaque_data", binary2(), true),
|
|
2583
|
+
field2("schema_path", list2(field2("item", utf82(), true)), true)
|
|
2584
|
+
]);
|
|
2585
|
+
var AggregateWindowInitRequestSchema = schema2([
|
|
2586
|
+
field2("function_name", utf82(), false),
|
|
2587
|
+
field2("execution_id", binary2(), false),
|
|
2588
|
+
field2("partition_id", int642(), false),
|
|
2589
|
+
field2("row_count", int642(), false),
|
|
2590
|
+
field2("partition_batch", binary2(), false),
|
|
2591
|
+
field2("output_schema", binary2(), false),
|
|
2592
|
+
field2("filter_mask", binary2(), false),
|
|
2593
|
+
field2("frame_stats", binary2(), false),
|
|
2594
|
+
field2("all_valid", binary2(), false),
|
|
2595
|
+
field2("attach_opaque_data", binary2(), true),
|
|
2596
|
+
field2("schema_path", list2(field2("item", utf82(), true)), true)
|
|
2597
|
+
]);
|
|
2598
|
+
var AggregateWindowRequestSchema = schema2([
|
|
2599
|
+
field2("function_name", utf82(), false),
|
|
2600
|
+
field2("execution_id", binary2(), false),
|
|
2601
|
+
field2("partition_id", int642(), false),
|
|
2602
|
+
field2("rid", int642(), false),
|
|
2603
|
+
field2("frame_starts", list2(field2("item", int642(), true)), false),
|
|
2604
|
+
field2("frame_ends", list2(field2("item", int642(), true)), false),
|
|
2605
|
+
field2("attach_opaque_data", binary2(), true),
|
|
2606
|
+
field2("schema_path", list2(field2("item", utf82(), true)), true)
|
|
2509
2607
|
]);
|
|
2510
2608
|
var BindRequestSchema = schema2([
|
|
2511
2609
|
field2("function_name", utf82(), false),
|
|
@@ -2521,7 +2619,8 @@ var BindRequestSchema = schema2([
|
|
|
2521
2619
|
field2("at_value", utf82(), true),
|
|
2522
2620
|
field2("copy_from", struct2([field2("format", utf82(), false), field2("file_path", utf82(), false), field2("expected_schema", binary2(), false)]), true),
|
|
2523
2621
|
field2("copy_to", struct2([field2("format", utf82(), false), field2("file_path", utf82(), false)]), true),
|
|
2524
|
-
field2("
|
|
2622
|
+
field2("schema_path", list2(field2("item", utf82(), true)), true),
|
|
2623
|
+
field2("argument_names", list2(field2("item", utf82(), true)), true)
|
|
2525
2624
|
]);
|
|
2526
2625
|
var CatalogAttachRequestSchema = schema2([
|
|
2527
2626
|
field2("name", utf82(), false),
|
|
@@ -2530,6 +2629,18 @@ var CatalogAttachRequestSchema = schema2([
|
|
|
2530
2629
|
field2("implementation_version", utf82(), true),
|
|
2531
2630
|
field2("client_capabilities", binary2(), true)
|
|
2532
2631
|
]);
|
|
2632
|
+
var CatalogCreateRequestSchema = schema2([
|
|
2633
|
+
field2("name", utf82(), false),
|
|
2634
|
+
field2("on_conflict", dictionary2(utf82(), int162()), false),
|
|
2635
|
+
field2("options", binary2(), true)
|
|
2636
|
+
]);
|
|
2637
|
+
var ClientCapabilitiesSchema = schema2([
|
|
2638
|
+
field2("engine", utf82(), false),
|
|
2639
|
+
field2("native_formats", list2(field2("item", utf82(), true)), false),
|
|
2640
|
+
field2("catalogs", list2(field2("item", utf82(), true)), false),
|
|
2641
|
+
field2("can_stream", bool2(), false),
|
|
2642
|
+
field2("filter_encodings", list2(field2("item", utf82(), true)), false)
|
|
2643
|
+
]);
|
|
2533
2644
|
var CopyFromContextSchema = schema2([
|
|
2534
2645
|
field2("format", utf82(), false),
|
|
2535
2646
|
field2("file_path", utf82(), false),
|
|
@@ -2544,6 +2655,18 @@ var GlobalInitResponseSchema = schema2([
|
|
|
2544
2655
|
field2("opaque_data", binary2(), true),
|
|
2545
2656
|
field2("max_workers", int642(), false)
|
|
2546
2657
|
]);
|
|
2658
|
+
var IndexCreateRequestSchema = schema2([
|
|
2659
|
+
field2("attach_opaque_data", binary2(), false),
|
|
2660
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2661
|
+
field2("name", utf82(), false),
|
|
2662
|
+
field2("table_name", utf82(), false),
|
|
2663
|
+
field2("index_type", utf82(), false),
|
|
2664
|
+
field2("constraint_type", dictionary2(utf82(), int162()), false),
|
|
2665
|
+
field2("expressions", list2(field2("item", utf82(), true)), false),
|
|
2666
|
+
field2("on_conflict", dictionary2(utf82(), int162()), false),
|
|
2667
|
+
field2("options", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), false),
|
|
2668
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
2669
|
+
]);
|
|
2547
2670
|
var InitRequestSchema = schema2([
|
|
2548
2671
|
field2("bind_call", binary2(), false),
|
|
2549
2672
|
field2("output_schema", binary2(), false),
|
|
@@ -2565,20 +2688,45 @@ var InitRequestSchema = schema2([
|
|
|
2565
2688
|
field2("tablesample_percentage", float642(), true),
|
|
2566
2689
|
field2("tablesample_seed", int642(), true)
|
|
2567
2690
|
]);
|
|
2691
|
+
var MacroCreateRequestSchema = schema2([
|
|
2692
|
+
field2("attach_opaque_data", binary2(), false),
|
|
2693
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2694
|
+
field2("name", utf82(), false),
|
|
2695
|
+
field2("macro_type", dictionary2(utf82(), int162()), false),
|
|
2696
|
+
field2("parameters", list2(field2("item", utf82(), true)), false),
|
|
2697
|
+
field2("definition", utf82(), false),
|
|
2698
|
+
field2("on_conflict", dictionary2(utf82(), int162()), false),
|
|
2699
|
+
field2("parameter_default_values", binary2(), true),
|
|
2700
|
+
field2("arguments_schema", binary2(), true),
|
|
2701
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
2702
|
+
]);
|
|
2703
|
+
var TableCreateRequestSchema = schema2([
|
|
2704
|
+
field2("attach_opaque_data", binary2(), false),
|
|
2705
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2706
|
+
field2("name", utf82(), false),
|
|
2707
|
+
field2("columns", binary2(), false),
|
|
2708
|
+
field2("on_conflict", dictionary2(utf82(), int162()), false),
|
|
2709
|
+
field2("not_null_constraints", list2(field2("item", int322(), true)), false),
|
|
2710
|
+
field2("unique_constraints", list2(field2("item", list2(field2("item", int322(), true)), true)), false),
|
|
2711
|
+
field2("check_constraints", list2(field2("item", utf82(), true)), false),
|
|
2712
|
+
field2("primary_key_constraints", list2(field2("item", list2(field2("item", int322(), true)), true)), false),
|
|
2713
|
+
field2("foreign_key_constraints", list2(field2("item", binary2(), true)), false),
|
|
2714
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
2715
|
+
]);
|
|
2568
2716
|
var TableBufferingCombineRequestSchema = schema2([
|
|
2569
2717
|
field2("function_name", utf82(), false),
|
|
2570
2718
|
field2("execution_id", binary2(), false),
|
|
2571
2719
|
field2("state_ids", list2(field2("item", binary2(), true)), false),
|
|
2572
2720
|
field2("attach_opaque_data", binary2(), true),
|
|
2573
2721
|
field2("transaction_id", binary2(), true),
|
|
2574
|
-
field2("
|
|
2722
|
+
field2("schema_path", list2(field2("item", utf82(), true)), true)
|
|
2575
2723
|
]);
|
|
2576
2724
|
var TableBufferingDestructorRequestSchema = schema2([
|
|
2577
2725
|
field2("function_name", utf82(), false),
|
|
2578
2726
|
field2("execution_id", binary2(), false),
|
|
2579
2727
|
field2("attach_opaque_data", binary2(), true),
|
|
2580
2728
|
field2("transaction_id", binary2(), true),
|
|
2581
|
-
field2("
|
|
2729
|
+
field2("schema_path", list2(field2("item", utf82(), true)), true)
|
|
2582
2730
|
]);
|
|
2583
2731
|
var TableBufferingProcessRequestSchema = schema2([
|
|
2584
2732
|
field2("function_name", utf82(), false),
|
|
@@ -2587,12 +2735,17 @@ var TableBufferingProcessRequestSchema = schema2([
|
|
|
2587
2735
|
field2("attach_opaque_data", binary2(), true),
|
|
2588
2736
|
field2("transaction_id", binary2(), true),
|
|
2589
2737
|
field2("batch_index", int642(), true),
|
|
2590
|
-
field2("
|
|
2738
|
+
field2("schema_path", list2(field2("item", utf82(), true)), true)
|
|
2591
2739
|
]);
|
|
2592
2740
|
var TableFunctionCardinalityRequestSchema = schema2([
|
|
2593
2741
|
field2("bind_call", binary2(), false),
|
|
2594
2742
|
field2("bind_opaque_data", binary2(), true)
|
|
2595
2743
|
]);
|
|
2744
|
+
var TableFunctionDynamicToStringRequestSchema = schema2([
|
|
2745
|
+
field2("bind_call", binary2(), false),
|
|
2746
|
+
field2("bind_opaque_data", binary2(), true),
|
|
2747
|
+
field2("global_execution_id", binary2(), false)
|
|
2748
|
+
]);
|
|
2596
2749
|
var TableFunctionPlanRequestSchema = schema2([
|
|
2597
2750
|
field2("bind_call", binary2(), false),
|
|
2598
2751
|
field2("bind_opaque_data", binary2(), true),
|
|
@@ -2615,6 +2768,10 @@ var TableFunctionPlanRequestSchema = schema2([
|
|
|
2615
2768
|
field2("tablesample_percentage", float642(), true),
|
|
2616
2769
|
field2("tablesample_seed", int642(), true)
|
|
2617
2770
|
]);
|
|
2771
|
+
var TableFunctionStatisticsRequestSchema = schema2([
|
|
2772
|
+
field2("bind_call", binary2(), false),
|
|
2773
|
+
field2("bind_opaque_data", binary2(), true)
|
|
2774
|
+
]);
|
|
2618
2775
|
var AggregateBindResultSchema = schema2([
|
|
2619
2776
|
field2("output_schema", binary2(), false),
|
|
2620
2777
|
field2("execution_id", binary2(), false)
|
|
@@ -2805,7 +2962,7 @@ var CatalogIndexCreateParamsSchema = schema2([
|
|
|
2805
2962
|
]);
|
|
2806
2963
|
var CatalogIndexDropParamsSchema = schema2([
|
|
2807
2964
|
field2("attach_opaque_data", binary2(), false),
|
|
2808
|
-
field2("
|
|
2965
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2809
2966
|
field2("name", utf82(), false),
|
|
2810
2967
|
field2("ignore_not_found", bool2(), false),
|
|
2811
2968
|
field2("cascade", bool2(), false),
|
|
@@ -2813,7 +2970,7 @@ var CatalogIndexDropParamsSchema = schema2([
|
|
|
2813
2970
|
]);
|
|
2814
2971
|
var CatalogIndexGetParamsSchema = schema2([
|
|
2815
2972
|
field2("attach_opaque_data", binary2(), false),
|
|
2816
|
-
field2("
|
|
2973
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2817
2974
|
field2("name", utf82(), false),
|
|
2818
2975
|
field2("transaction_opaque_data", binary2(), true)
|
|
2819
2976
|
]);
|
|
@@ -2822,47 +2979,47 @@ var CatalogMacroCreateParamsSchema = schema2([
|
|
|
2822
2979
|
]);
|
|
2823
2980
|
var CatalogMacroDropParamsSchema = schema2([
|
|
2824
2981
|
field2("attach_opaque_data", binary2(), false),
|
|
2825
|
-
field2("
|
|
2982
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2826
2983
|
field2("name", utf82(), false),
|
|
2827
2984
|
field2("ignore_not_found", bool2(), false),
|
|
2828
2985
|
field2("transaction_opaque_data", binary2(), true)
|
|
2829
2986
|
]);
|
|
2830
2987
|
var CatalogMacroGetParamsSchema = schema2([
|
|
2831
2988
|
field2("attach_opaque_data", binary2(), false),
|
|
2832
|
-
field2("
|
|
2989
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2833
2990
|
field2("name", utf82(), false),
|
|
2834
2991
|
field2("transaction_opaque_data", binary2(), true)
|
|
2835
2992
|
]);
|
|
2836
2993
|
var CatalogSchemaContentsFunctionsParamsSchema = schema2([
|
|
2837
2994
|
field2("attach_opaque_data", binary2(), false),
|
|
2838
|
-
field2("
|
|
2995
|
+
field2("path", list2(field2("item", utf82(), true)), false),
|
|
2839
2996
|
field2("type", dictionary2(utf82(), int162()), false),
|
|
2840
2997
|
field2("transaction_opaque_data", binary2(), true)
|
|
2841
2998
|
]);
|
|
2842
2999
|
var CatalogSchemaContentsIndexesParamsSchema = schema2([
|
|
2843
3000
|
field2("attach_opaque_data", binary2(), false),
|
|
2844
|
-
field2("
|
|
3001
|
+
field2("path", list2(field2("item", utf82(), true)), false),
|
|
2845
3002
|
field2("transaction_opaque_data", binary2(), true)
|
|
2846
3003
|
]);
|
|
2847
3004
|
var CatalogSchemaContentsMacrosParamsSchema = schema2([
|
|
2848
3005
|
field2("attach_opaque_data", binary2(), false),
|
|
2849
|
-
field2("
|
|
3006
|
+
field2("path", list2(field2("item", utf82(), true)), false),
|
|
2850
3007
|
field2("type", dictionary2(utf82(), int162()), false),
|
|
2851
3008
|
field2("transaction_opaque_data", binary2(), true)
|
|
2852
3009
|
]);
|
|
2853
3010
|
var CatalogSchemaContentsTablesParamsSchema = schema2([
|
|
2854
3011
|
field2("attach_opaque_data", binary2(), false),
|
|
2855
|
-
field2("
|
|
3012
|
+
field2("path", list2(field2("item", utf82(), true)), false),
|
|
2856
3013
|
field2("transaction_opaque_data", binary2(), true)
|
|
2857
3014
|
]);
|
|
2858
3015
|
var CatalogSchemaContentsViewsParamsSchema = schema2([
|
|
2859
3016
|
field2("attach_opaque_data", binary2(), false),
|
|
2860
|
-
field2("
|
|
3017
|
+
field2("path", list2(field2("item", utf82(), true)), false),
|
|
2861
3018
|
field2("transaction_opaque_data", binary2(), true)
|
|
2862
3019
|
]);
|
|
2863
3020
|
var CatalogSchemaCreateParamsSchema = schema2([
|
|
2864
3021
|
field2("attach_opaque_data", binary2(), false),
|
|
2865
|
-
field2("
|
|
3022
|
+
field2("path", list2(field2("item", utf82(), true)), false),
|
|
2866
3023
|
field2("on_conflict", dictionary2(utf82(), int162()), false),
|
|
2867
3024
|
field2("comment", utf82(), true),
|
|
2868
3025
|
field2("tags", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), true),
|
|
@@ -2870,14 +3027,14 @@ var CatalogSchemaCreateParamsSchema = schema2([
|
|
|
2870
3027
|
]);
|
|
2871
3028
|
var CatalogSchemaDropParamsSchema = schema2([
|
|
2872
3029
|
field2("attach_opaque_data", binary2(), false),
|
|
2873
|
-
field2("
|
|
3030
|
+
field2("path", list2(field2("item", utf82(), true)), false),
|
|
2874
3031
|
field2("ignore_not_found", bool2(), false),
|
|
2875
3032
|
field2("cascade", bool2(), false),
|
|
2876
3033
|
field2("transaction_opaque_data", binary2(), true)
|
|
2877
3034
|
]);
|
|
2878
3035
|
var CatalogSchemaGetParamsSchema = schema2([
|
|
2879
3036
|
field2("attach_opaque_data", binary2(), false),
|
|
2880
|
-
field2("
|
|
3037
|
+
field2("path", list2(field2("item", utf82(), true)), false),
|
|
2881
3038
|
field2("transaction_opaque_data", binary2(), true)
|
|
2882
3039
|
]);
|
|
2883
3040
|
var CatalogSchemasParamsSchema = schema2([
|
|
@@ -2886,7 +3043,7 @@ var CatalogSchemasParamsSchema = schema2([
|
|
|
2886
3043
|
]);
|
|
2887
3044
|
var CatalogTableColumnAddParamsSchema = schema2([
|
|
2888
3045
|
field2("attach_opaque_data", binary2(), false),
|
|
2889
|
-
field2("
|
|
3046
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2890
3047
|
field2("name", utf82(), false),
|
|
2891
3048
|
field2("column_definition", binary2(), false),
|
|
2892
3049
|
field2("ignore_not_found", bool2(), false),
|
|
@@ -2895,7 +3052,7 @@ var CatalogTableColumnAddParamsSchema = schema2([
|
|
|
2895
3052
|
]);
|
|
2896
3053
|
var CatalogTableColumnCommentSetParamsSchema = schema2([
|
|
2897
3054
|
field2("attach_opaque_data", binary2(), false),
|
|
2898
|
-
field2("
|
|
3055
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2899
3056
|
field2("name", utf82(), false),
|
|
2900
3057
|
field2("column_name", utf82(), false),
|
|
2901
3058
|
field2("comment", utf82(), true),
|
|
@@ -2904,7 +3061,7 @@ var CatalogTableColumnCommentSetParamsSchema = schema2([
|
|
|
2904
3061
|
]);
|
|
2905
3062
|
var CatalogTableColumnDefaultDropParamsSchema = schema2([
|
|
2906
3063
|
field2("attach_opaque_data", binary2(), false),
|
|
2907
|
-
field2("
|
|
3064
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2908
3065
|
field2("name", utf82(), false),
|
|
2909
3066
|
field2("column_name", utf82(), false),
|
|
2910
3067
|
field2("ignore_not_found", bool2(), false),
|
|
@@ -2912,7 +3069,7 @@ var CatalogTableColumnDefaultDropParamsSchema = schema2([
|
|
|
2912
3069
|
]);
|
|
2913
3070
|
var CatalogTableColumnDefaultSetParamsSchema = schema2([
|
|
2914
3071
|
field2("attach_opaque_data", binary2(), false),
|
|
2915
|
-
field2("
|
|
3072
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2916
3073
|
field2("name", utf82(), false),
|
|
2917
3074
|
field2("column_name", utf82(), false),
|
|
2918
3075
|
field2("expression", utf82(), false),
|
|
@@ -2921,7 +3078,7 @@ var CatalogTableColumnDefaultSetParamsSchema = schema2([
|
|
|
2921
3078
|
]);
|
|
2922
3079
|
var CatalogTableColumnDropParamsSchema = schema2([
|
|
2923
3080
|
field2("attach_opaque_data", binary2(), false),
|
|
2924
|
-
field2("
|
|
3081
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2925
3082
|
field2("name", utf82(), false),
|
|
2926
3083
|
field2("column_name", utf82(), false),
|
|
2927
3084
|
field2("ignore_not_found", bool2(), false),
|
|
@@ -2931,7 +3088,7 @@ var CatalogTableColumnDropParamsSchema = schema2([
|
|
|
2931
3088
|
]);
|
|
2932
3089
|
var CatalogTableColumnRenameParamsSchema = schema2([
|
|
2933
3090
|
field2("attach_opaque_data", binary2(), false),
|
|
2934
|
-
field2("
|
|
3091
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2935
3092
|
field2("name", utf82(), false),
|
|
2936
3093
|
field2("column_name", utf82(), false),
|
|
2937
3094
|
field2("new_column_name", utf82(), false),
|
|
@@ -2940,13 +3097,13 @@ var CatalogTableColumnRenameParamsSchema = schema2([
|
|
|
2940
3097
|
]);
|
|
2941
3098
|
var CatalogTableColumnStatisticsGetParamsSchema = schema2([
|
|
2942
3099
|
field2("attach_opaque_data", binary2(), false),
|
|
2943
|
-
field2("
|
|
3100
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2944
3101
|
field2("name", utf82(), false),
|
|
2945
3102
|
field2("transaction_opaque_data", binary2(), true)
|
|
2946
3103
|
]);
|
|
2947
3104
|
var CatalogTableColumnTypeChangeParamsSchema = schema2([
|
|
2948
3105
|
field2("attach_opaque_data", binary2(), false),
|
|
2949
|
-
field2("
|
|
3106
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2950
3107
|
field2("name", utf82(), false),
|
|
2951
3108
|
field2("column_definition", binary2(), false),
|
|
2952
3109
|
field2("expression", utf82(), true),
|
|
@@ -2955,7 +3112,7 @@ var CatalogTableColumnTypeChangeParamsSchema = schema2([
|
|
|
2955
3112
|
]);
|
|
2956
3113
|
var CatalogTableCommentSetParamsSchema = schema2([
|
|
2957
3114
|
field2("attach_opaque_data", binary2(), false),
|
|
2958
|
-
field2("
|
|
3115
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2959
3116
|
field2("name", utf82(), false),
|
|
2960
3117
|
field2("comment", utf82(), true),
|
|
2961
3118
|
field2("ignore_not_found", bool2(), false),
|
|
@@ -2966,13 +3123,13 @@ var CatalogTableCreateParamsSchema = schema2([
|
|
|
2966
3123
|
]);
|
|
2967
3124
|
var CatalogTableDeleteFunctionGetParamsSchema = schema2([
|
|
2968
3125
|
field2("attach_opaque_data", binary2(), false),
|
|
2969
|
-
field2("
|
|
3126
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2970
3127
|
field2("name", utf82(), false),
|
|
2971
3128
|
field2("transaction_opaque_data", binary2(), true)
|
|
2972
3129
|
]);
|
|
2973
3130
|
var CatalogTableDropParamsSchema = schema2([
|
|
2974
3131
|
field2("attach_opaque_data", binary2(), false),
|
|
2975
|
-
field2("
|
|
3132
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2976
3133
|
field2("name", utf82(), false),
|
|
2977
3134
|
field2("ignore_not_found", bool2(), false),
|
|
2978
3135
|
field2("cascade", bool2(), false),
|
|
@@ -2980,7 +3137,7 @@ var CatalogTableDropParamsSchema = schema2([
|
|
|
2980
3137
|
]);
|
|
2981
3138
|
var CatalogTableGetParamsSchema = schema2([
|
|
2982
3139
|
field2("attach_opaque_data", binary2(), false),
|
|
2983
|
-
field2("
|
|
3140
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2984
3141
|
field2("name", utf82(), false),
|
|
2985
3142
|
field2("at_unit", utf82(), true),
|
|
2986
3143
|
field2("at_value", utf82(), true),
|
|
@@ -2988,14 +3145,14 @@ var CatalogTableGetParamsSchema = schema2([
|
|
|
2988
3145
|
]);
|
|
2989
3146
|
var CatalogTableInsertFunctionGetParamsSchema = schema2([
|
|
2990
3147
|
field2("attach_opaque_data", binary2(), false),
|
|
2991
|
-
field2("
|
|
3148
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2992
3149
|
field2("name", utf82(), false),
|
|
2993
3150
|
field2("transaction_opaque_data", binary2(), true),
|
|
2994
3151
|
field2("writable_branch_function_name", utf82(), true)
|
|
2995
3152
|
]);
|
|
2996
3153
|
var CatalogTableNotNullDropParamsSchema = schema2([
|
|
2997
3154
|
field2("attach_opaque_data", binary2(), false),
|
|
2998
|
-
field2("
|
|
3155
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2999
3156
|
field2("name", utf82(), false),
|
|
3000
3157
|
field2("column_name", utf82(), false),
|
|
3001
3158
|
field2("ignore_not_found", bool2(), false),
|
|
@@ -3003,7 +3160,7 @@ var CatalogTableNotNullDropParamsSchema = schema2([
|
|
|
3003
3160
|
]);
|
|
3004
3161
|
var CatalogTableNotNullSetParamsSchema = schema2([
|
|
3005
3162
|
field2("attach_opaque_data", binary2(), false),
|
|
3006
|
-
field2("
|
|
3163
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
3007
3164
|
field2("name", utf82(), false),
|
|
3008
3165
|
field2("column_name", utf82(), false),
|
|
3009
3166
|
field2("ignore_not_found", bool2(), false),
|
|
@@ -3011,7 +3168,7 @@ var CatalogTableNotNullSetParamsSchema = schema2([
|
|
|
3011
3168
|
]);
|
|
3012
3169
|
var CatalogTableRenameParamsSchema = schema2([
|
|
3013
3170
|
field2("attach_opaque_data", binary2(), false),
|
|
3014
|
-
field2("
|
|
3171
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
3015
3172
|
field2("name", utf82(), false),
|
|
3016
3173
|
field2("new_name", utf82(), false),
|
|
3017
3174
|
field2("ignore_not_found", bool2(), false),
|
|
@@ -3019,7 +3176,7 @@ var CatalogTableRenameParamsSchema = schema2([
|
|
|
3019
3176
|
]);
|
|
3020
3177
|
var CatalogTableScanBranchesGetParamsSchema = schema2([
|
|
3021
3178
|
field2("attach_opaque_data", binary2(), false),
|
|
3022
|
-
field2("
|
|
3179
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
3023
3180
|
field2("name", utf82(), false),
|
|
3024
3181
|
field2("at_unit", utf82(), true),
|
|
3025
3182
|
field2("at_value", utf82(), true),
|
|
@@ -3027,7 +3184,7 @@ var CatalogTableScanBranchesGetParamsSchema = schema2([
|
|
|
3027
3184
|
]);
|
|
3028
3185
|
var CatalogTableScanFunctionGetParamsSchema = schema2([
|
|
3029
3186
|
field2("attach_opaque_data", binary2(), false),
|
|
3030
|
-
field2("
|
|
3187
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
3031
3188
|
field2("name", utf82(), false),
|
|
3032
3189
|
field2("at_unit", utf82(), true),
|
|
3033
3190
|
field2("at_value", utf82(), true),
|
|
@@ -3035,7 +3192,7 @@ var CatalogTableScanFunctionGetParamsSchema = schema2([
|
|
|
3035
3192
|
]);
|
|
3036
3193
|
var CatalogTableUpdateFunctionGetParamsSchema = schema2([
|
|
3037
3194
|
field2("attach_opaque_data", binary2(), false),
|
|
3038
|
-
field2("
|
|
3195
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
3039
3196
|
field2("name", utf82(), false),
|
|
3040
3197
|
field2("transaction_opaque_data", binary2(), true)
|
|
3041
3198
|
]);
|
|
@@ -3056,7 +3213,7 @@ var CatalogVersionParamsSchema = schema2([
|
|
|
3056
3213
|
]);
|
|
3057
3214
|
var CatalogViewCommentSetParamsSchema = schema2([
|
|
3058
3215
|
field2("attach_opaque_data", binary2(), false),
|
|
3059
|
-
field2("
|
|
3216
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
3060
3217
|
field2("name", utf82(), false),
|
|
3061
3218
|
field2("comment", utf82(), true),
|
|
3062
3219
|
field2("ignore_not_found", bool2(), false),
|
|
@@ -3064,7 +3221,7 @@ var CatalogViewCommentSetParamsSchema = schema2([
|
|
|
3064
3221
|
]);
|
|
3065
3222
|
var CatalogViewCreateParamsSchema = schema2([
|
|
3066
3223
|
field2("attach_opaque_data", binary2(), false),
|
|
3067
|
-
field2("
|
|
3224
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
3068
3225
|
field2("name", utf82(), false),
|
|
3069
3226
|
field2("definition", utf82(), false),
|
|
3070
3227
|
field2("on_conflict", dictionary2(utf82(), int162()), false),
|
|
@@ -3072,7 +3229,7 @@ var CatalogViewCreateParamsSchema = schema2([
|
|
|
3072
3229
|
]);
|
|
3073
3230
|
var CatalogViewDropParamsSchema = schema2([
|
|
3074
3231
|
field2("attach_opaque_data", binary2(), false),
|
|
3075
|
-
field2("
|
|
3232
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
3076
3233
|
field2("name", utf82(), false),
|
|
3077
3234
|
field2("ignore_not_found", bool2(), false),
|
|
3078
3235
|
field2("cascade", bool2(), false),
|
|
@@ -3080,13 +3237,13 @@ var CatalogViewDropParamsSchema = schema2([
|
|
|
3080
3237
|
]);
|
|
3081
3238
|
var CatalogViewGetParamsSchema = schema2([
|
|
3082
3239
|
field2("attach_opaque_data", binary2(), false),
|
|
3083
|
-
field2("
|
|
3240
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
3084
3241
|
field2("name", utf82(), false),
|
|
3085
3242
|
field2("transaction_opaque_data", binary2(), true)
|
|
3086
3243
|
]);
|
|
3087
3244
|
var CatalogViewRenameParamsSchema = schema2([
|
|
3088
3245
|
field2("attach_opaque_data", binary2(), false),
|
|
3089
|
-
field2("
|
|
3246
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
3090
3247
|
field2("name", utf82(), false),
|
|
3091
3248
|
field2("new_name", utf82(), false),
|
|
3092
3249
|
field2("ignore_not_found", bool2(), false),
|
|
@@ -3136,16 +3293,16 @@ function decodeScanFunctionResult(inner) {
|
|
|
3136
3293
|
const namedArguments = {};
|
|
3137
3294
|
if (argsBytes != null) {
|
|
3138
3295
|
const batch = deserializeBatch(toUint8Array(argsBytes));
|
|
3139
|
-
for (const
|
|
3140
|
-
const col = batch.getChild(
|
|
3296
|
+
for (const field of batch.schema.fields) {
|
|
3297
|
+
const col = batch.getChild(field.name);
|
|
3141
3298
|
const value = col ? col.get(0) : null;
|
|
3142
|
-
if (
|
|
3143
|
-
const idx = parseInt(
|
|
3299
|
+
if (field.name.startsWith("arg_")) {
|
|
3300
|
+
const idx = parseInt(field.name.slice(4), 10);
|
|
3144
3301
|
while (positionalArguments.length <= idx)
|
|
3145
3302
|
positionalArguments.push(null);
|
|
3146
3303
|
positionalArguments[idx] = value;
|
|
3147
3304
|
} else {
|
|
3148
|
-
namedArguments[
|
|
3305
|
+
namedArguments[field.name] = value;
|
|
3149
3306
|
}
|
|
3150
3307
|
}
|
|
3151
3308
|
}
|
|
@@ -3155,7 +3312,8 @@ function decodeScanFunctionResult(inner) {
|
|
|
3155
3312
|
functionName: String(inner.function_name ?? ""),
|
|
3156
3313
|
positionalArguments,
|
|
3157
3314
|
namedArguments,
|
|
3158
|
-
requiredExtensions
|
|
3315
|
+
requiredExtensions,
|
|
3316
|
+
schemaPath: inner.schema_path == null ? null : (Array.isArray(inner.schema_path) ? inner.schema_path : [...inner.schema_path]).filter((value) => value != null).map(String)
|
|
3159
3317
|
};
|
|
3160
3318
|
}
|
|
3161
3319
|
|
|
@@ -3202,8 +3360,8 @@ function serializeAttachOptions(options) {
|
|
|
3202
3360
|
fields.push(field2(key, type, true));
|
|
3203
3361
|
columns[key] = [value];
|
|
3204
3362
|
}
|
|
3205
|
-
const
|
|
3206
|
-
const batch = batchFromColumns(columns,
|
|
3363
|
+
const schema = schema2(fields);
|
|
3364
|
+
const batch = batchFromColumns(columns, schema);
|
|
3207
3365
|
return serializeBatch(batch);
|
|
3208
3366
|
}
|
|
3209
3367
|
|
|
@@ -3303,6 +3461,19 @@ class VgiClient {
|
|
|
3303
3461
|
this.rpc = wrapRpcWithErrorEnrichment(rpc);
|
|
3304
3462
|
this.defaultAttachOpaqueData = options?.attachOpaqueData ?? null;
|
|
3305
3463
|
}
|
|
3464
|
+
static async fromIroh(endpoint, options = {}, clientOptions, connector) {
|
|
3465
|
+
if (!/^(iroh|httpi):\/\//.test(endpoint)) {
|
|
3466
|
+
throw new TypeError("VgiClient.fromIroh requires an iroh:// or httpi:// endpoint");
|
|
3467
|
+
}
|
|
3468
|
+
let selected = connector;
|
|
3469
|
+
if (!selected) {
|
|
3470
|
+
const rpc = await import("@query-farm/vgi-rpc");
|
|
3471
|
+
selected = endpoint.startsWith("iroh://") ? rpc.irohConnect : rpc.httpiConnect;
|
|
3472
|
+
}
|
|
3473
|
+
if (!selected)
|
|
3474
|
+
throw new TypeError("no Iroh connector is available in this runtime");
|
|
3475
|
+
return new VgiClient(await selected(endpoint, options), clientOptions);
|
|
3476
|
+
}
|
|
3306
3477
|
async _doBind(functionName, functionType, args, inputSchema, settings, secrets, transactionOpaqueData, attachOpaqueData = null, onBind) {
|
|
3307
3478
|
const request = {
|
|
3308
3479
|
function_name: functionName,
|
|
@@ -3382,7 +3553,7 @@ class VgiClient {
|
|
|
3382
3553
|
const inputIter = toAsyncIterator(opts.input);
|
|
3383
3554
|
const first = await inputIter.next();
|
|
3384
3555
|
if (first.done) {
|
|
3385
|
-
throw new VgiClientError(`scalarFunction(${opts.functionName}): input iterator yielded no batches;
|
|
3556
|
+
throw new VgiClientError(`scalarFunction(${opts.functionName}): input iterator yielded no batches; at least one batch is required to determine the input schema`);
|
|
3386
3557
|
}
|
|
3387
3558
|
const firstBatch = first.value;
|
|
3388
3559
|
const inputSchema = firstBatch.schema;
|
|
@@ -3406,7 +3577,7 @@ class VgiClient {
|
|
|
3406
3577
|
const inputIter = toAsyncIterator(opts.input);
|
|
3407
3578
|
const first = await inputIter.next();
|
|
3408
3579
|
if (first.done) {
|
|
3409
|
-
throw new VgiClientError(`scalarFunction(${opts.functionName}): input iterator yielded no batches;
|
|
3580
|
+
throw new VgiClientError(`scalarFunction(${opts.functionName}): input iterator yielded no batches; at least one batch is required to determine the input schema`);
|
|
3410
3581
|
}
|
|
3411
3582
|
const firstBatch = first.value;
|
|
3412
3583
|
const inputSchema = firstBatch.schema;
|
|
@@ -3431,7 +3602,7 @@ class VgiClient {
|
|
|
3431
3602
|
const inputIter = toAsyncIterator(opts.input);
|
|
3432
3603
|
const first = await inputIter.next();
|
|
3433
3604
|
if (first.done) {
|
|
3434
|
-
throw new VgiClientError(`tableInOutFunction(${opts.functionName}): input iterator yielded no batches;
|
|
3605
|
+
throw new VgiClientError(`tableInOutFunction(${opts.functionName}): input iterator yielded no batches; at least one batch is required to determine the input schema`);
|
|
3435
3606
|
}
|
|
3436
3607
|
const firstBatch = first.value;
|
|
3437
3608
|
const inputSchema = firstBatch.schema;
|
|
@@ -3479,7 +3650,7 @@ class VgiClient {
|
|
|
3479
3650
|
const inputIter = toAsyncIterator(opts.input);
|
|
3480
3651
|
const first = await inputIter.next();
|
|
3481
3652
|
if (first.done) {
|
|
3482
|
-
throw new VgiClientError(`tableInOutFunction(${opts.functionName}): input iterator yielded no batches;
|
|
3653
|
+
throw new VgiClientError(`tableInOutFunction(${opts.functionName}): input iterator yielded no batches; at least one batch is required to determine the input schema`);
|
|
3483
3654
|
}
|
|
3484
3655
|
const firstBatch = first.value;
|
|
3485
3656
|
const inputSchema = firstBatch.schema;
|
|
@@ -3564,18 +3735,20 @@ class VgiClient {
|
|
|
3564
3735
|
} else {
|
|
3565
3736
|
wireOptions = serializeAttachOptions(opts?.options);
|
|
3566
3737
|
}
|
|
3567
|
-
const
|
|
3738
|
+
const schema = schema2([
|
|
3568
3739
|
field2("name", utf82(), false),
|
|
3569
3740
|
field2("options", binary2(), true),
|
|
3570
3741
|
field2("data_version_spec", utf82(), true),
|
|
3571
|
-
field2("implementation_version", utf82(), true)
|
|
3742
|
+
field2("implementation_version", utf82(), true),
|
|
3743
|
+
field2("client_capabilities", binary2(), true)
|
|
3572
3744
|
]);
|
|
3573
3745
|
const innerBatch = batchFromColumns({
|
|
3574
3746
|
name: [name],
|
|
3575
3747
|
options: [wireOptions],
|
|
3576
3748
|
data_version_spec: [opts?.dataVersionSpec ?? null],
|
|
3577
|
-
implementation_version: [opts?.implementationVersion ?? null]
|
|
3578
|
-
|
|
3749
|
+
implementation_version: [opts?.implementationVersion ?? null],
|
|
3750
|
+
client_capabilities: [opts?.clientCapabilities ? encodeASD(ClientCapabilitiesSchema, opts.clientCapabilities) : null]
|
|
3751
|
+
}, schema);
|
|
3579
3752
|
const result = await this.rpc.call("catalog_attach", wrapRequest(innerBatch));
|
|
3580
3753
|
if (!result)
|
|
3581
3754
|
throw new VgiClientError("catalog_attach returned null");
|
|
@@ -3672,10 +3845,10 @@ class VgiClient {
|
|
|
3672
3845
|
const inner = unwrapResult(result);
|
|
3673
3846
|
return deserializeInfoList(inner.items, decodeSchemaInfo);
|
|
3674
3847
|
}
|
|
3675
|
-
async schemaGet(attachOpaqueData,
|
|
3848
|
+
async schemaGet(attachOpaqueData, path, transactionOpaqueData) {
|
|
3676
3849
|
const result = await this.rpc.call("catalog_schema_get", {
|
|
3677
3850
|
attach_opaque_data: attachOpaqueData,
|
|
3678
|
-
|
|
3851
|
+
path: normalizeSchemaPath(path),
|
|
3679
3852
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
3680
3853
|
});
|
|
3681
3854
|
if (!result)
|
|
@@ -3684,30 +3857,30 @@ class VgiClient {
|
|
|
3684
3857
|
const items = deserializeInfoList(inner.items, decodeSchemaInfo);
|
|
3685
3858
|
return items.length > 0 ? items[0] : null;
|
|
3686
3859
|
}
|
|
3687
|
-
async schemaCreate(attachOpaqueData,
|
|
3860
|
+
async schemaCreate(attachOpaqueData, path, opts) {
|
|
3688
3861
|
const tagsMap = opts?.tags ? new Map(Object.entries(opts.tags)) : null;
|
|
3689
3862
|
await this.rpc.call("catalog_schema_create", {
|
|
3690
3863
|
attach_opaque_data: attachOpaqueData,
|
|
3691
|
-
|
|
3864
|
+
path: normalizeSchemaPath(path),
|
|
3692
3865
|
on_conflict: opts?.onConflict ?? "error",
|
|
3693
3866
|
comment: opts?.comment ?? null,
|
|
3694
3867
|
tags: tagsMap,
|
|
3695
3868
|
transaction_opaque_data: opts?.transactionOpaqueData ?? null
|
|
3696
3869
|
});
|
|
3697
3870
|
}
|
|
3698
|
-
async schemaDrop(attachOpaqueData,
|
|
3871
|
+
async schemaDrop(attachOpaqueData, path, ignoreNotFound, cascade, transactionOpaqueData) {
|
|
3699
3872
|
await this.rpc.call("catalog_schema_drop", {
|
|
3700
3873
|
attach_opaque_data: attachOpaqueData,
|
|
3701
|
-
|
|
3874
|
+
path: normalizeSchemaPath(path),
|
|
3702
3875
|
ignore_not_found: ignoreNotFound ?? false,
|
|
3703
3876
|
cascade: cascade ?? false,
|
|
3704
3877
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
3705
3878
|
});
|
|
3706
3879
|
}
|
|
3707
|
-
async schemaContentsTables(attachOpaqueData,
|
|
3880
|
+
async schemaContentsTables(attachOpaqueData, path, transactionOpaqueData) {
|
|
3708
3881
|
const result = await this.rpc.call("catalog_schema_contents_tables", {
|
|
3709
3882
|
attach_opaque_data: attachOpaqueData,
|
|
3710
|
-
|
|
3883
|
+
path: normalizeSchemaPath(path),
|
|
3711
3884
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
3712
3885
|
});
|
|
3713
3886
|
if (!result)
|
|
@@ -3715,10 +3888,10 @@ class VgiClient {
|
|
|
3715
3888
|
const inner = unwrapResult(result);
|
|
3716
3889
|
return deserializeInfoList(inner.items, decodeTableInfo);
|
|
3717
3890
|
}
|
|
3718
|
-
async schemaContentsViews(attachOpaqueData,
|
|
3891
|
+
async schemaContentsViews(attachOpaqueData, path, transactionOpaqueData) {
|
|
3719
3892
|
const result = await this.rpc.call("catalog_schema_contents_views", {
|
|
3720
3893
|
attach_opaque_data: attachOpaqueData,
|
|
3721
|
-
|
|
3894
|
+
path: normalizeSchemaPath(path),
|
|
3722
3895
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
3723
3896
|
});
|
|
3724
3897
|
if (!result)
|
|
@@ -3726,10 +3899,10 @@ class VgiClient {
|
|
|
3726
3899
|
const inner = unwrapResult(result);
|
|
3727
3900
|
return deserializeInfoList(inner.items, decodeViewInfo);
|
|
3728
3901
|
}
|
|
3729
|
-
async schemaContentsFunctions(attachOpaqueData,
|
|
3902
|
+
async schemaContentsFunctions(attachOpaqueData, path, type, transactionOpaqueData) {
|
|
3730
3903
|
const result = await this.rpc.call("catalog_schema_contents_functions", {
|
|
3731
3904
|
attach_opaque_data: attachOpaqueData,
|
|
3732
|
-
|
|
3905
|
+
path: normalizeSchemaPath(path),
|
|
3733
3906
|
type,
|
|
3734
3907
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
3735
3908
|
});
|
|
@@ -3738,10 +3911,10 @@ class VgiClient {
|
|
|
3738
3911
|
const inner = unwrapResult(result);
|
|
3739
3912
|
return deserializeInfoList(inner.items, decodeFunctionInfo);
|
|
3740
3913
|
}
|
|
3741
|
-
async tableGet(attachOpaqueData,
|
|
3914
|
+
async tableGet(attachOpaqueData, schemaPath, name, transactionOpaqueData) {
|
|
3742
3915
|
const result = await this.rpc.call("catalog_table_get", {
|
|
3743
3916
|
attach_opaque_data: attachOpaqueData,
|
|
3744
|
-
|
|
3917
|
+
schema_path: normalizeSchemaPath(schemaPath),
|
|
3745
3918
|
name,
|
|
3746
3919
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
3747
3920
|
});
|
|
@@ -3751,10 +3924,10 @@ class VgiClient {
|
|
|
3751
3924
|
const items = deserializeInfoList(inner.items, decodeTableInfo);
|
|
3752
3925
|
return items.length > 0 ? items[0] : null;
|
|
3753
3926
|
}
|
|
3754
|
-
async tableCreate(attachOpaqueData,
|
|
3927
|
+
async tableCreate(attachOpaqueData, schemaPath, name, columns, onConflict, notNullConstraints, uniqueConstraints, checkConstraints, transactionOpaqueData) {
|
|
3755
3928
|
await this.rpc.call("catalog_table_create", {
|
|
3756
3929
|
attach_opaque_data: attachOpaqueData,
|
|
3757
|
-
|
|
3930
|
+
schema_path: normalizeSchemaPath(schemaPath),
|
|
3758
3931
|
name,
|
|
3759
3932
|
columns,
|
|
3760
3933
|
on_conflict: onConflict,
|
|
@@ -3764,20 +3937,20 @@ class VgiClient {
|
|
|
3764
3937
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
3765
3938
|
});
|
|
3766
3939
|
}
|
|
3767
|
-
async tableDrop(attachOpaqueData,
|
|
3940
|
+
async tableDrop(attachOpaqueData, schemaPath, name, ignoreNotFound, cascade, transactionOpaqueData) {
|
|
3768
3941
|
await this.rpc.call("catalog_table_drop", {
|
|
3769
3942
|
attach_opaque_data: attachOpaqueData,
|
|
3770
|
-
|
|
3943
|
+
schema_path: normalizeSchemaPath(schemaPath),
|
|
3771
3944
|
name,
|
|
3772
3945
|
ignore_not_found: ignoreNotFound ?? false,
|
|
3773
3946
|
cascade: cascade ?? false,
|
|
3774
3947
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
3775
3948
|
});
|
|
3776
3949
|
}
|
|
3777
|
-
async tableScanFunctionGet(attachOpaqueData,
|
|
3950
|
+
async tableScanFunctionGet(attachOpaqueData, schemaPath, name, atUnit, atValue, transactionOpaqueData) {
|
|
3778
3951
|
const result = await this.rpc.call("catalog_table_scan_function_get", {
|
|
3779
3952
|
attach_opaque_data: attachOpaqueData,
|
|
3780
|
-
|
|
3953
|
+
schema_path: normalizeSchemaPath(schemaPath),
|
|
3781
3954
|
name,
|
|
3782
3955
|
at_unit: atUnit ?? null,
|
|
3783
3956
|
at_value: atValue ?? null,
|
|
@@ -3787,30 +3960,30 @@ class VgiClient {
|
|
|
3787
3960
|
throw new VgiClientError("table_scan_function_get returned null");
|
|
3788
3961
|
return decodeScanFunctionResult(unwrapResult(result));
|
|
3789
3962
|
}
|
|
3790
|
-
async tableCommentSet(attachOpaqueData,
|
|
3963
|
+
async tableCommentSet(attachOpaqueData, schemaPath, name, comment, ignoreNotFound, transactionOpaqueData) {
|
|
3791
3964
|
await this.rpc.call("catalog_table_comment_set", {
|
|
3792
3965
|
attach_opaque_data: attachOpaqueData,
|
|
3793
|
-
|
|
3966
|
+
schema_path: normalizeSchemaPath(schemaPath),
|
|
3794
3967
|
name,
|
|
3795
3968
|
comment: comment ?? null,
|
|
3796
3969
|
ignore_not_found: ignoreNotFound ?? null,
|
|
3797
3970
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
3798
3971
|
});
|
|
3799
3972
|
}
|
|
3800
|
-
async tableRename(attachOpaqueData,
|
|
3973
|
+
async tableRename(attachOpaqueData, schemaPath, name, newName, ignoreNotFound, transactionOpaqueData) {
|
|
3801
3974
|
await this.rpc.call("catalog_table_rename", {
|
|
3802
3975
|
attach_opaque_data: attachOpaqueData,
|
|
3803
|
-
|
|
3976
|
+
schema_path: normalizeSchemaPath(schemaPath),
|
|
3804
3977
|
name,
|
|
3805
3978
|
new_name: newName,
|
|
3806
3979
|
ignore_not_found: ignoreNotFound ?? null,
|
|
3807
3980
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
3808
3981
|
});
|
|
3809
3982
|
}
|
|
3810
|
-
async tableColumnAdd(attachOpaqueData,
|
|
3983
|
+
async tableColumnAdd(attachOpaqueData, schemaPath, name, columnName, columnType, defaultValue, ignoreNotFound, transactionOpaqueData) {
|
|
3811
3984
|
await this.rpc.call("catalog_table_column_add", {
|
|
3812
3985
|
attach_opaque_data: attachOpaqueData,
|
|
3813
|
-
|
|
3986
|
+
schema_path: normalizeSchemaPath(schemaPath),
|
|
3814
3987
|
name,
|
|
3815
3988
|
column_name: columnName,
|
|
3816
3989
|
column_type: columnType,
|
|
@@ -3819,20 +3992,20 @@ class VgiClient {
|
|
|
3819
3992
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
3820
3993
|
});
|
|
3821
3994
|
}
|
|
3822
|
-
async tableColumnDrop(attachOpaqueData,
|
|
3995
|
+
async tableColumnDrop(attachOpaqueData, schemaPath, name, columnName, ignoreNotFound, transactionOpaqueData) {
|
|
3823
3996
|
await this.rpc.call("catalog_table_column_drop", {
|
|
3824
3997
|
attach_opaque_data: attachOpaqueData,
|
|
3825
|
-
|
|
3998
|
+
schema_path: normalizeSchemaPath(schemaPath),
|
|
3826
3999
|
name,
|
|
3827
4000
|
column_name: columnName,
|
|
3828
4001
|
ignore_not_found: ignoreNotFound ?? null,
|
|
3829
4002
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
3830
4003
|
});
|
|
3831
4004
|
}
|
|
3832
|
-
async tableColumnRename(attachOpaqueData,
|
|
4005
|
+
async tableColumnRename(attachOpaqueData, schemaPath, name, columnName, newName, ignoreNotFound, transactionOpaqueData) {
|
|
3833
4006
|
await this.rpc.call("catalog_table_column_rename", {
|
|
3834
4007
|
attach_opaque_data: attachOpaqueData,
|
|
3835
|
-
|
|
4008
|
+
schema_path: normalizeSchemaPath(schemaPath),
|
|
3836
4009
|
name,
|
|
3837
4010
|
column_name: columnName,
|
|
3838
4011
|
new_name: newName,
|
|
@@ -3840,10 +4013,10 @@ class VgiClient {
|
|
|
3840
4013
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
3841
4014
|
});
|
|
3842
4015
|
}
|
|
3843
|
-
async tableColumnDefaultSet(attachOpaqueData,
|
|
4016
|
+
async tableColumnDefaultSet(attachOpaqueData, schemaPath, name, columnName, defaultValue, ignoreNotFound, transactionOpaqueData) {
|
|
3844
4017
|
await this.rpc.call("catalog_table_column_default_set", {
|
|
3845
4018
|
attach_opaque_data: attachOpaqueData,
|
|
3846
|
-
|
|
4019
|
+
schema_path: normalizeSchemaPath(schemaPath),
|
|
3847
4020
|
name,
|
|
3848
4021
|
column_name: columnName,
|
|
3849
4022
|
default_value: defaultValue,
|
|
@@ -3851,20 +4024,20 @@ class VgiClient {
|
|
|
3851
4024
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
3852
4025
|
});
|
|
3853
4026
|
}
|
|
3854
|
-
async tableColumnDefaultDrop(attachOpaqueData,
|
|
4027
|
+
async tableColumnDefaultDrop(attachOpaqueData, schemaPath, name, columnName, ignoreNotFound, transactionOpaqueData) {
|
|
3855
4028
|
await this.rpc.call("catalog_table_column_default_drop", {
|
|
3856
4029
|
attach_opaque_data: attachOpaqueData,
|
|
3857
|
-
|
|
4030
|
+
schema_path: normalizeSchemaPath(schemaPath),
|
|
3858
4031
|
name,
|
|
3859
4032
|
column_name: columnName,
|
|
3860
4033
|
ignore_not_found: ignoreNotFound ?? null,
|
|
3861
4034
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
3862
4035
|
});
|
|
3863
4036
|
}
|
|
3864
|
-
async tableColumnTypeChange(attachOpaqueData,
|
|
4037
|
+
async tableColumnTypeChange(attachOpaqueData, schemaPath, name, columnDefinition, expression, ignoreNotFound, transactionOpaqueData) {
|
|
3865
4038
|
await this.rpc.call("catalog_table_column_type_change", {
|
|
3866
4039
|
attach_opaque_data: attachOpaqueData,
|
|
3867
|
-
|
|
4040
|
+
schema_path: normalizeSchemaPath(schemaPath),
|
|
3868
4041
|
name,
|
|
3869
4042
|
column_definition: columnDefinition,
|
|
3870
4043
|
expression: expression ?? null,
|
|
@@ -3872,30 +4045,30 @@ class VgiClient {
|
|
|
3872
4045
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
3873
4046
|
});
|
|
3874
4047
|
}
|
|
3875
|
-
async tableNotNullSet(attachOpaqueData,
|
|
4048
|
+
async tableNotNullSet(attachOpaqueData, schemaPath, name, columnName, ignoreNotFound, transactionOpaqueData) {
|
|
3876
4049
|
await this.rpc.call("catalog_table_not_null_set", {
|
|
3877
4050
|
attach_opaque_data: attachOpaqueData,
|
|
3878
|
-
|
|
4051
|
+
schema_path: normalizeSchemaPath(schemaPath),
|
|
3879
4052
|
name,
|
|
3880
4053
|
column_name: columnName,
|
|
3881
4054
|
ignore_not_found: ignoreNotFound ?? null,
|
|
3882
4055
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
3883
4056
|
});
|
|
3884
4057
|
}
|
|
3885
|
-
async tableNotNullDrop(attachOpaqueData,
|
|
4058
|
+
async tableNotNullDrop(attachOpaqueData, schemaPath, name, columnName, ignoreNotFound, transactionOpaqueData) {
|
|
3886
4059
|
await this.rpc.call("catalog_table_not_null_drop", {
|
|
3887
4060
|
attach_opaque_data: attachOpaqueData,
|
|
3888
|
-
|
|
4061
|
+
schema_path: normalizeSchemaPath(schemaPath),
|
|
3889
4062
|
name,
|
|
3890
4063
|
column_name: columnName,
|
|
3891
4064
|
ignore_not_found: ignoreNotFound ?? null,
|
|
3892
4065
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
3893
4066
|
});
|
|
3894
4067
|
}
|
|
3895
|
-
async viewGet(attachOpaqueData,
|
|
4068
|
+
async viewGet(attachOpaqueData, schemaPath, name, transactionOpaqueData) {
|
|
3896
4069
|
const result = await this.rpc.call("catalog_view_get", {
|
|
3897
4070
|
attach_opaque_data: attachOpaqueData,
|
|
3898
|
-
|
|
4071
|
+
schema_path: normalizeSchemaPath(schemaPath),
|
|
3899
4072
|
name,
|
|
3900
4073
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
3901
4074
|
});
|
|
@@ -3905,50 +4078,50 @@ class VgiClient {
|
|
|
3905
4078
|
const items = deserializeInfoList(inner.items, decodeViewInfo);
|
|
3906
4079
|
return items.length > 0 ? items[0] : null;
|
|
3907
4080
|
}
|
|
3908
|
-
async viewCreate(attachOpaqueData,
|
|
4081
|
+
async viewCreate(attachOpaqueData, schemaPath, name, definition, onConflict, transactionOpaqueData) {
|
|
3909
4082
|
await this.rpc.call("catalog_view_create", {
|
|
3910
4083
|
attach_opaque_data: attachOpaqueData,
|
|
3911
|
-
|
|
4084
|
+
schema_path: normalizeSchemaPath(schemaPath),
|
|
3912
4085
|
name,
|
|
3913
4086
|
definition,
|
|
3914
4087
|
on_conflict: onConflict,
|
|
3915
4088
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
3916
4089
|
});
|
|
3917
4090
|
}
|
|
3918
|
-
async viewDrop(attachOpaqueData,
|
|
4091
|
+
async viewDrop(attachOpaqueData, schemaPath, name, ignoreNotFound, cascade, transactionOpaqueData) {
|
|
3919
4092
|
await this.rpc.call("catalog_view_drop", {
|
|
3920
4093
|
attach_opaque_data: attachOpaqueData,
|
|
3921
|
-
|
|
4094
|
+
schema_path: normalizeSchemaPath(schemaPath),
|
|
3922
4095
|
name,
|
|
3923
4096
|
ignore_not_found: ignoreNotFound ?? false,
|
|
3924
4097
|
cascade: cascade ?? false,
|
|
3925
4098
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
3926
4099
|
});
|
|
3927
4100
|
}
|
|
3928
|
-
async viewRename(attachOpaqueData,
|
|
4101
|
+
async viewRename(attachOpaqueData, schemaPath, name, newName, ignoreNotFound, transactionOpaqueData) {
|
|
3929
4102
|
await this.rpc.call("catalog_view_rename", {
|
|
3930
4103
|
attach_opaque_data: attachOpaqueData,
|
|
3931
|
-
|
|
4104
|
+
schema_path: normalizeSchemaPath(schemaPath),
|
|
3932
4105
|
name,
|
|
3933
4106
|
new_name: newName,
|
|
3934
4107
|
ignore_not_found: ignoreNotFound ?? null,
|
|
3935
4108
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
3936
4109
|
});
|
|
3937
4110
|
}
|
|
3938
|
-
async viewCommentSet(attachOpaqueData,
|
|
4111
|
+
async viewCommentSet(attachOpaqueData, schemaPath, name, comment, ignoreNotFound, transactionOpaqueData) {
|
|
3939
4112
|
await this.rpc.call("catalog_view_comment_set", {
|
|
3940
4113
|
attach_opaque_data: attachOpaqueData,
|
|
3941
|
-
|
|
4114
|
+
schema_path: normalizeSchemaPath(schemaPath),
|
|
3942
4115
|
name,
|
|
3943
4116
|
comment: comment ?? null,
|
|
3944
4117
|
ignore_not_found: ignoreNotFound ?? null,
|
|
3945
4118
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
3946
4119
|
});
|
|
3947
4120
|
}
|
|
3948
|
-
async macroGet(attachOpaqueData,
|
|
4121
|
+
async macroGet(attachOpaqueData, schemaPath, name, transactionOpaqueData) {
|
|
3949
4122
|
const result = await this.rpc.call("catalog_macro_get", {
|
|
3950
4123
|
attach_opaque_data: attachOpaqueData,
|
|
3951
|
-
|
|
4124
|
+
schema_path: normalizeSchemaPath(schemaPath),
|
|
3952
4125
|
name,
|
|
3953
4126
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
3954
4127
|
});
|
|
@@ -3958,10 +4131,10 @@ class VgiClient {
|
|
|
3958
4131
|
const items = deserializeInfoList(inner.items, decodeMacroInfo);
|
|
3959
4132
|
return items.length > 0 ? items[0] : null;
|
|
3960
4133
|
}
|
|
3961
|
-
async schemaContentsMacros(attachOpaqueData,
|
|
4134
|
+
async schemaContentsMacros(attachOpaqueData, path, type, transactionOpaqueData) {
|
|
3962
4135
|
const result = await this.rpc.call("catalog_schema_contents_macros", {
|
|
3963
4136
|
attach_opaque_data: attachOpaqueData,
|
|
3964
|
-
|
|
4137
|
+
path: normalizeSchemaPath(path),
|
|
3965
4138
|
type,
|
|
3966
4139
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
3967
4140
|
});
|
|
@@ -3970,22 +4143,10 @@ class VgiClient {
|
|
|
3970
4143
|
const inner = unwrapResult(result);
|
|
3971
4144
|
return deserializeInfoList(inner.items, decodeMacroInfo);
|
|
3972
4145
|
}
|
|
3973
|
-
async macroCreate(attachOpaqueData,
|
|
3974
|
-
const schema3 = schema2([
|
|
3975
|
-
field2("attach_opaque_data", binary2(), false),
|
|
3976
|
-
field2("schema_name", utf82(), false),
|
|
3977
|
-
field2("name", utf82(), false),
|
|
3978
|
-
field2("macro_type", utf82(), false),
|
|
3979
|
-
field2("parameters", list2(field2("item", utf82(), false)), false),
|
|
3980
|
-
field2("definition", utf82(), false),
|
|
3981
|
-
field2("on_conflict", utf82(), false),
|
|
3982
|
-
field2("parameter_default_values", binary2(), true),
|
|
3983
|
-
field2("arguments_schema", binary2(), true),
|
|
3984
|
-
field2("transaction_opaque_data", binary2(), true)
|
|
3985
|
-
]);
|
|
4146
|
+
async macroCreate(attachOpaqueData, schemaPath, name, macroType, parameters, definition, onConflict, parameterDefaultValues, argumentsSchema, transactionOpaqueData) {
|
|
3986
4147
|
const innerBatch = batchFromColumns({
|
|
3987
4148
|
attach_opaque_data: [attachOpaqueData],
|
|
3988
|
-
|
|
4149
|
+
schema_path: [normalizeSchemaPath(schemaPath)],
|
|
3989
4150
|
name: [name],
|
|
3990
4151
|
macro_type: [macroType],
|
|
3991
4152
|
parameters: [parameters],
|
|
@@ -3994,13 +4155,13 @@ class VgiClient {
|
|
|
3994
4155
|
parameter_default_values: [parameterDefaultValues ?? null],
|
|
3995
4156
|
arguments_schema: [argumentsSchema ?? null],
|
|
3996
4157
|
transaction_opaque_data: [transactionOpaqueData ?? null]
|
|
3997
|
-
},
|
|
4158
|
+
}, MacroCreateRequestSchema);
|
|
3998
4159
|
await this.rpc.call("catalog_macro_create", wrapRequest(innerBatch));
|
|
3999
4160
|
}
|
|
4000
|
-
async macroDrop(attachOpaqueData,
|
|
4161
|
+
async macroDrop(attachOpaqueData, schemaPath, name, ignoreNotFound, transactionOpaqueData) {
|
|
4001
4162
|
await this.rpc.call("catalog_macro_drop", {
|
|
4002
4163
|
attach_opaque_data: attachOpaqueData,
|
|
4003
|
-
|
|
4164
|
+
schema_path: normalizeSchemaPath(schemaPath),
|
|
4004
4165
|
name,
|
|
4005
4166
|
ignore_not_found: ignoreNotFound ?? false,
|
|
4006
4167
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
@@ -4060,18 +4221,18 @@ function argumentSpecsToSchema(specs) {
|
|
|
4060
4221
|
if (spec.pattern !== undefined) {
|
|
4061
4222
|
metadata.set(VGI_PATTERN_KEY, spec.pattern);
|
|
4062
4223
|
}
|
|
4063
|
-
const
|
|
4064
|
-
fields.push(
|
|
4224
|
+
const field = field2(spec.name, spec.arrowType, true, metadata.size > 0 ? metadata : undefined);
|
|
4225
|
+
fields.push(field);
|
|
4065
4226
|
}
|
|
4066
4227
|
return schema2(fields);
|
|
4067
4228
|
}
|
|
4068
|
-
function schemaToArgumentSpecs(
|
|
4229
|
+
function schemaToArgumentSpecs(schema) {
|
|
4069
4230
|
const specs = [];
|
|
4070
4231
|
let positionIndex = 0;
|
|
4071
|
-
for (const
|
|
4072
|
-
const metadata =
|
|
4232
|
+
for (const field of schema.fields) {
|
|
4233
|
+
const metadata = field.metadata;
|
|
4073
4234
|
const isNamed = metadata.get(VGI_ARG_KEY) === VGI_ARG_NAMED;
|
|
4074
|
-
const position = isNamed ?
|
|
4235
|
+
const position = isNamed ? field.name : positionIndex++;
|
|
4075
4236
|
const vgiType = metadata.get(VGI_TYPE_KEY);
|
|
4076
4237
|
const isTableInput = vgiType === VGI_TYPE_TABLE;
|
|
4077
4238
|
const isAnyType = vgiType === VGI_TYPE_ANY;
|
|
@@ -4083,9 +4244,9 @@ function schemaToArgumentSpecs(schema3) {
|
|
|
4083
4244
|
const rangeNotation = metadata.get(VGI_RANGE_KEY);
|
|
4084
4245
|
const pattern = metadata.get(VGI_PATTERN_KEY);
|
|
4085
4246
|
specs.push({
|
|
4086
|
-
name:
|
|
4247
|
+
name: field.name,
|
|
4087
4248
|
position,
|
|
4088
|
-
arrowType:
|
|
4249
|
+
arrowType: field.type,
|
|
4089
4250
|
isTableInput,
|
|
4090
4251
|
isAnyType,
|
|
4091
4252
|
isVarargs,
|
|
@@ -4135,6 +4296,7 @@ function deserializeAttachOptionSpecs(specs) {
|
|
|
4135
4296
|
return Array.from(specs, deserializeAttachOptionSpec);
|
|
4136
4297
|
}
|
|
4137
4298
|
export {
|
|
4299
|
+
ArgumentMonotonicity,
|
|
4138
4300
|
ArgumentValidationError,
|
|
4139
4301
|
Arguments,
|
|
4140
4302
|
CatalogAlreadyExistsError,
|
|
@@ -4185,4 +4347,4 @@ export {
|
|
|
4185
4347
|
typeSignature
|
|
4186
4348
|
};
|
|
4187
4349
|
|
|
4188
|
-
//# debugId=
|
|
4350
|
+
//# debugId=D11759D49AEAE35964756E2164756E21
|