@sqlanvil/core 0.0.1 → 1.0.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/bundle.d.ts +13720 -0
- package/bundle.js +15 -0
- package/configs.proto +1028 -0
- package/core.proto +467 -0
- package/db_adapter.proto +96 -0
- package/extension.proto +46 -0
- package/jit.proto +186 -0
- package/package.json +40 -15
- package/README.md +0 -12
- package/index.js +0 -4
package/core.proto
ADDED
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
// Copyright 2023 Google LLC
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
|
|
15
|
+
syntax = "proto3";
|
|
16
|
+
|
|
17
|
+
package sqlanvil;
|
|
18
|
+
|
|
19
|
+
import "configs.proto";
|
|
20
|
+
import "extension.proto";
|
|
21
|
+
import "google/protobuf/struct.proto";
|
|
22
|
+
|
|
23
|
+
option java_package = "com.sqlanvil.protos";
|
|
24
|
+
option java_outer_classname = "CoreMeta";
|
|
25
|
+
option java_multiple_files = true;
|
|
26
|
+
|
|
27
|
+
option go_package = "github.com/sqlanvil/sqlanvil/protos/sqlanvil";
|
|
28
|
+
|
|
29
|
+
message ProjectConfig {
|
|
30
|
+
string warehouse = 1;
|
|
31
|
+
|
|
32
|
+
string default_database = 9;
|
|
33
|
+
string default_schema = 2;
|
|
34
|
+
string default_location = 16;
|
|
35
|
+
|
|
36
|
+
string assertion_schema = 5;
|
|
37
|
+
|
|
38
|
+
map<string, string> vars = 14;
|
|
39
|
+
|
|
40
|
+
string database_suffix = 15;
|
|
41
|
+
string schema_suffix = 7;
|
|
42
|
+
string table_prefix = 11;
|
|
43
|
+
string builtin_assertion_name_prefix = 18;
|
|
44
|
+
|
|
45
|
+
NotebookRuntimeOptions default_notebook_runtime_options = 17;
|
|
46
|
+
|
|
47
|
+
DefaultIcebergConfig default_iceberg_config = 19;
|
|
48
|
+
|
|
49
|
+
bool disable_assertions = 20;
|
|
50
|
+
|
|
51
|
+
string default_reservation = 21;
|
|
52
|
+
|
|
53
|
+
bool include_tests_in_compiled_graph = 22;
|
|
54
|
+
|
|
55
|
+
reserved 3, 4, 6, 8, 10, 12, 13;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
message CompileConfig {
|
|
59
|
+
// Required.
|
|
60
|
+
string project_dir = 1;
|
|
61
|
+
|
|
62
|
+
// A list of all files in the project directory.
|
|
63
|
+
repeated string file_paths = 8;
|
|
64
|
+
|
|
65
|
+
// Project configuration overrides.
|
|
66
|
+
ProjectConfig project_config_override = 3;
|
|
67
|
+
|
|
68
|
+
// Override compilation timeout settings.
|
|
69
|
+
int32 timeout_millis = 6;
|
|
70
|
+
|
|
71
|
+
Extension extension = 10;
|
|
72
|
+
|
|
73
|
+
// Whether to emit compilation debug logs.
|
|
74
|
+
bool verbose = 11;
|
|
75
|
+
|
|
76
|
+
reserved 2, 4, 5, 7, 9, 12;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
message Target {
|
|
80
|
+
string database = 3;
|
|
81
|
+
string schema = 1;
|
|
82
|
+
string name = 2;
|
|
83
|
+
bool include_dependent_assertions = 4;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
enum FileFormat {
|
|
87
|
+
FILE_FORMAT_UNSPECIFIED = 0;
|
|
88
|
+
PARQUET = 1;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
enum TableFormat {
|
|
92
|
+
TABLE_FORMAT_UNSPECIFIED = 0;
|
|
93
|
+
ICEBERG = 1;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
message BigQueryOptions {
|
|
97
|
+
string partition_by = 1;
|
|
98
|
+
repeated string cluster_by = 2;
|
|
99
|
+
string update_partition_filter = 3;
|
|
100
|
+
map<string, string> labels = 4;
|
|
101
|
+
int32 partition_expiration_days = 5;
|
|
102
|
+
bool require_partition_filter = 6;
|
|
103
|
+
map<string, string> additional_options = 7;
|
|
104
|
+
string connection = 8;
|
|
105
|
+
TableFormat table_format = 9;
|
|
106
|
+
FileFormat file_format = 10;
|
|
107
|
+
string storage_uri = 11;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
message GraphErrors {
|
|
111
|
+
repeated CompilationError compilation_errors = 1;
|
|
112
|
+
|
|
113
|
+
reserved 2;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
message CompilationError {
|
|
117
|
+
string file_name = 1;
|
|
118
|
+
// TODO: Deprecate this and replace with action_target.
|
|
119
|
+
string action_name = 4;
|
|
120
|
+
Target action_target = 5;
|
|
121
|
+
string message = 2;
|
|
122
|
+
string stack = 3;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Compilation mode, unspecified is interpreted to AoT.
|
|
126
|
+
enum ActionCompilationMode {
|
|
127
|
+
ACTION_COMPILATION_MODE_UNSPECIFIED = 0;
|
|
128
|
+
// Ahead-of-time compilation (regular sqlanvil compilation).
|
|
129
|
+
ACTION_COMPILATION_MODE_AOT = 1;
|
|
130
|
+
// Just-in-time compilation.
|
|
131
|
+
// Will only populate jit_code fields in compiled graph,
|
|
132
|
+
// to be re-compiled at execution time.
|
|
133
|
+
ACTION_COMPILATION_MODE_JIT = 2;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
message ActionDescriptor {
|
|
137
|
+
string description = 1;
|
|
138
|
+
// For Operations, 'columns' may be set iff has_output == true.
|
|
139
|
+
// For Assertions, 'columns' will always be empty.
|
|
140
|
+
repeated ColumnDescriptor columns = 2;
|
|
141
|
+
map<string, string> bigquery_labels = 3;
|
|
142
|
+
Metadata metadata = 4;
|
|
143
|
+
ActionCompilationMode compilation_mode = 5;
|
|
144
|
+
string reservation = 6;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
message Metadata {
|
|
148
|
+
string overview = 1;
|
|
149
|
+
google.protobuf.Struct extra_properties = 2;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
message ColumnDescriptor {
|
|
153
|
+
string description = 1;
|
|
154
|
+
|
|
155
|
+
// For nested records, the path might look like e.g. ["record", "column"].
|
|
156
|
+
// For simple columns, this will always contain a single entry e.g.
|
|
157
|
+
// ["column"].
|
|
158
|
+
repeated string path = 2;
|
|
159
|
+
|
|
160
|
+
string display_name = 3;
|
|
161
|
+
|
|
162
|
+
repeated string tags = 7;
|
|
163
|
+
|
|
164
|
+
// BigQuery specific settings.
|
|
165
|
+
|
|
166
|
+
repeated string bigquery_policy_tags = 8;
|
|
167
|
+
|
|
168
|
+
reserved 4, 5, 6;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
enum TableType {
|
|
172
|
+
UNKNOWN_TYPE = 0;
|
|
173
|
+
TABLE = 1;
|
|
174
|
+
INCREMENTAL = 2;
|
|
175
|
+
VIEW = 3;
|
|
176
|
+
|
|
177
|
+
reserved 4;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
enum OnSchemaChange {
|
|
181
|
+
// Ignore any schema changes (default).
|
|
182
|
+
IGNORE = 0;
|
|
183
|
+
// Fails if the query would result in a new column(s) being added, deleted,
|
|
184
|
+
// or renamed.
|
|
185
|
+
FAIL = 1;
|
|
186
|
+
// Does not block any new column(s) from being added.
|
|
187
|
+
EXTEND = 2;
|
|
188
|
+
// Does not block any new column(s) from being added, deleted or renamed.
|
|
189
|
+
SYNCHRONIZE = 3;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
message Table {
|
|
193
|
+
// For legacy compatability reasons, both incremental tables and views are
|
|
194
|
+
// configured in compiled graphs via the Table proto.
|
|
195
|
+
TableType enum_type = 36;
|
|
196
|
+
|
|
197
|
+
Target target = 4;
|
|
198
|
+
Target canonical_target = 32;
|
|
199
|
+
|
|
200
|
+
repeated Target dependency_targets = 27;
|
|
201
|
+
ActionHermeticity hermeticity = 31;
|
|
202
|
+
|
|
203
|
+
bool disabled = 6;
|
|
204
|
+
|
|
205
|
+
string type = 3 [deprecated = true];
|
|
206
|
+
string query = 5;
|
|
207
|
+
bool protected = 9;
|
|
208
|
+
bool materialized = 35;
|
|
209
|
+
|
|
210
|
+
ActionDescriptor action_descriptor = 24;
|
|
211
|
+
|
|
212
|
+
repeated string tags = 23;
|
|
213
|
+
|
|
214
|
+
// Incremental only.
|
|
215
|
+
string where = 8 [deprecated = true];
|
|
216
|
+
string incremental_query = 26;
|
|
217
|
+
repeated string unique_key = 30;
|
|
218
|
+
OnSchemaChange on_schema_change = 37;
|
|
219
|
+
|
|
220
|
+
// Pre/post operations.
|
|
221
|
+
repeated string pre_ops = 13;
|
|
222
|
+
repeated string post_ops = 14;
|
|
223
|
+
repeated string incremental_pre_ops = 28;
|
|
224
|
+
repeated string incremental_post_ops = 29;
|
|
225
|
+
|
|
226
|
+
string jit_code = 38;
|
|
227
|
+
|
|
228
|
+
// Warehouse specific features.
|
|
229
|
+
BigQueryOptions bigquery = 22;
|
|
230
|
+
PostgresOptions postgres = 39;
|
|
231
|
+
SupabaseOptions supabase = 40;
|
|
232
|
+
|
|
233
|
+
// Generated.
|
|
234
|
+
string file_name = 18;
|
|
235
|
+
|
|
236
|
+
reserved 1, 2, 7, 12, 16;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
message Operation {
|
|
240
|
+
Target target = 3;
|
|
241
|
+
Target canonical_target = 13;
|
|
242
|
+
repeated Target dependency_targets = 11;
|
|
243
|
+
|
|
244
|
+
ActionHermeticity hermeticity = 12;
|
|
245
|
+
|
|
246
|
+
bool disabled = 14;
|
|
247
|
+
|
|
248
|
+
repeated string queries = 6;
|
|
249
|
+
string jit_code = 15;
|
|
250
|
+
bool has_output = 8;
|
|
251
|
+
repeated string tags = 9;
|
|
252
|
+
|
|
253
|
+
ActionDescriptor action_descriptor = 10;
|
|
254
|
+
|
|
255
|
+
// Generated.
|
|
256
|
+
string file_name = 7;
|
|
257
|
+
|
|
258
|
+
reserved 1, 2, 4, 5;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
message Assertion {
|
|
262
|
+
Target target = 8;
|
|
263
|
+
Target canonical_target = 13;
|
|
264
|
+
|
|
265
|
+
repeated Target dependency_targets = 11;
|
|
266
|
+
ActionHermeticity hermeticity = 12;
|
|
267
|
+
|
|
268
|
+
bool disabled = 14;
|
|
269
|
+
|
|
270
|
+
string query = 3;
|
|
271
|
+
|
|
272
|
+
repeated string tags = 9;
|
|
273
|
+
|
|
274
|
+
ActionDescriptor action_descriptor = 10;
|
|
275
|
+
|
|
276
|
+
// Only present for auto assertions.
|
|
277
|
+
Target parent_action = 15;
|
|
278
|
+
|
|
279
|
+
string jit_code = 16;
|
|
280
|
+
|
|
281
|
+
// Generated.
|
|
282
|
+
string file_name = 7;
|
|
283
|
+
|
|
284
|
+
reserved 1, 2, 4, 5, 6;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
enum ActionHermeticity {
|
|
288
|
+
UNKNOWN = 0;
|
|
289
|
+
HERMETIC = 1;
|
|
290
|
+
NON_HERMETIC = 2;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
message Declaration {
|
|
294
|
+
Target target = 2;
|
|
295
|
+
Target canonical_target = 5;
|
|
296
|
+
|
|
297
|
+
ActionDescriptor action_descriptor = 3;
|
|
298
|
+
|
|
299
|
+
// Generated.
|
|
300
|
+
string file_name = 4;
|
|
301
|
+
|
|
302
|
+
repeated string tags = 6;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
message Test {
|
|
306
|
+
string name = 1;
|
|
307
|
+
|
|
308
|
+
string test_query = 2;
|
|
309
|
+
string expected_output_query = 3;
|
|
310
|
+
|
|
311
|
+
string jit_code = 10;
|
|
312
|
+
|
|
313
|
+
// Generated.
|
|
314
|
+
string file_name = 4;
|
|
315
|
+
|
|
316
|
+
bool disabled = 5;
|
|
317
|
+
|
|
318
|
+
repeated string tags = 6;
|
|
319
|
+
|
|
320
|
+
Target target = 7;
|
|
321
|
+
Target canonical_target = 8;
|
|
322
|
+
|
|
323
|
+
repeated Target dependency_targets = 9;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
message Notebook {
|
|
327
|
+
Target target = 1;
|
|
328
|
+
|
|
329
|
+
Target canonical_target = 2;
|
|
330
|
+
|
|
331
|
+
repeated string tags = 3;
|
|
332
|
+
|
|
333
|
+
repeated Target dependency_targets = 4;
|
|
334
|
+
|
|
335
|
+
string file_name = 5;
|
|
336
|
+
|
|
337
|
+
bool disabled = 6;
|
|
338
|
+
|
|
339
|
+
string notebook_contents = 7;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
message RepositorySnapshotDestination {
|
|
343
|
+
string repository_snapshot_uri = 1;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
message NotebookRuntimeOptions {
|
|
347
|
+
oneof output_sink {
|
|
348
|
+
string output_bucket = 1;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
string runtime_template_name = 2;
|
|
352
|
+
|
|
353
|
+
oneof repository_snapshot_storage {
|
|
354
|
+
RepositorySnapshotDestination repository_snapshot_destination = 3;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
// Data Preparation Related entries
|
|
359
|
+
message DataPreparation {
|
|
360
|
+
// Used ONLY as an identifiers. All outputs should be listed in the targets
|
|
361
|
+
// section.
|
|
362
|
+
Target target = 8;
|
|
363
|
+
Target canonical_target = 9;
|
|
364
|
+
|
|
365
|
+
// Data preparations can have more than 1 output
|
|
366
|
+
repeated Target targets = 1;
|
|
367
|
+
|
|
368
|
+
repeated Target canonical_targets = 2;
|
|
369
|
+
|
|
370
|
+
repeated string tags = 3;
|
|
371
|
+
|
|
372
|
+
repeated Target dependency_targets = 4;
|
|
373
|
+
|
|
374
|
+
string file_name = 5;
|
|
375
|
+
|
|
376
|
+
bool disabled = 6;
|
|
377
|
+
|
|
378
|
+
oneof definition {
|
|
379
|
+
// YAML file containing the data preparation YAML with resolved
|
|
380
|
+
// dependencies, as well as error table and load configuration information.
|
|
381
|
+
string data_preparation_yaml = 11;
|
|
382
|
+
|
|
383
|
+
// SQL representing a compiled SQL string
|
|
384
|
+
string query = 15;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
// Error table configuration
|
|
388
|
+
Target error_table = 12;
|
|
389
|
+
int32 error_table_retention_days = 13;
|
|
390
|
+
|
|
391
|
+
LoadConfiguration load = 16;
|
|
392
|
+
|
|
393
|
+
reserved 7, 10;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
message LoadConfiguration {
|
|
397
|
+
oneof mode {
|
|
398
|
+
SimpleLoadMode replace = 1;
|
|
399
|
+
SimpleLoadMode append = 2;
|
|
400
|
+
IncrementalLoadMode maximum = 3;
|
|
401
|
+
IncrementalLoadMode unique = 4;
|
|
402
|
+
IncrementalLoadMode automatic = 5;
|
|
403
|
+
MergeLoadMode merge = 6;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
message SimpleLoadMode {}
|
|
408
|
+
|
|
409
|
+
message IncrementalLoadMode {
|
|
410
|
+
string column_name = 1;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
message MergeLoadMode {
|
|
414
|
+
repeated string unique_key = 1;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
message CompiledGraph {
|
|
418
|
+
ProjectConfig project_config = 4;
|
|
419
|
+
|
|
420
|
+
repeated Table tables = 1;
|
|
421
|
+
repeated Operation operations = 2;
|
|
422
|
+
repeated Assertion assertions = 3;
|
|
423
|
+
repeated Declaration declarations = 9;
|
|
424
|
+
// Note that the Test action doesn't really belong in the compiled graph
|
|
425
|
+
// because it is not used at runtime. Consider moving it if useful.
|
|
426
|
+
repeated Test tests = 8;
|
|
427
|
+
repeated Notebook notebooks = 12;
|
|
428
|
+
repeated DataPreparation data_preparations = 13;
|
|
429
|
+
|
|
430
|
+
GraphErrors graph_errors = 7;
|
|
431
|
+
|
|
432
|
+
string sqlanvil_core_version = 10;
|
|
433
|
+
|
|
434
|
+
repeated Target targets = 11;
|
|
435
|
+
|
|
436
|
+
google.protobuf.Struct jit_data = 15;
|
|
437
|
+
|
|
438
|
+
reserved 5, 6;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
message CoreExecutionRequest {
|
|
442
|
+
oneof request {
|
|
443
|
+
CompileExecutionRequest compile = 1;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
message CoreExecutionResponse {
|
|
448
|
+
oneof response {
|
|
449
|
+
CompileExecutionResponse compile = 1;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
message CompileExecutionRequest {
|
|
454
|
+
CompileConfig compile_config = 1;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
message CompileExecutionResponse {
|
|
458
|
+
CompiledGraph compiled_graph = 1;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
// This feature list is added to when making potentilly backwards breaking
|
|
462
|
+
// changes. It lets the caller of sqlanvil Core know whether it supports the
|
|
463
|
+
// change.
|
|
464
|
+
enum SupportedFeatures {
|
|
465
|
+
UNKNOWN_FEATURE = 0;
|
|
466
|
+
ARRAY_BUFFER_IPC = 1;
|
|
467
|
+
}
|
package/db_adapter.proto
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// Copyright 2023 Google LLC
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
|
|
15
|
+
syntax = "proto3";
|
|
16
|
+
|
|
17
|
+
package sqlanvil;
|
|
18
|
+
|
|
19
|
+
import "core.proto";
|
|
20
|
+
|
|
21
|
+
// Common structures for Evaluation, execution and compilation.
|
|
22
|
+
|
|
23
|
+
message Field {
|
|
24
|
+
enum Primitive {
|
|
25
|
+
UNKNOWN = 0;
|
|
26
|
+
INTEGER = 1;
|
|
27
|
+
FLOAT = 2;
|
|
28
|
+
NUMERIC = 5;
|
|
29
|
+
BOOLEAN = 3;
|
|
30
|
+
STRING = 4;
|
|
31
|
+
DATE = 6;
|
|
32
|
+
DATETIME = 7;
|
|
33
|
+
TIMESTAMP = 8;
|
|
34
|
+
TIME = 9;
|
|
35
|
+
BYTES = 10;
|
|
36
|
+
ANY = 11;
|
|
37
|
+
GEOGRAPHY = 12;
|
|
38
|
+
BIGNUMERIC = 13;
|
|
39
|
+
JSON = 14;
|
|
40
|
+
INTERVAL = 15;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
enum Flag {
|
|
44
|
+
UNKNOWN_FLAG = 0;
|
|
45
|
+
REPEATED = 1;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
string name = 1;
|
|
49
|
+
|
|
50
|
+
repeated Flag flags = 6;
|
|
51
|
+
|
|
52
|
+
oneof type {
|
|
53
|
+
Primitive primitive = 7;
|
|
54
|
+
Fields struct = 3;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
string description = 5;
|
|
58
|
+
|
|
59
|
+
reserved 2, 4;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
message Fields {
|
|
63
|
+
repeated Field fields = 1;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
message TableMetadata {
|
|
67
|
+
Target target = 1;
|
|
68
|
+
enum Type {
|
|
69
|
+
UNKNOWN = 0;
|
|
70
|
+
TABLE = 1;
|
|
71
|
+
VIEW = 2;
|
|
72
|
+
MATERIALIZED_VIEW = 3;
|
|
73
|
+
}
|
|
74
|
+
Type type = 6;
|
|
75
|
+
|
|
76
|
+
repeated Field fields = 3;
|
|
77
|
+
string description = 5;
|
|
78
|
+
map<string, string> labels = 7;
|
|
79
|
+
int64 last_updated_millis = 4;
|
|
80
|
+
|
|
81
|
+
message BigQuery {
|
|
82
|
+
bool has_streaming_buffer = 1;
|
|
83
|
+
}
|
|
84
|
+
BigQuery bigquery = 8;
|
|
85
|
+
|
|
86
|
+
reserved 2;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
message ExecutionMetadata {
|
|
90
|
+
message BigqueryMetadata {
|
|
91
|
+
string job_id = 1;
|
|
92
|
+
int64 total_bytes_processed = 2;
|
|
93
|
+
int64 total_bytes_billed = 3;
|
|
94
|
+
}
|
|
95
|
+
BigqueryMetadata bigquery = 1;
|
|
96
|
+
}
|
package/extension.proto
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Copyright 2023 Google LLC
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
|
|
15
|
+
syntax = "proto3";
|
|
16
|
+
|
|
17
|
+
package sqlanvil;
|
|
18
|
+
|
|
19
|
+
option java_package = "com.sqlanvil.protos";
|
|
20
|
+
option java_outer_classname = "ExtensionMeta";
|
|
21
|
+
option java_multiple_files = true;
|
|
22
|
+
|
|
23
|
+
option go_package = "github.com/sqlanvil/sqlanvil/protos/sqlanvil";
|
|
24
|
+
|
|
25
|
+
// Execution mode of compilation extension.
|
|
26
|
+
enum ExtensionCompilationMode {
|
|
27
|
+
// Unspecified compiled mode - extension will be skipped.
|
|
28
|
+
COMPILATION_MODE_UNSPECIFIED = 0;
|
|
29
|
+
// Execute before regular sqlanvil compilation.
|
|
30
|
+
PROLOGUE = 1;
|
|
31
|
+
// Replace regular sqlanvil compilation.
|
|
32
|
+
APPLICATION_CODE = 2;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
message Extension {
|
|
36
|
+
// Name of the extension (JS module) to delegate the compilation to.
|
|
37
|
+
string name = 1;
|
|
38
|
+
|
|
39
|
+
// Compilation mode of the extension, required.
|
|
40
|
+
ExtensionCompilationMode compilation_mode = 2;
|
|
41
|
+
|
|
42
|
+
// Supplementary key-value options for the extension execution.
|
|
43
|
+
// This can be used to pass environment-specific parameters or
|
|
44
|
+
// auxiliary configuration paths to the underlying extension engine.
|
|
45
|
+
map<string, string> options = 3;
|
|
46
|
+
}
|