@query-farm/vgi 0.17.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalog/descriptors.d.ts +13 -7
- package/dist/client-entry.js +2 -2
- package/dist/client-entry.js.map +4 -4
- package/dist/generated/vgi-client.d.ts +1 -1
- package/dist/index.js +16 -11
- package/dist/index.js.map +5 -5
- package/dist/serve-entry.js +2 -2
- package/dist/serve-entry.js.map +4 -4
- package/dist/worker-cf-entry.js +16 -11
- package/dist/worker-cf-entry.js.map +5 -5
- package/package.json +1 -1
- package/src/catalog/descriptors.ts +13 -7
- package/src/catalog/read-only.ts +22 -14
- package/src/generated/vgi-client.ts +2 -2
- package/src/generated/vgi-protocol-schemas.ts +2 -2
|
@@ -58,7 +58,7 @@ export interface TableInfo {
|
|
|
58
58
|
cardinality_max?: number | null;
|
|
59
59
|
column_statistics?: Uint8Array | null;
|
|
60
60
|
bind_result?: Uint8Array | null;
|
|
61
|
-
|
|
61
|
+
required_filters: string[][];
|
|
62
62
|
}
|
|
63
63
|
export interface ViewInfo {
|
|
64
64
|
comment?: string | null;
|
package/dist/index.js
CHANGED
|
@@ -5796,7 +5796,7 @@ var TableInfoSchema = schema2([
|
|
|
5796
5796
|
field2("cardinality_max", int642(), false),
|
|
5797
5797
|
field2("column_statistics", binary2(), false),
|
|
5798
5798
|
field2("bind_result", binary2(), false),
|
|
5799
|
-
field2("
|
|
5799
|
+
field2("required_filters", list2(field2("item", list2(field2("item", utf82(), true)), true)), false)
|
|
5800
5800
|
]);
|
|
5801
5801
|
var ViewInfoSchema = schema2([
|
|
5802
5802
|
field2("comment", utf82(), true),
|
|
@@ -6868,16 +6868,21 @@ class ReadOnlyCatalogInterface extends CatalogInterface {
|
|
|
6868
6868
|
const uniqueIndices = resolveIndexGroups(colSchema, t.unique);
|
|
6869
6869
|
const pkIndices = resolveIndexGroups(colSchema, t.primaryKey);
|
|
6870
6870
|
const fkBytes = serializeForeignKeys(t.foreignKey, name);
|
|
6871
|
-
const
|
|
6872
|
-
if (
|
|
6871
|
+
const requiredFilters = t.requiredFilters ?? [];
|
|
6872
|
+
if (requiredFilters.length > 0) {
|
|
6873
6873
|
const columnNames = new Set(colSchema.fields.map((f) => f.name));
|
|
6874
|
-
for (const
|
|
6875
|
-
if (!
|
|
6876
|
-
throw new Error(`Table '${t.name}':
|
|
6874
|
+
for (const group of requiredFilters) {
|
|
6875
|
+
if (!group || group.length === 0) {
|
|
6876
|
+
throw new Error(`Table '${t.name}': requiredFilters must not contain empty groups`);
|
|
6877
6877
|
}
|
|
6878
|
-
const
|
|
6879
|
-
|
|
6880
|
-
|
|
6878
|
+
for (const path2 of group) {
|
|
6879
|
+
if (!path2) {
|
|
6880
|
+
throw new Error(`Table '${t.name}': requiredFilters must not contain empty strings`);
|
|
6881
|
+
}
|
|
6882
|
+
const head = path2.split(".", 1)[0];
|
|
6883
|
+
if (!columnNames.has(head)) {
|
|
6884
|
+
throw new Error(`Table '${t.name}': requiredFilters path '${path2}' references ` + `unknown column '${head}'. Available columns: ${[...columnNames].sort().join(", ")}`);
|
|
6885
|
+
}
|
|
6881
6886
|
}
|
|
6882
6887
|
}
|
|
6883
6888
|
}
|
|
@@ -6903,7 +6908,7 @@ class ReadOnlyCatalogInterface extends CatalogInterface {
|
|
|
6903
6908
|
delete_function: null,
|
|
6904
6909
|
cardinality_estimate: t.inlinedCardinality ? Number(t.inlinedCardinality.estimate) : null,
|
|
6905
6910
|
cardinality_max: t.inlinedCardinality ? Number(t.inlinedCardinality.max) : null,
|
|
6906
|
-
|
|
6911
|
+
required_filters: requiredFilters
|
|
6907
6912
|
};
|
|
6908
6913
|
}));
|
|
6909
6914
|
}
|
|
@@ -11691,4 +11696,4 @@ export {
|
|
|
11691
11696
|
ArgumentValidationError
|
|
11692
11697
|
};
|
|
11693
11698
|
|
|
11694
|
-
//# debugId=
|
|
11699
|
+
//# debugId=B98CA527867E993364756E2164756E21
|