@query-farm/vgi 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/LICENSE +134 -0
  2. package/README.md +494 -0
  3. package/dist/__dbg.test-d.d.ts +1 -0
  4. package/dist/arguments/argument-spec.d.ts +51 -0
  5. package/dist/arguments/arguments.d.ts +13 -0
  6. package/dist/arrow/codec/branded.d.ts +83 -0
  7. package/dist/arrow/codec/registry.d.ts +29 -0
  8. package/dist/arrow/codec/repr.d.ts +23 -0
  9. package/dist/arrow/codec/type-descriptors.d.ts +109 -0
  10. package/dist/arrow/impl-arrowjs/build.d.ts +19 -0
  11. package/dist/arrow/impl-arrowjs/canonical.d.ts +15 -0
  12. package/dist/arrow/impl-arrowjs/empty.d.ts +7 -0
  13. package/dist/arrow/impl-arrowjs/filter.d.ts +11 -0
  14. package/dist/arrow/impl-arrowjs/index.d.ts +11 -0
  15. package/dist/arrow/impl-arrowjs/ipc.d.ts +24 -0
  16. package/dist/arrow/impl-arrowjs/iterate.d.ts +39 -0
  17. package/dist/arrow/impl-arrowjs/project.d.ts +10 -0
  18. package/dist/arrow/impl-arrowjs/schema.d.ts +62 -0
  19. package/dist/arrow/impl-arrowjs/statistics.d.ts +13 -0
  20. package/dist/arrow/impl-flechette/build.d.ts +14 -0
  21. package/dist/arrow/impl-flechette/canonical.d.ts +18 -0
  22. package/dist/arrow/impl-flechette/empty.d.ts +9 -0
  23. package/dist/arrow/impl-flechette/filter.d.ts +10 -0
  24. package/dist/arrow/impl-flechette/index.d.ts +11 -0
  25. package/dist/arrow/impl-flechette/ipc.d.ts +33 -0
  26. package/dist/arrow/impl-flechette/iterate.d.ts +29 -0
  27. package/dist/arrow/impl-flechette/message-meta.d.ts +10 -0
  28. package/dist/arrow/impl-flechette/normalize-type.d.ts +11 -0
  29. package/dist/arrow/impl-flechette/project.d.ts +3 -0
  30. package/dist/arrow/impl-flechette/schema.d.ts +47 -0
  31. package/dist/arrow/impl-flechette/statistics.d.ts +13 -0
  32. package/dist/arrow/index.d.ts +11 -0
  33. package/dist/arrow/predicates.d.ts +47 -0
  34. package/dist/arrow/repr.test-d.d.ts +52 -0
  35. package/dist/arrow/schema-types.d.ts +71 -0
  36. package/dist/arrow/types.d.ts +57 -0
  37. package/dist/catalog/attach-option.d.ts +33 -0
  38. package/dist/catalog/attach-options.d.ts +30 -0
  39. package/dist/catalog/composite.d.ts +33 -0
  40. package/dist/catalog/descriptors.d.ts +154 -0
  41. package/dist/catalog/interface.d.ts +239 -0
  42. package/dist/catalog/read-only.d.ts +33 -0
  43. package/dist/client/client.d.ts +189 -0
  44. package/dist/client/errors.d.ts +26 -0
  45. package/dist/client/helpers.d.ts +12 -0
  46. package/dist/client/protocol.d.ts +16 -0
  47. package/dist/client/types.d.ts +125 -0
  48. package/dist/client-entry.d.ts +11 -0
  49. package/dist/client-entry.js +48 -0
  50. package/dist/client-entry.js.map +9 -0
  51. package/dist/codec/asd.d.ts +25 -0
  52. package/dist/crypto.d.ts +36 -0
  53. package/dist/errors.d.ts +24 -0
  54. package/dist/filter-pushdown/collector.d.ts +32 -0
  55. package/dist/filter-pushdown/deserialize.d.ts +16 -0
  56. package/dist/filter-pushdown/evaluate.d.ts +51 -0
  57. package/dist/filter-pushdown/index.d.ts +4 -0
  58. package/dist/filter-pushdown/types.d.ts +84 -0
  59. package/dist/functions/aggregate.d.ts +129 -0
  60. package/dist/functions/copy-from.d.ts +81 -0
  61. package/dist/functions/copy-to.d.ts +121 -0
  62. package/dist/functions/registry.d.ts +16 -0
  63. package/dist/functions/scalar.d.ts +98 -0
  64. package/dist/functions/storage-cf-do.d.ts +47 -0
  65. package/dist/functions/storage.d.ts +86 -0
  66. package/dist/functions/table-buffering.d.ts +99 -0
  67. package/dist/functions/table-in-out.d.ts +64 -0
  68. package/dist/functions/table.d.ts +118 -0
  69. package/dist/functions/types.d.ts +157 -0
  70. package/dist/generated/vgi-client.d.ts +466 -0
  71. package/dist/generated/vgi-protocol-schemas.d.ts +115 -0
  72. package/dist/index.core.d.ts +42 -0
  73. package/dist/index.d.ts +2 -0
  74. package/dist/index.js +10888 -0
  75. package/dist/index.js.map +85 -0
  76. package/dist/metadata/resolve.d.ts +3 -0
  77. package/dist/metadata/serialize.d.ts +12 -0
  78. package/dist/metadata/types.d.ts +47 -0
  79. package/dist/protocol/dispatch.d.ts +23 -0
  80. package/dist/protocol/handlers/aggregate.d.ts +3 -0
  81. package/dist/protocol/handlers/catalog/admin.d.ts +3 -0
  82. package/dist/protocol/handlers/catalog/index.d.ts +3 -0
  83. package/dist/protocol/handlers/catalog/index_methods.d.ts +3 -0
  84. package/dist/protocol/handlers/catalog/macro.d.ts +3 -0
  85. package/dist/protocol/handlers/catalog/shared.d.ts +70 -0
  86. package/dist/protocol/handlers/catalog/table.d.ts +3 -0
  87. package/dist/protocol/handlers/catalog/view.d.ts +3 -0
  88. package/dist/protocol/handlers/function.d.ts +8 -0
  89. package/dist/protocol/handlers/shared.d.ts +31 -0
  90. package/dist/protocol/handlers/table-buffering.d.ts +3 -0
  91. package/dist/protocol/serialize.d.ts +4 -0
  92. package/dist/protocol/serializers/arguments.d.ts +3 -0
  93. package/dist/protocol/serializers/bind.d.ts +9 -0
  94. package/dist/protocol/serializers/cardinality.d.ts +7 -0
  95. package/dist/protocol/serializers/init.d.ts +9 -0
  96. package/dist/protocol/serializers/shared.d.ts +12 -0
  97. package/dist/protocol/state-serializer.d.ts +23 -0
  98. package/dist/protocol/types.d.ts +129 -0
  99. package/dist/secrets/helpers.d.ts +15 -0
  100. package/dist/types.d.ts +52 -0
  101. package/dist/util/arrow/index.d.ts +1 -0
  102. package/dist/util/bytes.d.ts +2 -0
  103. package/dist/util/statistics.d.ts +7 -0
  104. package/dist/worker-cf-entry.d.ts +30 -0
  105. package/dist/worker-cf-entry.js +8767 -0
  106. package/dist/worker-cf-entry.js.map +74 -0
  107. package/dist/worker.d.ts +36 -0
  108. package/package.json +96 -0
  109. package/src/arguments/argument-spec.ts +200 -0
  110. package/src/arguments/arguments.ts +81 -0
  111. package/src/arrow/codec/branded.ts +206 -0
  112. package/src/arrow/codec/registry.ts +674 -0
  113. package/src/arrow/codec/repr.ts +181 -0
  114. package/src/arrow/codec/type-descriptors.ts +137 -0
  115. package/src/arrow/impl-arrowjs/build.ts +88 -0
  116. package/src/arrow/impl-arrowjs/canonical.ts +509 -0
  117. package/src/arrow/impl-arrowjs/empty.ts +72 -0
  118. package/src/arrow/impl-arrowjs/filter.ts +53 -0
  119. package/src/arrow/impl-arrowjs/index.ts +54 -0
  120. package/src/arrow/impl-arrowjs/ipc.ts +67 -0
  121. package/src/arrow/impl-arrowjs/iterate.ts +159 -0
  122. package/src/arrow/impl-arrowjs/project.ts +73 -0
  123. package/src/arrow/impl-arrowjs/schema.ts +256 -0
  124. package/src/arrow/impl-arrowjs/statistics.ts +185 -0
  125. package/src/arrow/impl-flechette/build.ts +65 -0
  126. package/src/arrow/impl-flechette/canonical.ts +289 -0
  127. package/src/arrow/impl-flechette/empty.ts +20 -0
  128. package/src/arrow/impl-flechette/filter.ts +42 -0
  129. package/src/arrow/impl-flechette/index.ts +54 -0
  130. package/src/arrow/impl-flechette/ipc.ts +110 -0
  131. package/src/arrow/impl-flechette/iterate.ts +121 -0
  132. package/src/arrow/impl-flechette/message-meta.ts +175 -0
  133. package/src/arrow/impl-flechette/normalize-type.ts +99 -0
  134. package/src/arrow/impl-flechette/project.ts +64 -0
  135. package/src/arrow/impl-flechette/schema.ts +202 -0
  136. package/src/arrow/impl-flechette/statistics.ts +198 -0
  137. package/src/arrow/index.ts +129 -0
  138. package/src/arrow/predicates.ts +66 -0
  139. package/src/arrow/repr.test-d.ts +189 -0
  140. package/src/arrow/schema-types.ts +213 -0
  141. package/src/arrow/types.ts +74 -0
  142. package/src/catalog/attach-option.ts +107 -0
  143. package/src/catalog/attach-options.ts +79 -0
  144. package/src/catalog/composite.ts +180 -0
  145. package/src/catalog/descriptors.ts +164 -0
  146. package/src/catalog/interface.ts +721 -0
  147. package/src/catalog/read-only.ts +909 -0
  148. package/src/client/client.ts +1348 -0
  149. package/src/client/errors.ts +69 -0
  150. package/src/client/helpers.ts +56 -0
  151. package/src/client/protocol.ts +33 -0
  152. package/src/client/types.ts +140 -0
  153. package/src/client-entry.ts +112 -0
  154. package/src/codec/asd.ts +147 -0
  155. package/src/crypto.ts +143 -0
  156. package/src/errors.ts +61 -0
  157. package/src/filter-pushdown/collector.ts +147 -0
  158. package/src/filter-pushdown/deserialize.ts +253 -0
  159. package/src/filter-pushdown/evaluate.ts +591 -0
  160. package/src/filter-pushdown/index.ts +28 -0
  161. package/src/filter-pushdown/types.ts +91 -0
  162. package/src/functions/aggregate.ts +384 -0
  163. package/src/functions/copy-from.ts +282 -0
  164. package/src/functions/copy-to.ts +319 -0
  165. package/src/functions/registry.ts +258 -0
  166. package/src/functions/scalar.ts +356 -0
  167. package/src/functions/storage-cf-do.ts +303 -0
  168. package/src/functions/storage.ts +521 -0
  169. package/src/functions/table-buffering.ts +562 -0
  170. package/src/functions/table-in-out.ts +373 -0
  171. package/src/functions/table.ts +521 -0
  172. package/src/functions/types.ts +192 -0
  173. package/src/generated/vgi-client.ts +560 -0
  174. package/src/generated/vgi-protocol-schemas.ts +864 -0
  175. package/src/index.core.ts +267 -0
  176. package/src/index.ts +11 -0
  177. package/src/metadata/resolve.ts +109 -0
  178. package/src/metadata/serialize.ts +242 -0
  179. package/src/metadata/types.ts +60 -0
  180. package/src/protocol/dispatch.ts +52 -0
  181. package/src/protocol/handlers/aggregate.ts +355 -0
  182. package/src/protocol/handlers/catalog/admin.ts +368 -0
  183. package/src/protocol/handlers/catalog/index.ts +25 -0
  184. package/src/protocol/handlers/catalog/index_methods.ts +65 -0
  185. package/src/protocol/handlers/catalog/macro.ts +114 -0
  186. package/src/protocol/handlers/catalog/shared.ts +291 -0
  187. package/src/protocol/handlers/catalog/table.ts +401 -0
  188. package/src/protocol/handlers/catalog/view.ts +119 -0
  189. package/src/protocol/handlers/function.ts +302 -0
  190. package/src/protocol/handlers/shared.ts +80 -0
  191. package/src/protocol/handlers/table-buffering.ts +207 -0
  192. package/src/protocol/serialize.ts +23 -0
  193. package/src/protocol/serializers/arguments.ts +160 -0
  194. package/src/protocol/serializers/bind.ts +212 -0
  195. package/src/protocol/serializers/cardinality.ts +45 -0
  196. package/src/protocol/serializers/init.ts +247 -0
  197. package/src/protocol/serializers/shared.ts +46 -0
  198. package/src/protocol/state-serializer.ts +181 -0
  199. package/src/protocol/types.ts +153 -0
  200. package/src/secrets/helpers.ts +70 -0
  201. package/src/types.ts +71 -0
  202. package/src/util/arrow/index.ts +23 -0
  203. package/src/util/bytes.ts +14 -0
  204. package/src/util/statistics.ts +40 -0
  205. package/src/worker-cf-entry.ts +172 -0
  206. package/src/worker.ts +212 -0
@@ -0,0 +1,560 @@
1
+ // ============================================================================
2
+ // GENERATED by vgi.codegen.ts_client. DO NOT EDIT BY HAND.
3
+ //
4
+ // Generator: vgi-gen-ts-client v1
5
+ // Content hash: 101207be9452
6
+ //
7
+ // To regenerate:
8
+ // uv run --project ~/Development/vgi-python vgi-gen-ts-client \
9
+ // > ~/Development/vgi-typescript/src/generated/vgi-client.ts
10
+ // ============================================================================
11
+
12
+ import { encodeASD, decodeASD } from "../codec/asd.js";
13
+ import {
14
+ CatalogInfoSchema,
15
+ FunctionInfoSchema,
16
+ IndexInfoSchema,
17
+ MacroInfoSchema,
18
+ SchemaInfoSchema,
19
+ TableInfoSchema,
20
+ ViewInfoSchema,
21
+ } from "./vgi-protocol-schemas.js";
22
+
23
+ export type DistinctDependence = "DISTINCT_DEPENDENT" | "NOT_DISTINCT_DEPENDENT";
24
+ export type FunctionStability = "CONSISTENT" | "VOLATILE" | "CONSISTENT_WITHIN_QUERY";
25
+ export type FunctionType = "SCALAR" | "TABLE" | "TABLE_BUFFERING" | "AGGREGATE";
26
+ export type IndexConstraintType = "NONE" | "UNIQUE" | "PRIMARY";
27
+ export type InvocationFunctionType = "AGGREGATE" | "SCALAR" | "TABLE" | "TABLE_BUFFERING";
28
+ export type MacroType = "SCALAR" | "TABLE";
29
+ export type NullHandling = "DEFAULT" | "SPECIAL";
30
+ export type OnConflict = "ERROR" | "IGNORE" | "REPLACE";
31
+ export type OrderByDirection = "ASC" | "DESC";
32
+ export type OrderByNullOrder = "NULLS_FIRST" | "NULLS_LAST";
33
+ export type OrderDependence = "ORDER_DEPENDENT" | "NOT_ORDER_DEPENDENT";
34
+ export type OrderPreservation = "PRESERVES_ORDER" | "NO_ORDER_GUARANTEE" | "FIXED_ORDER";
35
+ export type PartitionKind = "NOT_PARTITIONED" | "SINGLE_VALUE_PARTITIONS" | "OVERLAPPING_PARTITIONS" | "DISJOINT_PARTITIONS";
36
+ export type SchemaObjectType = "TABLE" | "VIEW" | "SCALAR_FUNCTION" | "TABLE_FUNCTION" | "AGGREGATE_FUNCTION" | "SCALAR_MACRO" | "TABLE_MACRO" | "INDEX";
37
+ export type TableInOutFunctionInitPhase = "INPUT" | "FINALIZE" | "TABLE_BUFFERING" | "TABLE_BUFFERING_FINALIZE";
38
+
39
+ export interface CatalogDataVersionRelease {
40
+ version: string;
41
+ released_at?: bigint | null;
42
+ summary: string;
43
+ notes_url?: string | null;
44
+ }
45
+
46
+ export interface CatalogInfo {
47
+ name: string;
48
+ implementation_version?: string | null;
49
+ data_version_spec?: string | null;
50
+ attach_option_specs: Uint8Array[];
51
+ releases: CatalogDataVersionRelease[];
52
+ source_url?: string | null;
53
+ }
54
+
55
+ export interface SchemaInfo {
56
+ comment?: string | null;
57
+ tags: Record<string, string>;
58
+ attach_opaque_data: Uint8Array;
59
+ name: string;
60
+ estimated_object_count?: Record<string, number> | null;
61
+ }
62
+
63
+ export interface TableInfo {
64
+ comment?: string | null;
65
+ tags: Record<string, string>;
66
+ name: string;
67
+ schema_name: string;
68
+ columns: Uint8Array;
69
+ not_null_constraints: number[];
70
+ unique_constraints: number[][];
71
+ check_constraints: string[];
72
+ primary_key_constraints: number[][];
73
+ foreign_key_constraints: Uint8Array[];
74
+ supports_insert: boolean;
75
+ supports_update: boolean;
76
+ supports_delete: boolean;
77
+ supports_returning: boolean;
78
+ supports_column_statistics: boolean;
79
+ scan_function?: Uint8Array | null;
80
+ insert_function?: Uint8Array | null;
81
+ update_function?: Uint8Array | null;
82
+ delete_function?: Uint8Array | null;
83
+ cardinality_estimate?: number | null;
84
+ cardinality_max?: number | null;
85
+ column_statistics?: Uint8Array | null;
86
+ bind_result?: Uint8Array | null;
87
+ required_field_filter_paths: string[];
88
+ }
89
+
90
+ export interface ViewInfo {
91
+ comment?: string | null;
92
+ tags: Record<string, string>;
93
+ name: string;
94
+ schema_name: string;
95
+ definition: string;
96
+ column_comments: Record<string, string>;
97
+ }
98
+
99
+ export interface CatalogExample {
100
+ sql: string;
101
+ description: string;
102
+ expected_output?: string | null;
103
+ }
104
+
105
+ export interface SecretLookupEntry {
106
+ secret_type: string;
107
+ scope?: string | null;
108
+ secret_name?: string | null;
109
+ }
110
+
111
+ export interface FunctionInfo {
112
+ comment?: string | null;
113
+ tags: Record<string, string>;
114
+ name: string;
115
+ schema_name: string;
116
+ function_type: FunctionType;
117
+ arguments: Uint8Array;
118
+ output_schema: Uint8Array;
119
+ stability?: FunctionStability | null;
120
+ null_handling?: NullHandling | null;
121
+ description: string;
122
+ examples: CatalogExample[];
123
+ categories: string[];
124
+ projection_pushdown?: boolean | null;
125
+ filter_pushdown?: boolean | null;
126
+ sampling_pushdown?: boolean | null;
127
+ late_materialization?: boolean | null;
128
+ supported_expression_filters: string[];
129
+ order_preservation?: OrderPreservation | null;
130
+ max_workers?: number | null;
131
+ supports_batch_index: boolean;
132
+ partition_kind: PartitionKind;
133
+ order_dependent: OrderDependence;
134
+ distinct_dependent: DistinctDependence;
135
+ supports_window: boolean;
136
+ streaming_partitioned: boolean;
137
+ has_finalize: boolean;
138
+ source_order_dependent: boolean;
139
+ sink_order_dependent: boolean;
140
+ requires_input_batch_index: boolean;
141
+ required_settings: string[];
142
+ required_secrets: SecretLookupEntry[];
143
+ }
144
+
145
+ export interface MacroInfo {
146
+ comment?: string | null;
147
+ tags: Record<string, string>;
148
+ name: string;
149
+ schema_name: string;
150
+ macro_type: MacroType;
151
+ parameters: string[];
152
+ parameter_default_values?: /** @record-batch */ Uint8Array | null;
153
+ definition: string;
154
+ arguments_schema?: /** @arrow-schema */ Uint8Array | null;
155
+ }
156
+
157
+ export interface IndexInfo {
158
+ comment?: string | null;
159
+ tags: Record<string, string>;
160
+ name: string;
161
+ schema_name: string;
162
+ table_name: string;
163
+ index_type: string;
164
+ constraint_type: IndexConstraintType;
165
+ expressions: string[];
166
+ options: Record<string, string>;
167
+ }
168
+
169
+ export interface AggregateBindRequest {
170
+ function_name: string;
171
+ arguments: /** @vgi-arguments */ Uint8Array;
172
+ input_schema?: /** @arrow-schema */ Uint8Array | null;
173
+ settings?: /** @record-batch */ Uint8Array | null;
174
+ secrets?: /** @record-batch */ Uint8Array | null;
175
+ attach_opaque_data?: Uint8Array | null;
176
+ }
177
+
178
+ export interface AggregateBindResponse {
179
+ output_schema: /** @arrow-schema */ Uint8Array;
180
+ execution_id: Uint8Array;
181
+ }
182
+
183
+ export interface AggregateCombineRequest {
184
+ function_name: string;
185
+ execution_id: Uint8Array;
186
+ merge_batch: Uint8Array;
187
+ attach_opaque_data?: Uint8Array | null;
188
+ }
189
+
190
+ export interface AggregateCombineResponse {
191
+ }
192
+
193
+ export interface AggregateDestructorRequest {
194
+ function_name: string;
195
+ execution_id: Uint8Array;
196
+ group_ids_batch: Uint8Array;
197
+ attach_opaque_data?: Uint8Array | null;
198
+ }
199
+
200
+ export interface AggregateDestructorResponse {
201
+ }
202
+
203
+ export interface AggregateFinalizeRequest {
204
+ function_name: string;
205
+ execution_id: Uint8Array;
206
+ group_ids_batch: Uint8Array;
207
+ output_schema: /** @arrow-schema */ Uint8Array;
208
+ attach_opaque_data?: Uint8Array | null;
209
+ }
210
+
211
+ export interface AggregateFinalizeResponse {
212
+ result_batch: Uint8Array;
213
+ }
214
+
215
+ export interface AggregateStreamingChunkRequest {
216
+ function_name: string;
217
+ execution_id: Uint8Array;
218
+ input_batch: Uint8Array;
219
+ attach_opaque_data?: Uint8Array | null;
220
+ }
221
+
222
+ export interface AggregateStreamingChunkResponse {
223
+ result_batch: Uint8Array;
224
+ }
225
+
226
+ export interface AggregateStreamingCloseRequest {
227
+ function_name: string;
228
+ execution_id: Uint8Array;
229
+ attach_opaque_data?: Uint8Array | null;
230
+ }
231
+
232
+ export interface AggregateStreamingCloseResponse {
233
+ }
234
+
235
+ export interface AggregateStreamingOpenRequest {
236
+ function_name: string;
237
+ arguments: /** @vgi-arguments */ Uint8Array;
238
+ input_schema: /** @arrow-schema */ Uint8Array;
239
+ partition_key_count: number;
240
+ order_key_count: number;
241
+ output_schema: /** @arrow-schema */ Uint8Array;
242
+ settings?: /** @record-batch */ Uint8Array | null;
243
+ secrets?: /** @record-batch */ Uint8Array | null;
244
+ attach_opaque_data?: Uint8Array | null;
245
+ }
246
+
247
+ export interface AggregateStreamingOpenResponse {
248
+ execution_id: Uint8Array;
249
+ }
250
+
251
+ export interface AggregateUpdateRequest {
252
+ function_name: string;
253
+ execution_id: Uint8Array;
254
+ input_batch: Uint8Array;
255
+ attach_opaque_data?: Uint8Array | null;
256
+ }
257
+
258
+ export interface AggregateUpdateResponse {
259
+ }
260
+
261
+ export interface AggregateWindowRequest {
262
+ function_name: string;
263
+ execution_id: Uint8Array;
264
+ partition_id: number;
265
+ rid: number;
266
+ frame_starts: number[];
267
+ frame_ends: number[];
268
+ attach_opaque_data?: Uint8Array | null;
269
+ }
270
+
271
+ export interface AggregateWindowResponse {
272
+ result_batch: Uint8Array;
273
+ }
274
+
275
+ export interface AggregateWindowBatchRequest {
276
+ function_name: string;
277
+ execution_id: Uint8Array;
278
+ partition_id: number;
279
+ row_idx: number;
280
+ count: number;
281
+ frames_per_row: number[];
282
+ frame_starts: number[];
283
+ frame_ends: number[];
284
+ attach_opaque_data?: Uint8Array | null;
285
+ }
286
+
287
+ export interface AggregateWindowBatchResponse {
288
+ result_batch: Uint8Array;
289
+ }
290
+
291
+ export interface AggregateWindowDestructorRequest {
292
+ function_name: string;
293
+ execution_id: Uint8Array;
294
+ partition_id: number;
295
+ attach_opaque_data?: Uint8Array | null;
296
+ }
297
+
298
+ export interface AggregateWindowDestructorResponse {
299
+ }
300
+
301
+ export interface AggregateWindowInitRequest {
302
+ function_name: string;
303
+ execution_id: Uint8Array;
304
+ partition_id: number;
305
+ row_count: number;
306
+ partition_batch: Uint8Array;
307
+ output_schema: /** @arrow-schema */ Uint8Array;
308
+ filter_mask: Uint8Array;
309
+ frame_stats: Uint8Array;
310
+ all_valid: Uint8Array;
311
+ attach_opaque_data?: Uint8Array | null;
312
+ }
313
+
314
+ export interface AggregateWindowInitResponse {
315
+ }
316
+
317
+ export interface CopyFromContext {
318
+ format: string;
319
+ file_path: string;
320
+ expected_schema: /** @arrow-schema */ Uint8Array;
321
+ }
322
+
323
+ export interface CopyToContext {
324
+ format: string;
325
+ file_path: string;
326
+ }
327
+
328
+ export interface BindRequest {
329
+ function_name: string;
330
+ arguments: /** @vgi-arguments */ Uint8Array;
331
+ function_type: InvocationFunctionType;
332
+ input_schema?: /** @arrow-schema */ Uint8Array | null;
333
+ settings?: /** @record-batch */ Uint8Array | null;
334
+ secrets?: /** @record-batch */ Uint8Array | null;
335
+ attach_opaque_data?: Uint8Array | null;
336
+ transaction_opaque_data?: Uint8Array | null;
337
+ resolved_secrets_provided: boolean;
338
+ at_unit?: string | null;
339
+ at_value?: string | null;
340
+ copy_from?: CopyFromContext | null;
341
+ copy_to?: CopyToContext | null;
342
+ }
343
+
344
+ export interface BindResponse {
345
+ output_schema: /** @arrow-schema */ Uint8Array;
346
+ opaque_data?: Uint8Array | null;
347
+ lookup_secret_types: string[];
348
+ lookup_scopes: string[];
349
+ lookup_names: string[];
350
+ }
351
+
352
+ export interface CatalogAttachRequest {
353
+ name: string;
354
+ options?: /** @record-batch */ Uint8Array | null;
355
+ data_version_spec?: string | null;
356
+ implementation_version?: string | null;
357
+ }
358
+
359
+ export interface CatalogAttachResult {
360
+ attach_opaque_data: Uint8Array;
361
+ supports_transactions: boolean;
362
+ supports_time_travel: boolean;
363
+ catalog_version_frozen: boolean;
364
+ catalog_version: number;
365
+ attach_opaque_data_required: boolean;
366
+ default_schema: string;
367
+ settings: Uint8Array[];
368
+ secret_types: Uint8Array[];
369
+ comment?: string | null;
370
+ tags: Record<string, string>;
371
+ supports_column_statistics: boolean;
372
+ resolved_data_version?: string | null;
373
+ resolved_implementation_version?: string | null;
374
+ }
375
+
376
+ export interface CatalogsResponse {
377
+ items: CatalogInfo[];
378
+ }
379
+
380
+ export interface CopyFromFormatsResponse {
381
+ items: Uint8Array[];
382
+ }
383
+
384
+ export interface CatalogCreateRequest {
385
+ name: string;
386
+ on_conflict: OnConflict;
387
+ options?: /** @record-batch */ Uint8Array | null;
388
+ }
389
+
390
+ export interface IndexCreateRequest {
391
+ attach_opaque_data: Uint8Array;
392
+ schema_name: string;
393
+ name: string;
394
+ table_name: string;
395
+ index_type: string;
396
+ constraint_type: IndexConstraintType;
397
+ expressions: string[];
398
+ on_conflict: OnConflict;
399
+ options: Record<string, string>;
400
+ transaction_opaque_data?: Uint8Array | null;
401
+ }
402
+
403
+ export interface IndexesResponse {
404
+ items: IndexInfo[];
405
+ }
406
+
407
+ export interface MacroCreateRequest {
408
+ attach_opaque_data: Uint8Array;
409
+ schema_name: string;
410
+ name: string;
411
+ macro_type: MacroType;
412
+ parameters: string[];
413
+ definition: string;
414
+ on_conflict: OnConflict;
415
+ parameter_default_values?: /** @record-batch */ Uint8Array | null;
416
+ arguments_schema?: /** @arrow-schema */ Uint8Array | null;
417
+ transaction_opaque_data?: Uint8Array | null;
418
+ }
419
+
420
+ export interface MacrosResponse {
421
+ items: MacroInfo[];
422
+ }
423
+
424
+ export interface FunctionsResponse {
425
+ items: FunctionInfo[];
426
+ }
427
+
428
+ export interface TablesResponse {
429
+ items: TableInfo[];
430
+ }
431
+
432
+ export interface ViewsResponse {
433
+ items: ViewInfo[];
434
+ }
435
+
436
+ export interface SchemasResponse {
437
+ items: SchemaInfo[];
438
+ }
439
+
440
+ export interface TableCreateRequest {
441
+ attach_opaque_data: Uint8Array;
442
+ schema_name: string;
443
+ name: string;
444
+ columns: Uint8Array;
445
+ on_conflict: OnConflict;
446
+ not_null_constraints: number[];
447
+ unique_constraints: number[][];
448
+ check_constraints: string[];
449
+ primary_key_constraints: number[][];
450
+ foreign_key_constraints: Uint8Array[];
451
+ transaction_opaque_data?: Uint8Array | null;
452
+ }
453
+
454
+ export interface TransactionBeginResponse {
455
+ transaction_opaque_data?: Uint8Array | null;
456
+ }
457
+
458
+ export interface CatalogVersionResponse {
459
+ version: number;
460
+ }
461
+
462
+ export interface InitRequest {
463
+ bind_call: BindRequest;
464
+ output_schema: /** @arrow-schema */ Uint8Array;
465
+ bind_opaque_data?: Uint8Array | null;
466
+ projection_ids?: number[] | null;
467
+ pushdown_filters?: /** @record-batch */ Uint8Array | null;
468
+ join_keys?: /** @record-batch */ Uint8Array[] | null;
469
+ phase?: TableInOutFunctionInitPhase | null;
470
+ finalize_state_id?: Uint8Array | null;
471
+ execution_id?: Uint8Array | null;
472
+ init_opaque_data?: Uint8Array | null;
473
+ order_by_column_name?: string | null;
474
+ order_by_direction?: OrderByDirection | null;
475
+ order_by_null_order?: OrderByNullOrder | null;
476
+ order_by_limit?: number | null;
477
+ tablesample_percentage?: number | null;
478
+ tablesample_seed?: number | null;
479
+ }
480
+
481
+ export interface TableBufferingCombineRequest {
482
+ function_name: string;
483
+ execution_id: Uint8Array;
484
+ state_ids: Uint8Array[];
485
+ attach_opaque_data?: Uint8Array | null;
486
+ transaction_id?: Uint8Array | null;
487
+ }
488
+
489
+ export interface TableBufferingCombineResponse {
490
+ finalize_state_ids: Uint8Array[];
491
+ }
492
+
493
+ export interface TableBufferingDestructorRequest {
494
+ function_name: string;
495
+ execution_id: Uint8Array;
496
+ attach_opaque_data?: Uint8Array | null;
497
+ transaction_id?: Uint8Array | null;
498
+ }
499
+
500
+ export interface TableBufferingDestructorResponse {
501
+ }
502
+
503
+ export interface TableBufferingProcessRequest {
504
+ function_name: string;
505
+ execution_id: Uint8Array;
506
+ input_batch: Uint8Array;
507
+ attach_opaque_data?: Uint8Array | null;
508
+ transaction_id?: Uint8Array | null;
509
+ batch_index?: number | null;
510
+ }
511
+
512
+ export interface TableBufferingProcessResponse {
513
+ state_id: Uint8Array;
514
+ }
515
+
516
+ export interface TableFunctionCardinalityRequest {
517
+ bind_call: BindRequest;
518
+ bind_opaque_data?: Uint8Array | null;
519
+ }
520
+
521
+ export interface TableCardinality {
522
+ estimate?: number | null;
523
+ max?: number | null;
524
+ }
525
+
526
+ export interface TableFunctionDynamicToStringRequest {
527
+ bind_call: BindRequest;
528
+ bind_opaque_data?: Uint8Array | null;
529
+ global_execution_id: Uint8Array;
530
+ }
531
+
532
+ export interface TableFunctionDynamicToStringResponse {
533
+ keys: string[];
534
+ values: string[];
535
+ }
536
+
537
+ export interface TableFunctionStatisticsRequest {
538
+ bind_call: BindRequest;
539
+ bind_opaque_data?: Uint8Array | null;
540
+ }
541
+
542
+ // ----------------------------------------------------------------------------
543
+ // Codec wrappers: turn the typed interfaces above into actual wire bytes.
544
+ // ----------------------------------------------------------------------------
545
+
546
+ export const encodeCatalogInfo = (v: CatalogInfo): Uint8Array => encodeASD(CatalogInfoSchema, v);
547
+ export const decodeCatalogInfo = (b: Uint8Array): CatalogInfo => decodeASD<CatalogInfo>(CatalogInfoSchema, b);
548
+ export const encodeFunctionInfo = (v: FunctionInfo): Uint8Array => encodeASD(FunctionInfoSchema, v);
549
+ export const decodeFunctionInfo = (b: Uint8Array): FunctionInfo => decodeASD<FunctionInfo>(FunctionInfoSchema, b);
550
+ export const encodeIndexInfo = (v: IndexInfo): Uint8Array => encodeASD(IndexInfoSchema, v);
551
+ export const decodeIndexInfo = (b: Uint8Array): IndexInfo => decodeASD<IndexInfo>(IndexInfoSchema, b);
552
+ export const encodeMacroInfo = (v: MacroInfo): Uint8Array => encodeASD(MacroInfoSchema, v);
553
+ export const decodeMacroInfo = (b: Uint8Array): MacroInfo => decodeASD<MacroInfo>(MacroInfoSchema, b);
554
+ export const encodeSchemaInfo = (v: SchemaInfo): Uint8Array => encodeASD(SchemaInfoSchema, v);
555
+ export const decodeSchemaInfo = (b: Uint8Array): SchemaInfo => decodeASD<SchemaInfo>(SchemaInfoSchema, b);
556
+ export const encodeTableInfo = (v: TableInfo): Uint8Array => encodeASD(TableInfoSchema, v);
557
+ export const decodeTableInfo = (b: Uint8Array): TableInfo => decodeASD<TableInfo>(TableInfoSchema, b);
558
+ export const encodeViewInfo = (v: ViewInfo): Uint8Array => encodeASD(ViewInfoSchema, v);
559
+ export const decodeViewInfo = (b: Uint8Array): ViewInfo => decodeASD<ViewInfo>(ViewInfoSchema, b);
560
+