@query-farm/vgi 0.47.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.
@@ -6362,6 +6362,8 @@ function decodeASDCollection(schema, bytes) {
6362
6362
  }
6363
6363
 
6364
6364
  // src/generated/vgi-protocol-types.ts
6365
+ var encodeCatalogCapabilities = (v) => encodeASD(CatalogCapabilitiesSchema, v);
6366
+ var decodeCatalogCapabilities = (b) => decodeASD(CatalogCapabilitiesSchema, b);
6365
6367
  var decodeSqlExpression = (b) => decodeASD(SqlExpressionSchema, b);
6366
6368
  function buildCatalogAttachResult(init) {
6367
6369
  return {
@@ -8816,6 +8818,20 @@ function catalogStringMap(raw) {
8816
8818
  return result;
8817
8819
  }
8818
8820
 
8821
+ // src/catalog/constraints.ts
8822
+ var CONSTRAINT_RECORDS_READ = "vgi.constraint.records.read.v1";
8823
+ var ROW_SCALAR_EXPRESSION = "vgi.expression.duckdb.scalar.v1";
8824
+ function selectReadProfiles(available, clientCapabilities) {
8825
+ if (clientCapabilities == null || available.length === 0)
8826
+ return [];
8827
+ const client = decodeASD(ClientCapabilitiesSchema, clientCapabilities);
8828
+ const offered = client.catalog == null ? [] : decodeCatalogCapabilities(client.catalog).read;
8829
+ const selected = available.filter((p) => offered.includes(p));
8830
+ if (!selected.includes(CONSTRAINT_RECORDS_READ))
8831
+ return selected.filter((p) => p !== ROW_SCALAR_EXPRESSION).sort();
8832
+ return selected.sort();
8833
+ }
8834
+
8819
8835
  // src/protocol/handlers/catalog/contents.ts
8820
8836
  import { ExternalRef as ExternalRef2 } from "@query-farm/vgi-rpc";
8821
8837
 
@@ -9897,7 +9913,16 @@ function catalogAdminHandlers(getCatalog, signingKey) {
9897
9913
  innerParams.implementation_version = restored.implementationVersion;
9898
9914
  optionsDict = restored.options;
9899
9915
  }
9900
- const result = await cat.attach(innerParams.name, optionsDict, innerParams.data_version_spec ?? null, innerParams.implementation_version ?? null, innerParams.client_capabilities == null ? null : toUint8Array(innerParams.client_capabilities));
9916
+ const clientCapabilities = innerParams.client_capabilities == null ? null : toUint8Array(innerParams.client_capabilities);
9917
+ const result = await cat.attach(innerParams.name, optionsDict, innerParams.data_version_spec ?? null, innerParams.implementation_version ?? null, clientCapabilities);
9918
+ if (result.catalog_capabilities != null) {
9919
+ const available = decodeCatalogCapabilities(toUint8Array(result.catalog_capabilities));
9920
+ const chosen = result.selected_capabilities == null ? { read: [], ddl: [], write: [], transaction: [] } : decodeCatalogCapabilities(toUint8Array(result.selected_capabilities));
9921
+ result.selected_capabilities = encodeCatalogCapabilities({
9922
+ ...chosen,
9923
+ read: selectReadProfiles(available.read, clientCapabilities)
9924
+ });
9925
+ }
9901
9926
  const sealedAttach = await sealAttach(toUint8Array(result.attach_opaque_data), ctx?.auth, signingKey);
9902
9927
  return wrapResult(buildCatalogAttachResult({
9903
9928
  ...result,
@@ -10763,4 +10788,4 @@ export {
10763
10788
  serveVgiWorker
10764
10789
  };
10765
10790
 
10766
- //# debugId=922FE617FEE7F17564756E2164756E21
10791
+ //# debugId=9488384AF40D279864756E2164756E21