@sqlanvil/core 1.27.2 → 1.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/configs.proto CHANGED
@@ -90,6 +90,11 @@ message WorkflowSettings {
90
90
 
91
91
  // Optional. Named environments (dev/staging/prod) selected with `--environment`.
92
92
  map<string, Environment> environments = 19;
93
+
94
+ // Optional. If set to true, governance controls (e.g. Data Policies) will be
95
+ // preserved on BigQuery tables. BigQuery only — no other warehouse has the concept.
96
+ // Upstream #2220 numbers this 18, which sqlanvil already uses for `connections`.
97
+ bool preserve_governance_controls = 20;
93
98
  }
94
99
 
95
100
  // A named environment (dev/staging/prod). Holds only NON-SECRET overrides plus a
@@ -357,6 +362,11 @@ message ActionConfig {
357
362
 
358
363
  // MySQL/MariaDB specific options (engine/charset/collation + indexes).
359
364
  MysqlOptions mysql = 27;
365
+
366
+ // Optional. If true, preserves existing BigQuery column governance controls
367
+ // (e.g. data policy) when recreating a table. Upstream #2220 numbers this 25,
368
+ // already taken here by `postgres`.
369
+ optional bool preserve_governance_controls = 28;
360
370
  }
361
371
 
362
372
  message Metadata {
@@ -470,6 +480,18 @@ message ActionConfig {
470
480
  SYNCHRONIZE = 3;
471
481
  }
472
482
 
483
+ enum IncrementalStrategy {
484
+ // Strategy is unspecified. Defaults to MERGE if uniqueKey is configured,
485
+ // or APPEND otherwise.
486
+ INCREMENTAL_STRATEGY_UNSPECIFIED = 0;
487
+ // MERGE strategy. Matches rows based on uniqueKey to update existing rows
488
+ // or insert new ones.
489
+ INCREMENTAL_STRATEGY_MERGE = 1;
490
+ // INSERT_OVERWRITE strategy. Overwrites entire partitions in the target
491
+ // table that are present in the new staging data.
492
+ INCREMENTAL_STRATEGY_INSERT_OVERWRITE = 2;
493
+ }
494
+
473
495
  message IncrementalTableConfig {
474
496
  // The name of the incremental table.
475
497
  string name = 1;
@@ -580,6 +602,13 @@ message ActionConfig {
580
602
 
581
603
  // MySQL/MariaDB specific options (engine/charset/collation + indexes).
582
604
  MysqlOptions mysql = 30;
605
+
606
+ // Optional. The incremental strategy to use when updating the table.
607
+ // Upstream #2195 numbers these 28/29, already taken here by `postgres`/`supabase`.
608
+ IncrementalStrategy incremental_strategy = 31;
609
+
610
+ // Array of SQL-based predicates for when incremental updates are applied.
611
+ repeated string incremental_predicates = 32;
583
612
  }
584
613
 
585
614
  message AssertionConfig {
package/core.proto CHANGED
@@ -16,8 +16,12 @@ syntax = "proto3";
16
16
 
17
17
  package sqlanvil;
18
18
 
19
+ // Restored after upstream #2104 dropped it: sqlanvil's ProjectConfig.connections is a
20
+ // map<string, ConnectionConfig>, and ConnectionConfig lives in configs.proto. configs.proto
21
+ // does not import core.proto, so this does not reintroduce the cycle #2104 was fixing.
19
22
  import "configs.proto";
20
23
  import "extension.proto";
24
+
21
25
  import "google/protobuf/struct.proto";
22
26
 
23
27
  option java_package = "com.sqlanvil.protos";
@@ -56,9 +60,16 @@ message ProjectConfig {
56
60
 
57
61
  string warehouse_connection = 24;
58
62
 
63
+ // Upstream #2220 assigns this field number 24, which sqlanvil already shipped as
64
+ // warehouse_connection (released in 1.x, and stored inside every compiled graph a Cloud
65
+ // pinned release replays). Renumbering ours would silently misread those; renumbering the
66
+ // incoming field costs only wire-compat with upstream, which is not a thing we have.
67
+ bool preserve_governance_controls = 25;
68
+
59
69
  reserved 3, 4, 6, 8, 10, 12, 13;
60
70
  }
61
71
 
72
+
62
73
  message CompileConfig {
63
74
  // Required.
64
75
  string project_dir = 1;
@@ -69,7 +80,8 @@ message CompileConfig {
69
80
  // Project configuration overrides.
70
81
  ProjectConfig project_config_override = 3;
71
82
 
72
- // Override compilation timeout settings.
83
+ // Override top-level compilation timeout (the single compile worker that
84
+ // runs once per invocation).
73
85
  int32 timeout_millis = 6;
74
86
 
75
87
  Extension extension = 10;
@@ -109,6 +121,8 @@ message BigQueryOptions {
109
121
  TableFormat table_format = 9;
110
122
  FileFormat file_format = 10;
111
123
  string storage_uri = 11;
124
+ repeated string incremental_predicates = 12;
125
+ bool preserve_governance_controls = 13;
112
126
  }
113
127
 
114
128
  message GraphErrors {
@@ -193,6 +207,18 @@ enum OnSchemaChange {
193
207
  SYNCHRONIZE = 3;
194
208
  }
195
209
 
210
+ enum IncrementalStrategy {
211
+ // Strategy is unspecified. Defaults to MERGE if uniqueKey is configured,
212
+ // or APPEND otherwise.
213
+ INCREMENTAL_STRATEGY_UNSPECIFIED = 0;
214
+ // MERGE strategy. Matches rows based on uniqueKey to update existing row
215
+ // or insert new ones.
216
+ MERGE = 1;
217
+ // INSERT_OVERWRITE strategy. Overwrites entire partitions in the target
218
+ // table that are present in the new staging data.
219
+ INSERT_OVERWRITE = 2;
220
+ }
221
+
196
222
  message Table {
197
223
  // For legacy compatability reasons, both incremental tables and views are
198
224
  // configured in compiled graphs via the Table proto.
@@ -229,6 +255,11 @@ message Table {
229
255
 
230
256
  string jit_code = 38;
231
257
 
258
+ // The incremental strategy to use when updating the incremental table.
259
+ // Upstream #2195 assigns 39, which sqlanvil already uses for `postgres` below — same
260
+ // collision and same reasoning as preserve_governance_controls in ProjectConfig.
261
+ IncrementalStrategy incremental_strategy = 42;
262
+
232
263
  // Warehouse specific features.
233
264
  BigQueryOptions bigquery = 22;
234
265
  PostgresOptions postgres = 39;
package/package.json CHANGED
@@ -17,7 +17,9 @@
17
17
  "**/node-fetch": "^2.6.7",
18
18
  "**/markdown-it": "^12.3.2",
19
19
  "**/wrap-ansi": "7.0.0",
20
- "**/string-width": "4.1.0"
20
+ "**/string-width": "4.1.0",
21
+ "**/@eslint-community/eslint-utils": "4.9.1",
22
+ "**/@ungap/structured-clone": "1.3.1"
21
23
  },
22
24
  "homepage": "https://sqlanvil.com",
23
25
  "repository": {
@@ -41,7 +43,7 @@
41
43
  "publishConfig": {
42
44
  "access": "public"
43
45
  },
44
- "version": "1.27.2",
46
+ "version": "1.29.0",
45
47
  "name": "@sqlanvil/core",
46
48
  "description": "sqlanvil core API.",
47
49
  "main": "bundle.js"