@query-farm/vgi 0.46.0 → 0.47.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -5
- package/dist/arrow/impl-arrowjs/index.d.ts +1 -1
- package/dist/arrow/impl-arrowjs/iterate.d.ts +2 -0
- package/dist/arrow/impl-flechette/index.d.ts +1 -1
- package/dist/arrow/impl-flechette/iterate.d.ts +2 -0
- package/dist/arrow/index.d.ts +1 -1
- package/dist/catalog/column-expressions.d.ts +8 -0
- package/dist/catalog/column-metadata.d.ts +11 -0
- package/dist/catalog/composite.d.ts +2 -1
- package/dist/catalog/constraints.d.ts +74 -0
- package/dist/catalog/descriptors.d.ts +21 -29
- package/dist/catalog/interface.d.ts +15 -20
- package/dist/catalog/macro-overloads.d.ts +4 -0
- package/dist/catalog/read-only.d.ts +7 -1
- package/dist/catalog/unconstrained-columns.d.ts +2 -0
- package/dist/client/client.d.ts +18 -13
- package/dist/client-entry.js +753 -103
- package/dist/client-entry.js.map +16 -14
- package/dist/functions/projection.d.ts +18 -0
- package/dist/functions/table.d.ts +6 -1
- package/dist/functions/types.d.ts +1 -0
- package/dist/generated/vgi-client.d.ts +177 -36
- package/dist/generated/vgi-protocol-schemas.d.ts +51 -1
- package/dist/generated/vgi-protocol-types.d.ts +317 -3
- package/dist/generated/vgi-service.d.ts +266 -29
- package/dist/index.core.d.ts +3 -1
- package/dist/index.js +1630 -240
- package/dist/index.js.map +41 -34
- package/dist/protocol/dispatch.d.ts +9 -9
- package/dist/protocol/handlers/aggregate.d.ts +1 -1
- package/dist/protocol/handlers/catalog/index.d.ts +1 -1
- package/dist/protocol/handlers/catalog/metadata.d.ts +1 -0
- package/dist/protocol/handlers/function.d.ts +1 -1
- package/dist/protocol/handlers/table-buffering.d.ts +1 -1
- package/dist/protocol/handlers/unimplemented.d.ts +1 -1
- package/dist/protocol/serializers/bind.d.ts +5 -1
- package/dist/protocol/types.d.ts +5 -0
- package/dist/rpc-server.d.ts +6 -6
- package/dist/serve-entry.js +1613 -447
- package/dist/serve-entry.js.map +32 -26
- package/dist/util/arrow/index.d.ts +1 -1
- package/dist/worker-cf-entry.d.ts +2 -2
- package/dist/worker-cf-entry.js +1943 -572
- package/dist/worker-cf-entry.js.map +41 -34
- package/dist/worker.d.ts +1 -1
- package/package.json +5 -4
- package/src/arrow/impl-arrowjs/index.ts +1 -1
- package/src/arrow/impl-arrowjs/iterate.ts +9 -1
- package/src/arrow/impl-arrowjs/project.ts +1 -1
- package/src/arrow/impl-flechette/index.ts +1 -1
- package/src/arrow/impl-flechette/ipc.ts +12 -0
- package/src/arrow/impl-flechette/iterate.ts +5 -0
- package/src/arrow/impl-flechette/project.ts +6 -8
- package/src/arrow/index.ts +1 -1
- package/src/catalog/column-expressions.ts +224 -0
- package/src/catalog/column-metadata.ts +151 -0
- package/src/catalog/composite.ts +5 -1
- package/src/catalog/constraints.ts +207 -0
- package/src/catalog/contents-codec.ts +6 -1
- package/src/catalog/descriptors.ts +21 -29
- package/src/catalog/interface.ts +70 -55
- package/src/catalog/macro-overloads.ts +44 -0
- package/src/catalog/read-only.ts +92 -71
- package/src/catalog/unconstrained-columns.ts +23 -0
- package/src/client/client.ts +100 -58
- package/src/codec/asd.ts +3 -1
- package/src/functions/projection.ts +207 -0
- package/src/functions/table.ts +10 -0
- package/src/functions/types.ts +1 -0
- package/src/generated/vgi-client.ts +199 -37
- package/src/generated/vgi-protocol-schemas.ts +455 -41
- package/src/generated/vgi-protocol-types.ts +879 -5
- package/src/generated/vgi-service.ts +514 -42
- package/src/http/client-bundle.ts +1 -1
- package/src/http/fetch.ts +1 -1
- package/src/index.core.ts +5 -0
- package/src/protocol/dispatch.ts +9 -9
- package/src/protocol/handlers/aggregate.ts +1 -1
- package/src/protocol/handlers/catalog/admin.ts +27 -6
- package/src/protocol/handlers/catalog/index.ts +2 -2
- package/src/protocol/handlers/catalog/macro.ts +6 -5
- package/src/protocol/handlers/catalog/metadata.ts +16 -0
- package/src/protocol/handlers/catalog/table.ts +72 -26
- package/src/protocol/handlers/catalog/view.ts +24 -3
- package/src/protocol/handlers/function.ts +67 -1
- package/src/protocol/handlers/table-buffering.ts +1 -1
- package/src/protocol/handlers/unimplemented.ts +6 -6
- package/src/protocol/serializers/bind.ts +17 -1
- package/src/protocol/types.ts +6 -0
- package/src/rpc-server.ts +9 -9
- package/src/util/arrow/index.ts +1 -1
- package/src/worker-cf-entry.ts +6 -0
- package/src/worker.ts +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// GENERATED by vgi.codegen.ts_types. DO NOT EDIT BY HAND.
|
|
3
3
|
//
|
|
4
4
|
// Generator: python -m vgi.codegen.ts_types v1
|
|
5
|
-
// Content hash:
|
|
5
|
+
// Content hash: e3a5ddf92639
|
|
6
6
|
//
|
|
7
7
|
// To regenerate:
|
|
8
8
|
// uv run --project ~/Development/vgi-python python scripts/regen_generated.py
|
|
@@ -11,11 +11,879 @@
|
|
|
11
11
|
import { encodeASD, decodeASD } from "../codec/asd.js";
|
|
12
12
|
import {
|
|
13
13
|
CatalogAttachResultSchema,
|
|
14
|
+
CatalogCapabilitiesSchema,
|
|
14
15
|
CatalogContentsResultSchema,
|
|
16
|
+
CatalogMetadataChangesSchema,
|
|
17
|
+
CatalogObjectRefSchema,
|
|
18
|
+
CatalogQueryPrepareRequestSchema,
|
|
19
|
+
CatalogQueryPrepareResultSchema,
|
|
20
|
+
ClientQueryCapabilitiesSchema,
|
|
21
|
+
ConstraintChangeSchema,
|
|
22
|
+
ConstraintDefinitionSchema,
|
|
23
|
+
ConstraintInfoSchema,
|
|
24
|
+
ConstraintSnapshotSchema,
|
|
25
|
+
ConstraintsApplyRequestSchema,
|
|
26
|
+
DependencySnapshotSchema,
|
|
27
|
+
ForeignKeyDefinitionSchema,
|
|
28
|
+
IndexDefinitionSchema,
|
|
29
|
+
IndexKeySchema,
|
|
30
|
+
MacroOverloadSchema,
|
|
31
|
+
MacroParameterSchema,
|
|
32
|
+
ObjectDependencySchema,
|
|
33
|
+
OptionChangesSchema,
|
|
34
|
+
OptionDefinitionsSchema,
|
|
35
|
+
OptionStateSchema,
|
|
36
|
+
QueryCapabilitiesSchema,
|
|
37
|
+
QueryEvaluationContextSchema,
|
|
38
|
+
QueryObjectReferenceSchema,
|
|
39
|
+
RequiredFilterPathsSchema,
|
|
15
40
|
SchemaContentsSchema,
|
|
41
|
+
SortKeySchema,
|
|
42
|
+
SqlExpressionSchema,
|
|
43
|
+
SqlStatementSchema,
|
|
44
|
+
TableLayoutChangeSchema,
|
|
45
|
+
TableLayoutSchema,
|
|
16
46
|
} from "./vgi-protocol-schemas.js";
|
|
17
|
-
import type { CatalogAttachResult, CatalogContentsResponse } from "./vgi-client.js";
|
|
18
|
-
export type { CatalogAttachResult, CatalogContentsResponse };
|
|
47
|
+
import type { CatalogAttachResult, CatalogCapabilities, CatalogContentsResponse, CatalogObjectRef, CatalogQueryPrepareRequest, CatalogQueryPrepareResult, ClientQueryCapabilities, ConstraintSnapshot, ConstraintsApplyRequest, DependencySnapshot, IndexDefinition, MacroOverload, MacroParameter, OptionDefinitions, OptionState, QueryCapabilities, QueryEvaluationContext, QueryObjectReference, SqlExpression, TableLayout } from "./vgi-client.js";
|
|
48
|
+
export type { CatalogAttachResult, CatalogCapabilities, CatalogContentsResponse, CatalogObjectRef, CatalogQueryPrepareRequest, CatalogQueryPrepareResult, ClientQueryCapabilities, ConstraintSnapshot, ConstraintsApplyRequest, DependencySnapshot, IndexDefinition, MacroOverload, MacroParameter, OptionDefinitions, OptionState, QueryCapabilities, QueryEvaluationContext, QueryObjectReference, SqlExpression, TableLayout };
|
|
49
|
+
|
|
50
|
+
// ----------------------------------------------------------------------------
|
|
51
|
+
// MacroParameter (schema: MacroParameterSchema)
|
|
52
|
+
// ----------------------------------------------------------------------------
|
|
53
|
+
|
|
54
|
+
/** Fields of `MacroParameter` that have a protocol default. */
|
|
55
|
+
export type MacroParameterDefaultedField =
|
|
56
|
+
| "declared_type"
|
|
57
|
+
| "default_value"
|
|
58
|
+
| "default_expression"
|
|
59
|
+
| "documentation";
|
|
60
|
+
/** `MacroParameter` with every field that has a protocol default optional. */
|
|
61
|
+
export type MacroParameterInit = Omit<MacroParameter, MacroParameterDefaultedField> & Partial<Pick<MacroParameter, MacroParameterDefaultedField>>;
|
|
62
|
+
|
|
63
|
+
/** Build a complete `MacroParameter`, filling the protocol defaults, in wire order. */
|
|
64
|
+
export function buildMacroParameter(init: MacroParameterInit): MacroParameter {
|
|
65
|
+
return {
|
|
66
|
+
name: init.name,
|
|
67
|
+
declared_type: init.declared_type ?? null,
|
|
68
|
+
default_value: init.default_value ?? null,
|
|
69
|
+
default_expression: init.default_expression ?? null,
|
|
70
|
+
documentation: init.documentation ?? null,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export const encodeMacroParameter = (v: MacroParameter): Uint8Array => encodeASD(MacroParameterSchema, v);
|
|
75
|
+
export const decodeMacroParameter = (b: Uint8Array): MacroParameter => decodeASD<MacroParameter>(MacroParameterSchema, b);
|
|
76
|
+
|
|
77
|
+
// ----------------------------------------------------------------------------
|
|
78
|
+
// MacroOverload (schema: MacroOverloadSchema)
|
|
79
|
+
// ----------------------------------------------------------------------------
|
|
80
|
+
|
|
81
|
+
/** `MacroOverload` has no defaulted fields, so its init is the record itself. */
|
|
82
|
+
export type MacroOverloadInit = MacroOverload;
|
|
83
|
+
|
|
84
|
+
/** Build a complete `MacroOverload`, filling the protocol defaults, in wire order. */
|
|
85
|
+
export function buildMacroOverload(init: MacroOverloadInit): MacroOverload {
|
|
86
|
+
return {
|
|
87
|
+
parameters: init.parameters,
|
|
88
|
+
definition: init.definition,
|
|
89
|
+
profile: init.profile,
|
|
90
|
+
schema_path: init.schema_path,
|
|
91
|
+
macro_type: init.macro_type,
|
|
92
|
+
evaluation_context: init.evaluation_context,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export const encodeMacroOverload = (v: MacroOverload): Uint8Array => encodeASD(MacroOverloadSchema, v);
|
|
97
|
+
export const decodeMacroOverload = (b: Uint8Array): MacroOverload => decodeASD<MacroOverload>(MacroOverloadSchema, b);
|
|
98
|
+
|
|
99
|
+
// ----------------------------------------------------------------------------
|
|
100
|
+
// ClientQueryCapabilities (schema: ClientQueryCapabilitiesSchema)
|
|
101
|
+
// ----------------------------------------------------------------------------
|
|
102
|
+
|
|
103
|
+
/** Fields of `ClientQueryCapabilities` that have a protocol default. */
|
|
104
|
+
export type ClientQueryCapabilitiesDefaultedField =
|
|
105
|
+
| "max_query_bytes";
|
|
106
|
+
/** `ClientQueryCapabilities` with every field that has a protocol default optional. */
|
|
107
|
+
export type ClientQueryCapabilitiesInit = Omit<ClientQueryCapabilities, ClientQueryCapabilitiesDefaultedField> & Partial<Pick<ClientQueryCapabilities, ClientQueryCapabilitiesDefaultedField>>;
|
|
108
|
+
|
|
109
|
+
/** Build a complete `ClientQueryCapabilities`, filling the protocol defaults, in wire order. */
|
|
110
|
+
export function buildClientQueryCapabilities(init: ClientQueryCapabilitiesInit): ClientQueryCapabilities {
|
|
111
|
+
return {
|
|
112
|
+
encodings: init.encodings,
|
|
113
|
+
semantic_profiles: init.semantic_profiles,
|
|
114
|
+
engine_version: init.engine_version,
|
|
115
|
+
max_query_bytes: init.max_query_bytes ?? 1048576,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export const encodeClientQueryCapabilities = (v: ClientQueryCapabilities): Uint8Array => encodeASD(ClientQueryCapabilitiesSchema, v);
|
|
120
|
+
export const decodeClientQueryCapabilities = (b: Uint8Array): ClientQueryCapabilities => decodeASD<ClientQueryCapabilities>(ClientQueryCapabilitiesSchema, b);
|
|
121
|
+
|
|
122
|
+
// ----------------------------------------------------------------------------
|
|
123
|
+
// QueryCapabilities (schema: QueryCapabilitiesSchema)
|
|
124
|
+
// ----------------------------------------------------------------------------
|
|
125
|
+
|
|
126
|
+
/** Fields of `QueryCapabilities` that have a protocol default. */
|
|
127
|
+
export type QueryCapabilitiesDefaultedField =
|
|
128
|
+
| "max_query_bytes";
|
|
129
|
+
/** `QueryCapabilities` with every field that has a protocol default optional. */
|
|
130
|
+
export type QueryCapabilitiesInit = Omit<QueryCapabilities, QueryCapabilitiesDefaultedField> & Partial<Pick<QueryCapabilities, QueryCapabilitiesDefaultedField>>;
|
|
131
|
+
|
|
132
|
+
/** Build a complete `QueryCapabilities`, filling the protocol defaults, in wire order. */
|
|
133
|
+
export function buildQueryCapabilities(init: QueryCapabilitiesInit): QueryCapabilities {
|
|
134
|
+
return {
|
|
135
|
+
encoding: init.encoding,
|
|
136
|
+
semantic_profiles: init.semantic_profiles,
|
|
137
|
+
execution_modes: init.execution_modes,
|
|
138
|
+
backend_engine: init.backend_engine,
|
|
139
|
+
backend_version: init.backend_version,
|
|
140
|
+
capability_revision: init.capability_revision,
|
|
141
|
+
default_evaluation_context: init.default_evaluation_context,
|
|
142
|
+
max_query_bytes: init.max_query_bytes ?? 1048576,
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export const encodeQueryCapabilities = (v: QueryCapabilities): Uint8Array => encodeASD(QueryCapabilitiesSchema, v);
|
|
147
|
+
export const decodeQueryCapabilities = (b: Uint8Array): QueryCapabilities => decodeASD<QueryCapabilities>(QueryCapabilitiesSchema, b);
|
|
148
|
+
|
|
149
|
+
// ----------------------------------------------------------------------------
|
|
150
|
+
// QueryEvaluationContext (schema: QueryEvaluationContextSchema)
|
|
151
|
+
// ----------------------------------------------------------------------------
|
|
152
|
+
|
|
153
|
+
/** Fields of `QueryEvaluationContext` that have a protocol default. */
|
|
154
|
+
export type QueryEvaluationContextDefaultedField =
|
|
155
|
+
| "timezone"
|
|
156
|
+
| "collation"
|
|
157
|
+
| "default_order"
|
|
158
|
+
| "default_null_order"
|
|
159
|
+
| "preserve_insertion_order";
|
|
160
|
+
/** `QueryEvaluationContext` with every field that has a protocol default optional. */
|
|
161
|
+
export type QueryEvaluationContextInit = Omit<QueryEvaluationContext, QueryEvaluationContextDefaultedField> & Partial<Pick<QueryEvaluationContext, QueryEvaluationContextDefaultedField>>;
|
|
162
|
+
|
|
163
|
+
/** Build a complete `QueryEvaluationContext`, filling the protocol defaults, in wire order. */
|
|
164
|
+
export function buildQueryEvaluationContext(init: QueryEvaluationContextInit): QueryEvaluationContext {
|
|
165
|
+
return {
|
|
166
|
+
timezone: init.timezone ?? "UTC",
|
|
167
|
+
collation: init.collation ?? "binary",
|
|
168
|
+
default_order: init.default_order ?? "asc",
|
|
169
|
+
default_null_order: init.default_null_order ?? "nulls_last",
|
|
170
|
+
preserve_insertion_order: init.preserve_insertion_order ?? true,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export const encodeQueryEvaluationContext = (v: QueryEvaluationContext): Uint8Array => encodeASD(QueryEvaluationContextSchema, v);
|
|
175
|
+
export const decodeQueryEvaluationContext = (b: Uint8Array): QueryEvaluationContext => decodeASD<QueryEvaluationContext>(QueryEvaluationContextSchema, b);
|
|
176
|
+
|
|
177
|
+
// ----------------------------------------------------------------------------
|
|
178
|
+
// QueryObjectReference (schema: QueryObjectReferenceSchema)
|
|
179
|
+
// ----------------------------------------------------------------------------
|
|
180
|
+
|
|
181
|
+
/** `QueryObjectReference` has no defaulted fields, so its init is the record itself. */
|
|
182
|
+
export type QueryObjectReferenceInit = QueryObjectReference;
|
|
183
|
+
|
|
184
|
+
/** Build a complete `QueryObjectReference`, filling the protocol defaults, in wire order. */
|
|
185
|
+
export function buildQueryObjectReference(init: QueryObjectReferenceInit): QueryObjectReference {
|
|
186
|
+
return {
|
|
187
|
+
object: init.object,
|
|
188
|
+
expected_schema: init.expected_schema,
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export const encodeQueryObjectReference = (v: QueryObjectReference): Uint8Array => encodeASD(QueryObjectReferenceSchema, v);
|
|
193
|
+
export const decodeQueryObjectReference = (b: Uint8Array): QueryObjectReference => decodeASD<QueryObjectReference>(QueryObjectReferenceSchema, b);
|
|
194
|
+
|
|
195
|
+
// ----------------------------------------------------------------------------
|
|
196
|
+
// CatalogQueryPrepareRequest (schema: CatalogQueryPrepareRequestSchema)
|
|
197
|
+
// ----------------------------------------------------------------------------
|
|
198
|
+
|
|
199
|
+
/** Fields of `CatalogQueryPrepareRequest` that have a protocol default. */
|
|
200
|
+
export type CatalogQueryPrepareRequestDefaultedField =
|
|
201
|
+
| "transaction_opaque_data"
|
|
202
|
+
| "catalog_version"
|
|
203
|
+
| "catalog_etag"
|
|
204
|
+
| "referenced_objects"
|
|
205
|
+
| "expected_output_schema"
|
|
206
|
+
| "required_ordering";
|
|
207
|
+
/** `CatalogQueryPrepareRequest` with every field that has a protocol default optional. */
|
|
208
|
+
export type CatalogQueryPrepareRequestInit = Omit<CatalogQueryPrepareRequest, CatalogQueryPrepareRequestDefaultedField> & Partial<Pick<CatalogQueryPrepareRequest, CatalogQueryPrepareRequestDefaultedField>>;
|
|
209
|
+
|
|
210
|
+
/** Build a complete `CatalogQueryPrepareRequest`, filling the protocol defaults, in wire order. */
|
|
211
|
+
export function buildCatalogQueryPrepareRequest(init: CatalogQueryPrepareRequestInit): CatalogQueryPrepareRequest {
|
|
212
|
+
return {
|
|
213
|
+
attach_opaque_data: init.attach_opaque_data,
|
|
214
|
+
encoding: init.encoding,
|
|
215
|
+
semantic_profile: init.semantic_profile,
|
|
216
|
+
mode: init.mode,
|
|
217
|
+
capability_revision: init.capability_revision,
|
|
218
|
+
query: init.query,
|
|
219
|
+
parameter_schema: init.parameter_schema,
|
|
220
|
+
evaluation_context: init.evaluation_context,
|
|
221
|
+
transaction_opaque_data: init.transaction_opaque_data ?? null,
|
|
222
|
+
catalog_version: init.catalog_version ?? null,
|
|
223
|
+
catalog_etag: init.catalog_etag ?? null,
|
|
224
|
+
referenced_objects: init.referenced_objects ?? [],
|
|
225
|
+
expected_output_schema: init.expected_output_schema ?? null,
|
|
226
|
+
required_ordering: init.required_ordering ?? "unspecified",
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export const encodeCatalogQueryPrepareRequest = (v: CatalogQueryPrepareRequest): Uint8Array => encodeASD(CatalogQueryPrepareRequestSchema, v);
|
|
231
|
+
export const decodeCatalogQueryPrepareRequest = (b: Uint8Array): CatalogQueryPrepareRequest => decodeASD<CatalogQueryPrepareRequest>(CatalogQueryPrepareRequestSchema, b);
|
|
232
|
+
|
|
233
|
+
// ----------------------------------------------------------------------------
|
|
234
|
+
// CatalogQueryPrepareResult (schema: CatalogQueryPrepareResultSchema)
|
|
235
|
+
// ----------------------------------------------------------------------------
|
|
236
|
+
|
|
237
|
+
/** Fields of `CatalogQueryPrepareResult` that have a protocol default. */
|
|
238
|
+
export type CatalogQueryPrepareResultDefaultedField =
|
|
239
|
+
| "reason_code"
|
|
240
|
+
| "reason_detail"
|
|
241
|
+
| "prepared_query_token"
|
|
242
|
+
| "output_schema"
|
|
243
|
+
| "result_ordering"
|
|
244
|
+
| "validated_catalog_version"
|
|
245
|
+
| "validated_catalog_etag"
|
|
246
|
+
| "context_digest"
|
|
247
|
+
| "expires_at_epoch_ms"
|
|
248
|
+
| "estimated_rows"
|
|
249
|
+
| "estimated_bytes";
|
|
250
|
+
/** `CatalogQueryPrepareResult` with every field that has a protocol default optional. */
|
|
251
|
+
export type CatalogQueryPrepareResultInit = Omit<CatalogQueryPrepareResult, CatalogQueryPrepareResultDefaultedField> & Partial<Pick<CatalogQueryPrepareResult, CatalogQueryPrepareResultDefaultedField>>;
|
|
252
|
+
|
|
253
|
+
/** Build a complete `CatalogQueryPrepareResult`, filling the protocol defaults, in wire order. */
|
|
254
|
+
export function buildCatalogQueryPrepareResult(init: CatalogQueryPrepareResultInit): CatalogQueryPrepareResult {
|
|
255
|
+
return {
|
|
256
|
+
status: init.status,
|
|
257
|
+
reason_code: init.reason_code ?? null,
|
|
258
|
+
reason_detail: init.reason_detail ?? null,
|
|
259
|
+
prepared_query_token: init.prepared_query_token ?? null,
|
|
260
|
+
output_schema: init.output_schema ?? null,
|
|
261
|
+
result_ordering: init.result_ordering ?? null,
|
|
262
|
+
validated_catalog_version: init.validated_catalog_version ?? null,
|
|
263
|
+
validated_catalog_etag: init.validated_catalog_etag ?? null,
|
|
264
|
+
context_digest: init.context_digest ?? null,
|
|
265
|
+
expires_at_epoch_ms: init.expires_at_epoch_ms ?? null,
|
|
266
|
+
estimated_rows: init.estimated_rows ?? null,
|
|
267
|
+
estimated_bytes: init.estimated_bytes ?? null,
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export const encodeCatalogQueryPrepareResult = (v: CatalogQueryPrepareResult): Uint8Array => encodeASD(CatalogQueryPrepareResultSchema, v);
|
|
272
|
+
export const decodeCatalogQueryPrepareResult = (b: Uint8Array): CatalogQueryPrepareResult => decodeASD<CatalogQueryPrepareResult>(CatalogQueryPrepareResultSchema, b);
|
|
273
|
+
|
|
274
|
+
// ----------------------------------------------------------------------------
|
|
275
|
+
// CatalogCapabilities (schema: CatalogCapabilitiesSchema)
|
|
276
|
+
// ----------------------------------------------------------------------------
|
|
277
|
+
|
|
278
|
+
/** Fields of `CatalogCapabilities` that have a protocol default. */
|
|
279
|
+
export type CatalogCapabilitiesDefaultedField =
|
|
280
|
+
| "read"
|
|
281
|
+
| "ddl"
|
|
282
|
+
| "write"
|
|
283
|
+
| "transaction";
|
|
284
|
+
/** `CatalogCapabilities` with every field that has a protocol default optional. */
|
|
285
|
+
export type CatalogCapabilitiesInit = Omit<CatalogCapabilities, CatalogCapabilitiesDefaultedField> & Partial<Pick<CatalogCapabilities, CatalogCapabilitiesDefaultedField>>;
|
|
286
|
+
|
|
287
|
+
/** Build a complete `CatalogCapabilities`, filling the protocol defaults, in wire order. */
|
|
288
|
+
export function buildCatalogCapabilities(init: CatalogCapabilitiesInit): CatalogCapabilities {
|
|
289
|
+
return {
|
|
290
|
+
read: init.read ?? [],
|
|
291
|
+
ddl: init.ddl ?? [],
|
|
292
|
+
write: init.write ?? [],
|
|
293
|
+
transaction: init.transaction ?? [],
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
export const encodeCatalogCapabilities = (v: CatalogCapabilities): Uint8Array => encodeASD(CatalogCapabilitiesSchema, v);
|
|
298
|
+
export const decodeCatalogCapabilities = (b: Uint8Array): CatalogCapabilities => decodeASD<CatalogCapabilities>(CatalogCapabilitiesSchema, b);
|
|
299
|
+
|
|
300
|
+
// ----------------------------------------------------------------------------
|
|
301
|
+
// CatalogMetadataChanges (schema: CatalogMetadataChangesSchema)
|
|
302
|
+
// ----------------------------------------------------------------------------
|
|
303
|
+
|
|
304
|
+
/** A reusable patch with explicit comment presence and per-key tag changes. `set_comment=False` leaves the comment unchanged and requires `comment` to be NULL. With `set_comment=True`, NULL clears the comment; an empty string stores an empty comment. Tag keys are literal, case-sensitive strings. Setting an empty value differs from removing a key. SET/REMOVE overlap and duplicate removals are invalid, including when the target does not exist. */
|
|
305
|
+
export interface CatalogMetadataChanges {
|
|
306
|
+
set_comment: boolean;
|
|
307
|
+
comment?: string | null;
|
|
308
|
+
set_tags: Record<string, string>;
|
|
309
|
+
remove_tags: string[];
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/** Fields of `CatalogMetadataChanges` that have a protocol default. */
|
|
313
|
+
export type CatalogMetadataChangesDefaultedField =
|
|
314
|
+
| "set_comment"
|
|
315
|
+
| "comment"
|
|
316
|
+
| "set_tags"
|
|
317
|
+
| "remove_tags";
|
|
318
|
+
/** `CatalogMetadataChanges` with every field that has a protocol default optional. */
|
|
319
|
+
export type CatalogMetadataChangesInit = Omit<CatalogMetadataChanges, CatalogMetadataChangesDefaultedField> & Partial<Pick<CatalogMetadataChanges, CatalogMetadataChangesDefaultedField>>;
|
|
320
|
+
|
|
321
|
+
/** Build a complete `CatalogMetadataChanges`, filling the protocol defaults, in wire order. */
|
|
322
|
+
export function buildCatalogMetadataChanges(init: CatalogMetadataChangesInit): CatalogMetadataChanges {
|
|
323
|
+
return {
|
|
324
|
+
set_comment: init.set_comment ?? false,
|
|
325
|
+
comment: init.comment ?? null,
|
|
326
|
+
set_tags: init.set_tags ?? {},
|
|
327
|
+
remove_tags: init.remove_tags ?? [],
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
export const encodeCatalogMetadataChanges = (v: CatalogMetadataChanges): Uint8Array => encodeASD(CatalogMetadataChangesSchema, v);
|
|
332
|
+
export const decodeCatalogMetadataChanges = (b: Uint8Array): CatalogMetadataChanges => decodeASD<CatalogMetadataChanges>(CatalogMetadataChangesSchema, b);
|
|
333
|
+
|
|
334
|
+
// ----------------------------------------------------------------------------
|
|
335
|
+
// CatalogObjectRef (schema: CatalogObjectRefSchema)
|
|
336
|
+
// ----------------------------------------------------------------------------
|
|
337
|
+
|
|
338
|
+
/** Fields of `CatalogObjectRef` that have a protocol default. */
|
|
339
|
+
export type CatalogObjectRefDefaultedField =
|
|
340
|
+
| "owner_table";
|
|
341
|
+
/** `CatalogObjectRef` with every field that has a protocol default optional. */
|
|
342
|
+
export type CatalogObjectRefInit = Omit<CatalogObjectRef, CatalogObjectRefDefaultedField> & Partial<Pick<CatalogObjectRef, CatalogObjectRefDefaultedField>>;
|
|
343
|
+
|
|
344
|
+
/** Build a complete `CatalogObjectRef`, filling the protocol defaults, in wire order. */
|
|
345
|
+
export function buildCatalogObjectRef(init: CatalogObjectRefInit): CatalogObjectRef {
|
|
346
|
+
return {
|
|
347
|
+
kind: init.kind,
|
|
348
|
+
schema_path: init.schema_path,
|
|
349
|
+
name: init.name,
|
|
350
|
+
owner_table: init.owner_table ?? null,
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
export const encodeCatalogObjectRef = (v: CatalogObjectRef): Uint8Array => encodeASD(CatalogObjectRefSchema, v);
|
|
355
|
+
export const decodeCatalogObjectRef = (b: Uint8Array): CatalogObjectRef => decodeASD<CatalogObjectRef>(CatalogObjectRefSchema, b);
|
|
356
|
+
|
|
357
|
+
// ----------------------------------------------------------------------------
|
|
358
|
+
// ObjectDependency (schema: ObjectDependencySchema)
|
|
359
|
+
// ----------------------------------------------------------------------------
|
|
360
|
+
|
|
361
|
+
/** An edge from dependent to subject, both CatalogObjectRef IPC records. `requires` blocks RESTRICT; CASCADE deletes the dependent. `owned` automatically deletes the dependent when its owner is dropped, even under RESTRICT. Dropping a dependent never drops its subject. Owned objects can be dropped explicitly, have at most one owner, and cannot form owner cycles. Schema membership and parent schemas use requires, not owned. */
|
|
362
|
+
export interface ObjectDependency {
|
|
363
|
+
dependent: Uint8Array;
|
|
364
|
+
subject: Uint8Array;
|
|
365
|
+
blocks_alter: boolean;
|
|
366
|
+
kind: string;
|
|
367
|
+
subject_column_paths?: string[][] | null;
|
|
368
|
+
dependent_column_path?: string[] | null;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/** Fields of `ObjectDependency` that have a protocol default. */
|
|
372
|
+
export type ObjectDependencyDefaultedField =
|
|
373
|
+
| "kind"
|
|
374
|
+
| "subject_column_paths"
|
|
375
|
+
| "dependent_column_path";
|
|
376
|
+
/** `ObjectDependency` with every field that has a protocol default optional. */
|
|
377
|
+
export type ObjectDependencyInit = Omit<ObjectDependency, ObjectDependencyDefaultedField> & Partial<Pick<ObjectDependency, ObjectDependencyDefaultedField>>;
|
|
378
|
+
|
|
379
|
+
/** Build a complete `ObjectDependency`, filling the protocol defaults, in wire order. */
|
|
380
|
+
export function buildObjectDependency(init: ObjectDependencyInit): ObjectDependency {
|
|
381
|
+
return {
|
|
382
|
+
dependent: init.dependent,
|
|
383
|
+
subject: init.subject,
|
|
384
|
+
blocks_alter: init.blocks_alter,
|
|
385
|
+
kind: init.kind ?? "requires",
|
|
386
|
+
subject_column_paths: init.subject_column_paths ?? null,
|
|
387
|
+
dependent_column_path: init.dependent_column_path ?? null,
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
export const encodeObjectDependency = (v: ObjectDependency): Uint8Array => encodeASD(ObjectDependencySchema, v);
|
|
392
|
+
export const decodeObjectDependency = (b: Uint8Array): ObjectDependency => decodeASD<ObjectDependency>(ObjectDependencySchema, b);
|
|
393
|
+
|
|
394
|
+
// ----------------------------------------------------------------------------
|
|
395
|
+
// DependencySnapshot (schema: DependencySnapshotSchema)
|
|
396
|
+
// ----------------------------------------------------------------------------
|
|
397
|
+
|
|
398
|
+
/** Fields of `DependencySnapshot` that have a protocol default. */
|
|
399
|
+
export type DependencySnapshotDefaultedField =
|
|
400
|
+
| "objects"
|
|
401
|
+
| "dependencies";
|
|
402
|
+
/** `DependencySnapshot` with every field that has a protocol default optional. */
|
|
403
|
+
export type DependencySnapshotInit = Omit<DependencySnapshot, DependencySnapshotDefaultedField> & Partial<Pick<DependencySnapshot, DependencySnapshotDefaultedField>>;
|
|
404
|
+
|
|
405
|
+
/** Build a complete `DependencySnapshot`, filling the protocol defaults, in wire order. */
|
|
406
|
+
export function buildDependencySnapshot(init: DependencySnapshotInit): DependencySnapshot {
|
|
407
|
+
return {
|
|
408
|
+
catalog_version: init.catalog_version,
|
|
409
|
+
objects: init.objects ?? [],
|
|
410
|
+
dependencies: init.dependencies ?? [],
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
export const encodeDependencySnapshot = (v: DependencySnapshot): Uint8Array => encodeASD(DependencySnapshotSchema, v);
|
|
415
|
+
export const decodeDependencySnapshot = (b: Uint8Array): DependencySnapshot => decodeASD<DependencySnapshot>(DependencySnapshotSchema, b);
|
|
416
|
+
|
|
417
|
+
// ----------------------------------------------------------------------------
|
|
418
|
+
// OptionDefinitions (schema: OptionDefinitionsSchema)
|
|
419
|
+
// ----------------------------------------------------------------------------
|
|
420
|
+
|
|
421
|
+
/** Fields of `OptionDefinitions` that have a protocol default. */
|
|
422
|
+
export type OptionDefinitionsDefaultedField =
|
|
423
|
+
| "create_names"
|
|
424
|
+
| "alter_names";
|
|
425
|
+
/** `OptionDefinitions` with every field that has a protocol default optional. */
|
|
426
|
+
export type OptionDefinitionsInit = Omit<OptionDefinitions, OptionDefinitionsDefaultedField> & Partial<Pick<OptionDefinitions, OptionDefinitionsDefaultedField>>;
|
|
427
|
+
|
|
428
|
+
/** Build a complete `OptionDefinitions`, filling the protocol defaults, in wire order. */
|
|
429
|
+
export function buildOptionDefinitions(init: OptionDefinitionsInit): OptionDefinitions {
|
|
430
|
+
return {
|
|
431
|
+
schema: init.schema,
|
|
432
|
+
defaults: init.defaults,
|
|
433
|
+
create_names: init.create_names ?? [],
|
|
434
|
+
alter_names: init.alter_names ?? [],
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
export const encodeOptionDefinitions = (v: OptionDefinitions): Uint8Array => encodeASD(OptionDefinitionsSchema, v);
|
|
439
|
+
export const decodeOptionDefinitions = (b: Uint8Array): OptionDefinitions => decodeASD<OptionDefinitions>(OptionDefinitionsSchema, b);
|
|
440
|
+
|
|
441
|
+
// ----------------------------------------------------------------------------
|
|
442
|
+
// SqlExpression (schema: SqlExpressionSchema)
|
|
443
|
+
// ----------------------------------------------------------------------------
|
|
444
|
+
|
|
445
|
+
/** `SqlExpression` has no defaulted fields, so its init is the record itself. */
|
|
446
|
+
export type SqlExpressionInit = SqlExpression;
|
|
447
|
+
|
|
448
|
+
/** Build a complete `SqlExpression`, filling the protocol defaults, in wire order. */
|
|
449
|
+
export function buildSqlExpression(init: SqlExpressionInit): SqlExpression {
|
|
450
|
+
return {
|
|
451
|
+
sql: init.sql,
|
|
452
|
+
profile: init.profile,
|
|
453
|
+
schema_path: init.schema_path,
|
|
454
|
+
evaluation_context: init.evaluation_context,
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
export const encodeSqlExpression = (v: SqlExpression): Uint8Array => encodeASD(SqlExpressionSchema, v);
|
|
459
|
+
export const decodeSqlExpression = (b: Uint8Array): SqlExpression => decodeASD<SqlExpression>(SqlExpressionSchema, b);
|
|
460
|
+
|
|
461
|
+
// ----------------------------------------------------------------------------
|
|
462
|
+
// SqlStatement (schema: SqlStatementSchema)
|
|
463
|
+
// ----------------------------------------------------------------------------
|
|
464
|
+
|
|
465
|
+
/** One profiled query or DML statement; the codec grants no execution rights. */
|
|
466
|
+
export interface SqlStatement {
|
|
467
|
+
sql: string;
|
|
468
|
+
profile: string;
|
|
469
|
+
schema_path: string[];
|
|
470
|
+
evaluation_context: QueryEvaluationContext;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
/** `SqlStatement` has no defaulted fields, so its init is the record itself. */
|
|
474
|
+
export type SqlStatementInit = SqlStatement;
|
|
475
|
+
|
|
476
|
+
/** Build a complete `SqlStatement`, filling the protocol defaults, in wire order. */
|
|
477
|
+
export function buildSqlStatement(init: SqlStatementInit): SqlStatement {
|
|
478
|
+
return {
|
|
479
|
+
sql: init.sql,
|
|
480
|
+
profile: init.profile,
|
|
481
|
+
schema_path: init.schema_path,
|
|
482
|
+
evaluation_context: init.evaluation_context,
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
export const encodeSqlStatement = (v: SqlStatement): Uint8Array => encodeASD(SqlStatementSchema, v);
|
|
487
|
+
export const decodeSqlStatement = (b: Uint8Array): SqlStatement => decodeASD<SqlStatement>(SqlStatementSchema, b);
|
|
488
|
+
|
|
489
|
+
// ----------------------------------------------------------------------------
|
|
490
|
+
// ForeignKeyDefinition (schema: ForeignKeyDefinitionSchema)
|
|
491
|
+
// ----------------------------------------------------------------------------
|
|
492
|
+
|
|
493
|
+
/** An attachment-relative FK target and explicit immediate match/actions. */
|
|
494
|
+
export interface ForeignKeyDefinition {
|
|
495
|
+
referenced_table: Uint8Array;
|
|
496
|
+
referenced_column_paths: string[][];
|
|
497
|
+
match: string;
|
|
498
|
+
on_update: string;
|
|
499
|
+
on_delete: string;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
/** Fields of `ForeignKeyDefinition` that have a protocol default. */
|
|
503
|
+
export type ForeignKeyDefinitionDefaultedField =
|
|
504
|
+
| "match"
|
|
505
|
+
| "on_update"
|
|
506
|
+
| "on_delete";
|
|
507
|
+
/** `ForeignKeyDefinition` with every field that has a protocol default optional. */
|
|
508
|
+
export type ForeignKeyDefinitionInit = Omit<ForeignKeyDefinition, ForeignKeyDefinitionDefaultedField> & Partial<Pick<ForeignKeyDefinition, ForeignKeyDefinitionDefaultedField>>;
|
|
509
|
+
|
|
510
|
+
/** Build a complete `ForeignKeyDefinition`, filling the protocol defaults, in wire order. */
|
|
511
|
+
export function buildForeignKeyDefinition(init: ForeignKeyDefinitionInit): ForeignKeyDefinition {
|
|
512
|
+
return {
|
|
513
|
+
referenced_table: init.referenced_table,
|
|
514
|
+
referenced_column_paths: init.referenced_column_paths,
|
|
515
|
+
match: init.match ?? "SIMPLE",
|
|
516
|
+
on_update: init.on_update ?? "NO_ACTION",
|
|
517
|
+
on_delete: init.on_delete ?? "NO_ACTION",
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
export const encodeForeignKeyDefinition = (v: ForeignKeyDefinition): Uint8Array => encodeASD(ForeignKeyDefinitionSchema, v);
|
|
522
|
+
export const decodeForeignKeyDefinition = (b: Uint8Array): ForeignKeyDefinition => decodeASD<ForeignKeyDefinition>(ForeignKeyDefinitionSchema, b);
|
|
523
|
+
|
|
524
|
+
// ----------------------------------------------------------------------------
|
|
525
|
+
// ConstraintDefinition (schema: ConstraintDefinitionSchema)
|
|
526
|
+
// ----------------------------------------------------------------------------
|
|
527
|
+
|
|
528
|
+
/** Exactly one constraint definition; labels are never mutation identity. */
|
|
529
|
+
export interface ConstraintDefinition {
|
|
530
|
+
kind: string;
|
|
531
|
+
column_paths: string[][];
|
|
532
|
+
declared_name?: string | null;
|
|
533
|
+
check_expression?: Uint8Array | null;
|
|
534
|
+
foreign_key?: Uint8Array | null;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
/** Fields of `ConstraintDefinition` that have a protocol default. */
|
|
538
|
+
export type ConstraintDefinitionDefaultedField =
|
|
539
|
+
| "column_paths"
|
|
540
|
+
| "declared_name"
|
|
541
|
+
| "check_expression"
|
|
542
|
+
| "foreign_key";
|
|
543
|
+
/** `ConstraintDefinition` with every field that has a protocol default optional. */
|
|
544
|
+
export type ConstraintDefinitionInit = Omit<ConstraintDefinition, ConstraintDefinitionDefaultedField> & Partial<Pick<ConstraintDefinition, ConstraintDefinitionDefaultedField>>;
|
|
545
|
+
|
|
546
|
+
/** Build a complete `ConstraintDefinition`, filling the protocol defaults, in wire order. */
|
|
547
|
+
export function buildConstraintDefinition(init: ConstraintDefinitionInit): ConstraintDefinition {
|
|
548
|
+
return {
|
|
549
|
+
kind: init.kind,
|
|
550
|
+
column_paths: init.column_paths ?? [],
|
|
551
|
+
declared_name: init.declared_name ?? null,
|
|
552
|
+
check_expression: init.check_expression ?? null,
|
|
553
|
+
foreign_key: init.foreign_key ?? null,
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
export const encodeConstraintDefinition = (v: ConstraintDefinition): Uint8Array => encodeASD(ConstraintDefinitionSchema, v);
|
|
558
|
+
export const decodeConstraintDefinition = (b: Uint8Array): ConstraintDefinition => decodeASD<ConstraintDefinition>(ConstraintDefinitionSchema, b);
|
|
559
|
+
|
|
560
|
+
// ----------------------------------------------------------------------------
|
|
561
|
+
// ConstraintInfo (schema: ConstraintInfoSchema)
|
|
562
|
+
// ----------------------------------------------------------------------------
|
|
563
|
+
|
|
564
|
+
/** Canonical readback with stable logical identity and explicit trust state. */
|
|
565
|
+
export interface ConstraintInfo {
|
|
566
|
+
ref: Uint8Array;
|
|
567
|
+
definition: Uint8Array;
|
|
568
|
+
enforcement: string;
|
|
569
|
+
validation: string;
|
|
570
|
+
referenced_constraint?: Uint8Array | null;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
/** Fields of `ConstraintInfo` that have a protocol default. */
|
|
574
|
+
export type ConstraintInfoDefaultedField =
|
|
575
|
+
| "referenced_constraint";
|
|
576
|
+
/** `ConstraintInfo` with every field that has a protocol default optional. */
|
|
577
|
+
export type ConstraintInfoInit = Omit<ConstraintInfo, ConstraintInfoDefaultedField> & Partial<Pick<ConstraintInfo, ConstraintInfoDefaultedField>>;
|
|
578
|
+
|
|
579
|
+
/** Build a complete `ConstraintInfo`, filling the protocol defaults, in wire order. */
|
|
580
|
+
export function buildConstraintInfo(init: ConstraintInfoInit): ConstraintInfo {
|
|
581
|
+
return {
|
|
582
|
+
ref: init.ref,
|
|
583
|
+
definition: init.definition,
|
|
584
|
+
enforcement: init.enforcement,
|
|
585
|
+
validation: init.validation,
|
|
586
|
+
referenced_constraint: init.referenced_constraint ?? null,
|
|
587
|
+
};
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
export const encodeConstraintInfo = (v: ConstraintInfo): Uint8Array => encodeASD(ConstraintInfoSchema, v);
|
|
591
|
+
export const decodeConstraintInfo = (b: Uint8Array): ConstraintInfo => decodeASD<ConstraintInfo>(ConstraintInfoSchema, b);
|
|
592
|
+
|
|
593
|
+
// ----------------------------------------------------------------------------
|
|
594
|
+
// ConstraintChange (schema: ConstraintChangeSchema)
|
|
595
|
+
// ----------------------------------------------------------------------------
|
|
596
|
+
|
|
597
|
+
/** Strict ADD/DROP/RENAME/REPLACE union for one atomic apply request. */
|
|
598
|
+
export interface ConstraintChange {
|
|
599
|
+
operation: string;
|
|
600
|
+
ref?: Uint8Array | null;
|
|
601
|
+
definition?: Uint8Array | null;
|
|
602
|
+
enforcement?: string | null;
|
|
603
|
+
validation?: string | null;
|
|
604
|
+
cascade?: boolean | null;
|
|
605
|
+
declared_name?: string | null;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
/** Fields of `ConstraintChange` that have a protocol default. */
|
|
609
|
+
export type ConstraintChangeDefaultedField =
|
|
610
|
+
| "ref"
|
|
611
|
+
| "definition"
|
|
612
|
+
| "enforcement"
|
|
613
|
+
| "validation"
|
|
614
|
+
| "cascade"
|
|
615
|
+
| "declared_name";
|
|
616
|
+
/** `ConstraintChange` with every field that has a protocol default optional. */
|
|
617
|
+
export type ConstraintChangeInit = Omit<ConstraintChange, ConstraintChangeDefaultedField> & Partial<Pick<ConstraintChange, ConstraintChangeDefaultedField>>;
|
|
618
|
+
|
|
619
|
+
/** Build a complete `ConstraintChange`, filling the protocol defaults, in wire order. */
|
|
620
|
+
export function buildConstraintChange(init: ConstraintChangeInit): ConstraintChange {
|
|
621
|
+
return {
|
|
622
|
+
operation: init.operation,
|
|
623
|
+
ref: init.ref ?? null,
|
|
624
|
+
definition: init.definition ?? null,
|
|
625
|
+
enforcement: init.enforcement ?? null,
|
|
626
|
+
validation: init.validation ?? null,
|
|
627
|
+
cascade: init.cascade ?? null,
|
|
628
|
+
declared_name: init.declared_name ?? null,
|
|
629
|
+
};
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
export const encodeConstraintChange = (v: ConstraintChange): Uint8Array => encodeASD(ConstraintChangeSchema, v);
|
|
633
|
+
export const decodeConstraintChange = (b: Uint8Array): ConstraintChange => decodeASD<ConstraintChange>(ConstraintChangeSchema, b);
|
|
634
|
+
|
|
635
|
+
// ----------------------------------------------------------------------------
|
|
636
|
+
// ConstraintSnapshot (schema: ConstraintSnapshotSchema)
|
|
637
|
+
// ----------------------------------------------------------------------------
|
|
638
|
+
|
|
639
|
+
/** `ConstraintSnapshot` has no defaulted fields, so its init is the record itself. */
|
|
640
|
+
export type ConstraintSnapshotInit = ConstraintSnapshot;
|
|
641
|
+
|
|
642
|
+
/** Build a complete `ConstraintSnapshot`, filling the protocol defaults, in wire order. */
|
|
643
|
+
export function buildConstraintSnapshot(init: ConstraintSnapshotInit): ConstraintSnapshot {
|
|
644
|
+
return {
|
|
645
|
+
table: init.table,
|
|
646
|
+
definition_revision: init.definition_revision,
|
|
647
|
+
constraints: init.constraints,
|
|
648
|
+
};
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
export const encodeConstraintSnapshot = (v: ConstraintSnapshot): Uint8Array => encodeASD(ConstraintSnapshotSchema, v);
|
|
652
|
+
export const decodeConstraintSnapshot = (b: Uint8Array): ConstraintSnapshot => decodeASD<ConstraintSnapshot>(ConstraintSnapshotSchema, b);
|
|
653
|
+
|
|
654
|
+
// ----------------------------------------------------------------------------
|
|
655
|
+
// ConstraintsApplyRequest (schema: ConstraintsApplyRequestSchema)
|
|
656
|
+
// ----------------------------------------------------------------------------
|
|
657
|
+
|
|
658
|
+
/** Fields of `ConstraintsApplyRequest` that have a protocol default. */
|
|
659
|
+
export type ConstraintsApplyRequestDefaultedField =
|
|
660
|
+
| "transaction_opaque_data";
|
|
661
|
+
/** `ConstraintsApplyRequest` with every field that has a protocol default optional. */
|
|
662
|
+
export type ConstraintsApplyRequestInit = Omit<ConstraintsApplyRequest, ConstraintsApplyRequestDefaultedField> & Partial<Pick<ConstraintsApplyRequest, ConstraintsApplyRequestDefaultedField>>;
|
|
663
|
+
|
|
664
|
+
/** Build a complete `ConstraintsApplyRequest`, filling the protocol defaults, in wire order. */
|
|
665
|
+
export function buildConstraintsApplyRequest(init: ConstraintsApplyRequestInit): ConstraintsApplyRequest {
|
|
666
|
+
return {
|
|
667
|
+
attach_opaque_data: init.attach_opaque_data,
|
|
668
|
+
table: init.table,
|
|
669
|
+
expected_revision: init.expected_revision,
|
|
670
|
+
changes: init.changes,
|
|
671
|
+
transaction_opaque_data: init.transaction_opaque_data ?? null,
|
|
672
|
+
};
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
export const encodeConstraintsApplyRequest = (v: ConstraintsApplyRequest): Uint8Array => encodeASD(ConstraintsApplyRequestSchema, v);
|
|
676
|
+
export const decodeConstraintsApplyRequest = (b: Uint8Array): ConstraintsApplyRequest => decodeASD<ConstraintsApplyRequest>(ConstraintsApplyRequestSchema, b);
|
|
677
|
+
|
|
678
|
+
// ----------------------------------------------------------------------------
|
|
679
|
+
// IndexKey (schema: IndexKeySchema)
|
|
680
|
+
// ----------------------------------------------------------------------------
|
|
681
|
+
|
|
682
|
+
/** Exactly one raw column path or explicitly contextual SQL expression. Raw keys require provider-established binary column collation in the initial profile. Direction and physical ordering require an algorithm profile. */
|
|
683
|
+
export interface IndexKey {
|
|
684
|
+
column_path?: string[] | null;
|
|
685
|
+
expression?: Uint8Array | null;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
/** Fields of `IndexKey` that have a protocol default. */
|
|
689
|
+
export type IndexKeyDefaultedField =
|
|
690
|
+
| "column_path"
|
|
691
|
+
| "expression";
|
|
692
|
+
/** `IndexKey` with every field that has a protocol default optional. */
|
|
693
|
+
export type IndexKeyInit = Omit<IndexKey, IndexKeyDefaultedField> & Partial<Pick<IndexKey, IndexKeyDefaultedField>>;
|
|
694
|
+
|
|
695
|
+
/** Build a complete `IndexKey`, filling the protocol defaults, in wire order. */
|
|
696
|
+
export function buildIndexKey(init: IndexKeyInit): IndexKey {
|
|
697
|
+
return {
|
|
698
|
+
column_path: init.column_path ?? null,
|
|
699
|
+
expression: init.expression ?? null,
|
|
700
|
+
};
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
export const encodeIndexKey = (v: IndexKey): Uint8Array => encodeASD(IndexKeySchema, v);
|
|
704
|
+
export const decodeIndexKey = (b: Uint8Array): IndexKey => decodeASD<IndexKey>(IndexKeySchema, b);
|
|
705
|
+
|
|
706
|
+
// ----------------------------------------------------------------------------
|
|
707
|
+
// IndexDefinition (schema: IndexDefinitionSchema)
|
|
708
|
+
// ----------------------------------------------------------------------------
|
|
709
|
+
|
|
710
|
+
/** Fields of `IndexDefinition` that have a protocol default. */
|
|
711
|
+
export type IndexDefinitionDefaultedField =
|
|
712
|
+
| "associated_constraint";
|
|
713
|
+
/** `IndexDefinition` with every field that has a protocol default optional. */
|
|
714
|
+
export type IndexDefinitionInit = Omit<IndexDefinition, IndexDefinitionDefaultedField> & Partial<Pick<IndexDefinition, IndexDefinitionDefaultedField>>;
|
|
715
|
+
|
|
716
|
+
/** Build a complete `IndexDefinition`, filling the protocol defaults, in wire order. */
|
|
717
|
+
export function buildIndexDefinition(init: IndexDefinitionInit): IndexDefinition {
|
|
718
|
+
return {
|
|
719
|
+
table: init.table,
|
|
720
|
+
algorithm: init.algorithm,
|
|
721
|
+
keys: init.keys,
|
|
722
|
+
options: init.options,
|
|
723
|
+
constraint_type: init.constraint_type,
|
|
724
|
+
associated_constraint: init.associated_constraint ?? null,
|
|
725
|
+
};
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
export const encodeIndexDefinition = (v: IndexDefinition): Uint8Array => encodeASD(IndexDefinitionSchema, v);
|
|
729
|
+
export const decodeIndexDefinition = (b: Uint8Array): IndexDefinition => decodeASD<IndexDefinition>(IndexDefinitionSchema, b);
|
|
730
|
+
|
|
731
|
+
// ----------------------------------------------------------------------------
|
|
732
|
+
// SortKey (schema: SortKeySchema)
|
|
733
|
+
// ----------------------------------------------------------------------------
|
|
734
|
+
|
|
735
|
+
/** Scalar key, direction and NULL order for a table layout. */
|
|
736
|
+
export interface SortKey {
|
|
737
|
+
expression: Uint8Array;
|
|
738
|
+
direction: string;
|
|
739
|
+
null_order: string;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
/** `SortKey` has no defaulted fields, so its init is the record itself. */
|
|
743
|
+
export type SortKeyInit = SortKey;
|
|
744
|
+
|
|
745
|
+
/** Build a complete `SortKey`, filling the protocol defaults, in wire order. */
|
|
746
|
+
export function buildSortKey(init: SortKeyInit): SortKey {
|
|
747
|
+
return {
|
|
748
|
+
expression: init.expression,
|
|
749
|
+
direction: init.direction,
|
|
750
|
+
null_order: init.null_order,
|
|
751
|
+
};
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
export const encodeSortKey = (v: SortKey): Uint8Array => encodeASD(SortKeySchema, v);
|
|
755
|
+
export const decodeSortKey = (b: Uint8Array): SortKey => decodeASD<SortKey>(SortKeySchema, b);
|
|
756
|
+
|
|
757
|
+
// ----------------------------------------------------------------------------
|
|
758
|
+
// TableLayout (schema: TableLayoutSchema)
|
|
759
|
+
// ----------------------------------------------------------------------------
|
|
760
|
+
|
|
761
|
+
/** Fields of `TableLayout` that have a protocol default. */
|
|
762
|
+
export type TableLayoutDefaultedField =
|
|
763
|
+
| "partition_by"
|
|
764
|
+
| "sorted_by"
|
|
765
|
+
| "coverage";
|
|
766
|
+
/** `TableLayout` with every field that has a protocol default optional. */
|
|
767
|
+
export type TableLayoutInit = Omit<TableLayout, TableLayoutDefaultedField> & Partial<Pick<TableLayout, TableLayoutDefaultedField>>;
|
|
768
|
+
|
|
769
|
+
/** Build a complete `TableLayout`, filling the protocol defaults, in wire order. */
|
|
770
|
+
export function buildTableLayout(init: TableLayoutInit): TableLayout {
|
|
771
|
+
return {
|
|
772
|
+
partition_by: init.partition_by ?? [],
|
|
773
|
+
sorted_by: init.sorted_by ?? [],
|
|
774
|
+
coverage: init.coverage ?? "ALL_ROWS",
|
|
775
|
+
};
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
export const encodeTableLayout = (v: TableLayout): Uint8Array => encodeASD(TableLayoutSchema, v);
|
|
779
|
+
export const decodeTableLayout = (b: Uint8Array): TableLayout => decodeASD<TableLayout>(TableLayoutSchema, b);
|
|
780
|
+
|
|
781
|
+
// ----------------------------------------------------------------------------
|
|
782
|
+
// TableLayoutChange (schema: TableLayoutChangeSchema)
|
|
783
|
+
// ----------------------------------------------------------------------------
|
|
784
|
+
|
|
785
|
+
/** Replace either layout component, atomically under the requested mode. NULL leaves a component unchanged; an empty list clears it. REWRITE succeeds only after all existing data conforms to the replacement layout. A provider that cannot honor the mode must reject it before mutation. No implicit retry. */
|
|
786
|
+
export interface TableLayoutChange {
|
|
787
|
+
mode: string;
|
|
788
|
+
partition_by?: Uint8Array[] | null;
|
|
789
|
+
sorted_by?: Uint8Array[] | null;
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
/** Fields of `TableLayoutChange` that have a protocol default. */
|
|
793
|
+
export type TableLayoutChangeDefaultedField =
|
|
794
|
+
| "partition_by"
|
|
795
|
+
| "sorted_by";
|
|
796
|
+
/** `TableLayoutChange` with every field that has a protocol default optional. */
|
|
797
|
+
export type TableLayoutChangeInit = Omit<TableLayoutChange, TableLayoutChangeDefaultedField> & Partial<Pick<TableLayoutChange, TableLayoutChangeDefaultedField>>;
|
|
798
|
+
|
|
799
|
+
/** Build a complete `TableLayoutChange`, filling the protocol defaults, in wire order. */
|
|
800
|
+
export function buildTableLayoutChange(init: TableLayoutChangeInit): TableLayoutChange {
|
|
801
|
+
return {
|
|
802
|
+
mode: init.mode,
|
|
803
|
+
partition_by: init.partition_by ?? null,
|
|
804
|
+
sorted_by: init.sorted_by ?? null,
|
|
805
|
+
};
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
export const encodeTableLayoutChange = (v: TableLayoutChange): Uint8Array => encodeASD(TableLayoutChangeSchema, v);
|
|
809
|
+
export const decodeTableLayoutChange = (b: Uint8Array): TableLayoutChange => decodeASD<TableLayoutChange>(TableLayoutChangeSchema, b);
|
|
810
|
+
|
|
811
|
+
// ----------------------------------------------------------------------------
|
|
812
|
+
// OptionChanges (schema: OptionChangesSchema)
|
|
813
|
+
// ----------------------------------------------------------------------------
|
|
814
|
+
|
|
815
|
+
/** An atomic candidate change to literal catalog options. All identifiers are canonical provider option names. Every supplied field is a SET, including a typed NULL. Missing fields are unchanged. RESET drops an override and restores the provider default from the mutation's snapshot. Expressions are not encoded as strings masquerading as literal values. */
|
|
816
|
+
export interface OptionChanges {
|
|
817
|
+
/** Optional one-row batch containing only options to set. */
|
|
818
|
+
set_values?: Uint8Array | null;
|
|
819
|
+
/** Options whose stored overrides should be removed. */
|
|
820
|
+
reset_names: string[];
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
/** Fields of `OptionChanges` that have a protocol default. */
|
|
824
|
+
export type OptionChangesDefaultedField =
|
|
825
|
+
| "set_values"
|
|
826
|
+
| "reset_names";
|
|
827
|
+
/** `OptionChanges` with every field that has a protocol default optional. */
|
|
828
|
+
export type OptionChangesInit = Omit<OptionChanges, OptionChangesDefaultedField> & Partial<Pick<OptionChanges, OptionChangesDefaultedField>>;
|
|
829
|
+
|
|
830
|
+
/** Build a complete `OptionChanges`, filling the protocol defaults, in wire order. */
|
|
831
|
+
export function buildOptionChanges(init: OptionChangesInit): OptionChanges {
|
|
832
|
+
return {
|
|
833
|
+
set_values: init.set_values ?? null,
|
|
834
|
+
reset_names: init.reset_names ?? [],
|
|
835
|
+
};
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
export const encodeOptionChanges = (v: OptionChanges): Uint8Array => encodeASD(OptionChangesSchema, v);
|
|
839
|
+
export const decodeOptionChanges = (b: Uint8Array): OptionChanges => decodeASD<OptionChanges>(OptionChangesSchema, b);
|
|
840
|
+
|
|
841
|
+
// ----------------------------------------------------------------------------
|
|
842
|
+
// OptionState (schema: OptionStateSchema)
|
|
843
|
+
// ----------------------------------------------------------------------------
|
|
844
|
+
|
|
845
|
+
/** Fields of `OptionState` that have a protocol default. */
|
|
846
|
+
export type OptionStateDefaultedField =
|
|
847
|
+
| "explicit_names";
|
|
848
|
+
/** `OptionState` with every field that has a protocol default optional. */
|
|
849
|
+
export type OptionStateInit = Omit<OptionState, OptionStateDefaultedField> & Partial<Pick<OptionState, OptionStateDefaultedField>>;
|
|
850
|
+
|
|
851
|
+
/** Build a complete `OptionState`, filling the protocol defaults, in wire order. */
|
|
852
|
+
export function buildOptionState(init: OptionStateInit): OptionState {
|
|
853
|
+
return {
|
|
854
|
+
values: init.values,
|
|
855
|
+
explicit_names: init.explicit_names ?? [],
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
export const encodeOptionState = (v: OptionState): Uint8Array => encodeASD(OptionStateSchema, v);
|
|
860
|
+
export const decodeOptionState = (b: Uint8Array): OptionState => decodeASD<OptionState>(OptionStateSchema, b);
|
|
861
|
+
|
|
862
|
+
// ----------------------------------------------------------------------------
|
|
863
|
+
// RequiredFilterPaths (schema: RequiredFilterPathsSchema)
|
|
864
|
+
// ----------------------------------------------------------------------------
|
|
865
|
+
|
|
866
|
+
/** AND-of-OR groups of raw column paths required by a table scan. A group is satisfied when a present filter path is a component prefix of at least one member. Filtering `["a"]` satisfies `["a", "b"]`; filtering `["a.b"]` does not. An empty outer list means no requirements; an empty group is invalid. These are column-presence requirements, not a proof that a predicate was enforced remotely or that it restricts any rows. */
|
|
867
|
+
export interface RequiredFilterPaths {
|
|
868
|
+
/** Ordered AND groups, each containing one or more OR alternatives. */
|
|
869
|
+
groups: string[][][];
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
/** Fields of `RequiredFilterPaths` that have a protocol default. */
|
|
873
|
+
export type RequiredFilterPathsDefaultedField =
|
|
874
|
+
| "groups";
|
|
875
|
+
/** `RequiredFilterPaths` with every field that has a protocol default optional. */
|
|
876
|
+
export type RequiredFilterPathsInit = Omit<RequiredFilterPaths, RequiredFilterPathsDefaultedField> & Partial<Pick<RequiredFilterPaths, RequiredFilterPathsDefaultedField>>;
|
|
877
|
+
|
|
878
|
+
/** Build a complete `RequiredFilterPaths`, filling the protocol defaults, in wire order. */
|
|
879
|
+
export function buildRequiredFilterPaths(init: RequiredFilterPathsInit): RequiredFilterPaths {
|
|
880
|
+
return {
|
|
881
|
+
groups: init.groups ?? [],
|
|
882
|
+
};
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
export const encodeRequiredFilterPaths = (v: RequiredFilterPaths): Uint8Array => encodeASD(RequiredFilterPathsSchema, v);
|
|
886
|
+
export const decodeRequiredFilterPaths = (b: Uint8Array): RequiredFilterPaths => decodeASD<RequiredFilterPaths>(RequiredFilterPathsSchema, b);
|
|
19
887
|
|
|
20
888
|
// ----------------------------------------------------------------------------
|
|
21
889
|
// CatalogAttachResult (schema: CatalogAttachResultSchema)
|
|
@@ -33,7 +901,10 @@ export type CatalogAttachResultDefaultedField =
|
|
|
33
901
|
| "supports_column_statistics"
|
|
34
902
|
| "global_functions"
|
|
35
903
|
| "global_function_prefix"
|
|
36
|
-
| "supports_catalog_contents"
|
|
904
|
+
| "supports_catalog_contents"
|
|
905
|
+
| "catalog_capabilities"
|
|
906
|
+
| "selected_capabilities"
|
|
907
|
+
| "query_pushdown";
|
|
37
908
|
/** `CatalogAttachResult` with every field that has a protocol default optional. */
|
|
38
909
|
export type CatalogAttachResultInit = Omit<CatalogAttachResult, CatalogAttachResultDefaultedField> & Partial<Pick<CatalogAttachResult, CatalogAttachResultDefaultedField>>;
|
|
39
910
|
|
|
@@ -46,7 +917,7 @@ export function buildCatalogAttachResult(init: CatalogAttachResultInit): Catalog
|
|
|
46
917
|
catalog_version_frozen: init.catalog_version_frozen,
|
|
47
918
|
catalog_version: init.catalog_version,
|
|
48
919
|
attach_opaque_data_required: init.attach_opaque_data_required ?? true,
|
|
49
|
-
default_schema: init.default_schema
|
|
920
|
+
default_schema: init.default_schema === undefined ? "main" : init.default_schema,
|
|
50
921
|
settings: init.settings ?? [],
|
|
51
922
|
secret_types: init.secret_types ?? [],
|
|
52
923
|
attach_catalogs: init.attach_catalogs ?? [],
|
|
@@ -58,6 +929,9 @@ export function buildCatalogAttachResult(init: CatalogAttachResultInit): Catalog
|
|
|
58
929
|
resolved_data_version: init.resolved_data_version ?? null,
|
|
59
930
|
resolved_implementation_version: init.resolved_implementation_version ?? null,
|
|
60
931
|
supports_catalog_contents: init.supports_catalog_contents ?? false,
|
|
932
|
+
catalog_capabilities: init.catalog_capabilities ?? null,
|
|
933
|
+
selected_capabilities: init.selected_capabilities ?? null,
|
|
934
|
+
query_pushdown: init.query_pushdown ?? null,
|
|
61
935
|
};
|
|
62
936
|
}
|
|
63
937
|
|