@query-farm/vgi 0.28.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.
Files changed (121) hide show
  1. package/README.md +52 -8
  2. package/dist/arguments/argument-spec.d.ts +57 -2
  3. package/dist/arrow/impl-arrowjs/index.d.ts +1 -1
  4. package/dist/arrow/impl-arrowjs/iterate.d.ts +10 -1
  5. package/dist/arrow/impl-arrowjs/schema.d.ts +2 -0
  6. package/dist/arrow/impl-flechette/index.d.ts +1 -1
  7. package/dist/arrow/impl-flechette/iterate.d.ts +10 -1
  8. package/dist/arrow/impl-flechette/schema.d.ts +2 -0
  9. package/dist/arrow/index.d.ts +1 -1
  10. package/dist/arrow/schema-types.d.ts +3 -1
  11. package/dist/arrow/types.d.ts +39 -3
  12. package/dist/catalog/composite.d.ts +13 -13
  13. package/dist/catalog/descriptors.d.ts +7 -3
  14. package/dist/catalog/interface.d.ts +108 -38
  15. package/dist/catalog/read-only.d.ts +32 -15
  16. package/dist/client/client.d.ts +37 -30
  17. package/dist/client/types.d.ts +2 -0
  18. package/dist/client-entry.d.ts +1 -1
  19. package/dist/client-entry.js +791 -447
  20. package/dist/client-entry.js.map +18 -17
  21. package/dist/filter-pushdown/capabilities.d.ts +3 -0
  22. package/dist/filter-pushdown/deserialize.d.ts +14 -15
  23. package/dist/filter-pushdown/evaluate.d.ts +14 -44
  24. package/dist/filter-pushdown/index.d.ts +2 -2
  25. package/dist/filter-pushdown/types.d.ts +120 -68
  26. package/dist/functions/aggregate.d.ts +4 -0
  27. package/dist/functions/registry.d.ts +5 -5
  28. package/dist/functions/scalar.d.ts +6 -1
  29. package/dist/functions/table-buffering.d.ts +9 -0
  30. package/dist/functions/table-in-out.d.ts +13 -0
  31. package/dist/functions/table.d.ts +72 -2
  32. package/dist/functions/types.d.ts +60 -2
  33. package/dist/generated/vgi-client.d.ts +114 -26
  34. package/dist/generated/vgi-protocol-schemas.d.ts +34 -0
  35. package/dist/http/fetch.d.ts +16 -0
  36. package/dist/index.core.d.ts +4 -3
  37. package/dist/index.js +3396 -2064
  38. package/dist/index.js.map +55 -49
  39. package/dist/metadata/types.d.ts +15 -2
  40. package/dist/protocol/handlers/catalog/shared.d.ts +0 -8
  41. package/dist/protocol/handlers/function.d.ts +11 -0
  42. package/dist/protocol/handlers/shared.d.ts +3 -1
  43. package/dist/protocol/serializers/bind.d.ts +1 -2
  44. package/dist/protocol/serializers/cardinality.d.ts +1 -2
  45. package/dist/protocol/serializers/splits.d.ts +126 -0
  46. package/dist/protocol/types.d.ts +36 -3
  47. package/dist/request-auth.d.ts +28 -0
  48. package/dist/schema-path.d.ts +7 -0
  49. package/dist/serve-entry.d.ts +25 -0
  50. package/dist/serve-entry.js +1129 -569
  51. package/dist/serve-entry.js.map +36 -32
  52. package/dist/split-token.d.ts +88 -0
  53. package/dist/types.d.ts +8 -0
  54. package/dist/worker-cf-entry.js +2928 -1689
  55. package/dist/worker-cf-entry.js.map +51 -44
  56. package/dist/worker.d.ts +1 -1
  57. package/package.json +3 -3
  58. package/src/arguments/argument-spec.ts +93 -4
  59. package/src/arguments/arguments.ts +0 -1
  60. package/src/arrow/impl-arrowjs/index.ts +1 -1
  61. package/src/arrow/impl-arrowjs/iterate.ts +21 -0
  62. package/src/arrow/impl-arrowjs/schema.ts +4 -0
  63. package/src/arrow/impl-flechette/index.ts +1 -1
  64. package/src/arrow/impl-flechette/iterate.ts +24 -1
  65. package/src/arrow/impl-flechette/schema.ts +4 -0
  66. package/src/arrow/index.ts +1 -1
  67. package/src/arrow/schema-types.ts +4 -0
  68. package/src/arrow/types.ts +39 -3
  69. package/src/catalog/composite.ts +26 -26
  70. package/src/catalog/descriptors.ts +12 -3
  71. package/src/catalog/interface.ts +217 -72
  72. package/src/catalog/read-only.ts +141 -84
  73. package/src/client/client.ts +97 -73
  74. package/src/client/types.ts +2 -0
  75. package/src/client-entry.ts +2 -1
  76. package/src/filter-pushdown/capabilities.ts +13 -0
  77. package/src/filter-pushdown/collector.ts +22 -35
  78. package/src/filter-pushdown/deserialize.ts +657 -221
  79. package/src/filter-pushdown/evaluate.ts +410 -499
  80. package/src/filter-pushdown/index.ts +16 -2
  81. package/src/filter-pushdown/types.ts +88 -71
  82. package/src/functions/aggregate.ts +12 -1
  83. package/src/functions/copy-from.ts +2 -1
  84. package/src/functions/copy-to.ts +2 -1
  85. package/src/functions/registry.ts +24 -22
  86. package/src/functions/scalar.ts +37 -0
  87. package/src/functions/table-buffering.ts +48 -6
  88. package/src/functions/table-in-out.ts +194 -33
  89. package/src/functions/table.ts +187 -22
  90. package/src/functions/types.ts +64 -1
  91. package/src/generated/vgi-client.ts +122 -28
  92. package/src/generated/vgi-protocol-schemas.ts +455 -58
  93. package/src/http/fetch.ts +129 -2
  94. package/src/index.core.ts +4 -2
  95. package/src/metadata/resolve.ts +43 -1
  96. package/src/metadata/serialize.ts +43 -5
  97. package/src/metadata/types.ts +17 -1
  98. package/src/protocol/dispatch.ts +1 -1
  99. package/src/protocol/handlers/aggregate.ts +23 -12
  100. package/src/protocol/handlers/catalog/admin.ts +47 -54
  101. package/src/protocol/handlers/catalog/index_methods.ts +6 -13
  102. package/src/protocol/handlers/catalog/macro.ts +12 -20
  103. package/src/protocol/handlers/catalog/shared.ts +12 -57
  104. package/src/protocol/handlers/catalog/table.ts +49 -112
  105. package/src/protocol/handlers/catalog/view.ts +18 -22
  106. package/src/protocol/handlers/function.ts +311 -18
  107. package/src/protocol/handlers/shared.ts +12 -3
  108. package/src/protocol/handlers/table-buffering.ts +11 -8
  109. package/src/protocol/serializers/bind.ts +69 -67
  110. package/src/protocol/serializers/cardinality.ts +7 -7
  111. package/src/protocol/serializers/init.ts +52 -10
  112. package/src/protocol/serializers/splits.ts +221 -0
  113. package/src/protocol/state-serializer.ts +55 -1
  114. package/src/protocol/types.ts +36 -3
  115. package/src/request-auth.ts +73 -0
  116. package/src/schema-path.ts +25 -0
  117. package/src/serve-entry.ts +69 -2
  118. package/src/split-token.ts +297 -0
  119. package/src/types.ts +9 -0
  120. package/src/worker-cf-entry.ts +2 -1
  121. package/src/worker.ts +79 -14
@@ -97,72 +97,74 @@ function typeSignature(t) {
97
97
  // src/arrow/impl-arrowjs/index.ts
98
98
  var exports_impl_arrowjs = {};
99
99
  __export(exports_impl_arrowjs, {
100
- withBatchMetadata: () => withBatchMetadata,
101
- utf8: () => utf8,
102
- union: () => union,
103
- uint8: () => uint8,
104
- uint64: () => uint64,
105
- uint32: () => uint32,
106
- uint16: () => uint16,
107
- timestamp: () => timestamp,
108
- timeSecond: () => timeSecond,
109
- timeNanosecond: () => timeNanosecond,
110
- timeMillisecond: () => timeMillisecond,
111
- timeMicrosecond: () => timeMicrosecond,
112
- time: () => time,
113
- struct: () => struct,
114
- sparseUnion: () => sparseUnion,
115
- serializeSchema: () => serializeSchema,
116
- serializeBatch: () => serializeBatch,
117
- schema: () => schema,
118
- safeNumber: () => safeNumber,
119
- readCanonicalValue: () => readCanonicalValue,
120
- projectSchema: () => projectSchema,
121
- projectBatch: () => projectBatch,
122
- nullType: () => nullType,
123
- map: () => map,
124
- list: () => list,
125
- iterRows: () => iterRows,
126
- interval: () => interval,
127
- int8: () => int8,
128
- int64: () => int64,
129
- int32: () => int32,
130
- int16: () => int16,
131
- int: () => int,
132
- float64: () => float64,
133
- float32: () => float32,
134
- float16: () => float16,
135
- fixedSizeList: () => fixedSizeList,
136
- fixedSizeBinary: () => fixedSizeBinary,
137
- filterBatch: () => filterBatch,
138
- field: () => field,
139
- emptyBatch: () => emptyBatch,
140
- duration: () => duration,
141
- dictionary: () => dictionary,
142
- deserializeSchema: () => deserializeSchema,
143
- deserializeBatch: () => deserializeBatch,
144
- denseUnion: () => denseUnion,
145
- decodeDictValue: () => decodeDictValue,
146
- decimal256: () => decimal256,
147
- decimal128: () => decimal128,
148
- decimal: () => decimal,
149
- dateMillisecond: () => dateMillisecond,
150
- dateDay: () => dateDay,
151
- date: () => date,
152
- columnFromArray: () => columnFromArray,
153
- buildStatisticsBatch: () => buildStatisticsBatch,
154
- bool: () => bool,
155
- binary: () => binary,
156
- batchToSecretDict: () => batchToSecretDict,
157
- batchToScalarDict: () => batchToScalarDict,
158
- batchFromRows: () => batchFromRows,
159
- batchFromColumns: () => batchFromColumns,
160
- backend: () => backend,
161
- adoptArrowJsShape: () => adoptArrowJsShape,
162
- UnionMode: () => UnionMode,
163
- TimeUnit: () => TimeUnit,
100
+ DateUnit: () => DateUnit,
164
101
  IntervalUnit: () => IntervalUnit,
165
- DateUnit: () => DateUnit
102
+ TimeUnit: () => TimeUnit,
103
+ UnionMode: () => UnionMode,
104
+ adoptArrowJsShape: () => adoptArrowJsShape,
105
+ backend: () => backend,
106
+ batchFromColumns: () => batchFromColumns,
107
+ batchFromRows: () => batchFromRows,
108
+ batchToScalarDict: () => batchToScalarDict,
109
+ batchToSecretDict: () => batchToSecretDict,
110
+ binary: () => binary,
111
+ bool: () => bool,
112
+ buildStatisticsBatch: () => buildStatisticsBatch,
113
+ columnFromArray: () => columnFromArray,
114
+ date: () => date,
115
+ dateDay: () => dateDay,
116
+ dateMillisecond: () => dateMillisecond,
117
+ decimal: () => decimal,
118
+ decimal128: () => decimal128,
119
+ decimal256: () => decimal256,
120
+ decodeDictValue: () => decodeDictValue,
121
+ denseUnion: () => denseUnion,
122
+ deserializeBatch: () => deserializeBatch,
123
+ deserializeSchema: () => deserializeSchema,
124
+ dictionary: () => dictionary,
125
+ duration: () => duration,
126
+ emptyBatch: () => emptyBatch,
127
+ field: () => field,
128
+ filterBatch: () => filterBatch,
129
+ fixedSizeBinary: () => fixedSizeBinary,
130
+ fixedSizeList: () => fixedSizeList,
131
+ float16: () => float16,
132
+ float32: () => float32,
133
+ float64: () => float64,
134
+ int: () => int,
135
+ int16: () => int16,
136
+ int32: () => int32,
137
+ int64: () => int64,
138
+ int8: () => int8,
139
+ interval: () => interval,
140
+ iterRows: () => iterRows,
141
+ largeBinary: () => largeBinary,
142
+ largeUtf8: () => largeUtf8,
143
+ list: () => list,
144
+ map: () => map,
145
+ nullType: () => nullType,
146
+ projectBatch: () => projectBatch,
147
+ projectSchema: () => projectSchema,
148
+ readCanonicalValue: () => readCanonicalValue,
149
+ safeNumber: () => safeNumber,
150
+ schema: () => schema,
151
+ serializeBatch: () => serializeBatch,
152
+ serializeSchema: () => serializeSchema,
153
+ sparseUnion: () => sparseUnion,
154
+ struct: () => struct,
155
+ time: () => time,
156
+ timeMicrosecond: () => timeMicrosecond,
157
+ timeMillisecond: () => timeMillisecond,
158
+ timeNanosecond: () => timeNanosecond,
159
+ timeSecond: () => timeSecond,
160
+ timestamp: () => timestamp,
161
+ uint16: () => uint16,
162
+ uint32: () => uint32,
163
+ uint64: () => uint64,
164
+ uint8: () => uint8,
165
+ union: () => union,
166
+ utf8: () => utf8,
167
+ withBatchMetadata: () => withBatchMetadata
166
168
  });
167
169
 
168
170
  // src/arrow/impl-arrowjs/schema.ts
@@ -183,7 +185,9 @@ import {
183
185
  Float32 as A_Float32,
184
186
  Float64 as A_Float64,
185
187
  Utf8 as A_Utf8,
188
+ LargeUtf8 as A_LargeUtf8,
186
189
  Binary as A_Binary,
190
+ LargeBinary as A_LargeBinary,
187
191
  Decimal as A_Decimal,
188
192
  Date_ as A_Date,
189
193
  Time as A_Time,
@@ -268,7 +272,9 @@ var float16 = () => new A_Float16;
268
272
  var float32 = () => new A_Float32;
269
273
  var float64 = () => new A_Float64;
270
274
  var utf8 = () => new A_Utf8;
275
+ var largeUtf8 = () => new A_LargeUtf8;
271
276
  var binary = () => new A_Binary;
277
+ var largeBinary = () => new A_LargeBinary;
272
278
  var fixedSizeBinary = (byteWidth) => new A_FixedSizeBinary(byteWidth);
273
279
  function decimal(precision, scale, bitWidth = 128) {
274
280
  return new A_Decimal(scale, precision, bitWidth);
@@ -327,8 +333,8 @@ import {
327
333
  DataType,
328
334
  makeData
329
335
  } from "@query-farm/apache-arrow";
330
- function emptyData(field2) {
331
- const type = field2.type;
336
+ function emptyData(field) {
337
+ const type = field.type;
332
338
  if (DataType.isList(type)) {
333
339
  const childField = type.children[0];
334
340
  return makeData({
@@ -355,8 +361,8 @@ function emptyData(field2) {
355
361
  }
356
362
  return makeData({ type, length: 0, nullCount: 0 });
357
363
  }
358
- function emptyBatch(schema2) {
359
- const a = schema2;
364
+ function emptyBatch(schema) {
365
+ const a = schema;
360
366
  const children = a.fields.map((f) => emptyData(f));
361
367
  const structType = new Struct(a.fields);
362
368
  const data = makeData({
@@ -1363,8 +1369,8 @@ function readUnion(type, col, data, index) {
1363
1369
  const children = type.children;
1364
1370
  const typeIds = data?.typeIds;
1365
1371
  const tcode = typeIds ? typeIds[index] : children.length > 0 ? 0 : -1;
1366
- const map2 = type.typeIdToChildIndex;
1367
- const childIdx = map2 && map2[tcode] !== undefined ? map2[tcode] : tcode;
1372
+ const map = type.typeIdToChildIndex;
1373
+ const childIdx = map && map[tcode] !== undefined ? map[tcode] : tcode;
1368
1374
  const childField = children[childIdx];
1369
1375
  if (!childField)
1370
1376
  return { tag: null, value: null };
@@ -1426,19 +1432,19 @@ function readDictionary(type, col, data, index) {
1426
1432
  function columnFromArray(values, type) {
1427
1433
  return vectorFromArray2(values, type).data[0];
1428
1434
  }
1429
- function batchFromRows(rows, schema2) {
1430
- const a = schema2;
1435
+ function batchFromRows(rows, schema) {
1436
+ const a = schema;
1431
1437
  if (rows.length === 0) {
1432
1438
  return emptyBatch(a);
1433
1439
  }
1434
1440
  const columns = {};
1435
- for (const field2 of a.fields) {
1436
- columns[field2.name] = rows.map((r) => r[field2.name] ?? null);
1441
+ for (const field of a.fields) {
1442
+ columns[field.name] = rows.map((r) => r[field.name] ?? null);
1437
1443
  }
1438
1444
  return batchFromColumns(columns, a);
1439
1445
  }
1440
- function batchFromColumns(columns, schema2, repr = "rich") {
1441
- const a = schema2;
1446
+ function batchFromColumns(columns, schema, repr = "rich") {
1447
+ const a = schema;
1442
1448
  const numRows = a.fields.length > 0 ? columns[a.fields[0].name]?.length ?? 0 : 0;
1443
1449
  const children = a.fields.map((f) => {
1444
1450
  const values = columns[f.name];
@@ -1466,15 +1472,15 @@ function* iterRows(batch, repr = "rich") {
1466
1472
  for (let i = 0;i < a.numRows; i++) {
1467
1473
  const row = {};
1468
1474
  for (let fi = 0;fi < a.schema.fields.length; fi++) {
1469
- const field2 = a.schema.fields[fi];
1470
- const col = a.getChild(field2.name);
1475
+ const field = a.schema.fields[fi];
1476
+ const col = a.getChild(field.name);
1471
1477
  if (!col) {
1472
- row[field2.name] = null;
1478
+ row[field.name] = null;
1473
1479
  continue;
1474
1480
  }
1475
- const canonical = readCanonicalValue(field2.type, col, i);
1481
+ const canonical = readCanonicalValue(field.type, col, i);
1476
1482
  const codec = codecs[fi];
1477
- row[field2.name] = repr === "raw" ? codec.canonicalToRaw(canonical) : codec.canonicalToRich(canonical);
1483
+ row[field.name] = repr === "raw" ? codec.canonicalToRaw(canonical) : codec.canonicalToRich(canonical);
1478
1484
  }
1479
1485
  yield row;
1480
1486
  }
@@ -1486,12 +1492,12 @@ function batchToScalarDict(batch) {
1486
1492
  if (a.numRows === 0)
1487
1493
  return {};
1488
1494
  const result = {};
1489
- for (const field2 of a.schema.fields) {
1490
- const col = a.getChild(field2.name);
1495
+ for (const field of a.schema.fields) {
1496
+ const col = a.getChild(field.name);
1491
1497
  if (col) {
1492
- const type = field2.type;
1498
+ const type = field.type;
1493
1499
  const canonical = readCanonicalValue(type, col, 0);
1494
- result[field2.name] = codecFor(type).canonicalToRich(canonical);
1500
+ result[field.name] = codecFor(type).canonicalToRich(canonical);
1495
1501
  }
1496
1502
  }
1497
1503
  return result;
@@ -1517,18 +1523,18 @@ function batchToSecretDict(batch) {
1517
1523
  if (a.numRows === 0)
1518
1524
  return {};
1519
1525
  const result = {};
1520
- for (const field2 of a.schema.fields) {
1521
- const col = a.getChild(field2.name);
1526
+ for (const field of a.schema.fields) {
1527
+ const col = a.getChild(field.name);
1522
1528
  if (col) {
1523
- const type = field2.type;
1529
+ const type = field.type;
1524
1530
  const val = codecFor(type).canonicalToRich(readCanonicalValue(type, col, 0));
1525
- let key = field2.name;
1531
+ let key = field.name;
1526
1532
  let scope;
1527
- if (field2.name.startsWith("secret_")) {
1528
- const secretType = field2.metadata?.get?.("secret_type");
1533
+ if (field.name.startsWith("secret_")) {
1534
+ const secretType = field.metadata?.get?.("secret_type");
1529
1535
  if (secretType) {
1530
1536
  key = secretType;
1531
- scope = field2.metadata?.get?.("scope") ?? undefined;
1537
+ scope = field.metadata?.get?.("scope") ?? undefined;
1532
1538
  }
1533
1539
  }
1534
1540
  if (val && typeof val === "object" && !ArrayBuffer.isView(val)) {
@@ -1547,8 +1553,13 @@ function batchToSecretDict(batch) {
1547
1553
  }
1548
1554
  return result;
1549
1555
  }
1556
+ var MAX_SAFE = BigInt(Number.MAX_SAFE_INTEGER);
1557
+ var MIN_SAFE = -MAX_SAFE;
1550
1558
  function safeNumber(value) {
1551
1559
  if (typeof value === "bigint") {
1560
+ if (value > MAX_SAFE || value < MIN_SAFE) {
1561
+ throw new RangeError(`${value} cannot be represented exactly as a JS number ` + `(|value| > Number.MAX_SAFE_INTEGER). Keep it as a bigint.`);
1562
+ }
1552
1563
  return Number(value);
1553
1564
  }
1554
1565
  return value;
@@ -1572,11 +1583,11 @@ function filterBatch(batch, mask) {
1572
1583
  indices.push(i);
1573
1584
  }
1574
1585
  const columns = {};
1575
- for (const field2 of a.schema.fields) {
1576
- const col = a.getChild(field2.name);
1577
- const type = field2.type;
1586
+ for (const field of a.schema.fields) {
1587
+ const col = a.getChild(field.name);
1588
+ const type = field.type;
1578
1589
  const codec = codecFor(type);
1579
- columns[field2.name] = indices.map((i) => codec.canonicalToRich(readCanonicalValue(type, col, i)));
1590
+ columns[field.name] = indices.map((i) => codec.canonicalToRich(readCanonicalValue(type, col, i)));
1580
1591
  }
1581
1592
  return batchFromColumns(columns, a.schema);
1582
1593
  }
@@ -1598,8 +1609,8 @@ function validateProjectionIds(caller, projectionIds, fieldCount) {
1598
1609
  }
1599
1610
  return projectionIds.filter((i) => i >= 0 && i < fieldCount);
1600
1611
  }
1601
- function projectSchema(projectionIds, schema2) {
1602
- const a = schema2;
1612
+ function projectSchema(projectionIds, schema) {
1613
+ const a = schema;
1603
1614
  if (!projectionIds)
1604
1615
  return a;
1605
1616
  const validIds = validateProjectionIds("projectSchema", projectionIds, a.fields.length);
@@ -1640,9 +1651,9 @@ import {
1640
1651
  RecordBatchStreamWriter,
1641
1652
  RecordBatchReader
1642
1653
  } from "@query-farm/apache-arrow";
1643
- function serializeSchema(schema2) {
1654
+ function serializeSchema(schema) {
1644
1655
  const writer = new RecordBatchStreamWriter;
1645
- writer.reset(undefined, schema2);
1656
+ writer.reset(undefined, schema);
1646
1657
  writer.close();
1647
1658
  return writer.toUint8Array(true);
1648
1659
  }
@@ -1710,20 +1721,20 @@ function buildTypedColumnData(values, type) {
1710
1721
  function buildStatisticsBatch(stats) {
1711
1722
  if (stats.length === 0) {
1712
1723
  const nullField = new Field3("0", new Null, true);
1713
- const unionType2 = new SparseUnion([0], [nullField]);
1714
- const minData2 = makeData5({
1715
- type: unionType2,
1724
+ const unionType = new SparseUnion([0], [nullField]);
1725
+ const minData = makeData5({
1726
+ type: unionType,
1716
1727
  length: 0,
1717
1728
  typeIds: new Int8Array(0),
1718
1729
  children: [makeData5({ type: new Null, length: 0, nullCount: 0 })]
1719
1730
  });
1720
- const maxData2 = makeData5({
1721
- type: unionType2,
1731
+ const maxData = makeData5({
1732
+ type: unionType,
1722
1733
  length: 0,
1723
1734
  typeIds: new Int8Array(0),
1724
1735
  children: [makeData5({ type: new Null, length: 0, nullCount: 0 })]
1725
1736
  });
1726
- return assemble([], minData2, maxData2, [], [], [], [], [], unionType2);
1737
+ return assemble([], minData, maxData, [], [], [], [], [], unionType);
1727
1738
  }
1728
1739
  const typeOrder = [];
1729
1740
  const typeIdMap = new Map;
@@ -1767,7 +1778,7 @@ function buildStatisticsBatch(stats) {
1767
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);
1768
1779
  }
1769
1780
  function assemble(columnNames, minData, maxData, hasNull, hasNotNull, distinctCount, containsUnicode, maxStringLength, unionType) {
1770
- const schema2 = new Schema5([
1781
+ const schema = new Schema5([
1771
1782
  new Field3("column_name", new Utf8, false),
1772
1783
  new Field3("min", unionType, true),
1773
1784
  new Field3("max", unionType, true),
@@ -1788,9 +1799,9 @@ function assemble(columnNames, minData, maxData, hasNull, hasNotNull, distinctCo
1788
1799
  buildTypedColumnData(containsUnicode, new Bool),
1789
1800
  buildTypedColumnData(maxStringLength, new Uint64)
1790
1801
  ];
1791
- const structType = new Struct5(schema2.fields);
1802
+ const structType = new Struct5(schema.fields);
1792
1803
  const data = makeData5({ type: structType, length: n, children, nullCount: 0 });
1793
- return new RecordBatch6(schema2, data);
1804
+ return new RecordBatch6(schema, data);
1794
1805
  }
1795
1806
 
1796
1807
  // src/arrow/impl-arrowjs/index.ts
@@ -1808,9 +1819,11 @@ var bool2 = () => bool();
1808
1819
  var int162 = () => int16();
1809
1820
  var int322 = () => int32();
1810
1821
  var int642 = () => int64();
1822
+ var uint642 = () => uint64();
1811
1823
  var float642 = () => float64();
1812
1824
  var utf82 = () => utf8();
1813
1825
  var binary2 = () => binary();
1826
+ var largeBinary2 = () => largeBinary();
1814
1827
  var UNIT_TO_TAG = {
1815
1828
  [TimeUnit.SECOND]: "s",
1816
1829
  [TimeUnit.MILLISECOND]: "ms",
@@ -1893,47 +1906,100 @@ function unwrapScalar(val) {
1893
1906
  return val;
1894
1907
  }
1895
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
+
1896
1953
  // src/types.ts
1897
1954
  var FunctionType;
1898
- ((FunctionType2) => {
1899
- FunctionType2["SCALAR"] = "scalar";
1900
- FunctionType2["TABLE"] = "table";
1901
- FunctionType2["TABLE_BUFFERING"] = "table_buffering";
1902
- FunctionType2["AGGREGATE"] = "aggregate";
1955
+ ((FunctionType) => {
1956
+ FunctionType["SCALAR"] = "scalar";
1957
+ FunctionType["TABLE"] = "table";
1958
+ FunctionType["TABLE_BUFFERING"] = "table_buffering";
1959
+ FunctionType["AGGREGATE"] = "aggregate";
1903
1960
  })(FunctionType ||= {});
1904
1961
  var FunctionStability;
1905
- ((FunctionStability2) => {
1906
- FunctionStability2["CONSISTENT"] = "CONSISTENT";
1907
- FunctionStability2["VOLATILE"] = "VOLATILE";
1908
- FunctionStability2["CONSISTENT_WITHIN_QUERY"] = "CONSISTENT_WITHIN_QUERY";
1962
+ ((FunctionStability) => {
1963
+ FunctionStability["CONSISTENT"] = "CONSISTENT";
1964
+ FunctionStability["VOLATILE"] = "VOLATILE";
1965
+ FunctionStability["CONSISTENT_WITHIN_QUERY"] = "CONSISTENT_WITHIN_QUERY";
1909
1966
  })(FunctionStability ||= {});
1910
1967
  var NullHandling;
1911
- ((NullHandling2) => {
1912
- NullHandling2["DEFAULT"] = "DEFAULT";
1913
- NullHandling2["SPECIAL"] = "SPECIAL";
1968
+ ((NullHandling) => {
1969
+ NullHandling["DEFAULT"] = "DEFAULT";
1970
+ NullHandling["SPECIAL"] = "SPECIAL";
1914
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 ||= {});
1915
1981
  var OrderPreservation;
1916
- ((OrderPreservation2) => {
1917
- OrderPreservation2["PRESERVES_ORDER"] = "PRESERVES_ORDER";
1918
- OrderPreservation2["NO_ORDER_GUARANTEE"] = "NO_ORDER_GUARANTEE";
1919
- OrderPreservation2["FIXED_ORDER"] = "FIXED_ORDER";
1982
+ ((OrderPreservation) => {
1983
+ OrderPreservation["PRESERVES_ORDER"] = "PRESERVES_ORDER";
1984
+ OrderPreservation["NO_ORDER_GUARANTEE"] = "NO_ORDER_GUARANTEE";
1985
+ OrderPreservation["FIXED_ORDER"] = "FIXED_ORDER";
1920
1986
  })(OrderPreservation ||= {});
1921
1987
  var OrderDependence;
1922
- ((OrderDependence2) => {
1923
- OrderDependence2["ORDER_DEPENDENT"] = "ORDER_DEPENDENT";
1924
- OrderDependence2["NOT_ORDER_DEPENDENT"] = "NOT_ORDER_DEPENDENT";
1988
+ ((OrderDependence) => {
1989
+ OrderDependence["ORDER_DEPENDENT"] = "ORDER_DEPENDENT";
1990
+ OrderDependence["NOT_ORDER_DEPENDENT"] = "NOT_ORDER_DEPENDENT";
1925
1991
  })(OrderDependence ||= {});
1926
1992
  var DistinctDependence;
1927
- ((DistinctDependence2) => {
1928
- DistinctDependence2["DISTINCT_DEPENDENT"] = "DISTINCT_DEPENDENT";
1929
- DistinctDependence2["NOT_DISTINCT_DEPENDENT"] = "NOT_DISTINCT_DEPENDENT";
1993
+ ((DistinctDependence) => {
1994
+ DistinctDependence["DISTINCT_DEPENDENT"] = "DISTINCT_DEPENDENT";
1995
+ DistinctDependence["NOT_DISTINCT_DEPENDENT"] = "NOT_DISTINCT_DEPENDENT";
1930
1996
  })(DistinctDependence ||= {});
1931
1997
  var TableInOutPhase;
1932
- ((TableInOutPhase2) => {
1933
- TableInOutPhase2["INPUT"] = "INPUT";
1934
- TableInOutPhase2["FINALIZE"] = "FINALIZE";
1935
- TableInOutPhase2["TABLE_BUFFERING"] = "TABLE_BUFFERING";
1936
- TableInOutPhase2["TABLE_BUFFERING_FINALIZE"] = "TABLE_BUFFERING_FINALIZE";
1998
+ ((TableInOutPhase) => {
1999
+ TableInOutPhase["INPUT"] = "INPUT";
2000
+ TableInOutPhase["FINALIZE"] = "FINALIZE";
2001
+ TableInOutPhase["TABLE_BUFFERING"] = "TABLE_BUFFERING";
2002
+ TableInOutPhase["TABLE_BUFFERING_FINALIZE"] = "TABLE_BUFFERING_FINALIZE";
1937
2003
  })(TableInOutPhase ||= {});
1938
2004
  var VGI_ARG_KEY = "vgi_arg";
1939
2005
  var VGI_ARG_NAMED = "named";
@@ -1973,67 +2039,32 @@ function toUint8Array2(val) {
1973
2039
  }
1974
2040
  return result;
1975
2041
  }
1976
- function buildSingleRowBatch(schema3, values) {
2042
+ function buildSingleRowBatch(schema, values) {
1977
2043
  const cols = {};
1978
- for (const f of schema3.fields) {
2044
+ for (const f of schema.fields) {
1979
2045
  let val = values[f.name];
1980
2046
  if (isInt(f.type) && f.type.bitWidth === 64 && typeof val === "number") {
1981
2047
  val = BigInt(val);
1982
2048
  }
1983
2049
  cols[f.name] = [val];
1984
2050
  }
1985
- return batchFromColumns(cols, schema3);
1986
- }
1987
-
1988
- // src/protocol/serializers/arguments.ts
1989
- function serializeArguments(args) {
1990
- const structFields = [];
1991
- const structValues = {};
1992
- for (let i = 0;i < args.positional.length; i++) {
1993
- const val = args.positional[i];
1994
- const fieldName = `positional_${i}`;
1995
- structFields.push(field2(fieldName, inferScalarType(val), true));
1996
- structValues[fieldName] = val;
1997
- }
1998
- for (const [name, val] of args.named) {
1999
- const fieldName = `named_${name}`;
2000
- structFields.push(field2(fieldName, inferScalarType(val), true));
2001
- structValues[fieldName] = val;
2002
- }
2003
- const structType = struct2(structFields);
2004
- const sch = schema2([field2("args", structType, true)]);
2005
- const structRow = {};
2006
- for (const f of structFields) {
2007
- let val = structValues[f.name];
2008
- if (isInt(f.type) && f.type.bitWidth === 64 && typeof val === "number") {
2009
- val = BigInt(val);
2010
- }
2011
- structRow[f.name] = val;
2012
- }
2013
- const batch = batchFromColumns({ args: [structRow] }, sch);
2014
- return serializeBatch(batch);
2015
- }
2016
- function inferScalarType(val) {
2017
- if (val === null || val === undefined)
2018
- return nullType2();
2019
- if (typeof val === "string")
2020
- return utf82();
2021
- if (typeof val === "boolean")
2022
- return bool2();
2023
- if (typeof val === "number")
2024
- return int642();
2025
- if (typeof val === "bigint")
2026
- return int642();
2027
- if (val instanceof Uint8Array || val instanceof ArrayBuffer)
2028
- return binary2();
2029
- return utf82();
2051
+ return batchFromColumns(cols, schema);
2030
2052
  }
2031
2053
 
2032
2054
  // src/protocol/serializers/bind.ts
2055
+ var COPY_FROM_STRUCT_TYPE = struct2([
2056
+ field2("format", utf82(), false),
2057
+ field2("file_path", utf82(), false),
2058
+ field2("expected_schema", binary2(), false)
2059
+ ]);
2060
+ var COPY_TO_STRUCT_TYPE = struct2([
2061
+ field2("format", utf82(), false),
2062
+ field2("file_path", utf82(), false)
2063
+ ]);
2033
2064
  var BIND_REQUEST_SCHEMA = schema2([
2034
2065
  field2("function_name", utf82(), false),
2035
2066
  field2("arguments", binary2(), false),
2036
- field2("function_type", utf82(), false),
2067
+ field2("function_type", dictionary2(utf82(), int162()), false),
2037
2068
  field2("input_schema", binary2(), true),
2038
2069
  field2("settings", binary2(), true),
2039
2070
  field2("secrets", binary2(), true),
@@ -2042,28 +2073,13 @@ var BIND_REQUEST_SCHEMA = schema2([
2042
2073
  field2("resolved_secrets_provided", bool2(), false),
2043
2074
  field2("at_unit", utf82(), true),
2044
2075
  field2("at_value", utf82(), true),
2045
- field2("schema_name", utf82(), true)
2046
- ]);
2047
- var COPY_FROM_STRUCT_TYPE = struct2([
2048
- field2("format", utf82(), false),
2049
- field2("file_path", utf82(), false),
2050
- field2("expected_schema", binary2(), false)
2051
- ]);
2052
- var COPY_FROM_FIELD = field2("copy_from", COPY_FROM_STRUCT_TYPE, true);
2053
- var COPY_TO_STRUCT_TYPE = struct2([
2054
- field2("format", utf82(), false),
2055
- field2("file_path", utf82(), false)
2056
- ]);
2057
- var COPY_TO_FIELD = field2("copy_to", COPY_TO_STRUCT_TYPE, true);
2058
- var BIND_RESPONSE_SCHEMA = schema2([
2059
- field2("output_schema", binary2(), false),
2060
- field2("opaque_data", binary2(), true),
2061
- field2("lookup_secret_types", list2(field2("item", utf82(), true)), false),
2062
- field2("lookup_scopes", list2(field2("item", utf82(), true)), false),
2063
- field2("lookup_names", list2(field2("item", utf82(), true)), false)
2076
+ field2("copy_from", COPY_FROM_STRUCT_TYPE, true),
2077
+ field2("copy_to", COPY_TO_STRUCT_TYPE, true),
2078
+ field2("schema_path", list2(field2("item", utf82(), true)), true),
2079
+ field2("argument_names", list2(field2("item", utf82(), true)), true)
2064
2080
  ]);
2065
2081
  function serializeBindRequest(req) {
2066
- const row = {
2082
+ return buildSingleRowBatch(BIND_REQUEST_SCHEMA, {
2067
2083
  function_name: req.function_name,
2068
2084
  arguments: serializeArguments(req.arguments),
2069
2085
  function_type: req.function_type,
@@ -2075,29 +2091,15 @@ function serializeBindRequest(req) {
2075
2091
  resolved_secrets_provided: req.resolved_secrets_provided ?? false,
2076
2092
  at_unit: req.at_unit ?? null,
2077
2093
  at_value: req.at_value ?? null,
2078
- schema_name: req.schema_name ?? null
2079
- };
2080
- const extraFields = [];
2081
- if (req.copy_from) {
2082
- extraFields.push(COPY_FROM_FIELD);
2083
- row.copy_from = {
2094
+ copy_from: req.copy_from ? {
2084
2095
  format: req.copy_from.format,
2085
2096
  file_path: req.copy_from.file_path,
2086
2097
  expected_schema: serializeSchema(req.copy_from.expected_schema)
2087
- };
2088
- }
2089
- if (req.copy_to) {
2090
- extraFields.push(COPY_TO_FIELD);
2091
- row.copy_to = {
2092
- format: req.copy_to.format,
2093
- file_path: req.copy_to.file_path
2094
- };
2095
- }
2096
- if (extraFields.length > 0) {
2097
- const schemaWithCopy = schema2([...BIND_REQUEST_SCHEMA.fields, ...extraFields]);
2098
- return buildSingleRowBatch(schemaWithCopy, row);
2099
- }
2100
- return buildSingleRowBatch(BIND_REQUEST_SCHEMA, row);
2098
+ } : null,
2099
+ copy_to: req.copy_to ? { format: req.copy_to.format, file_path: req.copy_to.file_path } : null,
2100
+ schema_path: req.schema_path ?? null,
2101
+ argument_names: req.argument_names ?? null
2102
+ });
2101
2103
  }
2102
2104
  function deserializeBindResponse(params) {
2103
2105
  const toStrArray = (val) => {
@@ -2119,20 +2121,22 @@ var INIT_REQUEST_SCHEMA = schema2([
2119
2121
  field2("bind_call", binary2(), false),
2120
2122
  field2("output_schema", binary2(), false),
2121
2123
  field2("bind_opaque_data", binary2(), true),
2122
- field2("projection_ids", list2(field2("item", int642(), false)), true),
2123
- field2("pushdown_filters", binary2(), true),
2124
- field2("join_keys", list2(field2("item", binary2(), true)), false),
2125
- field2("phase", utf82(), true),
2124
+ field2("projection_ids", list2(field2("item", int642(), true)), true),
2125
+ field2("pushdown_filters", largeBinary2(), true),
2126
+ field2("join_keys", list2(field2("item", largeBinary2(), true)), true),
2127
+ field2("split_tokens", list2(field2("item", largeBinary2(), true)), true),
2128
+ field2("row_limit", int642(), true),
2129
+ field2("phase", dictionary2(utf82(), int162()), true),
2130
+ field2("finalize_state_id", binary2(), true),
2126
2131
  field2("execution_id", binary2(), true),
2127
2132
  field2("init_opaque_data", binary2(), true),
2128
2133
  field2("substream_id", binary2(), true),
2129
2134
  field2("order_by_column_name", utf82(), true),
2130
- field2("order_by_direction", utf82(), true),
2131
- field2("order_by_null_order", utf82(), true),
2135
+ field2("order_by_direction", dictionary2(utf82(), int162()), true),
2136
+ field2("order_by_null_order", dictionary2(utf82(), int162()), true),
2132
2137
  field2("order_by_limit", int642(), true),
2133
2138
  field2("tablesample_percentage", float642(), true),
2134
- field2("tablesample_seed", int642(), true),
2135
- field2("finalize_state_id", binary2(), true)
2139
+ field2("tablesample_seed", int642(), true)
2136
2140
  ]);
2137
2141
  var GLOBAL_INIT_RESPONSE_SCHEMA = schema2([
2138
2142
  field2("execution_id", binary2(), false),
@@ -2149,7 +2153,10 @@ function serializeInitRequest(req) {
2149
2153
  projection_ids: req.projection_ids?.map((n) => BigInt(n)) ?? null,
2150
2154
  pushdown_filters: req.pushdown_filters ? serializeBatch(req.pushdown_filters) : null,
2151
2155
  join_keys: (req.join_keys ?? []).map((b) => serializeBatch(b)),
2156
+ split_tokens: req.split_tokens ?? null,
2157
+ row_limit: req.row_limit ?? null,
2152
2158
  phase: req.phase ?? null,
2159
+ finalize_state_id: req.finalize_state_id ?? null,
2153
2160
  execution_id: req.execution_id ?? null,
2154
2161
  init_opaque_data: req.init_opaque_data ?? null,
2155
2162
  substream_id: req.substream_id ?? null,
@@ -2158,8 +2165,7 @@ function serializeInitRequest(req) {
2158
2165
  order_by_null_order: req.order_by_null_order ?? null,
2159
2166
  order_by_limit: req.order_by_limit ?? null,
2160
2167
  tablesample_percentage: req.tablesample_percentage ?? null,
2161
- tablesample_seed: req.tablesample_seed ?? null,
2162
- finalize_state_id: req.finalize_state_id ?? null
2168
+ tablesample_seed: req.tablesample_seed ?? null
2163
2169
  };
2164
2170
  return buildSingleRowBatch(INIT_REQUEST_SCHEMA, row);
2165
2171
  }
@@ -2227,21 +2233,26 @@ class NoCatalogError extends VgiError {
2227
2233
  }
2228
2234
  }
2229
2235
 
2236
+ // src/schema-path.ts
2237
+ function normalizeSchemaPath(path) {
2238
+ return typeof path === "string" ? [path] : Array.from(path, String);
2239
+ }
2240
+
2230
2241
  // src/codec/asd.ts
2231
- function encodeASD(schema3, obj) {
2232
- return serializeBatch(batchFromRows([obj], schema3));
2242
+ function encodeASD(schema, obj) {
2243
+ return serializeBatch(batchFromRows([obj], schema));
2233
2244
  }
2234
- function decodeASD(schema3, bytes) {
2245
+ function decodeASD(schema, bytes) {
2235
2246
  const batch = deserializeBatch(bytes);
2236
2247
  if (batch.numRows === 0) {
2237
- const names = schema3.fields.map((f) => f.name).join(",");
2248
+ const names = schema.fields.map((f) => f.name).join(",");
2238
2249
  throw new Error(`decodeASD: empty batch (expected 1 row for ${names})`);
2239
2250
  }
2240
2251
  const out = {};
2241
- for (const field3 of schema3.fields) {
2242
- const col = batch.getChild(field3.name);
2252
+ for (const field of schema.fields) {
2253
+ const col = batch.getChild(field.name);
2243
2254
  const raw = col ? col.get(0) : null;
2244
- out[field3.name] = normalizeValue(raw, field3.type);
2255
+ out[field.name] = normalizeValue(raw, field.type);
2245
2256
  }
2246
2257
  return out;
2247
2258
  }
@@ -2319,21 +2330,21 @@ var CatalogInfoSchema = schema2([
2319
2330
  field2("implementation_version", utf82(), true),
2320
2331
  field2("data_version_spec", utf82(), true),
2321
2332
  field2("attach_option_specs", list2(field2("item", binary2(), true)), false),
2322
- field2("releases", list2(field2("item", struct2([field2("version", utf82(), false), field2("released_at", timestamp2(TimeUnit2.MICROSECOND, "UTC"), false), field2("summary", utf82(), false), field2("notes_url", utf82(), true)]), true)), false),
2333
+ field2("releases", list2(field2("item", struct2([field2("version", utf82(), false), field2("released_at", timestamp2(TimeUnit2.MICROSECOND, "UTC"), true), field2("summary", utf82(), false), field2("notes_url", utf82(), true)]), true)), false),
2323
2334
  field2("source_url", utf82(), true)
2324
2335
  ]);
2325
2336
  var SchemaInfoSchema = schema2([
2326
2337
  field2("comment", utf82(), true),
2327
2338
  field2("tags", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), false),
2328
2339
  field2("attach_opaque_data", binary2(), false),
2329
- field2("name", utf82(), false),
2340
+ field2("path", list2(field2("item", utf82(), true)), false),
2330
2341
  field2("estimated_object_count", map2(field2("key", utf82(), false), field2("value", int642(), true), false), true)
2331
2342
  ]);
2332
2343
  var TableInfoSchema = schema2([
2333
2344
  field2("comment", utf82(), true),
2334
2345
  field2("tags", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), false),
2335
2346
  field2("name", utf82(), false),
2336
- field2("schema_name", utf82(), false),
2347
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2337
2348
  field2("columns", binary2(), false),
2338
2349
  field2("not_null_constraints", list2(field2("item", int322(), true)), false),
2339
2350
  field2("unique_constraints", list2(field2("item", list2(field2("item", int322(), true)), true)), false),
@@ -2345,21 +2356,21 @@ var TableInfoSchema = schema2([
2345
2356
  field2("supports_delete", bool2(), false),
2346
2357
  field2("supports_returning", bool2(), false),
2347
2358
  field2("supports_column_statistics", bool2(), false),
2348
- field2("scan_function", binary2(), false),
2349
- field2("insert_function", binary2(), false),
2350
- field2("update_function", binary2(), false),
2351
- field2("delete_function", binary2(), false),
2352
- field2("cardinality_estimate", int642(), false),
2353
- field2("cardinality_max", int642(), false),
2354
- field2("column_statistics", binary2(), false),
2355
- field2("bind_result", binary2(), false),
2359
+ field2("scan_function", binary2(), true),
2360
+ field2("insert_function", binary2(), true),
2361
+ field2("update_function", binary2(), true),
2362
+ field2("delete_function", binary2(), true),
2363
+ field2("cardinality_estimate", int642(), true),
2364
+ field2("cardinality_max", int642(), true),
2365
+ field2("column_statistics", binary2(), true),
2366
+ field2("bind_result", binary2(), true),
2356
2367
  field2("required_filters", list2(field2("item", list2(field2("item", utf82(), true)), true)), false)
2357
2368
  ]);
2358
2369
  var ViewInfoSchema = schema2([
2359
2370
  field2("comment", utf82(), true),
2360
2371
  field2("tags", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), false),
2361
2372
  field2("name", utf82(), false),
2362
- field2("schema_name", utf82(), false),
2373
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2363
2374
  field2("definition", utf82(), false),
2364
2375
  field2("column_comments", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), false)
2365
2376
  ]);
@@ -2367,12 +2378,14 @@ var FunctionInfoSchema = schema2([
2367
2378
  field2("comment", utf82(), true),
2368
2379
  field2("tags", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), false),
2369
2380
  field2("name", utf82(), false),
2370
- field2("schema_name", utf82(), false),
2381
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2371
2382
  field2("function_type", dictionary2(utf82(), int162()), false),
2372
2383
  field2("arguments", binary2(), false),
2373
2384
  field2("output_schema", binary2(), false),
2385
+ field2("parameter_default_values", binary2(), true),
2374
2386
  field2("stability", dictionary2(utf82(), int162()), true),
2375
2387
  field2("null_handling", dictionary2(utf82(), int162()), true),
2388
+ field2("argument_monotonicity", list2(field2("item", utf82(), true)), true),
2376
2389
  field2("description", utf82(), false),
2377
2390
  field2("examples", list2(field2("item", struct2([field2("sql", utf82(), false), field2("description", utf82(), false), field2("expected_output", utf82(), true)]), true)), false),
2378
2391
  field2("categories", list2(field2("item", utf82(), true)), false),
@@ -2380,10 +2393,17 @@ var FunctionInfoSchema = schema2([
2380
2393
  field2("filter_pushdown", bool2(), true),
2381
2394
  field2("sampling_pushdown", bool2(), true),
2382
2395
  field2("late_materialization", bool2(), true),
2383
- field2("supported_expression_filters", list2(field2("item", utf82(), true)), false),
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),
2384
2400
  field2("order_preservation", dictionary2(utf82(), int162()), true),
2385
- field2("max_workers", int322(), false),
2401
+ field2("max_workers", int322(), true),
2386
2402
  field2("supports_batch_index", bool2(), false),
2403
+ field2("supports_splits", bool2(), false),
2404
+ field2("filters_exactly_applied", bool2(), false),
2405
+ field2("supports_positions", bool2(), false),
2406
+ field2("split_token_ttl_seconds", int642(), true),
2387
2407
  field2("partition_kind", dictionary2(utf82(), int162()), false),
2388
2408
  field2("order_dependent", dictionary2(utf82(), int162()), false),
2389
2409
  field2("distinct_dependent", dictionary2(utf82(), int162()), false),
@@ -2401,18 +2421,18 @@ var MacroInfoSchema = schema2([
2401
2421
  field2("comment", utf82(), true),
2402
2422
  field2("tags", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), false),
2403
2423
  field2("name", utf82(), false),
2404
- field2("schema_name", utf82(), false),
2424
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2405
2425
  field2("macro_type", dictionary2(utf82(), int162()), false),
2406
2426
  field2("parameters", list2(field2("item", utf82(), true)), false),
2407
- field2("parameter_default_values", binary2(), false),
2427
+ field2("parameter_default_values", binary2(), true),
2408
2428
  field2("definition", utf82(), false),
2409
- field2("arguments_schema", binary2(), false)
2429
+ field2("arguments_schema", binary2(), true)
2410
2430
  ]);
2411
2431
  var IndexInfoSchema = schema2([
2412
2432
  field2("comment", utf82(), true),
2413
2433
  field2("tags", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), false),
2414
2434
  field2("name", utf82(), false),
2415
- field2("schema_name", utf82(), false),
2435
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2416
2436
  field2("table_name", utf82(), false),
2417
2437
  field2("index_type", utf82(), false),
2418
2438
  field2("constraint_type", dictionary2(utf82(), int162()), false),
@@ -2432,7 +2452,8 @@ var CopyFromFormatInfoSchema = schema2([
2432
2452
  var ScanFunctionResultSchema = schema2([
2433
2453
  field2("function_name", utf82(), false),
2434
2454
  field2("arguments", binary2(), false),
2435
- 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)
2436
2457
  ]);
2437
2458
  var ScanBranchesResultSchema = schema2([
2438
2459
  field2("branches", list2(field2("item", binary2(), true)), false),
@@ -2444,8 +2465,24 @@ var ScanBranchSchema = schema2([
2444
2465
  field2("branch_filter", utf82(), true),
2445
2466
  field2("writable", bool2(), false),
2446
2467
  field2("source_catalog", utf82(), true),
2447
- field2("source_schema", utf82(), true),
2448
- field2("source_table", utf82(), true)
2468
+ field2("source_schema_path", list2(field2("item", utf82(), true)), true),
2469
+ field2("source_table", utf82(), true),
2470
+ field2("format_name", utf82(), true),
2471
+ field2("format_locations", list2(field2("item", utf82(), true)), true),
2472
+ field2("format_options", binary2(), true),
2473
+ field2("schema_path", list2(field2("item", utf82(), true)), true)
2474
+ ]);
2475
+ var ScanSplitSchema = schema2([
2476
+ field2("payload", binary2(), false),
2477
+ field2("token", binary2(), false),
2478
+ field2("estimated_rows", int642(), true),
2479
+ field2("rows_exact", bool2(), false),
2480
+ field2("estimated_bytes", int642(), true),
2481
+ field2("partition_bounds", binary2(), true),
2482
+ field2("column_statistics", binary2(), true),
2483
+ field2("location_ids", list2(field2("item", int642(), true)), true),
2484
+ field2("start_position", binary2(), true),
2485
+ field2("end_position", binary2(), true)
2449
2486
  ]);
2450
2487
  var AttachCatalogInfoSchema = schema2([
2451
2488
  field2("alias", utf82(), false),
@@ -2456,9 +2493,288 @@ var AttachCatalogInfoSchema = schema2([
2456
2493
  field2("required", bool2(), false),
2457
2494
  field2("secret_ref", utf82(), false)
2458
2495
  ]);
2459
- var AggregateBindResultSchema = schema2([
2460
- field2("output_schema", binary2(), false),
2461
- field2("execution_id", binary2(), false)
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
+ ]);
2502
+ var AggregateBindRequestSchema = schema2([
2503
+ field2("function_name", utf82(), false),
2504
+ field2("arguments", binary2(), false),
2505
+ field2("input_schema", binary2(), true),
2506
+ field2("settings", binary2(), true),
2507
+ field2("secrets", binary2(), true),
2508
+ field2("attach_opaque_data", binary2(), true),
2509
+ field2("schema_path", list2(field2("item", utf82(), true)), true),
2510
+ field2("argument_names", list2(field2("item", utf82(), true)), true)
2511
+ ]);
2512
+ var AggregateCombineRequestSchema = schema2([
2513
+ field2("function_name", utf82(), false),
2514
+ field2("execution_id", binary2(), false),
2515
+ field2("merge_batch", binary2(), false),
2516
+ field2("attach_opaque_data", binary2(), true),
2517
+ field2("schema_path", list2(field2("item", utf82(), true)), true)
2518
+ ]);
2519
+ var AggregateDestructorRequestSchema = schema2([
2520
+ field2("function_name", utf82(), false),
2521
+ field2("execution_id", binary2(), false),
2522
+ field2("group_ids_batch", binary2(), false),
2523
+ field2("attach_opaque_data", binary2(), true),
2524
+ field2("schema_path", list2(field2("item", utf82(), true)), true)
2525
+ ]);
2526
+ var AggregateFinalizeRequestSchema = schema2([
2527
+ field2("function_name", utf82(), false),
2528
+ field2("execution_id", binary2(), false),
2529
+ field2("group_ids_batch", binary2(), false),
2530
+ field2("output_schema", binary2(), false),
2531
+ field2("attach_opaque_data", binary2(), true),
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)
2558
+ ]);
2559
+ var AggregateUpdateRequestSchema = schema2([
2560
+ field2("function_name", utf82(), false),
2561
+ field2("execution_id", binary2(), false),
2562
+ field2("input_batch", binary2(), false),
2563
+ field2("attach_opaque_data", binary2(), true),
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)
2607
+ ]);
2608
+ var BindRequestSchema = schema2([
2609
+ field2("function_name", utf82(), false),
2610
+ field2("arguments", binary2(), false),
2611
+ field2("function_type", dictionary2(utf82(), int162()), false),
2612
+ field2("input_schema", binary2(), true),
2613
+ field2("settings", binary2(), true),
2614
+ field2("secrets", binary2(), true),
2615
+ field2("attach_opaque_data", binary2(), true),
2616
+ field2("transaction_opaque_data", binary2(), true),
2617
+ field2("resolved_secrets_provided", bool2(), false),
2618
+ field2("at_unit", utf82(), true),
2619
+ field2("at_value", utf82(), true),
2620
+ field2("copy_from", struct2([field2("format", utf82(), false), field2("file_path", utf82(), false), field2("expected_schema", binary2(), false)]), true),
2621
+ field2("copy_to", struct2([field2("format", utf82(), false), field2("file_path", utf82(), false)]), true),
2622
+ field2("schema_path", list2(field2("item", utf82(), true)), true),
2623
+ field2("argument_names", list2(field2("item", utf82(), true)), true)
2624
+ ]);
2625
+ var CatalogAttachRequestSchema = schema2([
2626
+ field2("name", utf82(), false),
2627
+ field2("options", binary2(), true),
2628
+ field2("data_version_spec", utf82(), true),
2629
+ field2("implementation_version", utf82(), true),
2630
+ field2("client_capabilities", binary2(), true)
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
+ ]);
2644
+ var CopyFromContextSchema = schema2([
2645
+ field2("format", utf82(), false),
2646
+ field2("file_path", utf82(), false),
2647
+ field2("expected_schema", binary2(), false)
2648
+ ]);
2649
+ var CopyToContextSchema = schema2([
2650
+ field2("format", utf82(), false),
2651
+ field2("file_path", utf82(), false)
2652
+ ]);
2653
+ var GlobalInitResponseSchema = schema2([
2654
+ field2("execution_id", binary2(), false),
2655
+ field2("opaque_data", binary2(), true),
2656
+ field2("max_workers", int642(), false)
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
+ ]);
2670
+ var InitRequestSchema = schema2([
2671
+ field2("bind_call", binary2(), false),
2672
+ field2("output_schema", binary2(), false),
2673
+ field2("bind_opaque_data", binary2(), true),
2674
+ field2("projection_ids", list2(field2("item", int642(), true)), true),
2675
+ field2("pushdown_filters", largeBinary2(), true),
2676
+ field2("join_keys", list2(field2("item", largeBinary2(), true)), true),
2677
+ field2("split_tokens", list2(field2("item", largeBinary2(), true)), true),
2678
+ field2("row_limit", int642(), true),
2679
+ field2("phase", dictionary2(utf82(), int162()), true),
2680
+ field2("finalize_state_id", binary2(), true),
2681
+ field2("execution_id", binary2(), true),
2682
+ field2("init_opaque_data", binary2(), true),
2683
+ field2("substream_id", binary2(), true),
2684
+ field2("order_by_column_name", utf82(), true),
2685
+ field2("order_by_direction", dictionary2(utf82(), int162()), true),
2686
+ field2("order_by_null_order", dictionary2(utf82(), int162()), true),
2687
+ field2("order_by_limit", int642(), true),
2688
+ field2("tablesample_percentage", float642(), true),
2689
+ field2("tablesample_seed", int642(), true)
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
+ ]);
2716
+ var TableBufferingCombineRequestSchema = schema2([
2717
+ field2("function_name", utf82(), false),
2718
+ field2("execution_id", binary2(), false),
2719
+ field2("state_ids", list2(field2("item", binary2(), true)), false),
2720
+ field2("attach_opaque_data", binary2(), true),
2721
+ field2("transaction_id", binary2(), true),
2722
+ field2("schema_path", list2(field2("item", utf82(), true)), true)
2723
+ ]);
2724
+ var TableBufferingDestructorRequestSchema = schema2([
2725
+ field2("function_name", utf82(), false),
2726
+ field2("execution_id", binary2(), false),
2727
+ field2("attach_opaque_data", binary2(), true),
2728
+ field2("transaction_id", binary2(), true),
2729
+ field2("schema_path", list2(field2("item", utf82(), true)), true)
2730
+ ]);
2731
+ var TableBufferingProcessRequestSchema = schema2([
2732
+ field2("function_name", utf82(), false),
2733
+ field2("execution_id", binary2(), false),
2734
+ field2("input_batch", binary2(), false),
2735
+ field2("attach_opaque_data", binary2(), true),
2736
+ field2("transaction_id", binary2(), true),
2737
+ field2("batch_index", int642(), true),
2738
+ field2("schema_path", list2(field2("item", utf82(), true)), true)
2739
+ ]);
2740
+ var TableFunctionCardinalityRequestSchema = schema2([
2741
+ field2("bind_call", binary2(), false),
2742
+ field2("bind_opaque_data", binary2(), true)
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
+ ]);
2749
+ var TableFunctionPlanRequestSchema = schema2([
2750
+ field2("bind_call", binary2(), false),
2751
+ field2("bind_opaque_data", binary2(), true),
2752
+ field2("projection_ids", list2(field2("item", int642(), true)), true),
2753
+ field2("pushdown_filters", largeBinary2(), true),
2754
+ field2("join_keys", list2(field2("item", largeBinary2(), true)), true),
2755
+ field2("row_limit", int642(), true),
2756
+ field2("target_split_bytes", int642(), true),
2757
+ field2("min_splits", int642(), true),
2758
+ field2("max_splits_per_response", int642(), true),
2759
+ field2("cursor", binary2(), true),
2760
+ field2("refined_filters", largeBinary2(), true),
2761
+ field2("filters_complete", bool2(), false),
2762
+ field2("start_position", binary2(), true),
2763
+ field2("end_position", binary2(), true),
2764
+ field2("order_by_column_name", utf82(), true),
2765
+ field2("order_by_direction", dictionary2(utf82(), int162()), true),
2766
+ field2("order_by_null_order", dictionary2(utf82(), int162()), true),
2767
+ field2("order_by_limit", int642(), true),
2768
+ field2("tablesample_percentage", float642(), true),
2769
+ field2("tablesample_seed", int642(), true)
2770
+ ]);
2771
+ var TableFunctionStatisticsRequestSchema = schema2([
2772
+ field2("bind_call", binary2(), false),
2773
+ field2("bind_opaque_data", binary2(), true)
2774
+ ]);
2775
+ var AggregateBindResultSchema = schema2([
2776
+ field2("output_schema", binary2(), false),
2777
+ field2("execution_id", binary2(), false)
2462
2778
  ]);
2463
2779
  var AggregateCombineResultSchema = schema2([]);
2464
2780
  var AggregateDestructorResultSchema = schema2([]);
@@ -2483,7 +2799,7 @@ var AggregateWindowDestructorResultSchema = schema2([]);
2483
2799
  var AggregateWindowInitResultSchema = schema2([]);
2484
2800
  var BindResultSchema = schema2([
2485
2801
  field2("output_schema", binary2(), false),
2486
- field2("opaque_data", binary2(), false),
2802
+ field2("opaque_data", binary2(), true),
2487
2803
  field2("lookup_secret_types", list2(field2("item", utf82(), true)), false),
2488
2804
  field2("lookup_scopes", list2(field2("item", utf82(), true)), false),
2489
2805
  field2("lookup_names", list2(field2("item", utf82(), true)), false)
@@ -2567,6 +2883,24 @@ var TableFunctionDynamicToStringResultSchema = schema2([
2567
2883
  field2("keys", list2(field2("item", utf82(), true)), false),
2568
2884
  field2("values", list2(field2("item", utf82(), true)), false)
2569
2885
  ]);
2886
+ var TableFunctionPlanResultSchema = schema2([
2887
+ field2("splits", list2(field2("item", binary2(), true)), false),
2888
+ field2("next_cursors", list2(field2("item", binary2(), true)), true),
2889
+ field2("execution_id", binary2(), true),
2890
+ field2("init_opaque_data", binary2(), true),
2891
+ field2("max_workers", int642(), true),
2892
+ field2("estimated_total_splits", int642(), true),
2893
+ field2("estimated_total_rows", int642(), true),
2894
+ field2("estimated_total_bytes", int642(), true),
2895
+ field2("catalog_version", int642(), true),
2896
+ field2("scope", utf82(), false),
2897
+ field2("locations", list2(field2("item", utf82(), true)), true),
2898
+ field2("partitioning", list2(field2("item", binary2(), true)), true),
2899
+ field2("sort_order", list2(field2("item", binary2(), true)), true),
2900
+ field2("cache_max_age_seconds", int642(), true),
2901
+ field2("start_position", binary2(), true),
2902
+ field2("end_position", binary2(), true)
2903
+ ]);
2570
2904
  var AggregateBindParamsSchema = schema2([
2571
2905
  field2("request", binary2(), false)
2572
2906
  ]);
@@ -2628,7 +2962,7 @@ var CatalogIndexCreateParamsSchema = schema2([
2628
2962
  ]);
2629
2963
  var CatalogIndexDropParamsSchema = schema2([
2630
2964
  field2("attach_opaque_data", binary2(), false),
2631
- field2("schema_name", utf82(), false),
2965
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2632
2966
  field2("name", utf82(), false),
2633
2967
  field2("ignore_not_found", bool2(), false),
2634
2968
  field2("cascade", bool2(), false),
@@ -2636,7 +2970,7 @@ var CatalogIndexDropParamsSchema = schema2([
2636
2970
  ]);
2637
2971
  var CatalogIndexGetParamsSchema = schema2([
2638
2972
  field2("attach_opaque_data", binary2(), false),
2639
- field2("schema_name", utf82(), false),
2973
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2640
2974
  field2("name", utf82(), false),
2641
2975
  field2("transaction_opaque_data", binary2(), true)
2642
2976
  ]);
@@ -2645,47 +2979,47 @@ var CatalogMacroCreateParamsSchema = schema2([
2645
2979
  ]);
2646
2980
  var CatalogMacroDropParamsSchema = schema2([
2647
2981
  field2("attach_opaque_data", binary2(), false),
2648
- field2("schema_name", utf82(), false),
2982
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2649
2983
  field2("name", utf82(), false),
2650
2984
  field2("ignore_not_found", bool2(), false),
2651
2985
  field2("transaction_opaque_data", binary2(), true)
2652
2986
  ]);
2653
2987
  var CatalogMacroGetParamsSchema = schema2([
2654
2988
  field2("attach_opaque_data", binary2(), false),
2655
- field2("schema_name", utf82(), false),
2989
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2656
2990
  field2("name", utf82(), false),
2657
2991
  field2("transaction_opaque_data", binary2(), true)
2658
2992
  ]);
2659
2993
  var CatalogSchemaContentsFunctionsParamsSchema = schema2([
2660
2994
  field2("attach_opaque_data", binary2(), false),
2661
- field2("name", utf82(), false),
2995
+ field2("path", list2(field2("item", utf82(), true)), false),
2662
2996
  field2("type", dictionary2(utf82(), int162()), false),
2663
2997
  field2("transaction_opaque_data", binary2(), true)
2664
2998
  ]);
2665
2999
  var CatalogSchemaContentsIndexesParamsSchema = schema2([
2666
3000
  field2("attach_opaque_data", binary2(), false),
2667
- field2("name", utf82(), false),
3001
+ field2("path", list2(field2("item", utf82(), true)), false),
2668
3002
  field2("transaction_opaque_data", binary2(), true)
2669
3003
  ]);
2670
3004
  var CatalogSchemaContentsMacrosParamsSchema = schema2([
2671
3005
  field2("attach_opaque_data", binary2(), false),
2672
- field2("name", utf82(), false),
3006
+ field2("path", list2(field2("item", utf82(), true)), false),
2673
3007
  field2("type", dictionary2(utf82(), int162()), false),
2674
3008
  field2("transaction_opaque_data", binary2(), true)
2675
3009
  ]);
2676
3010
  var CatalogSchemaContentsTablesParamsSchema = schema2([
2677
3011
  field2("attach_opaque_data", binary2(), false),
2678
- field2("name", utf82(), false),
3012
+ field2("path", list2(field2("item", utf82(), true)), false),
2679
3013
  field2("transaction_opaque_data", binary2(), true)
2680
3014
  ]);
2681
3015
  var CatalogSchemaContentsViewsParamsSchema = schema2([
2682
3016
  field2("attach_opaque_data", binary2(), false),
2683
- field2("name", utf82(), false),
3017
+ field2("path", list2(field2("item", utf82(), true)), false),
2684
3018
  field2("transaction_opaque_data", binary2(), true)
2685
3019
  ]);
2686
3020
  var CatalogSchemaCreateParamsSchema = schema2([
2687
3021
  field2("attach_opaque_data", binary2(), false),
2688
- field2("name", utf82(), false),
3022
+ field2("path", list2(field2("item", utf82(), true)), false),
2689
3023
  field2("on_conflict", dictionary2(utf82(), int162()), false),
2690
3024
  field2("comment", utf82(), true),
2691
3025
  field2("tags", map2(field2("key", utf82(), false), field2("value", utf82(), true), false), true),
@@ -2693,14 +3027,14 @@ var CatalogSchemaCreateParamsSchema = schema2([
2693
3027
  ]);
2694
3028
  var CatalogSchemaDropParamsSchema = schema2([
2695
3029
  field2("attach_opaque_data", binary2(), false),
2696
- field2("name", utf82(), false),
3030
+ field2("path", list2(field2("item", utf82(), true)), false),
2697
3031
  field2("ignore_not_found", bool2(), false),
2698
3032
  field2("cascade", bool2(), false),
2699
3033
  field2("transaction_opaque_data", binary2(), true)
2700
3034
  ]);
2701
3035
  var CatalogSchemaGetParamsSchema = schema2([
2702
3036
  field2("attach_opaque_data", binary2(), false),
2703
- field2("name", utf82(), false),
3037
+ field2("path", list2(field2("item", utf82(), true)), false),
2704
3038
  field2("transaction_opaque_data", binary2(), true)
2705
3039
  ]);
2706
3040
  var CatalogSchemasParamsSchema = schema2([
@@ -2709,7 +3043,7 @@ var CatalogSchemasParamsSchema = schema2([
2709
3043
  ]);
2710
3044
  var CatalogTableColumnAddParamsSchema = schema2([
2711
3045
  field2("attach_opaque_data", binary2(), false),
2712
- field2("schema_name", utf82(), false),
3046
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2713
3047
  field2("name", utf82(), false),
2714
3048
  field2("column_definition", binary2(), false),
2715
3049
  field2("ignore_not_found", bool2(), false),
@@ -2718,7 +3052,7 @@ var CatalogTableColumnAddParamsSchema = schema2([
2718
3052
  ]);
2719
3053
  var CatalogTableColumnCommentSetParamsSchema = schema2([
2720
3054
  field2("attach_opaque_data", binary2(), false),
2721
- field2("schema_name", utf82(), false),
3055
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2722
3056
  field2("name", utf82(), false),
2723
3057
  field2("column_name", utf82(), false),
2724
3058
  field2("comment", utf82(), true),
@@ -2727,7 +3061,7 @@ var CatalogTableColumnCommentSetParamsSchema = schema2([
2727
3061
  ]);
2728
3062
  var CatalogTableColumnDefaultDropParamsSchema = schema2([
2729
3063
  field2("attach_opaque_data", binary2(), false),
2730
- field2("schema_name", utf82(), false),
3064
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2731
3065
  field2("name", utf82(), false),
2732
3066
  field2("column_name", utf82(), false),
2733
3067
  field2("ignore_not_found", bool2(), false),
@@ -2735,7 +3069,7 @@ var CatalogTableColumnDefaultDropParamsSchema = schema2([
2735
3069
  ]);
2736
3070
  var CatalogTableColumnDefaultSetParamsSchema = schema2([
2737
3071
  field2("attach_opaque_data", binary2(), false),
2738
- field2("schema_name", utf82(), false),
3072
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2739
3073
  field2("name", utf82(), false),
2740
3074
  field2("column_name", utf82(), false),
2741
3075
  field2("expression", utf82(), false),
@@ -2744,7 +3078,7 @@ var CatalogTableColumnDefaultSetParamsSchema = schema2([
2744
3078
  ]);
2745
3079
  var CatalogTableColumnDropParamsSchema = schema2([
2746
3080
  field2("attach_opaque_data", binary2(), false),
2747
- field2("schema_name", utf82(), false),
3081
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2748
3082
  field2("name", utf82(), false),
2749
3083
  field2("column_name", utf82(), false),
2750
3084
  field2("ignore_not_found", bool2(), false),
@@ -2754,7 +3088,7 @@ var CatalogTableColumnDropParamsSchema = schema2([
2754
3088
  ]);
2755
3089
  var CatalogTableColumnRenameParamsSchema = schema2([
2756
3090
  field2("attach_opaque_data", binary2(), false),
2757
- field2("schema_name", utf82(), false),
3091
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2758
3092
  field2("name", utf82(), false),
2759
3093
  field2("column_name", utf82(), false),
2760
3094
  field2("new_column_name", utf82(), false),
@@ -2763,13 +3097,13 @@ var CatalogTableColumnRenameParamsSchema = schema2([
2763
3097
  ]);
2764
3098
  var CatalogTableColumnStatisticsGetParamsSchema = schema2([
2765
3099
  field2("attach_opaque_data", binary2(), false),
2766
- field2("schema_name", utf82(), false),
3100
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2767
3101
  field2("name", utf82(), false),
2768
3102
  field2("transaction_opaque_data", binary2(), true)
2769
3103
  ]);
2770
3104
  var CatalogTableColumnTypeChangeParamsSchema = schema2([
2771
3105
  field2("attach_opaque_data", binary2(), false),
2772
- field2("schema_name", utf82(), false),
3106
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2773
3107
  field2("name", utf82(), false),
2774
3108
  field2("column_definition", binary2(), false),
2775
3109
  field2("expression", utf82(), true),
@@ -2778,7 +3112,7 @@ var CatalogTableColumnTypeChangeParamsSchema = schema2([
2778
3112
  ]);
2779
3113
  var CatalogTableCommentSetParamsSchema = schema2([
2780
3114
  field2("attach_opaque_data", binary2(), false),
2781
- field2("schema_name", utf82(), false),
3115
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2782
3116
  field2("name", utf82(), false),
2783
3117
  field2("comment", utf82(), true),
2784
3118
  field2("ignore_not_found", bool2(), false),
@@ -2789,13 +3123,13 @@ var CatalogTableCreateParamsSchema = schema2([
2789
3123
  ]);
2790
3124
  var CatalogTableDeleteFunctionGetParamsSchema = schema2([
2791
3125
  field2("attach_opaque_data", binary2(), false),
2792
- field2("schema_name", utf82(), false),
3126
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2793
3127
  field2("name", utf82(), false),
2794
3128
  field2("transaction_opaque_data", binary2(), true)
2795
3129
  ]);
2796
3130
  var CatalogTableDropParamsSchema = schema2([
2797
3131
  field2("attach_opaque_data", binary2(), false),
2798
- field2("schema_name", utf82(), false),
3132
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2799
3133
  field2("name", utf82(), false),
2800
3134
  field2("ignore_not_found", bool2(), false),
2801
3135
  field2("cascade", bool2(), false),
@@ -2803,7 +3137,7 @@ var CatalogTableDropParamsSchema = schema2([
2803
3137
  ]);
2804
3138
  var CatalogTableGetParamsSchema = schema2([
2805
3139
  field2("attach_opaque_data", binary2(), false),
2806
- field2("schema_name", utf82(), false),
3140
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2807
3141
  field2("name", utf82(), false),
2808
3142
  field2("at_unit", utf82(), true),
2809
3143
  field2("at_value", utf82(), true),
@@ -2811,14 +3145,14 @@ var CatalogTableGetParamsSchema = schema2([
2811
3145
  ]);
2812
3146
  var CatalogTableInsertFunctionGetParamsSchema = schema2([
2813
3147
  field2("attach_opaque_data", binary2(), false),
2814
- field2("schema_name", utf82(), false),
3148
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2815
3149
  field2("name", utf82(), false),
2816
3150
  field2("transaction_opaque_data", binary2(), true),
2817
3151
  field2("writable_branch_function_name", utf82(), true)
2818
3152
  ]);
2819
3153
  var CatalogTableNotNullDropParamsSchema = schema2([
2820
3154
  field2("attach_opaque_data", binary2(), false),
2821
- field2("schema_name", utf82(), false),
3155
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2822
3156
  field2("name", utf82(), false),
2823
3157
  field2("column_name", utf82(), false),
2824
3158
  field2("ignore_not_found", bool2(), false),
@@ -2826,7 +3160,7 @@ var CatalogTableNotNullDropParamsSchema = schema2([
2826
3160
  ]);
2827
3161
  var CatalogTableNotNullSetParamsSchema = schema2([
2828
3162
  field2("attach_opaque_data", binary2(), false),
2829
- field2("schema_name", utf82(), false),
3163
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2830
3164
  field2("name", utf82(), false),
2831
3165
  field2("column_name", utf82(), false),
2832
3166
  field2("ignore_not_found", bool2(), false),
@@ -2834,7 +3168,7 @@ var CatalogTableNotNullSetParamsSchema = schema2([
2834
3168
  ]);
2835
3169
  var CatalogTableRenameParamsSchema = schema2([
2836
3170
  field2("attach_opaque_data", binary2(), false),
2837
- field2("schema_name", utf82(), false),
3171
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2838
3172
  field2("name", utf82(), false),
2839
3173
  field2("new_name", utf82(), false),
2840
3174
  field2("ignore_not_found", bool2(), false),
@@ -2842,7 +3176,7 @@ var CatalogTableRenameParamsSchema = schema2([
2842
3176
  ]);
2843
3177
  var CatalogTableScanBranchesGetParamsSchema = schema2([
2844
3178
  field2("attach_opaque_data", binary2(), false),
2845
- field2("schema_name", utf82(), false),
3179
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2846
3180
  field2("name", utf82(), false),
2847
3181
  field2("at_unit", utf82(), true),
2848
3182
  field2("at_value", utf82(), true),
@@ -2850,7 +3184,7 @@ var CatalogTableScanBranchesGetParamsSchema = schema2([
2850
3184
  ]);
2851
3185
  var CatalogTableScanFunctionGetParamsSchema = schema2([
2852
3186
  field2("attach_opaque_data", binary2(), false),
2853
- field2("schema_name", utf82(), false),
3187
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2854
3188
  field2("name", utf82(), false),
2855
3189
  field2("at_unit", utf82(), true),
2856
3190
  field2("at_value", utf82(), true),
@@ -2858,7 +3192,7 @@ var CatalogTableScanFunctionGetParamsSchema = schema2([
2858
3192
  ]);
2859
3193
  var CatalogTableUpdateFunctionGetParamsSchema = schema2([
2860
3194
  field2("attach_opaque_data", binary2(), false),
2861
- field2("schema_name", utf82(), false),
3195
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2862
3196
  field2("name", utf82(), false),
2863
3197
  field2("transaction_opaque_data", binary2(), true)
2864
3198
  ]);
@@ -2879,7 +3213,7 @@ var CatalogVersionParamsSchema = schema2([
2879
3213
  ]);
2880
3214
  var CatalogViewCommentSetParamsSchema = schema2([
2881
3215
  field2("attach_opaque_data", binary2(), false),
2882
- field2("schema_name", utf82(), false),
3216
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2883
3217
  field2("name", utf82(), false),
2884
3218
  field2("comment", utf82(), true),
2885
3219
  field2("ignore_not_found", bool2(), false),
@@ -2887,7 +3221,7 @@ var CatalogViewCommentSetParamsSchema = schema2([
2887
3221
  ]);
2888
3222
  var CatalogViewCreateParamsSchema = schema2([
2889
3223
  field2("attach_opaque_data", binary2(), false),
2890
- field2("schema_name", utf82(), false),
3224
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2891
3225
  field2("name", utf82(), false),
2892
3226
  field2("definition", utf82(), false),
2893
3227
  field2("on_conflict", dictionary2(utf82(), int162()), false),
@@ -2895,7 +3229,7 @@ var CatalogViewCreateParamsSchema = schema2([
2895
3229
  ]);
2896
3230
  var CatalogViewDropParamsSchema = schema2([
2897
3231
  field2("attach_opaque_data", binary2(), false),
2898
- field2("schema_name", utf82(), false),
3232
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2899
3233
  field2("name", utf82(), false),
2900
3234
  field2("ignore_not_found", bool2(), false),
2901
3235
  field2("cascade", bool2(), false),
@@ -2903,13 +3237,13 @@ var CatalogViewDropParamsSchema = schema2([
2903
3237
  ]);
2904
3238
  var CatalogViewGetParamsSchema = schema2([
2905
3239
  field2("attach_opaque_data", binary2(), false),
2906
- field2("schema_name", utf82(), false),
3240
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2907
3241
  field2("name", utf82(), false),
2908
3242
  field2("transaction_opaque_data", binary2(), true)
2909
3243
  ]);
2910
3244
  var CatalogViewRenameParamsSchema = schema2([
2911
3245
  field2("attach_opaque_data", binary2(), false),
2912
- field2("schema_name", utf82(), false),
3246
+ field2("schema_path", list2(field2("item", utf82(), true)), false),
2913
3247
  field2("name", utf82(), false),
2914
3248
  field2("new_name", utf82(), false),
2915
3249
  field2("ignore_not_found", bool2(), false),
@@ -2933,6 +3267,9 @@ var TableFunctionCardinalityParamsSchema = schema2([
2933
3267
  var TableFunctionDynamicToStringParamsSchema = schema2([
2934
3268
  field2("request", binary2(), false)
2935
3269
  ]);
3270
+ var TableFunctionPlanParamsSchema = schema2([
3271
+ field2("request", binary2(), false)
3272
+ ]);
2936
3273
  var TableFunctionStatisticsParamsSchema = schema2([
2937
3274
  field2("request", binary2(), false)
2938
3275
  ]);
@@ -2956,16 +3293,16 @@ function decodeScanFunctionResult(inner) {
2956
3293
  const namedArguments = {};
2957
3294
  if (argsBytes != null) {
2958
3295
  const batch = deserializeBatch(toUint8Array(argsBytes));
2959
- for (const field3 of batch.schema.fields) {
2960
- const col = batch.getChild(field3.name);
3296
+ for (const field of batch.schema.fields) {
3297
+ const col = batch.getChild(field.name);
2961
3298
  const value = col ? col.get(0) : null;
2962
- if (field3.name.startsWith("arg_")) {
2963
- const idx = parseInt(field3.name.slice(4), 10);
3299
+ if (field.name.startsWith("arg_")) {
3300
+ const idx = parseInt(field.name.slice(4), 10);
2964
3301
  while (positionalArguments.length <= idx)
2965
3302
  positionalArguments.push(null);
2966
3303
  positionalArguments[idx] = value;
2967
3304
  } else {
2968
- namedArguments[field3.name] = value;
3305
+ namedArguments[field.name] = value;
2969
3306
  }
2970
3307
  }
2971
3308
  }
@@ -2975,7 +3312,8 @@ function decodeScanFunctionResult(inner) {
2975
3312
  functionName: String(inner.function_name ?? ""),
2976
3313
  positionalArguments,
2977
3314
  namedArguments,
2978
- 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)
2979
3317
  };
2980
3318
  }
2981
3319
 
@@ -3022,8 +3360,8 @@ function serializeAttachOptions(options) {
3022
3360
  fields.push(field2(key, type, true));
3023
3361
  columns[key] = [value];
3024
3362
  }
3025
- const schema3 = schema2(fields);
3026
- const batch = batchFromColumns(columns, schema3);
3363
+ const schema = schema2(fields);
3364
+ const batch = batchFromColumns(columns, schema);
3027
3365
  return serializeBatch(batch);
3028
3366
  }
3029
3367
 
@@ -3123,6 +3461,19 @@ class VgiClient {
3123
3461
  this.rpc = wrapRpcWithErrorEnrichment(rpc);
3124
3462
  this.defaultAttachOpaqueData = options?.attachOpaqueData ?? null;
3125
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
+ }
3126
3477
  async _doBind(functionName, functionType, args, inputSchema, settings, secrets, transactionOpaqueData, attachOpaqueData = null, onBind) {
3127
3478
  const request = {
3128
3479
  function_name: functionName,
@@ -3152,6 +3503,8 @@ class VgiClient {
3152
3503
  bind_call: bindRequest,
3153
3504
  output_schema: bindResponse.output_schema,
3154
3505
  bind_opaque_data: bindResponse.opaque_data,
3506
+ split_tokens: null,
3507
+ row_limit: null,
3155
3508
  projection_ids: opts?.projectionIds ?? null,
3156
3509
  pushdown_filters: opts?.pushdownFilters ?? null,
3157
3510
  join_keys: opts?.joinKeys ?? [],
@@ -3200,7 +3553,7 @@ class VgiClient {
3200
3553
  const inputIter = toAsyncIterator(opts.input);
3201
3554
  const first = await inputIter.next();
3202
3555
  if (first.done) {
3203
- throw new VgiClientError(`scalarFunction(${opts.functionName}): input iterator yielded no batches; ` + `at least one batch is required to determine the input schema`);
3556
+ throw new VgiClientError(`scalarFunction(${opts.functionName}): input iterator yielded no batches; at least one batch is required to determine the input schema`);
3204
3557
  }
3205
3558
  const firstBatch = first.value;
3206
3559
  const inputSchema = firstBatch.schema;
@@ -3224,7 +3577,7 @@ class VgiClient {
3224
3577
  const inputIter = toAsyncIterator(opts.input);
3225
3578
  const first = await inputIter.next();
3226
3579
  if (first.done) {
3227
- throw new VgiClientError(`scalarFunction(${opts.functionName}): input iterator yielded no batches; ` + `at least one batch is required to determine the input schema`);
3580
+ throw new VgiClientError(`scalarFunction(${opts.functionName}): input iterator yielded no batches; at least one batch is required to determine the input schema`);
3228
3581
  }
3229
3582
  const firstBatch = first.value;
3230
3583
  const inputSchema = firstBatch.schema;
@@ -3249,7 +3602,7 @@ class VgiClient {
3249
3602
  const inputIter = toAsyncIterator(opts.input);
3250
3603
  const first = await inputIter.next();
3251
3604
  if (first.done) {
3252
- throw new VgiClientError(`tableInOutFunction(${opts.functionName}): input iterator yielded no batches; ` + `at least one batch is required to determine the input schema`);
3605
+ throw new VgiClientError(`tableInOutFunction(${opts.functionName}): input iterator yielded no batches; at least one batch is required to determine the input schema`);
3253
3606
  }
3254
3607
  const firstBatch = first.value;
3255
3608
  const inputSchema = firstBatch.schema;
@@ -3297,7 +3650,7 @@ class VgiClient {
3297
3650
  const inputIter = toAsyncIterator(opts.input);
3298
3651
  const first = await inputIter.next();
3299
3652
  if (first.done) {
3300
- throw new VgiClientError(`tableInOutFunction(${opts.functionName}): input iterator yielded no batches; ` + `at least one batch is required to determine the input schema`);
3653
+ throw new VgiClientError(`tableInOutFunction(${opts.functionName}): input iterator yielded no batches; at least one batch is required to determine the input schema`);
3301
3654
  }
3302
3655
  const firstBatch = first.value;
3303
3656
  const inputSchema = firstBatch.schema;
@@ -3382,18 +3735,20 @@ class VgiClient {
3382
3735
  } else {
3383
3736
  wireOptions = serializeAttachOptions(opts?.options);
3384
3737
  }
3385
- const schema3 = schema2([
3738
+ const schema = schema2([
3386
3739
  field2("name", utf82(), false),
3387
3740
  field2("options", binary2(), true),
3388
3741
  field2("data_version_spec", utf82(), true),
3389
- field2("implementation_version", utf82(), true)
3742
+ field2("implementation_version", utf82(), true),
3743
+ field2("client_capabilities", binary2(), true)
3390
3744
  ]);
3391
3745
  const innerBatch = batchFromColumns({
3392
3746
  name: [name],
3393
3747
  options: [wireOptions],
3394
3748
  data_version_spec: [opts?.dataVersionSpec ?? null],
3395
- implementation_version: [opts?.implementationVersion ?? null]
3396
- }, schema3);
3749
+ implementation_version: [opts?.implementationVersion ?? null],
3750
+ client_capabilities: [opts?.clientCapabilities ? encodeASD(ClientCapabilitiesSchema, opts.clientCapabilities) : null]
3751
+ }, schema);
3397
3752
  const result = await this.rpc.call("catalog_attach", wrapRequest(innerBatch));
3398
3753
  if (!result)
3399
3754
  throw new VgiClientError("catalog_attach returned null");
@@ -3490,10 +3845,10 @@ class VgiClient {
3490
3845
  const inner = unwrapResult(result);
3491
3846
  return deserializeInfoList(inner.items, decodeSchemaInfo);
3492
3847
  }
3493
- async schemaGet(attachOpaqueData, name, transactionOpaqueData) {
3848
+ async schemaGet(attachOpaqueData, path, transactionOpaqueData) {
3494
3849
  const result = await this.rpc.call("catalog_schema_get", {
3495
3850
  attach_opaque_data: attachOpaqueData,
3496
- name,
3851
+ path: normalizeSchemaPath(path),
3497
3852
  transaction_opaque_data: transactionOpaqueData ?? null
3498
3853
  });
3499
3854
  if (!result)
@@ -3502,30 +3857,30 @@ class VgiClient {
3502
3857
  const items = deserializeInfoList(inner.items, decodeSchemaInfo);
3503
3858
  return items.length > 0 ? items[0] : null;
3504
3859
  }
3505
- async schemaCreate(attachOpaqueData, name, opts) {
3860
+ async schemaCreate(attachOpaqueData, path, opts) {
3506
3861
  const tagsMap = opts?.tags ? new Map(Object.entries(opts.tags)) : null;
3507
3862
  await this.rpc.call("catalog_schema_create", {
3508
3863
  attach_opaque_data: attachOpaqueData,
3509
- name,
3864
+ path: normalizeSchemaPath(path),
3510
3865
  on_conflict: opts?.onConflict ?? "error",
3511
3866
  comment: opts?.comment ?? null,
3512
3867
  tags: tagsMap,
3513
3868
  transaction_opaque_data: opts?.transactionOpaqueData ?? null
3514
3869
  });
3515
3870
  }
3516
- async schemaDrop(attachOpaqueData, name, ignoreNotFound, cascade, transactionOpaqueData) {
3871
+ async schemaDrop(attachOpaqueData, path, ignoreNotFound, cascade, transactionOpaqueData) {
3517
3872
  await this.rpc.call("catalog_schema_drop", {
3518
3873
  attach_opaque_data: attachOpaqueData,
3519
- name,
3874
+ path: normalizeSchemaPath(path),
3520
3875
  ignore_not_found: ignoreNotFound ?? false,
3521
3876
  cascade: cascade ?? false,
3522
3877
  transaction_opaque_data: transactionOpaqueData ?? null
3523
3878
  });
3524
3879
  }
3525
- async schemaContentsTables(attachOpaqueData, name, transactionOpaqueData) {
3880
+ async schemaContentsTables(attachOpaqueData, path, transactionOpaqueData) {
3526
3881
  const result = await this.rpc.call("catalog_schema_contents_tables", {
3527
3882
  attach_opaque_data: attachOpaqueData,
3528
- name,
3883
+ path: normalizeSchemaPath(path),
3529
3884
  transaction_opaque_data: transactionOpaqueData ?? null
3530
3885
  });
3531
3886
  if (!result)
@@ -3533,10 +3888,10 @@ class VgiClient {
3533
3888
  const inner = unwrapResult(result);
3534
3889
  return deserializeInfoList(inner.items, decodeTableInfo);
3535
3890
  }
3536
- async schemaContentsViews(attachOpaqueData, name, transactionOpaqueData) {
3891
+ async schemaContentsViews(attachOpaqueData, path, transactionOpaqueData) {
3537
3892
  const result = await this.rpc.call("catalog_schema_contents_views", {
3538
3893
  attach_opaque_data: attachOpaqueData,
3539
- name,
3894
+ path: normalizeSchemaPath(path),
3540
3895
  transaction_opaque_data: transactionOpaqueData ?? null
3541
3896
  });
3542
3897
  if (!result)
@@ -3544,10 +3899,10 @@ class VgiClient {
3544
3899
  const inner = unwrapResult(result);
3545
3900
  return deserializeInfoList(inner.items, decodeViewInfo);
3546
3901
  }
3547
- async schemaContentsFunctions(attachOpaqueData, name, type, transactionOpaqueData) {
3902
+ async schemaContentsFunctions(attachOpaqueData, path, type, transactionOpaqueData) {
3548
3903
  const result = await this.rpc.call("catalog_schema_contents_functions", {
3549
3904
  attach_opaque_data: attachOpaqueData,
3550
- name,
3905
+ path: normalizeSchemaPath(path),
3551
3906
  type,
3552
3907
  transaction_opaque_data: transactionOpaqueData ?? null
3553
3908
  });
@@ -3556,10 +3911,10 @@ class VgiClient {
3556
3911
  const inner = unwrapResult(result);
3557
3912
  return deserializeInfoList(inner.items, decodeFunctionInfo);
3558
3913
  }
3559
- async tableGet(attachOpaqueData, schemaName, name, transactionOpaqueData) {
3914
+ async tableGet(attachOpaqueData, schemaPath, name, transactionOpaqueData) {
3560
3915
  const result = await this.rpc.call("catalog_table_get", {
3561
3916
  attach_opaque_data: attachOpaqueData,
3562
- schema_name: schemaName,
3917
+ schema_path: normalizeSchemaPath(schemaPath),
3563
3918
  name,
3564
3919
  transaction_opaque_data: transactionOpaqueData ?? null
3565
3920
  });
@@ -3569,10 +3924,10 @@ class VgiClient {
3569
3924
  const items = deserializeInfoList(inner.items, decodeTableInfo);
3570
3925
  return items.length > 0 ? items[0] : null;
3571
3926
  }
3572
- async tableCreate(attachOpaqueData, schemaName, name, columns, onConflict, notNullConstraints, uniqueConstraints, checkConstraints, transactionOpaqueData) {
3927
+ async tableCreate(attachOpaqueData, schemaPath, name, columns, onConflict, notNullConstraints, uniqueConstraints, checkConstraints, transactionOpaqueData) {
3573
3928
  await this.rpc.call("catalog_table_create", {
3574
3929
  attach_opaque_data: attachOpaqueData,
3575
- schema_name: schemaName,
3930
+ schema_path: normalizeSchemaPath(schemaPath),
3576
3931
  name,
3577
3932
  columns,
3578
3933
  on_conflict: onConflict,
@@ -3582,20 +3937,20 @@ class VgiClient {
3582
3937
  transaction_opaque_data: transactionOpaqueData ?? null
3583
3938
  });
3584
3939
  }
3585
- async tableDrop(attachOpaqueData, schemaName, name, ignoreNotFound, cascade, transactionOpaqueData) {
3940
+ async tableDrop(attachOpaqueData, schemaPath, name, ignoreNotFound, cascade, transactionOpaqueData) {
3586
3941
  await this.rpc.call("catalog_table_drop", {
3587
3942
  attach_opaque_data: attachOpaqueData,
3588
- schema_name: schemaName,
3943
+ schema_path: normalizeSchemaPath(schemaPath),
3589
3944
  name,
3590
3945
  ignore_not_found: ignoreNotFound ?? false,
3591
3946
  cascade: cascade ?? false,
3592
3947
  transaction_opaque_data: transactionOpaqueData ?? null
3593
3948
  });
3594
3949
  }
3595
- async tableScanFunctionGet(attachOpaqueData, schemaName, name, atUnit, atValue, transactionOpaqueData) {
3950
+ async tableScanFunctionGet(attachOpaqueData, schemaPath, name, atUnit, atValue, transactionOpaqueData) {
3596
3951
  const result = await this.rpc.call("catalog_table_scan_function_get", {
3597
3952
  attach_opaque_data: attachOpaqueData,
3598
- schema_name: schemaName,
3953
+ schema_path: normalizeSchemaPath(schemaPath),
3599
3954
  name,
3600
3955
  at_unit: atUnit ?? null,
3601
3956
  at_value: atValue ?? null,
@@ -3605,30 +3960,30 @@ class VgiClient {
3605
3960
  throw new VgiClientError("table_scan_function_get returned null");
3606
3961
  return decodeScanFunctionResult(unwrapResult(result));
3607
3962
  }
3608
- async tableCommentSet(attachOpaqueData, schemaName, name, comment, ignoreNotFound, transactionOpaqueData) {
3963
+ async tableCommentSet(attachOpaqueData, schemaPath, name, comment, ignoreNotFound, transactionOpaqueData) {
3609
3964
  await this.rpc.call("catalog_table_comment_set", {
3610
3965
  attach_opaque_data: attachOpaqueData,
3611
- schema_name: schemaName,
3966
+ schema_path: normalizeSchemaPath(schemaPath),
3612
3967
  name,
3613
3968
  comment: comment ?? null,
3614
3969
  ignore_not_found: ignoreNotFound ?? null,
3615
3970
  transaction_opaque_data: transactionOpaqueData ?? null
3616
3971
  });
3617
3972
  }
3618
- async tableRename(attachOpaqueData, schemaName, name, newName, ignoreNotFound, transactionOpaqueData) {
3973
+ async tableRename(attachOpaqueData, schemaPath, name, newName, ignoreNotFound, transactionOpaqueData) {
3619
3974
  await this.rpc.call("catalog_table_rename", {
3620
3975
  attach_opaque_data: attachOpaqueData,
3621
- schema_name: schemaName,
3976
+ schema_path: normalizeSchemaPath(schemaPath),
3622
3977
  name,
3623
3978
  new_name: newName,
3624
3979
  ignore_not_found: ignoreNotFound ?? null,
3625
3980
  transaction_opaque_data: transactionOpaqueData ?? null
3626
3981
  });
3627
3982
  }
3628
- async tableColumnAdd(attachOpaqueData, schemaName, name, columnName, columnType, defaultValue, ignoreNotFound, transactionOpaqueData) {
3983
+ async tableColumnAdd(attachOpaqueData, schemaPath, name, columnName, columnType, defaultValue, ignoreNotFound, transactionOpaqueData) {
3629
3984
  await this.rpc.call("catalog_table_column_add", {
3630
3985
  attach_opaque_data: attachOpaqueData,
3631
- schema_name: schemaName,
3986
+ schema_path: normalizeSchemaPath(schemaPath),
3632
3987
  name,
3633
3988
  column_name: columnName,
3634
3989
  column_type: columnType,
@@ -3637,20 +3992,20 @@ class VgiClient {
3637
3992
  transaction_opaque_data: transactionOpaqueData ?? null
3638
3993
  });
3639
3994
  }
3640
- async tableColumnDrop(attachOpaqueData, schemaName, name, columnName, ignoreNotFound, transactionOpaqueData) {
3995
+ async tableColumnDrop(attachOpaqueData, schemaPath, name, columnName, ignoreNotFound, transactionOpaqueData) {
3641
3996
  await this.rpc.call("catalog_table_column_drop", {
3642
3997
  attach_opaque_data: attachOpaqueData,
3643
- schema_name: schemaName,
3998
+ schema_path: normalizeSchemaPath(schemaPath),
3644
3999
  name,
3645
4000
  column_name: columnName,
3646
4001
  ignore_not_found: ignoreNotFound ?? null,
3647
4002
  transaction_opaque_data: transactionOpaqueData ?? null
3648
4003
  });
3649
4004
  }
3650
- async tableColumnRename(attachOpaqueData, schemaName, name, columnName, newName, ignoreNotFound, transactionOpaqueData) {
4005
+ async tableColumnRename(attachOpaqueData, schemaPath, name, columnName, newName, ignoreNotFound, transactionOpaqueData) {
3651
4006
  await this.rpc.call("catalog_table_column_rename", {
3652
4007
  attach_opaque_data: attachOpaqueData,
3653
- schema_name: schemaName,
4008
+ schema_path: normalizeSchemaPath(schemaPath),
3654
4009
  name,
3655
4010
  column_name: columnName,
3656
4011
  new_name: newName,
@@ -3658,10 +4013,10 @@ class VgiClient {
3658
4013
  transaction_opaque_data: transactionOpaqueData ?? null
3659
4014
  });
3660
4015
  }
3661
- async tableColumnDefaultSet(attachOpaqueData, schemaName, name, columnName, defaultValue, ignoreNotFound, transactionOpaqueData) {
4016
+ async tableColumnDefaultSet(attachOpaqueData, schemaPath, name, columnName, defaultValue, ignoreNotFound, transactionOpaqueData) {
3662
4017
  await this.rpc.call("catalog_table_column_default_set", {
3663
4018
  attach_opaque_data: attachOpaqueData,
3664
- schema_name: schemaName,
4019
+ schema_path: normalizeSchemaPath(schemaPath),
3665
4020
  name,
3666
4021
  column_name: columnName,
3667
4022
  default_value: defaultValue,
@@ -3669,20 +4024,20 @@ class VgiClient {
3669
4024
  transaction_opaque_data: transactionOpaqueData ?? null
3670
4025
  });
3671
4026
  }
3672
- async tableColumnDefaultDrop(attachOpaqueData, schemaName, name, columnName, ignoreNotFound, transactionOpaqueData) {
4027
+ async tableColumnDefaultDrop(attachOpaqueData, schemaPath, name, columnName, ignoreNotFound, transactionOpaqueData) {
3673
4028
  await this.rpc.call("catalog_table_column_default_drop", {
3674
4029
  attach_opaque_data: attachOpaqueData,
3675
- schema_name: schemaName,
4030
+ schema_path: normalizeSchemaPath(schemaPath),
3676
4031
  name,
3677
4032
  column_name: columnName,
3678
4033
  ignore_not_found: ignoreNotFound ?? null,
3679
4034
  transaction_opaque_data: transactionOpaqueData ?? null
3680
4035
  });
3681
4036
  }
3682
- async tableColumnTypeChange(attachOpaqueData, schemaName, name, columnDefinition, expression, ignoreNotFound, transactionOpaqueData) {
4037
+ async tableColumnTypeChange(attachOpaqueData, schemaPath, name, columnDefinition, expression, ignoreNotFound, transactionOpaqueData) {
3683
4038
  await this.rpc.call("catalog_table_column_type_change", {
3684
4039
  attach_opaque_data: attachOpaqueData,
3685
- schema_name: schemaName,
4040
+ schema_path: normalizeSchemaPath(schemaPath),
3686
4041
  name,
3687
4042
  column_definition: columnDefinition,
3688
4043
  expression: expression ?? null,
@@ -3690,30 +4045,30 @@ class VgiClient {
3690
4045
  transaction_opaque_data: transactionOpaqueData ?? null
3691
4046
  });
3692
4047
  }
3693
- async tableNotNullSet(attachOpaqueData, schemaName, name, columnName, ignoreNotFound, transactionOpaqueData) {
4048
+ async tableNotNullSet(attachOpaqueData, schemaPath, name, columnName, ignoreNotFound, transactionOpaqueData) {
3694
4049
  await this.rpc.call("catalog_table_not_null_set", {
3695
4050
  attach_opaque_data: attachOpaqueData,
3696
- schema_name: schemaName,
4051
+ schema_path: normalizeSchemaPath(schemaPath),
3697
4052
  name,
3698
4053
  column_name: columnName,
3699
4054
  ignore_not_found: ignoreNotFound ?? null,
3700
4055
  transaction_opaque_data: transactionOpaqueData ?? null
3701
4056
  });
3702
4057
  }
3703
- async tableNotNullDrop(attachOpaqueData, schemaName, name, columnName, ignoreNotFound, transactionOpaqueData) {
4058
+ async tableNotNullDrop(attachOpaqueData, schemaPath, name, columnName, ignoreNotFound, transactionOpaqueData) {
3704
4059
  await this.rpc.call("catalog_table_not_null_drop", {
3705
4060
  attach_opaque_data: attachOpaqueData,
3706
- schema_name: schemaName,
4061
+ schema_path: normalizeSchemaPath(schemaPath),
3707
4062
  name,
3708
4063
  column_name: columnName,
3709
4064
  ignore_not_found: ignoreNotFound ?? null,
3710
4065
  transaction_opaque_data: transactionOpaqueData ?? null
3711
4066
  });
3712
4067
  }
3713
- async viewGet(attachOpaqueData, schemaName, name, transactionOpaqueData) {
4068
+ async viewGet(attachOpaqueData, schemaPath, name, transactionOpaqueData) {
3714
4069
  const result = await this.rpc.call("catalog_view_get", {
3715
4070
  attach_opaque_data: attachOpaqueData,
3716
- schema_name: schemaName,
4071
+ schema_path: normalizeSchemaPath(schemaPath),
3717
4072
  name,
3718
4073
  transaction_opaque_data: transactionOpaqueData ?? null
3719
4074
  });
@@ -3723,50 +4078,50 @@ class VgiClient {
3723
4078
  const items = deserializeInfoList(inner.items, decodeViewInfo);
3724
4079
  return items.length > 0 ? items[0] : null;
3725
4080
  }
3726
- async viewCreate(attachOpaqueData, schemaName, name, definition, onConflict, transactionOpaqueData) {
4081
+ async viewCreate(attachOpaqueData, schemaPath, name, definition, onConflict, transactionOpaqueData) {
3727
4082
  await this.rpc.call("catalog_view_create", {
3728
4083
  attach_opaque_data: attachOpaqueData,
3729
- schema_name: schemaName,
4084
+ schema_path: normalizeSchemaPath(schemaPath),
3730
4085
  name,
3731
4086
  definition,
3732
4087
  on_conflict: onConflict,
3733
4088
  transaction_opaque_data: transactionOpaqueData ?? null
3734
4089
  });
3735
4090
  }
3736
- async viewDrop(attachOpaqueData, schemaName, name, ignoreNotFound, cascade, transactionOpaqueData) {
4091
+ async viewDrop(attachOpaqueData, schemaPath, name, ignoreNotFound, cascade, transactionOpaqueData) {
3737
4092
  await this.rpc.call("catalog_view_drop", {
3738
4093
  attach_opaque_data: attachOpaqueData,
3739
- schema_name: schemaName,
4094
+ schema_path: normalizeSchemaPath(schemaPath),
3740
4095
  name,
3741
4096
  ignore_not_found: ignoreNotFound ?? false,
3742
4097
  cascade: cascade ?? false,
3743
4098
  transaction_opaque_data: transactionOpaqueData ?? null
3744
4099
  });
3745
4100
  }
3746
- async viewRename(attachOpaqueData, schemaName, name, newName, ignoreNotFound, transactionOpaqueData) {
4101
+ async viewRename(attachOpaqueData, schemaPath, name, newName, ignoreNotFound, transactionOpaqueData) {
3747
4102
  await this.rpc.call("catalog_view_rename", {
3748
4103
  attach_opaque_data: attachOpaqueData,
3749
- schema_name: schemaName,
4104
+ schema_path: normalizeSchemaPath(schemaPath),
3750
4105
  name,
3751
4106
  new_name: newName,
3752
4107
  ignore_not_found: ignoreNotFound ?? null,
3753
4108
  transaction_opaque_data: transactionOpaqueData ?? null
3754
4109
  });
3755
4110
  }
3756
- async viewCommentSet(attachOpaqueData, schemaName, name, comment, ignoreNotFound, transactionOpaqueData) {
4111
+ async viewCommentSet(attachOpaqueData, schemaPath, name, comment, ignoreNotFound, transactionOpaqueData) {
3757
4112
  await this.rpc.call("catalog_view_comment_set", {
3758
4113
  attach_opaque_data: attachOpaqueData,
3759
- schema_name: schemaName,
4114
+ schema_path: normalizeSchemaPath(schemaPath),
3760
4115
  name,
3761
4116
  comment: comment ?? null,
3762
4117
  ignore_not_found: ignoreNotFound ?? null,
3763
4118
  transaction_opaque_data: transactionOpaqueData ?? null
3764
4119
  });
3765
4120
  }
3766
- async macroGet(attachOpaqueData, schemaName, name, transactionOpaqueData) {
4121
+ async macroGet(attachOpaqueData, schemaPath, name, transactionOpaqueData) {
3767
4122
  const result = await this.rpc.call("catalog_macro_get", {
3768
4123
  attach_opaque_data: attachOpaqueData,
3769
- schema_name: schemaName,
4124
+ schema_path: normalizeSchemaPath(schemaPath),
3770
4125
  name,
3771
4126
  transaction_opaque_data: transactionOpaqueData ?? null
3772
4127
  });
@@ -3776,10 +4131,10 @@ class VgiClient {
3776
4131
  const items = deserializeInfoList(inner.items, decodeMacroInfo);
3777
4132
  return items.length > 0 ? items[0] : null;
3778
4133
  }
3779
- async schemaContentsMacros(attachOpaqueData, name, type, transactionOpaqueData) {
4134
+ async schemaContentsMacros(attachOpaqueData, path, type, transactionOpaqueData) {
3780
4135
  const result = await this.rpc.call("catalog_schema_contents_macros", {
3781
4136
  attach_opaque_data: attachOpaqueData,
3782
- name,
4137
+ path: normalizeSchemaPath(path),
3783
4138
  type,
3784
4139
  transaction_opaque_data: transactionOpaqueData ?? null
3785
4140
  });
@@ -3788,22 +4143,10 @@ class VgiClient {
3788
4143
  const inner = unwrapResult(result);
3789
4144
  return deserializeInfoList(inner.items, decodeMacroInfo);
3790
4145
  }
3791
- async macroCreate(attachOpaqueData, schemaName, name, macroType, parameters, definition, onConflict, parameterDefaultValues, argumentsSchema, transactionOpaqueData) {
3792
- const schema3 = schema2([
3793
- field2("attach_opaque_data", binary2(), true),
3794
- field2("schema_name", utf82(), false),
3795
- field2("name", utf82(), false),
3796
- field2("macro_type", utf82(), false),
3797
- field2("parameters", list2(field2("item", utf82(), false)), false),
3798
- field2("definition", utf82(), false),
3799
- field2("on_conflict", utf82(), false),
3800
- field2("parameter_default_values", binary2(), true),
3801
- field2("arguments_schema", binary2(), true),
3802
- field2("transaction_opaque_data", binary2(), true)
3803
- ]);
4146
+ async macroCreate(attachOpaqueData, schemaPath, name, macroType, parameters, definition, onConflict, parameterDefaultValues, argumentsSchema, transactionOpaqueData) {
3804
4147
  const innerBatch = batchFromColumns({
3805
4148
  attach_opaque_data: [attachOpaqueData],
3806
- schema_name: [schemaName],
4149
+ schema_path: [normalizeSchemaPath(schemaPath)],
3807
4150
  name: [name],
3808
4151
  macro_type: [macroType],
3809
4152
  parameters: [parameters],
@@ -3812,13 +4155,13 @@ class VgiClient {
3812
4155
  parameter_default_values: [parameterDefaultValues ?? null],
3813
4156
  arguments_schema: [argumentsSchema ?? null],
3814
4157
  transaction_opaque_data: [transactionOpaqueData ?? null]
3815
- }, schema3);
4158
+ }, MacroCreateRequestSchema);
3816
4159
  await this.rpc.call("catalog_macro_create", wrapRequest(innerBatch));
3817
4160
  }
3818
- async macroDrop(attachOpaqueData, schemaName, name, ignoreNotFound, transactionOpaqueData) {
4161
+ async macroDrop(attachOpaqueData, schemaPath, name, ignoreNotFound, transactionOpaqueData) {
3819
4162
  await this.rpc.call("catalog_macro_drop", {
3820
4163
  attach_opaque_data: attachOpaqueData,
3821
- schema_name: schemaName,
4164
+ schema_path: normalizeSchemaPath(schemaPath),
3822
4165
  name,
3823
4166
  ignore_not_found: ignoreNotFound ?? false,
3824
4167
  transaction_opaque_data: transactionOpaqueData ?? null
@@ -3878,18 +4221,18 @@ function argumentSpecsToSchema(specs) {
3878
4221
  if (spec.pattern !== undefined) {
3879
4222
  metadata.set(VGI_PATTERN_KEY, spec.pattern);
3880
4223
  }
3881
- const field3 = field2(spec.name, spec.arrowType, true, metadata.size > 0 ? metadata : undefined);
3882
- fields.push(field3);
4224
+ const field = field2(spec.name, spec.arrowType, true, metadata.size > 0 ? metadata : undefined);
4225
+ fields.push(field);
3883
4226
  }
3884
4227
  return schema2(fields);
3885
4228
  }
3886
- function schemaToArgumentSpecs(schema3) {
4229
+ function schemaToArgumentSpecs(schema) {
3887
4230
  const specs = [];
3888
4231
  let positionIndex = 0;
3889
- for (const field3 of schema3.fields) {
3890
- const metadata = field3.metadata;
4232
+ for (const field of schema.fields) {
4233
+ const metadata = field.metadata;
3891
4234
  const isNamed = metadata.get(VGI_ARG_KEY) === VGI_ARG_NAMED;
3892
- const position = isNamed ? field3.name : positionIndex++;
4235
+ const position = isNamed ? field.name : positionIndex++;
3893
4236
  const vgiType = metadata.get(VGI_TYPE_KEY);
3894
4237
  const isTableInput = vgiType === VGI_TYPE_TABLE;
3895
4238
  const isAnyType = vgiType === VGI_TYPE_ANY;
@@ -3901,9 +4244,9 @@ function schemaToArgumentSpecs(schema3) {
3901
4244
  const rangeNotation = metadata.get(VGI_RANGE_KEY);
3902
4245
  const pattern = metadata.get(VGI_PATTERN_KEY);
3903
4246
  specs.push({
3904
- name: field3.name,
4247
+ name: field.name,
3905
4248
  position,
3906
- arrowType: field3.type,
4249
+ arrowType: field.type,
3907
4250
  isTableInput,
3908
4251
  isAnyType,
3909
4252
  isVarargs,
@@ -3953,54 +4296,55 @@ function deserializeAttachOptionSpecs(specs) {
3953
4296
  return Array.from(specs, deserializeAttachOptionSpec);
3954
4297
  }
3955
4298
  export {
3956
- typeSignature,
3957
- toUint8Array,
3958
- serializeSchema,
3959
- serializeBatch,
3960
- schemaToArgumentSpecs,
3961
- safeNumber,
3962
- projectSchema,
3963
- projectBatch,
3964
- iterRows,
3965
- filterBatch,
3966
- encodeViewInfo,
3967
- encodeTableInfo,
3968
- encodeSchemaInfo,
3969
- encodeMacroInfo,
3970
- encodeFunctionInfo,
3971
- emptyBatch,
3972
- deserializeSchema,
3973
- deserializeBatch,
3974
- deserializeAttachOptionSpecs,
3975
- deserializeAttachOptionSpec,
3976
- decodeViewInfo,
3977
- decodeTableInfo,
3978
- decodeSchemaInfo,
3979
- decodeMacroInfo,
3980
- decodeFunctionInfo,
3981
- batchToScalarDict,
3982
- batchFromRows,
3983
- batchFromColumns,
3984
- argumentSpecsToSchema,
3985
- VgiError,
3986
- VgiClientError,
3987
- VgiClient,
3988
- TypeId,
3989
- TableInOutPhase,
3990
- RowCountMismatchError,
3991
- OrderPreservation,
3992
- OrderDependence,
3993
- NullHandling,
3994
- NoCatalogError,
3995
- FunctionType,
3996
- FunctionStability,
3997
- FunctionNotFoundError,
3998
- DistinctDependence,
3999
- CatalogReadOnlyError,
4000
- CatalogNotFoundError,
4001
- CatalogAlreadyExistsError,
4299
+ ArgumentMonotonicity,
4300
+ ArgumentValidationError,
4002
4301
  Arguments,
4003
- ArgumentValidationError
4302
+ CatalogAlreadyExistsError,
4303
+ CatalogNotFoundError,
4304
+ CatalogReadOnlyError,
4305
+ DistinctDependence,
4306
+ FunctionNotFoundError,
4307
+ FunctionStability,
4308
+ FunctionType,
4309
+ NoCatalogError,
4310
+ NullHandling,
4311
+ OrderDependence,
4312
+ OrderPreservation,
4313
+ RowCountMismatchError,
4314
+ TableInOutPhase,
4315
+ TypeId,
4316
+ VgiClient,
4317
+ VgiClientError,
4318
+ VgiError,
4319
+ argumentSpecsToSchema,
4320
+ batchFromColumns,
4321
+ batchFromRows,
4322
+ batchToScalarDict,
4323
+ decodeFunctionInfo,
4324
+ decodeMacroInfo,
4325
+ decodeSchemaInfo,
4326
+ decodeTableInfo,
4327
+ decodeViewInfo,
4328
+ deserializeAttachOptionSpec,
4329
+ deserializeAttachOptionSpecs,
4330
+ deserializeBatch,
4331
+ deserializeSchema,
4332
+ emptyBatch,
4333
+ encodeFunctionInfo,
4334
+ encodeMacroInfo,
4335
+ encodeSchemaInfo,
4336
+ encodeTableInfo,
4337
+ encodeViewInfo,
4338
+ filterBatch,
4339
+ iterRows,
4340
+ projectBatch,
4341
+ projectSchema,
4342
+ safeNumber,
4343
+ schemaToArgumentSpecs,
4344
+ serializeBatch,
4345
+ serializeSchema,
4346
+ toUint8Array,
4347
+ typeSignature
4004
4348
  };
4005
4349
 
4006
- //# debugId=07C8934BE302A34C64756E2164756E21
4350
+ //# debugId=D11759D49AEAE35964756E2164756E21