@query-farm/vgi 0.46.0 → 0.47.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 +11 -5
- package/dist/arrow/impl-arrowjs/index.d.ts +1 -1
- package/dist/arrow/impl-arrowjs/iterate.d.ts +2 -0
- package/dist/arrow/impl-flechette/index.d.ts +1 -1
- package/dist/arrow/impl-flechette/iterate.d.ts +2 -0
- package/dist/arrow/index.d.ts +1 -1
- package/dist/catalog/column-expressions.d.ts +8 -0
- package/dist/catalog/column-metadata.d.ts +11 -0
- package/dist/catalog/composite.d.ts +2 -1
- package/dist/catalog/constraints.d.ts +74 -0
- package/dist/catalog/descriptors.d.ts +21 -29
- package/dist/catalog/interface.d.ts +15 -20
- package/dist/catalog/macro-overloads.d.ts +4 -0
- package/dist/catalog/read-only.d.ts +7 -1
- package/dist/catalog/unconstrained-columns.d.ts +2 -0
- package/dist/client/client.d.ts +18 -13
- package/dist/client-entry.js +753 -103
- package/dist/client-entry.js.map +16 -14
- package/dist/functions/projection.d.ts +18 -0
- package/dist/functions/table.d.ts +6 -1
- package/dist/functions/types.d.ts +1 -0
- package/dist/generated/vgi-client.d.ts +177 -36
- package/dist/generated/vgi-protocol-schemas.d.ts +51 -1
- package/dist/generated/vgi-protocol-types.d.ts +317 -3
- package/dist/generated/vgi-service.d.ts +266 -29
- package/dist/index.core.d.ts +3 -1
- package/dist/index.js +1630 -240
- package/dist/index.js.map +41 -34
- package/dist/protocol/dispatch.d.ts +9 -9
- package/dist/protocol/handlers/aggregate.d.ts +1 -1
- package/dist/protocol/handlers/catalog/index.d.ts +1 -1
- package/dist/protocol/handlers/catalog/metadata.d.ts +1 -0
- package/dist/protocol/handlers/function.d.ts +1 -1
- package/dist/protocol/handlers/table-buffering.d.ts +1 -1
- package/dist/protocol/handlers/unimplemented.d.ts +1 -1
- package/dist/protocol/serializers/bind.d.ts +5 -1
- package/dist/protocol/types.d.ts +5 -0
- package/dist/rpc-server.d.ts +6 -6
- package/dist/serve-entry.js +1613 -447
- package/dist/serve-entry.js.map +32 -26
- package/dist/util/arrow/index.d.ts +1 -1
- package/dist/worker-cf-entry.d.ts +2 -2
- package/dist/worker-cf-entry.js +1943 -572
- package/dist/worker-cf-entry.js.map +41 -34
- package/dist/worker.d.ts +1 -1
- package/package.json +5 -4
- package/src/arrow/impl-arrowjs/index.ts +1 -1
- package/src/arrow/impl-arrowjs/iterate.ts +9 -1
- package/src/arrow/impl-arrowjs/project.ts +1 -1
- package/src/arrow/impl-flechette/index.ts +1 -1
- package/src/arrow/impl-flechette/ipc.ts +12 -0
- package/src/arrow/impl-flechette/iterate.ts +5 -0
- package/src/arrow/impl-flechette/project.ts +6 -8
- package/src/arrow/index.ts +1 -1
- package/src/catalog/column-expressions.ts +224 -0
- package/src/catalog/column-metadata.ts +151 -0
- package/src/catalog/composite.ts +5 -1
- package/src/catalog/constraints.ts +207 -0
- package/src/catalog/contents-codec.ts +6 -1
- package/src/catalog/descriptors.ts +21 -29
- package/src/catalog/interface.ts +70 -55
- package/src/catalog/macro-overloads.ts +44 -0
- package/src/catalog/read-only.ts +92 -71
- package/src/catalog/unconstrained-columns.ts +23 -0
- package/src/client/client.ts +100 -58
- package/src/codec/asd.ts +3 -1
- package/src/functions/projection.ts +207 -0
- package/src/functions/table.ts +10 -0
- package/src/functions/types.ts +1 -0
- package/src/generated/vgi-client.ts +199 -37
- package/src/generated/vgi-protocol-schemas.ts +455 -41
- package/src/generated/vgi-protocol-types.ts +879 -5
- package/src/generated/vgi-service.ts +514 -42
- package/src/http/client-bundle.ts +1 -1
- package/src/http/fetch.ts +1 -1
- package/src/index.core.ts +5 -0
- package/src/protocol/dispatch.ts +9 -9
- package/src/protocol/handlers/aggregate.ts +1 -1
- package/src/protocol/handlers/catalog/admin.ts +27 -6
- package/src/protocol/handlers/catalog/index.ts +2 -2
- package/src/protocol/handlers/catalog/macro.ts +6 -5
- package/src/protocol/handlers/catalog/metadata.ts +16 -0
- package/src/protocol/handlers/catalog/table.ts +72 -26
- package/src/protocol/handlers/catalog/view.ts +24 -3
- package/src/protocol/handlers/function.ts +67 -1
- package/src/protocol/handlers/table-buffering.ts +1 -1
- package/src/protocol/handlers/unimplemented.ts +6 -6
- package/src/protocol/serializers/bind.ts +17 -1
- package/src/protocol/types.ts +6 -0
- package/src/rpc-server.ts +9 -9
- package/src/util/arrow/index.ts +1 -1
- package/src/worker-cf-entry.ts +6 -0
- package/src/worker.ts +1 -1
package/dist/client-entry.js
CHANGED
|
@@ -37,6 +37,7 @@ __export(exports_impl_arrowjs, {
|
|
|
37
37
|
decimal128: () => decimal128,
|
|
38
38
|
decimal256: () => decimal256,
|
|
39
39
|
decodeDictValue: () => decodeDictValue,
|
|
40
|
+
decodeMapValue: () => decodeMapValue,
|
|
40
41
|
denseUnion: () => denseUnion,
|
|
41
42
|
deserializeBatch: () => deserializeBatch,
|
|
42
43
|
deserializeBatches: () => deserializeBatches,
|
|
@@ -1517,6 +1518,7 @@ function batchFromColumns(columns, schema, repr = "rich") {
|
|
|
1517
1518
|
return new RecordBatch2(a, data);
|
|
1518
1519
|
}
|
|
1519
1520
|
// src/arrow/impl-arrowjs/iterate.ts
|
|
1521
|
+
import { makeVector } from "@query-farm/apache-arrow";
|
|
1520
1522
|
function* iterRows(batch, repr = "rich") {
|
|
1521
1523
|
const a = batch;
|
|
1522
1524
|
const codecs = a.schema.fields.map((f) => codecFor(f.type));
|
|
@@ -1615,6 +1617,12 @@ function safeNumber(value) {
|
|
|
1615
1617
|
}
|
|
1616
1618
|
return value;
|
|
1617
1619
|
}
|
|
1620
|
+
function decodeMapValue(value, index = 0) {
|
|
1621
|
+
if (value?.type?.typeId === 17 && value.valueOffsets && value.children) {
|
|
1622
|
+
return readCanonicalValue(value.type, makeVector(value), index);
|
|
1623
|
+
}
|
|
1624
|
+
return value;
|
|
1625
|
+
}
|
|
1618
1626
|
// src/arrow/impl-arrowjs/filter.ts
|
|
1619
1627
|
function filterBatch(batch, mask) {
|
|
1620
1628
|
const a = batch;
|
|
@@ -1644,7 +1652,7 @@ function filterBatch(batch, mask) {
|
|
|
1644
1652
|
}
|
|
1645
1653
|
// src/arrow/impl-arrowjs/project.ts
|
|
1646
1654
|
import {
|
|
1647
|
-
RecordBatch as
|
|
1655
|
+
RecordBatch as RecordBatch4,
|
|
1648
1656
|
Schema as Schema3,
|
|
1649
1657
|
Struct as Struct4,
|
|
1650
1658
|
makeData as makeData4
|
|
@@ -1667,7 +1675,7 @@ function projectSchema(projectionIds, schema) {
|
|
|
1667
1675
|
const validIds = validateProjectionIds("projectSchema", projectionIds, a.fields.length);
|
|
1668
1676
|
if (validIds.length === 0)
|
|
1669
1677
|
return a;
|
|
1670
|
-
return new Schema3(validIds.map((i) => a.fields[i]));
|
|
1678
|
+
return new Schema3(validIds.map((i) => a.fields[i]), a.metadata);
|
|
1671
1679
|
}
|
|
1672
1680
|
function projectBatch(projectionIds, batch) {
|
|
1673
1681
|
const a = batch;
|
|
@@ -1688,13 +1696,13 @@ function projectBatch(projectionIds, batch) {
|
|
|
1688
1696
|
children,
|
|
1689
1697
|
nullCount: 0
|
|
1690
1698
|
});
|
|
1691
|
-
return new
|
|
1699
|
+
return new RecordBatch4(projectedSchema, data);
|
|
1692
1700
|
}
|
|
1693
1701
|
// src/arrow/impl-arrowjs/metadata.ts
|
|
1694
|
-
import { RecordBatch as
|
|
1702
|
+
import { RecordBatch as RecordBatch5 } from "@query-farm/apache-arrow";
|
|
1695
1703
|
function withBatchMetadata(batch, metadata) {
|
|
1696
1704
|
const a = batch;
|
|
1697
|
-
return new
|
|
1705
|
+
return new RecordBatch5(a.schema, a.data, metadata);
|
|
1698
1706
|
}
|
|
1699
1707
|
// src/arrow/impl-arrowjs/ipc.ts
|
|
1700
1708
|
import {
|
|
@@ -1758,7 +1766,7 @@ import {
|
|
|
1758
1766
|
Field as Field3,
|
|
1759
1767
|
Null,
|
|
1760
1768
|
makeData as makeData5,
|
|
1761
|
-
RecordBatch as
|
|
1769
|
+
RecordBatch as RecordBatch7,
|
|
1762
1770
|
Struct as Struct5,
|
|
1763
1771
|
SparseUnion,
|
|
1764
1772
|
Schema as Schema5,
|
|
@@ -1870,7 +1878,7 @@ function assemble(columnNames, minData, maxData, hasNull, hasNotNull, distinctCo
|
|
|
1870
1878
|
];
|
|
1871
1879
|
const structType = new Struct5(schema.fields);
|
|
1872
1880
|
const data = makeData5({ type: structType, length: n, children, nullCount: 0 });
|
|
1873
|
-
return new
|
|
1881
|
+
return new RecordBatch7(schema, data);
|
|
1874
1882
|
}
|
|
1875
1883
|
|
|
1876
1884
|
// src/arrow/impl-arrowjs/index.ts
|
|
@@ -2293,6 +2301,11 @@ function serializeBindRequest(req) {
|
|
|
2293
2301
|
argument_names: req.argument_names ?? null
|
|
2294
2302
|
});
|
|
2295
2303
|
}
|
|
2304
|
+
function parseBindRepeatability(value) {
|
|
2305
|
+
if (value !== "UNKNOWN" && value !== "STABLE_WITHIN_QUERY")
|
|
2306
|
+
throw new Error("invalid bind repeatability");
|
|
2307
|
+
return value;
|
|
2308
|
+
}
|
|
2296
2309
|
function deserializeBindResponse(params) {
|
|
2297
2310
|
const toStrArray = (val) => {
|
|
2298
2311
|
if (!val)
|
|
@@ -2302,10 +2315,12 @@ function deserializeBindResponse(params) {
|
|
|
2302
2315
|
};
|
|
2303
2316
|
return {
|
|
2304
2317
|
output_schema: deserializeSchema(toUint8Array2(params.output_schema)),
|
|
2318
|
+
projection_expression_profiles: toStrArray(params.projection_expression_profiles),
|
|
2305
2319
|
opaque_data: params.opaque_data ? toUint8Array2(params.opaque_data) : null,
|
|
2306
2320
|
lookup_secret_types: toStrArray(params.lookup_secret_types),
|
|
2307
2321
|
lookup_scopes: toStrArray(params.lookup_scopes),
|
|
2308
|
-
lookup_names: toStrArray(params.lookup_names)
|
|
2322
|
+
lookup_names: toStrArray(params.lookup_names),
|
|
2323
|
+
repeatability: parseBindRepeatability(params.repeatability)
|
|
2309
2324
|
};
|
|
2310
2325
|
}
|
|
2311
2326
|
// src/protocol/serializers/init.ts
|
|
@@ -2543,7 +2558,12 @@ function normalizeValue(raw, type) {
|
|
|
2543
2558
|
const valueType = entries.children[1].type;
|
|
2544
2559
|
const out = {};
|
|
2545
2560
|
const put = (k, v) => {
|
|
2546
|
-
out
|
|
2561
|
+
Object.defineProperty(out, String(k), {
|
|
2562
|
+
value: normalizeValue(v, valueType),
|
|
2563
|
+
enumerable: true,
|
|
2564
|
+
writable: true,
|
|
2565
|
+
configurable: true
|
|
2566
|
+
});
|
|
2547
2567
|
};
|
|
2548
2568
|
if (raw[Symbol.iterator]) {
|
|
2549
2569
|
for (const entry of raw) {
|
|
@@ -2640,7 +2660,8 @@ var SchemaInfoSchema = schema2([
|
|
|
2640
2660
|
field2("comment", utf82(), true),
|
|
2641
2661
|
field2("tags", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), false),
|
|
2642
2662
|
field2("path", list2(field2("item", utf82(), true)), false),
|
|
2643
|
-
field2("estimated_object_count", map2(field2("key", utf82(), false), field2("value", int642(), true), false), true)
|
|
2663
|
+
field2("estimated_object_count", map2(field2("key", utf82(), false), field2("value", int642(), true), false), true),
|
|
2664
|
+
field2("options", binary2(), true)
|
|
2644
2665
|
]);
|
|
2645
2666
|
var TableInfoSchema = schema2([
|
|
2646
2667
|
field2("comment", utf82(), true),
|
|
@@ -2648,11 +2669,8 @@ var TableInfoSchema = schema2([
|
|
|
2648
2669
|
field2("name", utf82(), false),
|
|
2649
2670
|
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2650
2671
|
field2("columns", binary2(), false),
|
|
2651
|
-
field2("
|
|
2652
|
-
field2("
|
|
2653
|
-
field2("check_constraints", list2(field2("item", utf82(), true)), false),
|
|
2654
|
-
field2("primary_key_constraints", list2(field2("item", list2(field2("item", int322(), true)), true)), false),
|
|
2655
|
-
field2("foreign_key_constraints", list2(field2("item", binary2(), true)), false),
|
|
2672
|
+
field2("constraints", list2(field2("item", binary2(), true)), false),
|
|
2673
|
+
field2("definition_revision", binary2(), true),
|
|
2656
2674
|
field2("write_result_modes", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), false),
|
|
2657
2675
|
field2("supports_column_statistics", bool2(), false),
|
|
2658
2676
|
field2("scan_function", binary2(), true),
|
|
@@ -2663,7 +2681,9 @@ var TableInfoSchema = schema2([
|
|
|
2663
2681
|
field2("cardinality_max", int642(), true),
|
|
2664
2682
|
field2("column_statistics", binary2(), true),
|
|
2665
2683
|
field2("bind_result", binary2(), true),
|
|
2666
|
-
field2("required_filters", list2(field2("item", list2(field2("item", utf82(), true)), true)), false)
|
|
2684
|
+
field2("required_filters", list2(field2("item", list2(field2("item", list2(field2("item", utf82(), true)), true)), true)), false),
|
|
2685
|
+
field2("options", binary2(), true),
|
|
2686
|
+
field2("layout", binary2(), true)
|
|
2667
2687
|
]);
|
|
2668
2688
|
var ViewInfoSchema = schema2([
|
|
2669
2689
|
field2("comment", utf82(), true),
|
|
@@ -2671,7 +2691,9 @@ var ViewInfoSchema = schema2([
|
|
|
2671
2691
|
field2("name", utf82(), false),
|
|
2672
2692
|
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2673
2693
|
field2("definition", utf82(), false),
|
|
2674
|
-
field2("column_comments", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), false)
|
|
2694
|
+
field2("column_comments", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), false),
|
|
2695
|
+
field2("aliases", list2(field2("item", utf82(), true)), false),
|
|
2696
|
+
field2("security", utf82(), false)
|
|
2675
2697
|
]);
|
|
2676
2698
|
var FunctionInfoSchema = schema2([
|
|
2677
2699
|
field2("comment", utf82(), true),
|
|
@@ -2723,21 +2745,15 @@ var MacroInfoSchema = schema2([
|
|
|
2723
2745
|
field2("name", utf82(), false),
|
|
2724
2746
|
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2725
2747
|
field2("macro_type", dictionary2(utf82(), int162()), false),
|
|
2726
|
-
field2("parameters", list2(field2("item", utf82(), true)), false),
|
|
2727
|
-
field2("parameter_default_values", binary2(), true),
|
|
2728
|
-
field2("definition", utf82(), false),
|
|
2729
|
-
field2("arguments_schema", binary2(), true)
|
|
2748
|
+
field2("overloads", list2(field2("item", struct2([field2("parameters", list2(field2("item", struct2([field2("name", utf82(), false), field2("declared_type", binary2(), true), field2("default_value", binary2(), true), field2("default_expression", binary2(), true), field2("documentation", utf82(), true)]), true)), false), field2("definition", utf82(), false), field2("profile", utf82(), false), field2("schema_path", list2(field2("item", utf82(), true)), false), field2("macro_type", utf82(), false), field2("evaluation_context", struct2([field2("timezone", utf82(), false), field2("collation", utf82(), false), field2("default_order", utf82(), false), field2("default_null_order", utf82(), false), field2("preserve_insertion_order", bool2(), false)]), false)]), true)), false)
|
|
2730
2749
|
]);
|
|
2731
2750
|
var IndexInfoSchema = schema2([
|
|
2732
2751
|
field2("comment", utf82(), true),
|
|
2733
2752
|
field2("tags", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), false),
|
|
2734
2753
|
field2("name", utf82(), false),
|
|
2735
2754
|
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2736
|
-
field2("
|
|
2737
|
-
field2("
|
|
2738
|
-
field2("constraint_type", dictionary2(utf82(), int162()), false),
|
|
2739
|
-
field2("expressions", list2(field2("item", utf82(), true)), false),
|
|
2740
|
-
field2("options", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), false)
|
|
2755
|
+
field2("definition", binary2(), false),
|
|
2756
|
+
field2("options", binary2(), false)
|
|
2741
2757
|
]);
|
|
2742
2758
|
var CopyFromFormatInfoSchema = schema2([
|
|
2743
2759
|
field2("comment", utf82(), true),
|
|
@@ -2749,6 +2765,207 @@ var CopyFromFormatInfoSchema = schema2([
|
|
|
2749
2765
|
field2("description", utf82(), false),
|
|
2750
2766
|
field2("ordered", bool2(), false)
|
|
2751
2767
|
]);
|
|
2768
|
+
var MacroParameterSchema = schema2([
|
|
2769
|
+
field2("name", utf82(), false),
|
|
2770
|
+
field2("declared_type", binary2(), true),
|
|
2771
|
+
field2("default_value", binary2(), true),
|
|
2772
|
+
field2("default_expression", binary2(), true),
|
|
2773
|
+
field2("documentation", utf82(), true)
|
|
2774
|
+
]);
|
|
2775
|
+
var MacroOverloadSchema = schema2([
|
|
2776
|
+
field2("parameters", list2(field2("item", struct2([field2("name", utf82(), false), field2("declared_type", binary2(), true), field2("default_value", binary2(), true), field2("default_expression", binary2(), true), field2("documentation", utf82(), true)]), true)), false),
|
|
2777
|
+
field2("definition", utf82(), false),
|
|
2778
|
+
field2("profile", utf82(), false),
|
|
2779
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2780
|
+
field2("macro_type", utf82(), false),
|
|
2781
|
+
field2("evaluation_context", struct2([field2("timezone", utf82(), false), field2("collation", utf82(), false), field2("default_order", utf82(), false), field2("default_null_order", utf82(), false), field2("preserve_insertion_order", bool2(), false)]), false)
|
|
2782
|
+
]);
|
|
2783
|
+
var ClientQueryCapabilitiesSchema = schema2([
|
|
2784
|
+
field2("encodings", list2(field2("item", utf82(), true)), false),
|
|
2785
|
+
field2("semantic_profiles", list2(field2("item", utf82(), true)), false),
|
|
2786
|
+
field2("engine_version", utf82(), false),
|
|
2787
|
+
field2("max_query_bytes", int642(), false)
|
|
2788
|
+
]);
|
|
2789
|
+
var QueryCapabilitiesSchema = schema2([
|
|
2790
|
+
field2("encoding", utf82(), false),
|
|
2791
|
+
field2("semantic_profiles", list2(field2("item", utf82(), true)), false),
|
|
2792
|
+
field2("execution_modes", list2(field2("item", utf82(), true)), false),
|
|
2793
|
+
field2("backend_engine", utf82(), false),
|
|
2794
|
+
field2("backend_version", utf82(), false),
|
|
2795
|
+
field2("capability_revision", utf82(), false),
|
|
2796
|
+
field2("default_evaluation_context", struct2([field2("timezone", utf82(), false), field2("collation", utf82(), false), field2("default_order", utf82(), false), field2("default_null_order", utf82(), false), field2("preserve_insertion_order", bool2(), false)]), false),
|
|
2797
|
+
field2("max_query_bytes", int642(), false)
|
|
2798
|
+
]);
|
|
2799
|
+
var QueryEvaluationContextSchema = schema2([
|
|
2800
|
+
field2("timezone", utf82(), false),
|
|
2801
|
+
field2("collation", utf82(), false),
|
|
2802
|
+
field2("default_order", utf82(), false),
|
|
2803
|
+
field2("default_null_order", utf82(), false),
|
|
2804
|
+
field2("preserve_insertion_order", bool2(), false)
|
|
2805
|
+
]);
|
|
2806
|
+
var QueryObjectReferenceSchema = schema2([
|
|
2807
|
+
field2("object", struct2([field2("kind", utf82(), false), field2("schema_path", list2(field2("item", utf82(), true)), false), field2("name", utf82(), false), field2("owner_table", utf82(), true)]), false),
|
|
2808
|
+
field2("expected_schema", binary2(), false)
|
|
2809
|
+
]);
|
|
2810
|
+
var CatalogQueryPrepareRequestSchema = schema2([
|
|
2811
|
+
field2("attach_opaque_data", binary2(), false),
|
|
2812
|
+
field2("encoding", utf82(), false),
|
|
2813
|
+
field2("semantic_profile", utf82(), false),
|
|
2814
|
+
field2("mode", utf82(), false),
|
|
2815
|
+
field2("capability_revision", utf82(), false),
|
|
2816
|
+
field2("query", utf82(), false),
|
|
2817
|
+
field2("parameter_schema", binary2(), false),
|
|
2818
|
+
field2("evaluation_context", struct2([field2("timezone", utf82(), false), field2("collation", utf82(), false), field2("default_order", utf82(), false), field2("default_null_order", utf82(), false), field2("preserve_insertion_order", bool2(), false)]), false),
|
|
2819
|
+
field2("transaction_opaque_data", binary2(), true),
|
|
2820
|
+
field2("catalog_version", int642(), true),
|
|
2821
|
+
field2("catalog_etag", utf82(), true),
|
|
2822
|
+
field2("referenced_objects", list2(field2("item", struct2([field2("object", struct2([field2("kind", utf82(), false), field2("schema_path", list2(field2("item", utf82(), true)), false), field2("name", utf82(), false), field2("owner_table", utf82(), true)]), false), field2("expected_schema", binary2(), false)]), true)), false),
|
|
2823
|
+
field2("expected_output_schema", binary2(), true),
|
|
2824
|
+
field2("required_ordering", utf82(), false)
|
|
2825
|
+
]);
|
|
2826
|
+
var CatalogQueryPrepareResultSchema = schema2([
|
|
2827
|
+
field2("status", utf82(), false),
|
|
2828
|
+
field2("reason_code", utf82(), true),
|
|
2829
|
+
field2("reason_detail", utf82(), true),
|
|
2830
|
+
field2("prepared_query_token", binary2(), true),
|
|
2831
|
+
field2("output_schema", binary2(), true),
|
|
2832
|
+
field2("result_ordering", utf82(), true),
|
|
2833
|
+
field2("validated_catalog_version", int642(), true),
|
|
2834
|
+
field2("validated_catalog_etag", utf82(), true),
|
|
2835
|
+
field2("context_digest", binary2(), true),
|
|
2836
|
+
field2("expires_at_epoch_ms", int642(), true),
|
|
2837
|
+
field2("estimated_rows", int642(), true),
|
|
2838
|
+
field2("estimated_bytes", int642(), true)
|
|
2839
|
+
]);
|
|
2840
|
+
var CatalogCapabilitiesSchema = schema2([
|
|
2841
|
+
field2("read", list2(field2("item", utf82(), true)), false),
|
|
2842
|
+
field2("ddl", list2(field2("item", utf82(), true)), false),
|
|
2843
|
+
field2("write", list2(field2("item", utf82(), true)), false),
|
|
2844
|
+
field2("transaction", list2(field2("item", utf82(), true)), false)
|
|
2845
|
+
]);
|
|
2846
|
+
var CatalogMetadataChangesSchema = schema2([
|
|
2847
|
+
field2("set_comment", bool2(), false),
|
|
2848
|
+
field2("comment", utf82(), true),
|
|
2849
|
+
field2("set_tags", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), false),
|
|
2850
|
+
field2("remove_tags", list2(field2("item", utf82(), true)), false)
|
|
2851
|
+
]);
|
|
2852
|
+
var CatalogObjectRefSchema = schema2([
|
|
2853
|
+
field2("kind", utf82(), false),
|
|
2854
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2855
|
+
field2("name", utf82(), false),
|
|
2856
|
+
field2("owner_table", utf82(), true)
|
|
2857
|
+
]);
|
|
2858
|
+
var ObjectDependencySchema = schema2([
|
|
2859
|
+
field2("dependent", binary2(), false),
|
|
2860
|
+
field2("subject", binary2(), false),
|
|
2861
|
+
field2("blocks_alter", bool2(), false),
|
|
2862
|
+
field2("kind", utf82(), false),
|
|
2863
|
+
field2("subject_column_paths", list2(field2("item", list2(field2("item", utf82(), true)), true)), true),
|
|
2864
|
+
field2("dependent_column_path", list2(field2("item", utf82(), true)), true)
|
|
2865
|
+
]);
|
|
2866
|
+
var DependencySnapshotSchema = schema2([
|
|
2867
|
+
field2("catalog_version", int642(), false),
|
|
2868
|
+
field2("objects", list2(field2("item", binary2(), true)), false),
|
|
2869
|
+
field2("dependencies", list2(field2("item", binary2(), true)), false)
|
|
2870
|
+
]);
|
|
2871
|
+
var OptionDefinitionsSchema = schema2([
|
|
2872
|
+
field2("schema", binary2(), false),
|
|
2873
|
+
field2("defaults", binary2(), false),
|
|
2874
|
+
field2("create_names", list2(field2("item", utf82(), true)), false),
|
|
2875
|
+
field2("alter_names", list2(field2("item", utf82(), true)), false)
|
|
2876
|
+
]);
|
|
2877
|
+
var SqlExpressionSchema = schema2([
|
|
2878
|
+
field2("sql", utf82(), false),
|
|
2879
|
+
field2("profile", utf82(), false),
|
|
2880
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2881
|
+
field2("evaluation_context", struct2([field2("timezone", utf82(), false), field2("collation", utf82(), false), field2("default_order", utf82(), false), field2("default_null_order", utf82(), false), field2("preserve_insertion_order", bool2(), false)]), false)
|
|
2882
|
+
]);
|
|
2883
|
+
var SqlStatementSchema = schema2([
|
|
2884
|
+
field2("sql", utf82(), false),
|
|
2885
|
+
field2("profile", utf82(), false),
|
|
2886
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2887
|
+
field2("evaluation_context", struct2([field2("timezone", utf82(), false), field2("collation", utf82(), false), field2("default_order", utf82(), false), field2("default_null_order", utf82(), false), field2("preserve_insertion_order", bool2(), false)]), false)
|
|
2888
|
+
]);
|
|
2889
|
+
var ForeignKeyDefinitionSchema = schema2([
|
|
2890
|
+
field2("referenced_table", binary2(), false),
|
|
2891
|
+
field2("referenced_column_paths", list2(field2("item", list2(field2("item", utf82(), true)), true)), false),
|
|
2892
|
+
field2("match", dictionary2(utf82(), int162()), false),
|
|
2893
|
+
field2("on_update", dictionary2(utf82(), int162()), false),
|
|
2894
|
+
field2("on_delete", dictionary2(utf82(), int162()), false)
|
|
2895
|
+
]);
|
|
2896
|
+
var ConstraintDefinitionSchema = schema2([
|
|
2897
|
+
field2("kind", dictionary2(utf82(), int162()), false),
|
|
2898
|
+
field2("column_paths", list2(field2("item", list2(field2("item", utf82(), true)), true)), false),
|
|
2899
|
+
field2("declared_name", utf82(), true),
|
|
2900
|
+
field2("check_expression", binary2(), true),
|
|
2901
|
+
field2("foreign_key", binary2(), true)
|
|
2902
|
+
]);
|
|
2903
|
+
var ConstraintInfoSchema = schema2([
|
|
2904
|
+
field2("ref", binary2(), false),
|
|
2905
|
+
field2("definition", binary2(), false),
|
|
2906
|
+
field2("enforcement", dictionary2(utf82(), int162()), false),
|
|
2907
|
+
field2("validation", dictionary2(utf82(), int162()), false),
|
|
2908
|
+
field2("referenced_constraint", binary2(), true)
|
|
2909
|
+
]);
|
|
2910
|
+
var ConstraintChangeSchema = schema2([
|
|
2911
|
+
field2("operation", dictionary2(utf82(), int162()), false),
|
|
2912
|
+
field2("ref", binary2(), true),
|
|
2913
|
+
field2("definition", binary2(), true),
|
|
2914
|
+
field2("enforcement", dictionary2(utf82(), int162()), true),
|
|
2915
|
+
field2("validation", dictionary2(utf82(), int162()), true),
|
|
2916
|
+
field2("cascade", bool2(), true),
|
|
2917
|
+
field2("declared_name", utf82(), true)
|
|
2918
|
+
]);
|
|
2919
|
+
var ConstraintSnapshotSchema = schema2([
|
|
2920
|
+
field2("table", binary2(), false),
|
|
2921
|
+
field2("definition_revision", binary2(), false),
|
|
2922
|
+
field2("constraints", list2(field2("item", binary2(), true)), false)
|
|
2923
|
+
]);
|
|
2924
|
+
var ConstraintsApplyRequestSchema = schema2([
|
|
2925
|
+
field2("attach_opaque_data", binary2(), false),
|
|
2926
|
+
field2("table", binary2(), false),
|
|
2927
|
+
field2("expected_revision", binary2(), false),
|
|
2928
|
+
field2("changes", list2(field2("item", binary2(), true)), false),
|
|
2929
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
2930
|
+
]);
|
|
2931
|
+
var IndexKeySchema = schema2([
|
|
2932
|
+
field2("column_path", list2(field2("item", utf82(), true)), true),
|
|
2933
|
+
field2("expression", binary2(), true)
|
|
2934
|
+
]);
|
|
2935
|
+
var IndexDefinitionSchema = schema2([
|
|
2936
|
+
field2("table", binary2(), false),
|
|
2937
|
+
field2("algorithm", utf82(), false),
|
|
2938
|
+
field2("keys", list2(field2("item", binary2(), true)), false),
|
|
2939
|
+
field2("options", binary2(), false),
|
|
2940
|
+
field2("constraint_type", dictionary2(utf82(), int162()), false),
|
|
2941
|
+
field2("associated_constraint", binary2(), true)
|
|
2942
|
+
]);
|
|
2943
|
+
var SortKeySchema = schema2([
|
|
2944
|
+
field2("expression", binary2(), false),
|
|
2945
|
+
field2("direction", dictionary2(utf82(), int162()), false),
|
|
2946
|
+
field2("null_order", dictionary2(utf82(), int162()), false)
|
|
2947
|
+
]);
|
|
2948
|
+
var TableLayoutSchema = schema2([
|
|
2949
|
+
field2("partition_by", list2(field2("item", binary2(), true)), false),
|
|
2950
|
+
field2("sorted_by", list2(field2("item", binary2(), true)), false),
|
|
2951
|
+
field2("coverage", dictionary2(utf82(), int162()), false)
|
|
2952
|
+
]);
|
|
2953
|
+
var TableLayoutChangeSchema = schema2([
|
|
2954
|
+
field2("mode", dictionary2(utf82(), int162()), false),
|
|
2955
|
+
field2("partition_by", list2(field2("item", binary2(), true)), true),
|
|
2956
|
+
field2("sorted_by", list2(field2("item", binary2(), true)), true)
|
|
2957
|
+
]);
|
|
2958
|
+
var OptionChangesSchema = schema2([
|
|
2959
|
+
field2("set_values", binary2(), true),
|
|
2960
|
+
field2("reset_names", list2(field2("item", utf82(), true)), false)
|
|
2961
|
+
]);
|
|
2962
|
+
var OptionStateSchema = schema2([
|
|
2963
|
+
field2("values", binary2(), false),
|
|
2964
|
+
field2("explicit_names", list2(field2("item", utf82(), true)), false)
|
|
2965
|
+
]);
|
|
2966
|
+
var RequiredFilterPathsSchema = schema2([
|
|
2967
|
+
field2("groups", list2(field2("item", list2(field2("item", list2(field2("item", utf82(), true)), true)), true)), false)
|
|
2968
|
+
]);
|
|
2752
2969
|
var ScanFunctionResultSchema = schema2([
|
|
2753
2970
|
field2("function_name", utf82(), false),
|
|
2754
2971
|
field2("arguments", binary2(), false),
|
|
@@ -2951,7 +3168,9 @@ var ClientCapabilitiesSchema = schema2([
|
|
|
2951
3168
|
field2("native_formats", list2(field2("item", utf82(), true)), false),
|
|
2952
3169
|
field2("catalogs", list2(field2("item", utf82(), true)), false),
|
|
2953
3170
|
field2("can_stream", bool2(), false),
|
|
2954
|
-
field2("filter_encodings", list2(field2("item", utf82(), true)), false)
|
|
3171
|
+
field2("filter_encodings", list2(field2("item", utf82(), true)), false),
|
|
3172
|
+
field2("catalog", binary2(), true),
|
|
3173
|
+
field2("query_pushdown", struct2([field2("encodings", list2(field2("item", utf82(), true)), false), field2("semantic_profiles", list2(field2("item", utf82(), true)), false), field2("engine_version", utf82(), false), field2("max_query_bytes", int642(), false)]), true)
|
|
2955
3174
|
]);
|
|
2956
3175
|
var CopyFromContextSchema = schema2([
|
|
2957
3176
|
field2("format", utf82(), false),
|
|
@@ -2971,12 +3190,8 @@ var IndexCreateRequestSchema = schema2([
|
|
|
2971
3190
|
field2("attach_opaque_data", binary2(), false),
|
|
2972
3191
|
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
2973
3192
|
field2("name", utf82(), false),
|
|
2974
|
-
field2("
|
|
2975
|
-
field2("index_type", utf82(), false),
|
|
2976
|
-
field2("constraint_type", dictionary2(utf82(), int162()), false),
|
|
2977
|
-
field2("expressions", list2(field2("item", utf82(), true)), false),
|
|
3193
|
+
field2("definition", binary2(), false),
|
|
2978
3194
|
field2("on_conflict", dictionary2(utf82(), int162()), false),
|
|
2979
|
-
field2("options", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), false),
|
|
2980
3195
|
field2("transaction_opaque_data", binary2(), true)
|
|
2981
3196
|
]);
|
|
2982
3197
|
var InitRequestSchema = schema2([
|
|
@@ -3005,11 +3220,8 @@ var MacroCreateRequestSchema = schema2([
|
|
|
3005
3220
|
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
3006
3221
|
field2("name", utf82(), false),
|
|
3007
3222
|
field2("macro_type", dictionary2(utf82(), int162()), false),
|
|
3008
|
-
field2("parameters", list2(field2("item", utf82(), true)), false),
|
|
3009
|
-
field2("definition", utf82(), false),
|
|
3223
|
+
field2("overloads", list2(field2("item", struct2([field2("parameters", list2(field2("item", struct2([field2("name", utf82(), false), field2("declared_type", binary2(), true), field2("default_value", binary2(), true), field2("default_expression", binary2(), true), field2("documentation", utf82(), true)]), true)), false), field2("definition", utf82(), false), field2("profile", utf82(), false), field2("schema_path", list2(field2("item", utf82(), true)), false), field2("macro_type", utf82(), false), field2("evaluation_context", struct2([field2("timezone", utf82(), false), field2("collation", utf82(), false), field2("default_order", utf82(), false), field2("default_null_order", utf82(), false), field2("preserve_insertion_order", bool2(), false)]), false)]), true)), false),
|
|
3010
3224
|
field2("on_conflict", dictionary2(utf82(), int162()), false),
|
|
3011
|
-
field2("parameter_default_values", binary2(), true),
|
|
3012
|
-
field2("arguments_schema", binary2(), true),
|
|
3013
3225
|
field2("transaction_opaque_data", binary2(), true)
|
|
3014
3226
|
]);
|
|
3015
3227
|
var TableCreateRequestSchema = schema2([
|
|
@@ -3018,12 +3230,12 @@ var TableCreateRequestSchema = schema2([
|
|
|
3018
3230
|
field2("name", utf82(), false),
|
|
3019
3231
|
field2("columns", binary2(), false),
|
|
3020
3232
|
field2("on_conflict", dictionary2(utf82(), int162()), false),
|
|
3021
|
-
field2("
|
|
3022
|
-
field2("
|
|
3023
|
-
field2("
|
|
3024
|
-
field2("
|
|
3025
|
-
field2("
|
|
3026
|
-
field2("
|
|
3233
|
+
field2("constraint_definitions", list2(field2("item", binary2(), true)), false),
|
|
3234
|
+
field2("transaction_opaque_data", binary2(), true),
|
|
3235
|
+
field2("comment", utf82(), true),
|
|
3236
|
+
field2("tags", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), true),
|
|
3237
|
+
field2("options", binary2(), true),
|
|
3238
|
+
field2("layout", binary2(), true)
|
|
3027
3239
|
]);
|
|
3028
3240
|
var TableBufferingCombineRequestSchema = schema2([
|
|
3029
3241
|
field2("function_name", utf82(), false),
|
|
@@ -3080,6 +3292,12 @@ var TableFunctionPlanRequestSchema = schema2([
|
|
|
3080
3292
|
field2("tablesample_percentage", float642(), true),
|
|
3081
3293
|
field2("tablesample_seed", int642(), true)
|
|
3082
3294
|
]);
|
|
3295
|
+
var TableFunctionProjectionRequestSchema = schema2([
|
|
3296
|
+
field2("bind_call", binary2(), false),
|
|
3297
|
+
field2("bind_result", binary2(), false),
|
|
3298
|
+
field2("expressions", list2(field2("item", largeBinary2(), true)), false),
|
|
3299
|
+
field2("result_schema", binary2(), false)
|
|
3300
|
+
]);
|
|
3083
3301
|
var TableFunctionStatisticsRequestSchema = schema2([
|
|
3084
3302
|
field2("bind_call", binary2(), false),
|
|
3085
3303
|
field2("bind_opaque_data", binary2(), true)
|
|
@@ -3114,7 +3332,9 @@ var BindResultSchema = schema2([
|
|
|
3114
3332
|
field2("opaque_data", binary2(), true),
|
|
3115
3333
|
field2("lookup_secret_types", list2(field2("item", utf82(), true)), false),
|
|
3116
3334
|
field2("lookup_scopes", list2(field2("item", utf82(), true)), false),
|
|
3117
|
-
field2("lookup_names", list2(field2("item", utf82(), true)), false)
|
|
3335
|
+
field2("lookup_names", list2(field2("item", utf82(), true)), false),
|
|
3336
|
+
field2("projection_expression_profiles", list2(field2("item", utf82(), true)), false),
|
|
3337
|
+
field2("repeatability", dictionary2(utf82(), int162()), false)
|
|
3118
3338
|
]);
|
|
3119
3339
|
var CatalogAttachResultSchema = schema2([
|
|
3120
3340
|
field2("attach_opaque_data", binary2(), false),
|
|
@@ -3123,7 +3343,7 @@ var CatalogAttachResultSchema = schema2([
|
|
|
3123
3343
|
field2("catalog_version_frozen", bool2(), false),
|
|
3124
3344
|
field2("catalog_version", int642(), false),
|
|
3125
3345
|
field2("attach_opaque_data_required", bool2(), false),
|
|
3126
|
-
field2("default_schema", utf82(),
|
|
3346
|
+
field2("default_schema", utf82(), true),
|
|
3127
3347
|
field2("settings", list2(field2("item", binary2(), true)), false),
|
|
3128
3348
|
field2("secret_types", list2(field2("item", binary2(), true)), false),
|
|
3129
3349
|
field2("attach_catalogs", list2(field2("item", binary2(), true)), false),
|
|
@@ -3134,7 +3354,10 @@ var CatalogAttachResultSchema = schema2([
|
|
|
3134
3354
|
field2("global_function_prefix", utf82(), false),
|
|
3135
3355
|
field2("resolved_data_version", utf82(), true),
|
|
3136
3356
|
field2("resolved_implementation_version", utf82(), true),
|
|
3137
|
-
field2("supports_catalog_contents", bool2(), false)
|
|
3357
|
+
field2("supports_catalog_contents", bool2(), false),
|
|
3358
|
+
field2("catalog_capabilities", binary2(), true),
|
|
3359
|
+
field2("selected_capabilities", binary2(), true),
|
|
3360
|
+
field2("query_pushdown", struct2([field2("encoding", utf82(), false), field2("semantic_profiles", list2(field2("item", utf82(), true)), false), field2("execution_modes", list2(field2("item", utf82(), true)), false), field2("backend_engine", utf82(), false), field2("backend_version", utf82(), false), field2("capability_revision", utf82(), false), field2("default_evaluation_context", struct2([field2("timezone", utf82(), false), field2("collation", utf82(), false), field2("default_order", utf82(), false), field2("default_null_order", utf82(), false), field2("preserve_insertion_order", bool2(), false)]), false), field2("max_query_bytes", int642(), false)]), true)
|
|
3138
3361
|
]);
|
|
3139
3362
|
var CatalogCatalogsResultSchema = schema2([
|
|
3140
3363
|
field2("items", list2(field2("item", binary2(), true)), false)
|
|
@@ -3153,9 +3376,20 @@ var CatalogContentsResultSchema = schema2([
|
|
|
3153
3376
|
var CatalogCopyFromFormatsResultSchema = schema2([
|
|
3154
3377
|
field2("items", list2(field2("item", binary2(), true)), false)
|
|
3155
3378
|
]);
|
|
3379
|
+
var CatalogDependenciesResultSchema = schema2([
|
|
3380
|
+
field2("catalog_version", int642(), false),
|
|
3381
|
+
field2("objects", list2(field2("item", binary2(), true)), false),
|
|
3382
|
+
field2("dependencies", list2(field2("item", binary2(), true)), false)
|
|
3383
|
+
]);
|
|
3156
3384
|
var CatalogIndexGetResultSchema = schema2([
|
|
3157
3385
|
field2("items", list2(field2("item", binary2(), true)), false)
|
|
3158
3386
|
]);
|
|
3387
|
+
var CatalogIndexOptionDefinitionsResultSchema = schema2([
|
|
3388
|
+
field2("schema", binary2(), false),
|
|
3389
|
+
field2("defaults", binary2(), false),
|
|
3390
|
+
field2("create_names", list2(field2("item", utf82(), true)), false),
|
|
3391
|
+
field2("alter_names", list2(field2("item", utf82(), true)), false)
|
|
3392
|
+
]);
|
|
3159
3393
|
var CatalogMacroGetResultSchema = schema2([
|
|
3160
3394
|
field2("items", list2(field2("item", binary2(), true)), false)
|
|
3161
3395
|
]);
|
|
@@ -3177,12 +3411,29 @@ var CatalogSchemaContentsViewsResultSchema = schema2([
|
|
|
3177
3411
|
var CatalogSchemaGetResultSchema = schema2([
|
|
3178
3412
|
field2("items", list2(field2("item", binary2(), true)), false)
|
|
3179
3413
|
]);
|
|
3414
|
+
var CatalogSchemaOptionDefinitionsResultSchema = schema2([
|
|
3415
|
+
field2("schema", binary2(), false),
|
|
3416
|
+
field2("defaults", binary2(), false),
|
|
3417
|
+
field2("create_names", list2(field2("item", utf82(), true)), false),
|
|
3418
|
+
field2("alter_names", list2(field2("item", utf82(), true)), false)
|
|
3419
|
+
]);
|
|
3180
3420
|
var CatalogSchemasResultSchema = schema2([
|
|
3181
3421
|
field2("items", list2(field2("item", binary2(), true)), false)
|
|
3182
3422
|
]);
|
|
3423
|
+
var CatalogTableConstraintsApplyResultSchema = schema2([
|
|
3424
|
+
field2("table", binary2(), false),
|
|
3425
|
+
field2("definition_revision", binary2(), false),
|
|
3426
|
+
field2("constraints", list2(field2("item", binary2(), true)), false)
|
|
3427
|
+
]);
|
|
3183
3428
|
var CatalogTableGetResultSchema = schema2([
|
|
3184
3429
|
field2("items", list2(field2("item", binary2(), true)), false)
|
|
3185
3430
|
]);
|
|
3431
|
+
var CatalogTableOptionDefinitionsResultSchema = schema2([
|
|
3432
|
+
field2("schema", binary2(), false),
|
|
3433
|
+
field2("defaults", binary2(), false),
|
|
3434
|
+
field2("create_names", list2(field2("item", utf82(), true)), false),
|
|
3435
|
+
field2("alter_names", list2(field2("item", utf82(), true)), false)
|
|
3436
|
+
]);
|
|
3186
3437
|
var CatalogTransactionBeginResultSchema = schema2([
|
|
3187
3438
|
field2("transaction_opaque_data", binary2(), true)
|
|
3188
3439
|
]);
|
|
@@ -3225,6 +3476,10 @@ var TableFunctionPlanResultSchema = schema2([
|
|
|
3225
3476
|
field2("start_position", binary2(), true),
|
|
3226
3477
|
field2("end_position", binary2(), true)
|
|
3227
3478
|
]);
|
|
3479
|
+
var TableFunctionProjectionResultSchema = schema2([
|
|
3480
|
+
field2("accepted_indices", list2(field2("item", int642(), true)), false),
|
|
3481
|
+
field2("bind_result", binary2(), true)
|
|
3482
|
+
]);
|
|
3228
3483
|
var AggregateBindParamsSchema = schema2([
|
|
3229
3484
|
field2("request", binary2(), false)
|
|
3230
3485
|
]);
|
|
@@ -3279,6 +3534,10 @@ var CatalogCopyFromFormatsParamsSchema = schema2([
|
|
|
3279
3534
|
var CatalogCreateParamsSchema = schema2([
|
|
3280
3535
|
field2("request", binary2(), false)
|
|
3281
3536
|
]);
|
|
3537
|
+
var CatalogDependenciesParamsSchema = schema2([
|
|
3538
|
+
field2("attach_opaque_data", binary2(), false),
|
|
3539
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
3540
|
+
]);
|
|
3282
3541
|
var CatalogDetachParamsSchema = schema2([
|
|
3283
3542
|
field2("attach_opaque_data", binary2(), false)
|
|
3284
3543
|
]);
|
|
@@ -3302,6 +3561,12 @@ var CatalogIndexGetParamsSchema = schema2([
|
|
|
3302
3561
|
field2("name", utf82(), false),
|
|
3303
3562
|
field2("transaction_opaque_data", binary2(), true)
|
|
3304
3563
|
]);
|
|
3564
|
+
var CatalogIndexOptionDefinitionsParamsSchema = schema2([
|
|
3565
|
+
field2("attach_opaque_data", binary2(), false),
|
|
3566
|
+
field2("table", binary2(), false),
|
|
3567
|
+
field2("algorithm", utf82(), false),
|
|
3568
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
3569
|
+
]);
|
|
3305
3570
|
var CatalogMacroCreateParamsSchema = schema2([
|
|
3306
3571
|
field2("request", binary2(), false)
|
|
3307
3572
|
]);
|
|
@@ -3318,6 +3583,27 @@ var CatalogMacroGetParamsSchema = schema2([
|
|
|
3318
3583
|
field2("name", utf82(), false),
|
|
3319
3584
|
field2("transaction_opaque_data", binary2(), true)
|
|
3320
3585
|
]);
|
|
3586
|
+
var CatalogQueryPrepareParamsSchema = schema2([
|
|
3587
|
+
field2("request", binary2(), false)
|
|
3588
|
+
]);
|
|
3589
|
+
var CatalogQueryReleaseParamsSchema = schema2([
|
|
3590
|
+
field2("attach_opaque_data", binary2(), false),
|
|
3591
|
+
field2("prepared_query_token", binary2(), false),
|
|
3592
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
3593
|
+
]);
|
|
3594
|
+
var CatalogSchemaAlterMetadataParamsSchema = schema2([
|
|
3595
|
+
field2("attach_opaque_data", binary2(), false),
|
|
3596
|
+
field2("path", list2(field2("item", utf82(), true)), false),
|
|
3597
|
+
field2("changes", binary2(), false),
|
|
3598
|
+
field2("ignore_not_found", bool2(), false),
|
|
3599
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
3600
|
+
]);
|
|
3601
|
+
var CatalogSchemaAlterOptionsParamsSchema = schema2([
|
|
3602
|
+
field2("attach_opaque_data", binary2(), false),
|
|
3603
|
+
field2("path", list2(field2("item", utf82(), true)), false),
|
|
3604
|
+
field2("changes", binary2(), false),
|
|
3605
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
3606
|
+
]);
|
|
3321
3607
|
var CatalogSchemaContentsFunctionsParamsSchema = schema2([
|
|
3322
3608
|
field2("attach_opaque_data", binary2(), false),
|
|
3323
3609
|
field2("path", list2(field2("item", utf82(), true)), false),
|
|
@@ -3351,7 +3637,8 @@ var CatalogSchemaCreateParamsSchema = schema2([
|
|
|
3351
3637
|
field2("on_conflict", dictionary2(utf82(), int162()), false),
|
|
3352
3638
|
field2("comment", utf82(), true),
|
|
3353
3639
|
field2("tags", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), true),
|
|
3354
|
-
field2("transaction_opaque_data", binary2(), true)
|
|
3640
|
+
field2("transaction_opaque_data", binary2(), true),
|
|
3641
|
+
field2("options", binary2(), true)
|
|
3355
3642
|
]);
|
|
3356
3643
|
var CatalogSchemaDropParamsSchema = schema2([
|
|
3357
3644
|
field2("attach_opaque_data", binary2(), false),
|
|
@@ -3365,14 +3652,34 @@ var CatalogSchemaGetParamsSchema = schema2([
|
|
|
3365
3652
|
field2("path", list2(field2("item", utf82(), true)), false),
|
|
3366
3653
|
field2("transaction_opaque_data", binary2(), true)
|
|
3367
3654
|
]);
|
|
3655
|
+
var CatalogSchemaOptionDefinitionsParamsSchema = schema2([
|
|
3656
|
+
field2("attach_opaque_data", binary2(), false),
|
|
3657
|
+
field2("path", list2(field2("item", utf82(), true)), false),
|
|
3658
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
3659
|
+
]);
|
|
3368
3660
|
var CatalogSchemasParamsSchema = schema2([
|
|
3369
3661
|
field2("attach_opaque_data", binary2(), false),
|
|
3370
3662
|
field2("transaction_opaque_data", binary2(), true)
|
|
3371
3663
|
]);
|
|
3664
|
+
var CatalogTableAlterLayoutParamsSchema = schema2([
|
|
3665
|
+
field2("attach_opaque_data", binary2(), false),
|
|
3666
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
3667
|
+
field2("name", utf82(), false),
|
|
3668
|
+
field2("changes", binary2(), false),
|
|
3669
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
3670
|
+
]);
|
|
3671
|
+
var CatalogTableAlterOptionsParamsSchema = schema2([
|
|
3672
|
+
field2("attach_opaque_data", binary2(), false),
|
|
3673
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
3674
|
+
field2("name", utf82(), false),
|
|
3675
|
+
field2("changes", binary2(), false),
|
|
3676
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
3677
|
+
]);
|
|
3372
3678
|
var CatalogTableColumnAddParamsSchema = schema2([
|
|
3373
3679
|
field2("attach_opaque_data", binary2(), false),
|
|
3374
3680
|
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
3375
3681
|
field2("name", utf82(), false),
|
|
3682
|
+
field2("column_path", list2(field2("item", utf82(), true)), false),
|
|
3376
3683
|
field2("column_definition", binary2(), false),
|
|
3377
3684
|
field2("ignore_not_found", bool2(), false),
|
|
3378
3685
|
field2("if_column_not_exists", bool2(), false),
|
|
@@ -3382,7 +3689,7 @@ var CatalogTableColumnCommentSetParamsSchema = schema2([
|
|
|
3382
3689
|
field2("attach_opaque_data", binary2(), false),
|
|
3383
3690
|
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
3384
3691
|
field2("name", utf82(), false),
|
|
3385
|
-
field2("
|
|
3692
|
+
field2("column_path", list2(field2("item", utf82(), true)), false),
|
|
3386
3693
|
field2("comment", utf82(), true),
|
|
3387
3694
|
field2("ignore_not_found", bool2(), false),
|
|
3388
3695
|
field2("transaction_opaque_data", binary2(), true)
|
|
@@ -3391,7 +3698,7 @@ var CatalogTableColumnDefaultDropParamsSchema = schema2([
|
|
|
3391
3698
|
field2("attach_opaque_data", binary2(), false),
|
|
3392
3699
|
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
3393
3700
|
field2("name", utf82(), false),
|
|
3394
|
-
field2("
|
|
3701
|
+
field2("column_path", list2(field2("item", utf82(), true)), false),
|
|
3395
3702
|
field2("ignore_not_found", bool2(), false),
|
|
3396
3703
|
field2("transaction_opaque_data", binary2(), true)
|
|
3397
3704
|
]);
|
|
@@ -3399,8 +3706,8 @@ var CatalogTableColumnDefaultSetParamsSchema = schema2([
|
|
|
3399
3706
|
field2("attach_opaque_data", binary2(), false),
|
|
3400
3707
|
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
3401
3708
|
field2("name", utf82(), false),
|
|
3402
|
-
field2("
|
|
3403
|
-
field2("expression",
|
|
3709
|
+
field2("column_path", list2(field2("item", utf82(), true)), false),
|
|
3710
|
+
field2("expression", binary2(), false),
|
|
3404
3711
|
field2("ignore_not_found", bool2(), false),
|
|
3405
3712
|
field2("transaction_opaque_data", binary2(), true)
|
|
3406
3713
|
]);
|
|
@@ -3408,7 +3715,7 @@ var CatalogTableColumnDropParamsSchema = schema2([
|
|
|
3408
3715
|
field2("attach_opaque_data", binary2(), false),
|
|
3409
3716
|
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
3410
3717
|
field2("name", utf82(), false),
|
|
3411
|
-
field2("
|
|
3718
|
+
field2("column_path", list2(field2("item", utf82(), true)), false),
|
|
3412
3719
|
field2("ignore_not_found", bool2(), false),
|
|
3413
3720
|
field2("if_column_exists", bool2(), false),
|
|
3414
3721
|
field2("cascade", bool2(), false),
|
|
@@ -3418,7 +3725,7 @@ var CatalogTableColumnRenameParamsSchema = schema2([
|
|
|
3418
3725
|
field2("attach_opaque_data", binary2(), false),
|
|
3419
3726
|
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
3420
3727
|
field2("name", utf82(), false),
|
|
3421
|
-
field2("
|
|
3728
|
+
field2("column_path", list2(field2("item", utf82(), true)), false),
|
|
3422
3729
|
field2("new_column_name", utf82(), false),
|
|
3423
3730
|
field2("ignore_not_found", bool2(), false),
|
|
3424
3731
|
field2("transaction_opaque_data", binary2(), true)
|
|
@@ -3433,8 +3740,9 @@ var CatalogTableColumnTypeChangeParamsSchema = schema2([
|
|
|
3433
3740
|
field2("attach_opaque_data", binary2(), false),
|
|
3434
3741
|
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
3435
3742
|
field2("name", utf82(), false),
|
|
3743
|
+
field2("column_path", list2(field2("item", utf82(), true)), false),
|
|
3436
3744
|
field2("column_definition", binary2(), false),
|
|
3437
|
-
field2("expression",
|
|
3745
|
+
field2("expression", binary2(), true),
|
|
3438
3746
|
field2("ignore_not_found", bool2(), false),
|
|
3439
3747
|
field2("transaction_opaque_data", binary2(), true)
|
|
3440
3748
|
]);
|
|
@@ -3446,6 +3754,9 @@ var CatalogTableCommentSetParamsSchema = schema2([
|
|
|
3446
3754
|
field2("ignore_not_found", bool2(), false),
|
|
3447
3755
|
field2("transaction_opaque_data", binary2(), true)
|
|
3448
3756
|
]);
|
|
3757
|
+
var CatalogTableConstraintsApplyParamsSchema = schema2([
|
|
3758
|
+
field2("request", binary2(), false)
|
|
3759
|
+
]);
|
|
3449
3760
|
var CatalogTableCreateParamsSchema = schema2([
|
|
3450
3761
|
field2("request", binary2(), false)
|
|
3451
3762
|
]);
|
|
@@ -3482,7 +3793,7 @@ var CatalogTableNotNullDropParamsSchema = schema2([
|
|
|
3482
3793
|
field2("attach_opaque_data", binary2(), false),
|
|
3483
3794
|
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
3484
3795
|
field2("name", utf82(), false),
|
|
3485
|
-
field2("
|
|
3796
|
+
field2("column_path", list2(field2("item", utf82(), true)), false),
|
|
3486
3797
|
field2("ignore_not_found", bool2(), false),
|
|
3487
3798
|
field2("transaction_opaque_data", binary2(), true)
|
|
3488
3799
|
]);
|
|
@@ -3490,10 +3801,16 @@ var CatalogTableNotNullSetParamsSchema = schema2([
|
|
|
3490
3801
|
field2("attach_opaque_data", binary2(), false),
|
|
3491
3802
|
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
3492
3803
|
field2("name", utf82(), false),
|
|
3493
|
-
field2("
|
|
3804
|
+
field2("column_path", list2(field2("item", utf82(), true)), false),
|
|
3494
3805
|
field2("ignore_not_found", bool2(), false),
|
|
3495
3806
|
field2("transaction_opaque_data", binary2(), true)
|
|
3496
3807
|
]);
|
|
3808
|
+
var CatalogTableOptionDefinitionsParamsSchema = schema2([
|
|
3809
|
+
field2("attach_opaque_data", binary2(), false),
|
|
3810
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
3811
|
+
field2("name", utf82(), false),
|
|
3812
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
3813
|
+
]);
|
|
3497
3814
|
var CatalogTableRenameParamsSchema = schema2([
|
|
3498
3815
|
field2("attach_opaque_data", binary2(), false),
|
|
3499
3816
|
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
@@ -3539,6 +3856,15 @@ var CatalogVersionParamsSchema = schema2([
|
|
|
3539
3856
|
field2("attach_opaque_data", binary2(), false),
|
|
3540
3857
|
field2("transaction_opaque_data", binary2(), true)
|
|
3541
3858
|
]);
|
|
3859
|
+
var CatalogViewColumnCommentSetParamsSchema = schema2([
|
|
3860
|
+
field2("attach_opaque_data", binary2(), false),
|
|
3861
|
+
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
3862
|
+
field2("name", utf82(), false),
|
|
3863
|
+
field2("column_path", list2(field2("item", utf82(), true)), false),
|
|
3864
|
+
field2("comment", utf82(), true),
|
|
3865
|
+
field2("ignore_not_found", bool2(), false),
|
|
3866
|
+
field2("transaction_opaque_data", binary2(), true)
|
|
3867
|
+
]);
|
|
3542
3868
|
var CatalogViewCommentSetParamsSchema = schema2([
|
|
3543
3869
|
field2("attach_opaque_data", binary2(), false),
|
|
3544
3870
|
field2("schema_path", list2(field2("item", utf82(), true)), false),
|
|
@@ -3553,7 +3879,12 @@ var CatalogViewCreateParamsSchema = schema2([
|
|
|
3553
3879
|
field2("name", utf82(), false),
|
|
3554
3880
|
field2("definition", utf82(), false),
|
|
3555
3881
|
field2("on_conflict", dictionary2(utf82(), int162()), false),
|
|
3556
|
-
field2("transaction_opaque_data", binary2(), true)
|
|
3882
|
+
field2("transaction_opaque_data", binary2(), true),
|
|
3883
|
+
field2("aliases", list2(field2("item", utf82(), true)), true),
|
|
3884
|
+
field2("security", utf82(), false),
|
|
3885
|
+
field2("comment", utf82(), true),
|
|
3886
|
+
field2("tags", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), true),
|
|
3887
|
+
field2("column_comments", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), true)
|
|
3557
3888
|
]);
|
|
3558
3889
|
var CatalogViewDropParamsSchema = schema2([
|
|
3559
3890
|
field2("attach_opaque_data", binary2(), false),
|
|
@@ -3598,11 +3929,15 @@ var TableFunctionDynamicToStringParamsSchema = schema2([
|
|
|
3598
3929
|
var TableFunctionPlanParamsSchema = schema2([
|
|
3599
3930
|
field2("request", binary2(), false)
|
|
3600
3931
|
]);
|
|
3932
|
+
var TableFunctionProjectionParamsSchema = schema2([
|
|
3933
|
+
field2("request", binary2(), false)
|
|
3934
|
+
]);
|
|
3601
3935
|
var TableFunctionStatisticsParamsSchema = schema2([
|
|
3602
3936
|
field2("request", binary2(), false)
|
|
3603
3937
|
]);
|
|
3604
3938
|
|
|
3605
3939
|
// src/generated/vgi-protocol-types.ts
|
|
3940
|
+
var decodeSqlExpression = (b) => decodeASD(SqlExpressionSchema, b);
|
|
3606
3941
|
var decodeCatalogContentsResponse = (b) => decodeASD(CatalogContentsResultSchema, b);
|
|
3607
3942
|
|
|
3608
3943
|
// src/generated/vgi-client.ts
|
|
@@ -3767,6 +4102,292 @@ function wrapRpcWithErrorEnrichment(rpc) {
|
|
|
3767
4102
|
};
|
|
3768
4103
|
}
|
|
3769
4104
|
|
|
4105
|
+
// src/catalog/column-expressions.ts
|
|
4106
|
+
var GENERATED_EXPRESSION_KEY = "vgi.column.generated.v1";
|
|
4107
|
+
var GENERATION_KEY = "vgi.column.generation.v1";
|
|
4108
|
+
var PROFILE = "vgi.expression.duckdb.scalar.v1";
|
|
4109
|
+
var MAX_BYTES = 8 * 1024 * 1024;
|
|
4110
|
+
var base64 = (bytes) => btoa(Array.from(bytes, (value) => String.fromCharCode(value)).join(""));
|
|
4111
|
+
function text(value, maximum) {
|
|
4112
|
+
if (typeof value !== "string" || !value || value.includes("\x00") || new TextEncoder().encode(value).length > maximum)
|
|
4113
|
+
throw new Error("invalid generated expression text");
|
|
4114
|
+
for (let i = 0;i < value.length; i++) {
|
|
4115
|
+
const c = value.charCodeAt(i);
|
|
4116
|
+
if (c >= 55296 && c <= 56319) {
|
|
4117
|
+
const d = value.charCodeAt(++i);
|
|
4118
|
+
if (!(d >= 56320 && d <= 57343))
|
|
4119
|
+
throw new Error("invalid generated expression Unicode");
|
|
4120
|
+
} else if (c >= 56320 && c <= 57343)
|
|
4121
|
+
throw new Error("invalid generated expression Unicode");
|
|
4122
|
+
}
|
|
4123
|
+
}
|
|
4124
|
+
function expression(value, owner) {
|
|
4125
|
+
text(value.sql, 1024 * 1024);
|
|
4126
|
+
if (!value.sql.trim() || value.profile !== PROFILE)
|
|
4127
|
+
throw new Error("unsupported generated expression profile or empty SQL");
|
|
4128
|
+
if (!Array.isArray(value.schema_path) || value.schema_path.length > 32)
|
|
4129
|
+
throw new Error("invalid generated expression owner");
|
|
4130
|
+
value.schema_path.forEach((part) => text(part, 4096));
|
|
4131
|
+
if (JSON.stringify(value.schema_path) !== JSON.stringify(owner))
|
|
4132
|
+
throw new Error("generated expression owner differs from table schema");
|
|
4133
|
+
const context = value.evaluation_context;
|
|
4134
|
+
if (!context)
|
|
4135
|
+
throw new Error("generated expression requires explicit evaluation context");
|
|
4136
|
+
text(context.timezone, 256);
|
|
4137
|
+
text(context.collation, 256);
|
|
4138
|
+
if (!["asc", "desc"].includes(context.default_order) || ![
|
|
4139
|
+
"nulls_first",
|
|
4140
|
+
"nulls_last",
|
|
4141
|
+
"nulls_first_on_asc_last_on_desc",
|
|
4142
|
+
"nulls_last_on_asc_first_on_desc"
|
|
4143
|
+
].includes(context.default_null_order) || typeof context.preserve_insertion_order !== "boolean")
|
|
4144
|
+
throw new Error("invalid generated expression evaluation context");
|
|
4145
|
+
}
|
|
4146
|
+
function envelope(bytes) {
|
|
4147
|
+
if (!bytes.length || bytes.length > MAX_BYTES)
|
|
4148
|
+
throw new Error("invalid generated expression size");
|
|
4149
|
+
const data = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
4150
|
+
const kinds = [];
|
|
4151
|
+
const textBuffers = [];
|
|
4152
|
+
let offset = 0;
|
|
4153
|
+
while (offset < bytes.length) {
|
|
4154
|
+
const prefix = data.getInt32(offset, true) === -1 ? 8 : 4;
|
|
4155
|
+
const length = data.getInt32(offset + prefix - 4, true);
|
|
4156
|
+
offset += prefix;
|
|
4157
|
+
if (!length) {
|
|
4158
|
+
if (offset !== bytes.length || kinds.join(",") !== "1,3")
|
|
4159
|
+
throw new Error("SqlExpression requires exactly one complete IPC batch");
|
|
4160
|
+
return textBuffers;
|
|
4161
|
+
}
|
|
4162
|
+
if (length < 0 || offset + length > bytes.length)
|
|
4163
|
+
throw new Error("invalid expression IPC length");
|
|
4164
|
+
const p = offset + data.getUint32(offset, true), v = p - data.getInt32(p, true);
|
|
4165
|
+
const slot = (id) => 4 + id * 2 < data.getUint16(v, true) ? data.getUint16(v + 4 + id * 2, true) : 0;
|
|
4166
|
+
const kind = slot(1), body = slot(3);
|
|
4167
|
+
if (!kind)
|
|
4168
|
+
throw new Error("invalid expression IPC message");
|
|
4169
|
+
kinds.push(data.getUint8(p + kind));
|
|
4170
|
+
const bodyLength = body ? Number(data.getBigInt64(p + body, true)) : 0;
|
|
4171
|
+
if (bodyLength < 0 || bodyLength > bytes.length - offset - length)
|
|
4172
|
+
throw new Error("invalid expression IPC body");
|
|
4173
|
+
if (data.getUint8(p + kind) === 3) {
|
|
4174
|
+
const headerSlot = slot(2);
|
|
4175
|
+
const record = p + headerSlot + data.getUint32(p + headerSlot, true);
|
|
4176
|
+
const table = record - data.getInt32(record, true);
|
|
4177
|
+
const recordSlot = (id) => 4 + id * 2 < data.getUint16(table, true) ? data.getUint16(table + 4 + id * 2, true) : 0;
|
|
4178
|
+
if (recordSlot(3))
|
|
4179
|
+
throw new Error("compressed expression IPC is unsupported");
|
|
4180
|
+
const bufferSlot = recordSlot(2);
|
|
4181
|
+
const buffers = record + bufferSlot + data.getUint32(record + bufferSlot, true);
|
|
4182
|
+
if (data.getUint32(buffers, true) !== 26)
|
|
4183
|
+
throw new Error("invalid SqlExpression buffer layout");
|
|
4184
|
+
for (const index of [2, 5, 10, 14, 17, 20, 23]) {
|
|
4185
|
+
const buffer = buffers + 4 + index * 16;
|
|
4186
|
+
const start = Number(data.getBigInt64(buffer, true));
|
|
4187
|
+
const size = Number(data.getBigInt64(buffer + 8, true));
|
|
4188
|
+
if (start < 0 || size < 0 || start + size > bodyLength)
|
|
4189
|
+
throw new Error("invalid expression string buffer");
|
|
4190
|
+
textBuffers.push(bytes.subarray(offset + length + start, offset + length + start + size));
|
|
4191
|
+
}
|
|
4192
|
+
}
|
|
4193
|
+
offset += length + bodyLength;
|
|
4194
|
+
}
|
|
4195
|
+
throw new Error("expression IPC lacks end marker");
|
|
4196
|
+
}
|
|
4197
|
+
function shape(schema) {
|
|
4198
|
+
const field = (f) => [
|
|
4199
|
+
f.name,
|
|
4200
|
+
f.nullable,
|
|
4201
|
+
String(f.type),
|
|
4202
|
+
(f.type.children ?? []).map(field)
|
|
4203
|
+
];
|
|
4204
|
+
return JSON.stringify(schema.fields.map(field));
|
|
4205
|
+
}
|
|
4206
|
+
function validateEncoded(encoded, owner) {
|
|
4207
|
+
if (!encoded.length || encoded.length > 4 * Math.ceil(MAX_BYTES / 3))
|
|
4208
|
+
throw new Error("invalid generated expression size");
|
|
4209
|
+
const bytes = Uint8Array.from(atob(encoded), (c) => c.charCodeAt(0));
|
|
4210
|
+
if (base64(bytes) !== encoded)
|
|
4211
|
+
throw new Error("generated expression requires canonical base64");
|
|
4212
|
+
const textBuffers = envelope(bytes);
|
|
4213
|
+
const batch = deserializeBatch(bytes);
|
|
4214
|
+
if (batch.numRows !== 1 || shape(batch.schema) !== shape(SqlExpressionSchema))
|
|
4215
|
+
throw new Error("invalid SqlExpression record schema");
|
|
4216
|
+
const utf8 = new TextDecoder("utf-8", { fatal: true });
|
|
4217
|
+
textBuffers.forEach((buffer) => utf8.decode(buffer));
|
|
4218
|
+
expression(decodeSqlExpression(bytes), owner);
|
|
4219
|
+
}
|
|
4220
|
+
function validateColumnExpressions(schema, owner, allowGenerated = true) {
|
|
4221
|
+
const type = (t) => {
|
|
4222
|
+
for (const f of t?.children ?? t?.fields ?? [])
|
|
4223
|
+
field(f);
|
|
4224
|
+
if (t?.dictionary)
|
|
4225
|
+
type(t.dictionary);
|
|
4226
|
+
};
|
|
4227
|
+
const field = (f) => {
|
|
4228
|
+
const metadata = f.metadata ?? new Map;
|
|
4229
|
+
for (const key of metadata.keys()) {
|
|
4230
|
+
if (key.startsWith("vgi.column.generated.") && key !== GENERATED_EXPRESSION_KEY || key.startsWith("vgi.column.generation.") && key !== GENERATION_KEY)
|
|
4231
|
+
throw new Error("unknown generated metadata version");
|
|
4232
|
+
}
|
|
4233
|
+
if (metadata.has("generated_expression"))
|
|
4234
|
+
throw new Error("legacy generated expression requires explicit canonical translation");
|
|
4235
|
+
if (metadata.has(GENERATED_EXPRESSION_KEY) !== metadata.has(GENERATION_KEY))
|
|
4236
|
+
throw new Error("generated expression and category must occur together");
|
|
4237
|
+
if (metadata.has(GENERATED_EXPRESSION_KEY)) {
|
|
4238
|
+
if (metadata.get(GENERATION_KEY) !== "virtual")
|
|
4239
|
+
throw new Error("only VIRTUAL generated columns are supported");
|
|
4240
|
+
if (metadata.has("default") || metadata.has("vgi.column.default.v1"))
|
|
4241
|
+
throw new Error("generated column cannot have a default");
|
|
4242
|
+
validateEncoded(metadata.get(GENERATED_EXPRESSION_KEY), owner);
|
|
4243
|
+
if (!allowGenerated)
|
|
4244
|
+
throw new Error("generated columns unsupported by this catalog");
|
|
4245
|
+
}
|
|
4246
|
+
type(f.type);
|
|
4247
|
+
};
|
|
4248
|
+
schema.fields.forEach(field);
|
|
4249
|
+
}
|
|
4250
|
+
function validateColumnExpressionsIpc(bytes, owner, allowGenerated = true) {
|
|
4251
|
+
validateColumnExpressions(deserializeSchema(bytes), owner, allowGenerated);
|
|
4252
|
+
}
|
|
4253
|
+
|
|
4254
|
+
// src/catalog/column-metadata.ts
|
|
4255
|
+
function scalarText(value) {
|
|
4256
|
+
for (let i = 0;i < value.length; i++) {
|
|
4257
|
+
const c = value.charCodeAt(i);
|
|
4258
|
+
if (c >= 55296 && c <= 56319) {
|
|
4259
|
+
const d = value.charCodeAt(++i);
|
|
4260
|
+
if (!(d >= 56320 && d <= 57343))
|
|
4261
|
+
throw new Error("column metadata contains an unpaired surrogate");
|
|
4262
|
+
} else if (c >= 56320 && c <= 57343)
|
|
4263
|
+
throw new Error("column metadata contains an unpaired surrogate");
|
|
4264
|
+
}
|
|
4265
|
+
}
|
|
4266
|
+
function tags(value) {
|
|
4267
|
+
let i = 0;
|
|
4268
|
+
const ws = () => {
|
|
4269
|
+
while (i < value.length && /[ \t\r\n]/.test(value[i]))
|
|
4270
|
+
i++;
|
|
4271
|
+
};
|
|
4272
|
+
const str = () => {
|
|
4273
|
+
ws();
|
|
4274
|
+
const start = i;
|
|
4275
|
+
if (value[i++] !== '"')
|
|
4276
|
+
throw new Error("column tags require string keys and values");
|
|
4277
|
+
while (i < value.length) {
|
|
4278
|
+
const c = value[i++];
|
|
4279
|
+
if (c === "\\") {
|
|
4280
|
+
i++;
|
|
4281
|
+
continue;
|
|
4282
|
+
}
|
|
4283
|
+
if (c === '"') {
|
|
4284
|
+
const result = JSON.parse(value.slice(start, i));
|
|
4285
|
+
scalarText(result);
|
|
4286
|
+
return result;
|
|
4287
|
+
}
|
|
4288
|
+
}
|
|
4289
|
+
throw new Error("unterminated column tag string");
|
|
4290
|
+
};
|
|
4291
|
+
ws();
|
|
4292
|
+
if (value[i++] !== "{")
|
|
4293
|
+
throw new Error("column tags must be a JSON object");
|
|
4294
|
+
ws();
|
|
4295
|
+
const seen = new Set;
|
|
4296
|
+
if (value[i] !== "}")
|
|
4297
|
+
for (;; ) {
|
|
4298
|
+
const key = str();
|
|
4299
|
+
if (seen.has(key))
|
|
4300
|
+
throw new Error("duplicate column tag key");
|
|
4301
|
+
seen.add(key);
|
|
4302
|
+
ws();
|
|
4303
|
+
if (value[i++] !== ":")
|
|
4304
|
+
throw new Error("invalid column tags JSON");
|
|
4305
|
+
str();
|
|
4306
|
+
ws();
|
|
4307
|
+
if (value[i] !== ",")
|
|
4308
|
+
break;
|
|
4309
|
+
i++;
|
|
4310
|
+
}
|
|
4311
|
+
if (value[i++] !== "}")
|
|
4312
|
+
throw new Error("invalid column tags JSON");
|
|
4313
|
+
ws();
|
|
4314
|
+
if (i !== value.length)
|
|
4315
|
+
throw new Error("trailing column tags JSON");
|
|
4316
|
+
}
|
|
4317
|
+
function entry(key, value) {
|
|
4318
|
+
if (key === "comment" || key === "tags") {
|
|
4319
|
+
scalarText(value);
|
|
4320
|
+
if (key === "tags")
|
|
4321
|
+
tags(value);
|
|
4322
|
+
}
|
|
4323
|
+
}
|
|
4324
|
+
function validateColumnMetadataIpc(bytes) {
|
|
4325
|
+
const input = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
4326
|
+
const prefix = input.getInt32(0, true) === -1 ? 8 : 4;
|
|
4327
|
+
const size = input.getInt32(prefix - 4, true);
|
|
4328
|
+
if (size <= 0 || prefix + size > bytes.length)
|
|
4329
|
+
throw new Error("invalid column schema IPC");
|
|
4330
|
+
const raw = bytes.subarray(prefix, prefix + size);
|
|
4331
|
+
const view = new DataView(raw.buffer, raw.byteOffset, raw.byteLength);
|
|
4332
|
+
const u32 = (p) => view.getUint32(p, true), i32 = (p) => view.getInt32(p, true), u16 = (p) => view.getUint16(p, true);
|
|
4333
|
+
const slot = (p, id) => {
|
|
4334
|
+
const v = p - i32(p), o = 4 + id * 2;
|
|
4335
|
+
return o < u16(v) ? u16(v + o) : 0;
|
|
4336
|
+
};
|
|
4337
|
+
const ref = (p, id) => {
|
|
4338
|
+
const o = slot(p, id);
|
|
4339
|
+
return o ? p + o + u32(p + o) : 0;
|
|
4340
|
+
};
|
|
4341
|
+
const vector = (p, id, fn) => {
|
|
4342
|
+
const v = ref(p, id);
|
|
4343
|
+
if (!v)
|
|
4344
|
+
return;
|
|
4345
|
+
const n = u32(v);
|
|
4346
|
+
if (n > (raw.length - v - 4) / 4)
|
|
4347
|
+
throw new Error("invalid column metadata vector");
|
|
4348
|
+
for (let j = 0;j < n; j++) {
|
|
4349
|
+
const q = v + 4 + j * 4;
|
|
4350
|
+
fn(q + u32(q));
|
|
4351
|
+
}
|
|
4352
|
+
};
|
|
4353
|
+
const text = (p, id) => {
|
|
4354
|
+
const v = ref(p, id);
|
|
4355
|
+
if (!v)
|
|
4356
|
+
return "";
|
|
4357
|
+
const n = u32(v);
|
|
4358
|
+
if (v + 4 + n > raw.length)
|
|
4359
|
+
throw new Error("invalid column metadata string");
|
|
4360
|
+
return new TextDecoder("utf-8", { fatal: true }).decode(raw.subarray(v + 4, v + 4 + n));
|
|
4361
|
+
};
|
|
4362
|
+
const field = (p, depth) => {
|
|
4363
|
+
if (depth > 64)
|
|
4364
|
+
throw new Error("column metadata nesting too deep");
|
|
4365
|
+
const seen = new Set;
|
|
4366
|
+
vector(p, 6, (m) => {
|
|
4367
|
+
const k = text(m, 0);
|
|
4368
|
+
if (seen.has(k))
|
|
4369
|
+
throw new Error("duplicate column metadata key");
|
|
4370
|
+
seen.add(k);
|
|
4371
|
+
if (k === "comment" || k === "tags")
|
|
4372
|
+
entry(k, text(m, 1));
|
|
4373
|
+
});
|
|
4374
|
+
vector(p, 5, (c) => field(c, depth + 1));
|
|
4375
|
+
};
|
|
4376
|
+
const message = u32(0), kind = slot(message, 1);
|
|
4377
|
+
if (!kind || view.getUint8(message + kind) !== 1)
|
|
4378
|
+
throw new Error("expected column schema message");
|
|
4379
|
+
const schema = ref(message, 2);
|
|
4380
|
+
if (!schema)
|
|
4381
|
+
throw new Error("missing column schema");
|
|
4382
|
+
vector(schema, 1, (f) => field(f, 0));
|
|
4383
|
+
}
|
|
4384
|
+
function validateTableInfoColumns(info) {
|
|
4385
|
+
if (info.columns.length) {
|
|
4386
|
+
validateColumnMetadataIpc(info.columns);
|
|
4387
|
+
validateColumnExpressionsIpc(info.columns, info.schema_path);
|
|
4388
|
+
}
|
|
4389
|
+
}
|
|
4390
|
+
|
|
3770
4391
|
// src/catalog/contents-codec.ts
|
|
3771
4392
|
var schemaPathKey = (path) => JSON.stringify(path.map((part) => part.toLowerCase()));
|
|
3772
4393
|
var CATALOG_STREAM_KINDS = ["schemas", "tables", "views", "functions", "macros", "indexes"];
|
|
@@ -3799,8 +4420,10 @@ function decodeCatalogStreams(response, ifNoneMatch) {
|
|
|
3799
4420
|
throw new Error("catalog object references an absent schema");
|
|
3800
4421
|
return entry;
|
|
3801
4422
|
};
|
|
3802
|
-
for (const item of decodeASDCollection(TableInfoSchema, response.tables))
|
|
4423
|
+
for (const item of decodeASDCollection(TableInfoSchema, response.tables)) {
|
|
4424
|
+
validateTableInfoColumns(item);
|
|
3803
4425
|
owner(item).tables.push(item);
|
|
4426
|
+
}
|
|
3804
4427
|
for (const item of decodeASDCollection(ViewInfoSchema, response.views))
|
|
3805
4428
|
owner(item).views.push(item);
|
|
3806
4429
|
for (const item of decodeASDCollection(FunctionInfoSchema, response.functions)) {
|
|
@@ -4221,7 +4844,7 @@ class VgiClient {
|
|
|
4221
4844
|
catalog_version_frozen: inner.catalog_version_frozen ?? false,
|
|
4222
4845
|
catalog_version: Number(inner.catalog_version ?? 0),
|
|
4223
4846
|
attach_opaque_data_required: inner.attach_opaque_data_required ?? true,
|
|
4224
|
-
default_schema: inner.default_schema ??
|
|
4847
|
+
default_schema: inner.default_schema ?? null,
|
|
4225
4848
|
settings: inner.settings ? (Array.isArray(inner.settings) ? inner.settings : [...inner.settings]).map(toUint8Array) : [],
|
|
4226
4849
|
secret_types: inner.secret_types ? (Array.isArray(inner.secret_types) ? inner.secret_types : [...inner.secret_types]).map(toUint8Array) : [],
|
|
4227
4850
|
attach_catalogs: inner.attach_catalogs ? (Array.isArray(inner.attach_catalogs) ? inner.attach_catalogs : [...inner.attach_catalogs]).map(toUint8Array) : [],
|
|
@@ -4491,17 +5114,17 @@ class VgiClient {
|
|
|
4491
5114
|
const items = deserializeInfoList(inner.items, decodeTableInfo);
|
|
4492
5115
|
return items.length > 0 ? items[0] : null;
|
|
4493
5116
|
}
|
|
4494
|
-
async tableCreate(attachOpaqueData, schemaPath, name, columns, onConflict,
|
|
5117
|
+
async tableCreate(attachOpaqueData, schemaPath, name, columns, onConflict, constraintDefinitions = [], transactionOpaqueData) {
|
|
4495
5118
|
await this.rpc.call("catalog_table_create", {
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
5119
|
+
request: encodeASD(TableCreateRequestSchema, {
|
|
5120
|
+
attach_opaque_data: attachOpaqueData,
|
|
5121
|
+
schema_path: normalizeSchemaPath(schemaPath),
|
|
5122
|
+
name,
|
|
5123
|
+
columns,
|
|
5124
|
+
on_conflict: onConflictName(onConflict),
|
|
5125
|
+
constraint_definitions: constraintDefinitions,
|
|
5126
|
+
transaction_opaque_data: transactionOpaqueData ?? null
|
|
5127
|
+
})
|
|
4505
5128
|
});
|
|
4506
5129
|
}
|
|
4507
5130
|
async tableDrop(attachOpaqueData, schemaPath, name, ignoreNotFound, cascade, transactionOpaqueData) {
|
|
@@ -4547,88 +5170,102 @@ class VgiClient {
|
|
|
4547
5170
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
4548
5171
|
});
|
|
4549
5172
|
}
|
|
4550
|
-
async tableColumnAdd(attachOpaqueData, schemaPath, name,
|
|
5173
|
+
async tableColumnAdd(attachOpaqueData, schemaPath, name, columnPath, columnDefinition, ignoreNotFound = false, ifColumnNotExists = false, transactionOpaqueData) {
|
|
4551
5174
|
await this.rpc.call("catalog_table_column_add", {
|
|
4552
5175
|
attach_opaque_data: attachOpaqueData,
|
|
4553
5176
|
schema_path: normalizeSchemaPath(schemaPath),
|
|
4554
5177
|
name,
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
5178
|
+
column_path: columnPath,
|
|
5179
|
+
column_definition: columnDefinition,
|
|
5180
|
+
ignore_not_found: ignoreNotFound,
|
|
5181
|
+
if_column_not_exists: ifColumnNotExists,
|
|
4559
5182
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
4560
5183
|
});
|
|
4561
5184
|
}
|
|
4562
|
-
async tableColumnDrop(attachOpaqueData, schemaPath, name,
|
|
5185
|
+
async tableColumnDrop(attachOpaqueData, schemaPath, name, columnPath, ignoreNotFound = false, ifColumnExists = false, cascade = false, transactionOpaqueData) {
|
|
4563
5186
|
await this.rpc.call("catalog_table_column_drop", {
|
|
4564
5187
|
attach_opaque_data: attachOpaqueData,
|
|
4565
5188
|
schema_path: normalizeSchemaPath(schemaPath),
|
|
4566
5189
|
name,
|
|
4567
|
-
|
|
4568
|
-
ignore_not_found: ignoreNotFound
|
|
5190
|
+
column_path: columnPath,
|
|
5191
|
+
ignore_not_found: ignoreNotFound,
|
|
5192
|
+
if_column_exists: ifColumnExists,
|
|
5193
|
+
cascade,
|
|
4569
5194
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
4570
5195
|
});
|
|
4571
5196
|
}
|
|
4572
|
-
async tableColumnRename(attachOpaqueData, schemaPath, name,
|
|
5197
|
+
async tableColumnRename(attachOpaqueData, schemaPath, name, columnPath, newColumnName, ignoreNotFound = false, transactionOpaqueData) {
|
|
4573
5198
|
await this.rpc.call("catalog_table_column_rename", {
|
|
4574
5199
|
attach_opaque_data: attachOpaqueData,
|
|
4575
5200
|
schema_path: normalizeSchemaPath(schemaPath),
|
|
4576
5201
|
name,
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
ignore_not_found: ignoreNotFound
|
|
5202
|
+
column_path: columnPath,
|
|
5203
|
+
new_column_name: newColumnName,
|
|
5204
|
+
ignore_not_found: ignoreNotFound,
|
|
5205
|
+
transaction_opaque_data: transactionOpaqueData ?? null
|
|
5206
|
+
});
|
|
5207
|
+
}
|
|
5208
|
+
async tableColumnCommentSet(attachOpaqueData, schemaPath, name, columnPath, comment, ignoreNotFound = false, transactionOpaqueData) {
|
|
5209
|
+
await this.rpc.call("catalog_table_column_comment_set", {
|
|
5210
|
+
attach_opaque_data: attachOpaqueData,
|
|
5211
|
+
schema_path: normalizeSchemaPath(schemaPath),
|
|
5212
|
+
name,
|
|
5213
|
+
column_path: columnPath,
|
|
5214
|
+
comment,
|
|
5215
|
+
ignore_not_found: ignoreNotFound,
|
|
4580
5216
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
4581
5217
|
});
|
|
4582
5218
|
}
|
|
4583
|
-
async tableColumnDefaultSet(attachOpaqueData, schemaPath, name,
|
|
5219
|
+
async tableColumnDefaultSet(attachOpaqueData, schemaPath, name, columnPath, expression, ignoreNotFound = false, transactionOpaqueData) {
|
|
4584
5220
|
await this.rpc.call("catalog_table_column_default_set", {
|
|
4585
5221
|
attach_opaque_data: attachOpaqueData,
|
|
4586
5222
|
schema_path: normalizeSchemaPath(schemaPath),
|
|
4587
5223
|
name,
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
ignore_not_found: ignoreNotFound
|
|
5224
|
+
column_path: columnPath,
|
|
5225
|
+
expression,
|
|
5226
|
+
ignore_not_found: ignoreNotFound,
|
|
4591
5227
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
4592
5228
|
});
|
|
4593
5229
|
}
|
|
4594
|
-
async tableColumnDefaultDrop(attachOpaqueData, schemaPath, name,
|
|
5230
|
+
async tableColumnDefaultDrop(attachOpaqueData, schemaPath, name, columnPath, ignoreNotFound = false, transactionOpaqueData) {
|
|
4595
5231
|
await this.rpc.call("catalog_table_column_default_drop", {
|
|
4596
5232
|
attach_opaque_data: attachOpaqueData,
|
|
4597
5233
|
schema_path: normalizeSchemaPath(schemaPath),
|
|
4598
5234
|
name,
|
|
4599
|
-
|
|
4600
|
-
ignore_not_found: ignoreNotFound
|
|
5235
|
+
column_path: columnPath,
|
|
5236
|
+
ignore_not_found: ignoreNotFound,
|
|
4601
5237
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
4602
5238
|
});
|
|
4603
5239
|
}
|
|
4604
|
-
async tableColumnTypeChange(attachOpaqueData, schemaPath, name, columnDefinition, expression, ignoreNotFound, transactionOpaqueData) {
|
|
5240
|
+
async tableColumnTypeChange(attachOpaqueData, schemaPath, name, columnPath, columnDefinition, expression = null, ignoreNotFound = false, transactionOpaqueData) {
|
|
4605
5241
|
await this.rpc.call("catalog_table_column_type_change", {
|
|
4606
5242
|
attach_opaque_data: attachOpaqueData,
|
|
4607
5243
|
schema_path: normalizeSchemaPath(schemaPath),
|
|
4608
5244
|
name,
|
|
5245
|
+
column_path: columnPath,
|
|
4609
5246
|
column_definition: columnDefinition,
|
|
4610
|
-
expression
|
|
4611
|
-
ignore_not_found: ignoreNotFound
|
|
5247
|
+
expression,
|
|
5248
|
+
ignore_not_found: ignoreNotFound,
|
|
4612
5249
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
4613
5250
|
});
|
|
4614
5251
|
}
|
|
4615
|
-
async tableNotNullSet(attachOpaqueData, schemaPath, name,
|
|
5252
|
+
async tableNotNullSet(attachOpaqueData, schemaPath, name, columnPath, ignoreNotFound = false, transactionOpaqueData) {
|
|
4616
5253
|
await this.rpc.call("catalog_table_not_null_set", {
|
|
4617
5254
|
attach_opaque_data: attachOpaqueData,
|
|
4618
5255
|
schema_path: normalizeSchemaPath(schemaPath),
|
|
4619
5256
|
name,
|
|
4620
|
-
|
|
4621
|
-
ignore_not_found: ignoreNotFound
|
|
5257
|
+
column_path: columnPath,
|
|
5258
|
+
ignore_not_found: ignoreNotFound,
|
|
4622
5259
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
4623
5260
|
});
|
|
4624
5261
|
}
|
|
4625
|
-
async tableNotNullDrop(attachOpaqueData, schemaPath, name,
|
|
5262
|
+
async tableNotNullDrop(attachOpaqueData, schemaPath, name, columnPath, ignoreNotFound = false, transactionOpaqueData) {
|
|
4626
5263
|
await this.rpc.call("catalog_table_not_null_drop", {
|
|
4627
5264
|
attach_opaque_data: attachOpaqueData,
|
|
4628
5265
|
schema_path: normalizeSchemaPath(schemaPath),
|
|
4629
5266
|
name,
|
|
4630
|
-
|
|
4631
|
-
ignore_not_found: ignoreNotFound
|
|
5267
|
+
column_path: columnPath,
|
|
5268
|
+
ignore_not_found: ignoreNotFound,
|
|
4632
5269
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
4633
5270
|
});
|
|
4634
5271
|
}
|
|
@@ -4645,12 +5282,17 @@ class VgiClient {
|
|
|
4645
5282
|
const items = deserializeInfoList(inner.items, decodeViewInfo);
|
|
4646
5283
|
return items.length > 0 ? items[0] : null;
|
|
4647
5284
|
}
|
|
4648
|
-
async viewCreate(attachOpaqueData, schemaPath, name, definition, onConflict, transactionOpaqueData) {
|
|
5285
|
+
async viewCreate(attachOpaqueData, schemaPath, name, definition, onConflict, transactionOpaqueData, aliases, security = "regular", comment, tags, columnComments) {
|
|
4649
5286
|
await this.rpc.call("catalog_view_create", {
|
|
4650
5287
|
attach_opaque_data: attachOpaqueData,
|
|
4651
5288
|
schema_path: normalizeSchemaPath(schemaPath),
|
|
4652
5289
|
name,
|
|
4653
5290
|
definition,
|
|
5291
|
+
aliases: aliases ?? null,
|
|
5292
|
+
security,
|
|
5293
|
+
comment: comment ?? null,
|
|
5294
|
+
tags: tags ?? null,
|
|
5295
|
+
column_comments: columnComments ?? null,
|
|
4654
5296
|
on_conflict: onConflictName(onConflict),
|
|
4655
5297
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
4656
5298
|
});
|
|
@@ -4685,6 +5327,17 @@ class VgiClient {
|
|
|
4685
5327
|
transaction_opaque_data: transactionOpaqueData ?? null
|
|
4686
5328
|
});
|
|
4687
5329
|
}
|
|
5330
|
+
async viewColumnCommentSet(attachOpaqueData, schemaPath, name, columnPath, comment, ignoreNotFound = false, transactionOpaqueData) {
|
|
5331
|
+
await this.rpc.call("catalog_view_column_comment_set", {
|
|
5332
|
+
attach_opaque_data: attachOpaqueData,
|
|
5333
|
+
schema_path: normalizeSchemaPath(schemaPath),
|
|
5334
|
+
name,
|
|
5335
|
+
column_path: columnPath,
|
|
5336
|
+
comment: comment ?? null,
|
|
5337
|
+
ignore_not_found: ignoreNotFound,
|
|
5338
|
+
transaction_opaque_data: transactionOpaqueData ?? null
|
|
5339
|
+
});
|
|
5340
|
+
}
|
|
4688
5341
|
async macroGet(attachOpaqueData, schemaPath, name, transactionOpaqueData) {
|
|
4689
5342
|
const result = await this.rpc.call("catalog_macro_get", {
|
|
4690
5343
|
attach_opaque_data: attachOpaqueData,
|
|
@@ -4710,17 +5363,14 @@ class VgiClient {
|
|
|
4710
5363
|
const inner = unwrapResult(result);
|
|
4711
5364
|
return deserializeInfoList(inner.items, decodeMacroInfo);
|
|
4712
5365
|
}
|
|
4713
|
-
async macroCreate(attachOpaqueData, schemaPath, name, macroType,
|
|
5366
|
+
async macroCreate(attachOpaqueData, schemaPath, name, macroType, overloads, onConflict, transactionOpaqueData) {
|
|
4714
5367
|
const innerBatch = batchFromColumns({
|
|
4715
5368
|
attach_opaque_data: [attachOpaqueData],
|
|
4716
5369
|
schema_path: [normalizeSchemaPath(schemaPath)],
|
|
4717
5370
|
name: [name],
|
|
4718
5371
|
macro_type: [macroType],
|
|
4719
|
-
|
|
4720
|
-
definition: [definition],
|
|
5372
|
+
overloads: [overloads],
|
|
4721
5373
|
on_conflict: [onConflictName(onConflict)],
|
|
4722
|
-
parameter_default_values: [parameterDefaultValues ?? null],
|
|
4723
|
-
arguments_schema: [argumentsSchema ?? null],
|
|
4724
5374
|
transaction_opaque_data: [transactionOpaqueData ?? null]
|
|
4725
5375
|
}, MacroCreateRequestSchema);
|
|
4726
5376
|
await this.rpc.call("catalog_macro_create", wrapRequest(innerBatch));
|
|
@@ -4916,4 +5566,4 @@ export {
|
|
|
4916
5566
|
typeSignature
|
|
4917
5567
|
};
|
|
4918
5568
|
|
|
4919
|
-
//# debugId=
|
|
5569
|
+
//# debugId=4510F06EECD1F22E64756E2164756E21
|