@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.
- package/README.md +52 -8
- package/dist/arguments/argument-spec.d.ts +57 -2
- package/dist/arrow/impl-arrowjs/index.d.ts +1 -1
- package/dist/arrow/impl-arrowjs/iterate.d.ts +10 -1
- package/dist/arrow/impl-arrowjs/schema.d.ts +2 -0
- package/dist/arrow/impl-flechette/index.d.ts +1 -1
- package/dist/arrow/impl-flechette/iterate.d.ts +10 -1
- package/dist/arrow/impl-flechette/schema.d.ts +2 -0
- package/dist/arrow/index.d.ts +1 -1
- package/dist/arrow/schema-types.d.ts +3 -1
- package/dist/arrow/types.d.ts +39 -3
- package/dist/catalog/composite.d.ts +13 -13
- package/dist/catalog/descriptors.d.ts +7 -3
- package/dist/catalog/interface.d.ts +108 -38
- package/dist/catalog/read-only.d.ts +32 -15
- package/dist/client/client.d.ts +37 -30
- package/dist/client/types.d.ts +2 -0
- package/dist/client-entry.d.ts +1 -1
- package/dist/client-entry.js +791 -447
- package/dist/client-entry.js.map +18 -17
- package/dist/filter-pushdown/capabilities.d.ts +3 -0
- package/dist/filter-pushdown/deserialize.d.ts +14 -15
- package/dist/filter-pushdown/evaluate.d.ts +14 -44
- package/dist/filter-pushdown/index.d.ts +2 -2
- package/dist/filter-pushdown/types.d.ts +120 -68
- package/dist/functions/aggregate.d.ts +4 -0
- package/dist/functions/registry.d.ts +5 -5
- package/dist/functions/scalar.d.ts +6 -1
- package/dist/functions/table-buffering.d.ts +9 -0
- package/dist/functions/table-in-out.d.ts +13 -0
- package/dist/functions/table.d.ts +72 -2
- package/dist/functions/types.d.ts +60 -2
- package/dist/generated/vgi-client.d.ts +114 -26
- package/dist/generated/vgi-protocol-schemas.d.ts +34 -0
- package/dist/http/fetch.d.ts +16 -0
- package/dist/index.core.d.ts +4 -3
- package/dist/index.js +3396 -2064
- package/dist/index.js.map +55 -49
- package/dist/metadata/types.d.ts +15 -2
- package/dist/protocol/handlers/catalog/shared.d.ts +0 -8
- package/dist/protocol/handlers/function.d.ts +11 -0
- package/dist/protocol/handlers/shared.d.ts +3 -1
- package/dist/protocol/serializers/bind.d.ts +1 -2
- package/dist/protocol/serializers/cardinality.d.ts +1 -2
- package/dist/protocol/serializers/splits.d.ts +126 -0
- package/dist/protocol/types.d.ts +36 -3
- package/dist/request-auth.d.ts +28 -0
- package/dist/schema-path.d.ts +7 -0
- package/dist/serve-entry.d.ts +25 -0
- package/dist/serve-entry.js +1129 -569
- package/dist/serve-entry.js.map +36 -32
- package/dist/split-token.d.ts +88 -0
- package/dist/types.d.ts +8 -0
- package/dist/worker-cf-entry.js +2928 -1689
- package/dist/worker-cf-entry.js.map +51 -44
- package/dist/worker.d.ts +1 -1
- package/package.json +3 -3
- package/src/arguments/argument-spec.ts +93 -4
- package/src/arguments/arguments.ts +0 -1
- package/src/arrow/impl-arrowjs/index.ts +1 -1
- package/src/arrow/impl-arrowjs/iterate.ts +21 -0
- package/src/arrow/impl-arrowjs/schema.ts +4 -0
- package/src/arrow/impl-flechette/index.ts +1 -1
- package/src/arrow/impl-flechette/iterate.ts +24 -1
- package/src/arrow/impl-flechette/schema.ts +4 -0
- package/src/arrow/index.ts +1 -1
- package/src/arrow/schema-types.ts +4 -0
- package/src/arrow/types.ts +39 -3
- package/src/catalog/composite.ts +26 -26
- package/src/catalog/descriptors.ts +12 -3
- package/src/catalog/interface.ts +217 -72
- package/src/catalog/read-only.ts +141 -84
- package/src/client/client.ts +97 -73
- package/src/client/types.ts +2 -0
- package/src/client-entry.ts +2 -1
- package/src/filter-pushdown/capabilities.ts +13 -0
- package/src/filter-pushdown/collector.ts +22 -35
- package/src/filter-pushdown/deserialize.ts +657 -221
- package/src/filter-pushdown/evaluate.ts +410 -499
- package/src/filter-pushdown/index.ts +16 -2
- package/src/filter-pushdown/types.ts +88 -71
- package/src/functions/aggregate.ts +12 -1
- package/src/functions/copy-from.ts +2 -1
- package/src/functions/copy-to.ts +2 -1
- package/src/functions/registry.ts +24 -22
- package/src/functions/scalar.ts +37 -0
- package/src/functions/table-buffering.ts +48 -6
- package/src/functions/table-in-out.ts +194 -33
- package/src/functions/table.ts +187 -22
- package/src/functions/types.ts +64 -1
- package/src/generated/vgi-client.ts +122 -28
- package/src/generated/vgi-protocol-schemas.ts +455 -58
- package/src/http/fetch.ts +129 -2
- package/src/index.core.ts +4 -2
- package/src/metadata/resolve.ts +43 -1
- package/src/metadata/serialize.ts +43 -5
- package/src/metadata/types.ts +17 -1
- package/src/protocol/dispatch.ts +1 -1
- package/src/protocol/handlers/aggregate.ts +23 -12
- package/src/protocol/handlers/catalog/admin.ts +47 -54
- package/src/protocol/handlers/catalog/index_methods.ts +6 -13
- package/src/protocol/handlers/catalog/macro.ts +12 -20
- package/src/protocol/handlers/catalog/shared.ts +12 -57
- package/src/protocol/handlers/catalog/table.ts +49 -112
- package/src/protocol/handlers/catalog/view.ts +18 -22
- package/src/protocol/handlers/function.ts +311 -18
- package/src/protocol/handlers/shared.ts +12 -3
- package/src/protocol/handlers/table-buffering.ts +11 -8
- package/src/protocol/serializers/bind.ts +69 -67
- package/src/protocol/serializers/cardinality.ts +7 -7
- package/src/protocol/serializers/init.ts +52 -10
- package/src/protocol/serializers/splits.ts +221 -0
- package/src/protocol/state-serializer.ts +55 -1
- package/src/protocol/types.ts +36 -3
- package/src/request-auth.ts +73 -0
- package/src/schema-path.ts +25 -0
- package/src/serve-entry.ts +69 -2
- package/src/split-token.ts +297 -0
- package/src/types.ts +9 -0
- package/src/worker-cf-entry.ts +2 -1
- package/src/worker.ts +79 -14
|
@@ -6,9 +6,25 @@ import { type VgiSchema, schema, type VgiField, field, type VgiDataType, binary,
|
|
|
6
6
|
import { Protocol } from "@query-farm/vgi-rpc";
|
|
7
7
|
import { encodeTableInfo } from "../../../generated/vgi-client.js";
|
|
8
8
|
import {
|
|
9
|
+
CatalogTableColumnAddParamsSchema,
|
|
10
|
+
CatalogTableColumnDefaultDropParamsSchema,
|
|
11
|
+
CatalogTableColumnDefaultSetParamsSchema,
|
|
12
|
+
CatalogTableColumnDropParamsSchema,
|
|
13
|
+
CatalogTableColumnRenameParamsSchema,
|
|
14
|
+
CatalogTableColumnStatisticsGetParamsSchema,
|
|
15
|
+
CatalogTableColumnTypeChangeParamsSchema,
|
|
16
|
+
CatalogTableCommentSetParamsSchema,
|
|
17
|
+
CatalogTableCreateParamsSchema,
|
|
18
|
+
CatalogTableDropParamsSchema,
|
|
19
|
+
CatalogTableGetParamsSchema,
|
|
9
20
|
CatalogTableGetResultSchema,
|
|
10
|
-
|
|
21
|
+
CatalogTableNotNullDropParamsSchema,
|
|
22
|
+
CatalogTableNotNullSetParamsSchema,
|
|
23
|
+
CatalogTableRenameParamsSchema,
|
|
24
|
+
CatalogTableScanBranchesGetParamsSchema,
|
|
25
|
+
CatalogTableScanFunctionGetParamsSchema,
|
|
11
26
|
ScanBranchesResultSchema,
|
|
27
|
+
ScanFunctionResultSchema,
|
|
12
28
|
} from "../../../generated/vgi-protocol-schemas.js";
|
|
13
29
|
import { toUint8Array } from "../../../util/bytes.js";
|
|
14
30
|
import {
|
|
@@ -19,30 +35,19 @@ import {
|
|
|
19
35
|
import {
|
|
20
36
|
type GetCatalog,
|
|
21
37
|
emptyResultSchema,
|
|
22
|
-
schemaNameIgnoreNotFoundTxnParams,
|
|
23
|
-
schemaNameCommentParams,
|
|
24
|
-
schemaNameRenameParams,
|
|
25
|
-
columnOpParams,
|
|
26
38
|
catalogUnary,
|
|
27
39
|
} from "./shared.js";
|
|
28
40
|
|
|
29
41
|
export function registerCatalogTableMethods(protocol: Protocol, getCatalog: GetCatalog, signingKey?: Uint8Array): void {
|
|
30
42
|
// catalog_table_get
|
|
31
43
|
catalogUnary(protocol, signingKey, "catalog_table_get", {
|
|
32
|
-
params:
|
|
33
|
-
field("attach_opaque_data", binary(), true),
|
|
34
|
-
field("schema_name", utf8(), false),
|
|
35
|
-
field("name", utf8(), false),
|
|
36
|
-
field("at_unit", utf8(), true),
|
|
37
|
-
field("at_value", utf8(), true),
|
|
38
|
-
field("transaction_opaque_data", binary(), true),
|
|
39
|
-
]),
|
|
44
|
+
params: CatalogTableGetParamsSchema,
|
|
40
45
|
result: RESULT_BINARY_SCHEMA,
|
|
41
46
|
handler: async (params) => {
|
|
42
47
|
const cat = getCatalog();
|
|
43
48
|
const info = await cat.tableGet(
|
|
44
49
|
toUint8Array(params.attach_opaque_data),
|
|
45
|
-
params.
|
|
50
|
+
params.schema_path,
|
|
46
51
|
params.name,
|
|
47
52
|
params.at_unit,
|
|
48
53
|
params.at_value,
|
|
@@ -56,23 +61,13 @@ export function registerCatalogTableMethods(protocol: Protocol, getCatalog: GetC
|
|
|
56
61
|
|
|
57
62
|
// catalog_table_create
|
|
58
63
|
catalogUnary(protocol, signingKey, "catalog_table_create", {
|
|
59
|
-
params:
|
|
60
|
-
field("attach_opaque_data", binary(), true),
|
|
61
|
-
field("schema_name", utf8(), false),
|
|
62
|
-
field("name", utf8(), false),
|
|
63
|
-
field("columns", binary(), false),
|
|
64
|
-
field("on_conflict", utf8(), false),
|
|
65
|
-
field("not_null_constraints", list(field("item", int32(), false)), true),
|
|
66
|
-
field("unique_constraints", list(field("item", list(field("item", int32(), false)), false)), true),
|
|
67
|
-
field("check_constraints", list(field("item", utf8(), false)), true),
|
|
68
|
-
field("transaction_opaque_data", binary(), true),
|
|
69
|
-
]),
|
|
64
|
+
params: CatalogTableCreateParamsSchema,
|
|
70
65
|
result: emptyResultSchema,
|
|
71
66
|
handler: async (params) => {
|
|
72
67
|
const cat = getCatalog();
|
|
73
68
|
await cat.tableCreate(
|
|
74
69
|
toUint8Array(params.attach_opaque_data),
|
|
75
|
-
params.
|
|
70
|
+
params.schema_path,
|
|
76
71
|
params.name,
|
|
77
72
|
toUint8Array(params.columns),
|
|
78
73
|
params.on_conflict,
|
|
@@ -87,19 +82,13 @@ export function registerCatalogTableMethods(protocol: Protocol, getCatalog: GetC
|
|
|
87
82
|
|
|
88
83
|
// catalog_table_drop
|
|
89
84
|
catalogUnary(protocol, signingKey, "catalog_table_drop", {
|
|
90
|
-
params:
|
|
91
|
-
field("attach_opaque_data", binary(), true),
|
|
92
|
-
field("schema_name", utf8(), false),
|
|
93
|
-
field("name", utf8(), false),
|
|
94
|
-
field("ignore_not_found", bool(), true),
|
|
95
|
-
field("transaction_opaque_data", binary(), true),
|
|
96
|
-
]),
|
|
85
|
+
params: CatalogTableDropParamsSchema,
|
|
97
86
|
result: emptyResultSchema,
|
|
98
87
|
handler: async (params) => {
|
|
99
88
|
const cat = getCatalog();
|
|
100
89
|
await cat.tableDrop(
|
|
101
90
|
toUint8Array(params.attach_opaque_data),
|
|
102
|
-
params.
|
|
91
|
+
params.schema_path,
|
|
103
92
|
params.name,
|
|
104
93
|
params.ignore_not_found,
|
|
105
94
|
params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined
|
|
@@ -110,18 +99,13 @@ export function registerCatalogTableMethods(protocol: Protocol, getCatalog: GetC
|
|
|
110
99
|
|
|
111
100
|
// catalog_table_column_statistics_get
|
|
112
101
|
catalogUnary(protocol, signingKey, "catalog_table_column_statistics_get", {
|
|
113
|
-
params:
|
|
114
|
-
field("attach_opaque_data", binary(), true),
|
|
115
|
-
field("schema_name", utf8(), false),
|
|
116
|
-
field("name", utf8(), false),
|
|
117
|
-
field("transaction_opaque_data", binary(), true),
|
|
118
|
-
]),
|
|
102
|
+
params: CatalogTableColumnStatisticsGetParamsSchema,
|
|
119
103
|
result: RESULT_BINARY_NULLABLE_SCHEMA,
|
|
120
104
|
handler: async (params) => {
|
|
121
105
|
const cat = getCatalog();
|
|
122
106
|
const stats = await cat.tableColumnStatisticsGet(
|
|
123
107
|
toUint8Array(params.attach_opaque_data),
|
|
124
|
-
params.
|
|
108
|
+
params.schema_path,
|
|
125
109
|
params.name,
|
|
126
110
|
params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined,
|
|
127
111
|
);
|
|
@@ -131,20 +115,13 @@ export function registerCatalogTableMethods(protocol: Protocol, getCatalog: GetC
|
|
|
131
115
|
|
|
132
116
|
// catalog_table_scan_function_get
|
|
133
117
|
catalogUnary(protocol, signingKey, "catalog_table_scan_function_get", {
|
|
134
|
-
params:
|
|
135
|
-
field("attach_opaque_data", binary(), true),
|
|
136
|
-
field("schema_name", utf8(), false),
|
|
137
|
-
field("name", utf8(), false),
|
|
138
|
-
field("at_unit", utf8(), true),
|
|
139
|
-
field("at_value", utf8(), true),
|
|
140
|
-
field("transaction_opaque_data", binary(), true),
|
|
141
|
-
]),
|
|
118
|
+
params: CatalogTableScanFunctionGetParamsSchema,
|
|
142
119
|
result: RESULT_BINARY_SCHEMA,
|
|
143
120
|
handler: async (params) => {
|
|
144
121
|
const cat = getCatalog();
|
|
145
122
|
const scanResult = await cat.tableScanFunctionGet(
|
|
146
123
|
toUint8Array(params.attach_opaque_data),
|
|
147
|
-
params.
|
|
124
|
+
params.schema_path,
|
|
148
125
|
params.name,
|
|
149
126
|
params.at_unit,
|
|
150
127
|
params.at_value,
|
|
@@ -158,20 +135,13 @@ export function registerCatalogTableMethods(protocol: Protocol, getCatalog: GetC
|
|
|
158
135
|
// scan_function_get. The branches-aware C++ extension calls this for every
|
|
159
136
|
// table scan; single-source catalogs synthesise a one-branch result.
|
|
160
137
|
catalogUnary(protocol, signingKey, "catalog_table_scan_branches_get", {
|
|
161
|
-
params:
|
|
162
|
-
field("attach_opaque_data", binary(), true),
|
|
163
|
-
field("schema_name", utf8(), false),
|
|
164
|
-
field("name", utf8(), false),
|
|
165
|
-
field("at_unit", utf8(), true),
|
|
166
|
-
field("at_value", utf8(), true),
|
|
167
|
-
field("transaction_opaque_data", binary(), true),
|
|
168
|
-
]),
|
|
138
|
+
params: CatalogTableScanBranchesGetParamsSchema,
|
|
169
139
|
result: RESULT_BINARY_SCHEMA,
|
|
170
140
|
handler: async (params) => {
|
|
171
141
|
const cat = getCatalog();
|
|
172
142
|
const branchesResult = await cat.tableScanBranchesGet(
|
|
173
143
|
toUint8Array(params.attach_opaque_data),
|
|
174
|
-
params.
|
|
144
|
+
params.schema_path,
|
|
175
145
|
params.name,
|
|
176
146
|
params.at_unit,
|
|
177
147
|
params.at_value,
|
|
@@ -183,13 +153,13 @@ export function registerCatalogTableMethods(protocol: Protocol, getCatalog: GetC
|
|
|
183
153
|
|
|
184
154
|
// catalog_table_comment_set
|
|
185
155
|
catalogUnary(protocol, signingKey, "catalog_table_comment_set", {
|
|
186
|
-
params:
|
|
156
|
+
params: CatalogTableCommentSetParamsSchema,
|
|
187
157
|
result: emptyResultSchema,
|
|
188
158
|
handler: async (params) => {
|
|
189
159
|
const cat = getCatalog();
|
|
190
160
|
await cat.tableCommentSet(
|
|
191
161
|
toUint8Array(params.attach_opaque_data),
|
|
192
|
-
params.
|
|
162
|
+
params.schema_path,
|
|
193
163
|
params.name,
|
|
194
164
|
params.comment,
|
|
195
165
|
params.ignore_not_found,
|
|
@@ -201,13 +171,13 @@ export function registerCatalogTableMethods(protocol: Protocol, getCatalog: GetC
|
|
|
201
171
|
|
|
202
172
|
// catalog_table_rename
|
|
203
173
|
catalogUnary(protocol, signingKey, "catalog_table_rename", {
|
|
204
|
-
params:
|
|
174
|
+
params: CatalogTableRenameParamsSchema,
|
|
205
175
|
result: emptyResultSchema,
|
|
206
176
|
handler: async (params) => {
|
|
207
177
|
const cat = getCatalog();
|
|
208
178
|
await cat.tableRename(
|
|
209
179
|
toUint8Array(params.attach_opaque_data),
|
|
210
|
-
params.
|
|
180
|
+
params.schema_path,
|
|
211
181
|
params.name,
|
|
212
182
|
params.new_name,
|
|
213
183
|
params.ignore_not_found,
|
|
@@ -219,22 +189,13 @@ export function registerCatalogTableMethods(protocol: Protocol, getCatalog: GetC
|
|
|
219
189
|
|
|
220
190
|
// catalog_table_column_add
|
|
221
191
|
catalogUnary(protocol, signingKey, "catalog_table_column_add", {
|
|
222
|
-
params:
|
|
223
|
-
field("attach_opaque_data", binary(), true),
|
|
224
|
-
field("schema_name", utf8(), false),
|
|
225
|
-
field("name", utf8(), false),
|
|
226
|
-
field("column_name", utf8(), false),
|
|
227
|
-
field("column_type", utf8(), false),
|
|
228
|
-
field("default_value", utf8(), true),
|
|
229
|
-
field("ignore_not_found", bool(), true),
|
|
230
|
-
field("transaction_opaque_data", binary(), true),
|
|
231
|
-
]),
|
|
192
|
+
params: CatalogTableColumnAddParamsSchema,
|
|
232
193
|
result: emptyResultSchema,
|
|
233
194
|
handler: async (params) => {
|
|
234
195
|
const cat = getCatalog();
|
|
235
196
|
await cat.tableColumnAdd(
|
|
236
197
|
toUint8Array(params.attach_opaque_data),
|
|
237
|
-
params.
|
|
198
|
+
params.schema_path,
|
|
238
199
|
params.name,
|
|
239
200
|
params.column_name,
|
|
240
201
|
params.column_type,
|
|
@@ -248,13 +209,13 @@ export function registerCatalogTableMethods(protocol: Protocol, getCatalog: GetC
|
|
|
248
209
|
|
|
249
210
|
// catalog_table_column_drop
|
|
250
211
|
catalogUnary(protocol, signingKey, "catalog_table_column_drop", {
|
|
251
|
-
params:
|
|
212
|
+
params: CatalogTableColumnDropParamsSchema,
|
|
252
213
|
result: emptyResultSchema,
|
|
253
214
|
handler: async (params) => {
|
|
254
215
|
const cat = getCatalog();
|
|
255
216
|
await cat.tableColumnDrop(
|
|
256
217
|
toUint8Array(params.attach_opaque_data),
|
|
257
|
-
params.
|
|
218
|
+
params.schema_path,
|
|
258
219
|
params.name,
|
|
259
220
|
params.column_name,
|
|
260
221
|
params.ignore_not_found,
|
|
@@ -266,21 +227,13 @@ export function registerCatalogTableMethods(protocol: Protocol, getCatalog: GetC
|
|
|
266
227
|
|
|
267
228
|
// catalog_table_column_rename
|
|
268
229
|
catalogUnary(protocol, signingKey, "catalog_table_column_rename", {
|
|
269
|
-
params:
|
|
270
|
-
field("attach_opaque_data", binary(), true),
|
|
271
|
-
field("schema_name", utf8(), false),
|
|
272
|
-
field("name", utf8(), false),
|
|
273
|
-
field("column_name", utf8(), false),
|
|
274
|
-
field("new_name", utf8(), false),
|
|
275
|
-
field("ignore_not_found", bool(), true),
|
|
276
|
-
field("transaction_opaque_data", binary(), true),
|
|
277
|
-
]),
|
|
230
|
+
params: CatalogTableColumnRenameParamsSchema,
|
|
278
231
|
result: emptyResultSchema,
|
|
279
232
|
handler: async (params) => {
|
|
280
233
|
const cat = getCatalog();
|
|
281
234
|
await cat.tableColumnRename(
|
|
282
235
|
toUint8Array(params.attach_opaque_data),
|
|
283
|
-
params.
|
|
236
|
+
params.schema_path,
|
|
284
237
|
params.name,
|
|
285
238
|
params.column_name,
|
|
286
239
|
params.new_name,
|
|
@@ -293,21 +246,13 @@ export function registerCatalogTableMethods(protocol: Protocol, getCatalog: GetC
|
|
|
293
246
|
|
|
294
247
|
// catalog_table_column_default_set
|
|
295
248
|
catalogUnary(protocol, signingKey, "catalog_table_column_default_set", {
|
|
296
|
-
params:
|
|
297
|
-
field("attach_opaque_data", binary(), true),
|
|
298
|
-
field("schema_name", utf8(), false),
|
|
299
|
-
field("name", utf8(), false),
|
|
300
|
-
field("column_name", utf8(), false),
|
|
301
|
-
field("default_value", utf8(), false),
|
|
302
|
-
field("ignore_not_found", bool(), true),
|
|
303
|
-
field("transaction_opaque_data", binary(), true),
|
|
304
|
-
]),
|
|
249
|
+
params: CatalogTableColumnDefaultSetParamsSchema,
|
|
305
250
|
result: emptyResultSchema,
|
|
306
251
|
handler: async (params) => {
|
|
307
252
|
const cat = getCatalog();
|
|
308
253
|
await cat.tableColumnDefaultSet(
|
|
309
254
|
toUint8Array(params.attach_opaque_data),
|
|
310
|
-
params.
|
|
255
|
+
params.schema_path,
|
|
311
256
|
params.name,
|
|
312
257
|
params.column_name,
|
|
313
258
|
params.default_value,
|
|
@@ -320,13 +265,13 @@ export function registerCatalogTableMethods(protocol: Protocol, getCatalog: GetC
|
|
|
320
265
|
|
|
321
266
|
// catalog_table_column_default_drop
|
|
322
267
|
catalogUnary(protocol, signingKey, "catalog_table_column_default_drop", {
|
|
323
|
-
params:
|
|
268
|
+
params: CatalogTableColumnDefaultDropParamsSchema,
|
|
324
269
|
result: emptyResultSchema,
|
|
325
270
|
handler: async (params) => {
|
|
326
271
|
const cat = getCatalog();
|
|
327
272
|
await cat.tableColumnDefaultDrop(
|
|
328
273
|
toUint8Array(params.attach_opaque_data),
|
|
329
|
-
params.
|
|
274
|
+
params.schema_path,
|
|
330
275
|
params.name,
|
|
331
276
|
params.column_name,
|
|
332
277
|
params.ignore_not_found,
|
|
@@ -338,21 +283,13 @@ export function registerCatalogTableMethods(protocol: Protocol, getCatalog: GetC
|
|
|
338
283
|
|
|
339
284
|
// catalog_table_column_type_change
|
|
340
285
|
catalogUnary(protocol, signingKey, "catalog_table_column_type_change", {
|
|
341
|
-
params:
|
|
342
|
-
field("attach_opaque_data", binary(), true),
|
|
343
|
-
field("schema_name", utf8(), false),
|
|
344
|
-
field("name", utf8(), false),
|
|
345
|
-
field("column_name", utf8(), false),
|
|
346
|
-
field("new_type", utf8(), false),
|
|
347
|
-
field("ignore_not_found", bool(), true),
|
|
348
|
-
field("transaction_opaque_data", binary(), true),
|
|
349
|
-
]),
|
|
286
|
+
params: CatalogTableColumnTypeChangeParamsSchema,
|
|
350
287
|
result: emptyResultSchema,
|
|
351
288
|
handler: async (params) => {
|
|
352
289
|
const cat = getCatalog();
|
|
353
290
|
await cat.tableColumnTypeChange(
|
|
354
291
|
toUint8Array(params.attach_opaque_data),
|
|
355
|
-
params.
|
|
292
|
+
params.schema_path,
|
|
356
293
|
params.name,
|
|
357
294
|
params.column_name,
|
|
358
295
|
params.new_type,
|
|
@@ -365,13 +302,13 @@ export function registerCatalogTableMethods(protocol: Protocol, getCatalog: GetC
|
|
|
365
302
|
|
|
366
303
|
// catalog_table_not_null_set
|
|
367
304
|
catalogUnary(protocol, signingKey, "catalog_table_not_null_set", {
|
|
368
|
-
params:
|
|
305
|
+
params: CatalogTableNotNullSetParamsSchema,
|
|
369
306
|
result: emptyResultSchema,
|
|
370
307
|
handler: async (params) => {
|
|
371
308
|
const cat = getCatalog();
|
|
372
309
|
await cat.tableNotNullSet(
|
|
373
310
|
toUint8Array(params.attach_opaque_data),
|
|
374
|
-
params.
|
|
311
|
+
params.schema_path,
|
|
375
312
|
params.name,
|
|
376
313
|
params.column_name,
|
|
377
314
|
params.ignore_not_found,
|
|
@@ -383,13 +320,13 @@ export function registerCatalogTableMethods(protocol: Protocol, getCatalog: GetC
|
|
|
383
320
|
|
|
384
321
|
// catalog_table_not_null_drop
|
|
385
322
|
catalogUnary(protocol, signingKey, "catalog_table_not_null_drop", {
|
|
386
|
-
params:
|
|
323
|
+
params: CatalogTableNotNullDropParamsSchema,
|
|
387
324
|
result: emptyResultSchema,
|
|
388
325
|
handler: async (params) => {
|
|
389
326
|
const cat = getCatalog();
|
|
390
327
|
await cat.tableNotNullDrop(
|
|
391
328
|
toUint8Array(params.attach_opaque_data),
|
|
392
|
-
params.
|
|
329
|
+
params.schema_path,
|
|
393
330
|
params.name,
|
|
394
331
|
params.column_name,
|
|
395
332
|
params.ignore_not_found,
|
|
@@ -4,7 +4,14 @@
|
|
|
4
4
|
import { type VgiSchema, schema, type VgiField, field, type VgiDataType, binary, utf8 } from "../../../arrow/index.js";
|
|
5
5
|
import { Protocol } from "@query-farm/vgi-rpc";
|
|
6
6
|
import { encodeViewInfo } from "../../../generated/vgi-client.js";
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
CatalogViewCommentSetParamsSchema,
|
|
9
|
+
CatalogViewCreateParamsSchema,
|
|
10
|
+
CatalogViewDropParamsSchema,
|
|
11
|
+
CatalogViewGetParamsSchema,
|
|
12
|
+
CatalogViewGetResultSchema,
|
|
13
|
+
CatalogViewRenameParamsSchema,
|
|
14
|
+
} from "../../../generated/vgi-protocol-schemas.js";
|
|
8
15
|
import { toUint8Array } from "../../../util/bytes.js";
|
|
9
16
|
import {
|
|
10
17
|
RESULT_BINARY_SCHEMA,
|
|
@@ -13,23 +20,19 @@ import {
|
|
|
13
20
|
import {
|
|
14
21
|
type GetCatalog,
|
|
15
22
|
emptyResultSchema,
|
|
16
|
-
attachOpaqueDataSchemaNameTxnParams,
|
|
17
|
-
schemaNameIgnoreNotFoundTxnParams,
|
|
18
|
-
schemaNameRenameParams,
|
|
19
|
-
schemaNameCommentParams,
|
|
20
23
|
catalogUnary,
|
|
21
24
|
} from "./shared.js";
|
|
22
25
|
|
|
23
26
|
export function registerCatalogViewMethods(protocol: Protocol, getCatalog: GetCatalog, signingKey?: Uint8Array): void {
|
|
24
27
|
// catalog_view_get
|
|
25
28
|
catalogUnary(protocol, signingKey, "catalog_view_get", {
|
|
26
|
-
params:
|
|
29
|
+
params: CatalogViewGetParamsSchema,
|
|
27
30
|
result: RESULT_BINARY_SCHEMA,
|
|
28
31
|
handler: async (params) => {
|
|
29
32
|
const cat = getCatalog();
|
|
30
33
|
const info = await cat.viewGet(
|
|
31
34
|
toUint8Array(params.attach_opaque_data),
|
|
32
|
-
params.
|
|
35
|
+
params.schema_path,
|
|
33
36
|
params.name,
|
|
34
37
|
params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined
|
|
35
38
|
);
|
|
@@ -41,20 +44,13 @@ export function registerCatalogViewMethods(protocol: Protocol, getCatalog: GetCa
|
|
|
41
44
|
|
|
42
45
|
// catalog_view_create
|
|
43
46
|
catalogUnary(protocol, signingKey, "catalog_view_create", {
|
|
44
|
-
params:
|
|
45
|
-
field("attach_opaque_data", binary(), true),
|
|
46
|
-
field("schema_name", utf8(), false),
|
|
47
|
-
field("name", utf8(), false),
|
|
48
|
-
field("definition", utf8(), false),
|
|
49
|
-
field("on_conflict", utf8(), false),
|
|
50
|
-
field("transaction_opaque_data", binary(), true),
|
|
51
|
-
]),
|
|
47
|
+
params: CatalogViewCreateParamsSchema,
|
|
52
48
|
result: emptyResultSchema,
|
|
53
49
|
handler: async (params) => {
|
|
54
50
|
const cat = getCatalog();
|
|
55
51
|
await cat.viewCreate(
|
|
56
52
|
toUint8Array(params.attach_opaque_data),
|
|
57
|
-
params.
|
|
53
|
+
params.schema_path,
|
|
58
54
|
params.name,
|
|
59
55
|
params.definition,
|
|
60
56
|
params.on_conflict,
|
|
@@ -66,13 +62,13 @@ export function registerCatalogViewMethods(protocol: Protocol, getCatalog: GetCa
|
|
|
66
62
|
|
|
67
63
|
// catalog_view_drop
|
|
68
64
|
catalogUnary(protocol, signingKey, "catalog_view_drop", {
|
|
69
|
-
params:
|
|
65
|
+
params: CatalogViewDropParamsSchema,
|
|
70
66
|
result: emptyResultSchema,
|
|
71
67
|
handler: async (params) => {
|
|
72
68
|
const cat = getCatalog();
|
|
73
69
|
await cat.viewDrop(
|
|
74
70
|
toUint8Array(params.attach_opaque_data),
|
|
75
|
-
params.
|
|
71
|
+
params.schema_path,
|
|
76
72
|
params.name,
|
|
77
73
|
params.ignore_not_found,
|
|
78
74
|
params.transaction_opaque_data ? toUint8Array(params.transaction_opaque_data) : undefined
|
|
@@ -83,13 +79,13 @@ export function registerCatalogViewMethods(protocol: Protocol, getCatalog: GetCa
|
|
|
83
79
|
|
|
84
80
|
// catalog_view_rename
|
|
85
81
|
catalogUnary(protocol, signingKey, "catalog_view_rename", {
|
|
86
|
-
params:
|
|
82
|
+
params: CatalogViewRenameParamsSchema,
|
|
87
83
|
result: emptyResultSchema,
|
|
88
84
|
handler: async (params) => {
|
|
89
85
|
const cat = getCatalog();
|
|
90
86
|
await cat.viewRename(
|
|
91
87
|
toUint8Array(params.attach_opaque_data),
|
|
92
|
-
params.
|
|
88
|
+
params.schema_path,
|
|
93
89
|
params.name,
|
|
94
90
|
params.new_name,
|
|
95
91
|
params.ignore_not_found,
|
|
@@ -101,13 +97,13 @@ export function registerCatalogViewMethods(protocol: Protocol, getCatalog: GetCa
|
|
|
101
97
|
|
|
102
98
|
// catalog_view_comment_set
|
|
103
99
|
catalogUnary(protocol, signingKey, "catalog_view_comment_set", {
|
|
104
|
-
params:
|
|
100
|
+
params: CatalogViewCommentSetParamsSchema,
|
|
105
101
|
result: emptyResultSchema,
|
|
106
102
|
handler: async (params) => {
|
|
107
103
|
const cat = getCatalog();
|
|
108
104
|
await cat.viewCommentSet(
|
|
109
105
|
toUint8Array(params.attach_opaque_data),
|
|
110
|
-
params.
|
|
106
|
+
params.schema_path,
|
|
111
107
|
params.name,
|
|
112
108
|
params.comment,
|
|
113
109
|
params.ignore_not_found,
|