@sqlanvil/cli 1.28.0 → 1.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.
Files changed (3) hide show
  1. package/bundle.js +497 -28
  2. package/package.json +4 -2
  3. package/worker_bundle.js +356 -1
package/bundle.js CHANGED
@@ -151,6 +151,7 @@ const sqlanvil = $root.sqlanvil = (() => {
151
151
  * @property {string|null} [warehouse] WorkflowSettings warehouse
152
152
  * @property {Object.<string,sqlanvil.IConnectionConfig>|null} [connections] WorkflowSettings connections
153
153
  * @property {Object.<string,sqlanvil.IEnvironment>|null} [environments] WorkflowSettings environments
154
+ * @property {boolean|null} [preserveGovernanceControls] WorkflowSettings preserveGovernanceControls
154
155
  */
155
156
 
156
157
  /**
@@ -323,6 +324,14 @@ const sqlanvil = $root.sqlanvil = (() => {
323
324
  */
324
325
  WorkflowSettings.prototype.environments = $util.emptyObject;
325
326
 
327
+ /**
328
+ * WorkflowSettings preserveGovernanceControls.
329
+ * @member {boolean} preserveGovernanceControls
330
+ * @memberof sqlanvil.WorkflowSettings
331
+ * @instance
332
+ */
333
+ WorkflowSettings.prototype.preserveGovernanceControls = false;
334
+
326
335
  /**
327
336
  * Creates a new WorkflowSettings instance using the specified properties.
328
337
  * @function create
@@ -396,6 +405,8 @@ const sqlanvil = $root.sqlanvil = (() => {
396
405
  writer.uint32(/* id 19, wireType 2 =*/154).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]);
397
406
  $root.sqlanvil.Environment.encode(message.environments[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim().ldelim();
398
407
  }
408
+ if (message.preserveGovernanceControls != null && Object.hasOwnProperty.call(message, "preserveGovernanceControls"))
409
+ writer.uint32(/* id 20, wireType 0 =*/160).bool(message.preserveGovernanceControls);
399
410
  return writer;
400
411
  };
401
412
 
@@ -575,6 +586,10 @@ const sqlanvil = $root.sqlanvil = (() => {
575
586
  message.environments[key] = value;
576
587
  break;
577
588
  }
589
+ case 20: {
590
+ message.preserveGovernanceControls = reader.bool();
591
+ break;
592
+ }
578
593
  default:
579
594
  reader.skipType(tag & 7, long);
580
595
  break;
@@ -696,6 +711,9 @@ const sqlanvil = $root.sqlanvil = (() => {
696
711
  return "environments." + error;
697
712
  }
698
713
  }
714
+ if (message.preserveGovernanceControls != null && Object.hasOwnProperty.call(message, "preserveGovernanceControls"))
715
+ if (typeof message.preserveGovernanceControls !== "boolean")
716
+ return "preserveGovernanceControls: boolean expected";
699
717
  return null;
700
718
  };
701
719
 
@@ -792,6 +810,8 @@ const sqlanvil = $root.sqlanvil = (() => {
792
810
  message.environments[keys[i]] = $root.sqlanvil.Environment.fromObject(object.environments[keys[i]], long + 1);
793
811
  }
794
812
  }
813
+ if (object.preserveGovernanceControls != null)
814
+ message.preserveGovernanceControls = Boolean(object.preserveGovernanceControls);
795
815
  return message;
796
816
  };
797
817
 
@@ -834,6 +854,7 @@ const sqlanvil = $root.sqlanvil = (() => {
834
854
  object.extension = null;
835
855
  object.includeTestsInCompiledGraph = false;
836
856
  object.warehouse = "";
857
+ object.preserveGovernanceControls = false;
837
858
  }
838
859
  if (message.sqlanvilCoreVersion != null && Object.hasOwnProperty.call(message, "sqlanvilCoreVersion"))
839
860
  object.sqlanvilCoreVersion = message.sqlanvilCoreVersion;
@@ -892,6 +913,8 @@ const sqlanvil = $root.sqlanvil = (() => {
892
913
  object.environments[keys2[j]] = $root.sqlanvil.Environment.toObject(message.environments[keys2[j]], options, q + 1);
893
914
  }
894
915
  }
916
+ if (message.preserveGovernanceControls != null && Object.hasOwnProperty.call(message, "preserveGovernanceControls"))
917
+ object.preserveGovernanceControls = message.preserveGovernanceControls;
895
918
  return object;
896
919
  };
897
920
 
@@ -4643,6 +4666,7 @@ const sqlanvil = $root.sqlanvil = (() => {
4643
4666
  * @property {sqlanvil.IPostgresOptions|null} [postgres] TableConfig postgres
4644
4667
  * @property {sqlanvil.ISupabaseOptions|null} [supabase] TableConfig supabase
4645
4668
  * @property {sqlanvil.IMysqlOptions|null} [mysql] TableConfig mysql
4669
+ * @property {boolean|null} [preserveGovernanceControls] TableConfig preserveGovernanceControls
4646
4670
  */
4647
4671
 
4648
4672
  /**
@@ -4876,6 +4900,23 @@ const sqlanvil = $root.sqlanvil = (() => {
4876
4900
  */
4877
4901
  TableConfig.prototype.mysql = null;
4878
4902
 
4903
+ /**
4904
+ * TableConfig preserveGovernanceControls.
4905
+ * @member {boolean|null|undefined} preserveGovernanceControls
4906
+ * @memberof sqlanvil.ActionConfig.TableConfig
4907
+ * @instance
4908
+ */
4909
+ TableConfig.prototype.preserveGovernanceControls = null;
4910
+
4911
+ // OneOf field names bound to virtual getters and setters
4912
+ let $oneOfFields;
4913
+
4914
+ // Virtual OneOf for proto3 optional field
4915
+ Object.defineProperty(TableConfig.prototype, "_preserveGovernanceControls", {
4916
+ get: $util.oneOfGetter($oneOfFields = ["preserveGovernanceControls"]),
4917
+ set: $util.oneOfSetter($oneOfFields)
4918
+ });
4919
+
4879
4920
  /**
4880
4921
  * Creates a new TableConfig instance using the specified properties.
4881
4922
  * @function create
@@ -4964,6 +5005,8 @@ const sqlanvil = $root.sqlanvil = (() => {
4964
5005
  $root.sqlanvil.SupabaseOptions.encode(message.supabase, writer.uint32(/* id 26, wireType 2 =*/210).fork(), q + 1).ldelim();
4965
5006
  if (message.mysql != null && Object.hasOwnProperty.call(message, "mysql"))
4966
5007
  $root.sqlanvil.MysqlOptions.encode(message.mysql, writer.uint32(/* id 27, wireType 2 =*/218).fork(), q + 1).ldelim();
5008
+ if (message.preserveGovernanceControls != null && Object.hasOwnProperty.call(message, "preserveGovernanceControls"))
5009
+ writer.uint32(/* id 28, wireType 0 =*/224).bool(message.preserveGovernanceControls);
4967
5010
  return writer;
4968
5011
  };
4969
5012
 
@@ -5162,6 +5205,10 @@ const sqlanvil = $root.sqlanvil = (() => {
5162
5205
  message.mysql = $root.sqlanvil.MysqlOptions.decode(reader, reader.uint32(), undefined, long + 1);
5163
5206
  break;
5164
5207
  }
5208
+ case 28: {
5209
+ message.preserveGovernanceControls = reader.bool();
5210
+ break;
5211
+ }
5165
5212
  default:
5166
5213
  reader.skipType(tag & 7, long);
5167
5214
  break;
@@ -5329,6 +5376,10 @@ const sqlanvil = $root.sqlanvil = (() => {
5329
5376
  if (error)
5330
5377
  return "mysql." + error;
5331
5378
  }
5379
+ if (message.preserveGovernanceControls != null && Object.hasOwnProperty.call(message, "preserveGovernanceControls")) {
5380
+ if (typeof message.preserveGovernanceControls !== "boolean")
5381
+ return "preserveGovernanceControls: boolean expected";
5382
+ }
5332
5383
  return null;
5333
5384
  };
5334
5385
 
@@ -5472,6 +5523,8 @@ const sqlanvil = $root.sqlanvil = (() => {
5472
5523
  throw TypeError(".sqlanvil.ActionConfig.TableConfig.mysql: object expected");
5473
5524
  message.mysql = $root.sqlanvil.MysqlOptions.fromObject(object.mysql, long + 1);
5474
5525
  }
5526
+ if (object.preserveGovernanceControls != null)
5527
+ message.preserveGovernanceControls = Boolean(object.preserveGovernanceControls);
5475
5528
  return message;
5476
5529
  };
5477
5530
 
@@ -5607,6 +5660,11 @@ const sqlanvil = $root.sqlanvil = (() => {
5607
5660
  object.supabase = $root.sqlanvil.SupabaseOptions.toObject(message.supabase, options, q + 1);
5608
5661
  if (message.mysql != null && Object.hasOwnProperty.call(message, "mysql"))
5609
5662
  object.mysql = $root.sqlanvil.MysqlOptions.toObject(message.mysql, options, q + 1);
5663
+ if (message.preserveGovernanceControls != null && Object.hasOwnProperty.call(message, "preserveGovernanceControls")) {
5664
+ object.preserveGovernanceControls = message.preserveGovernanceControls;
5665
+ if (options.oneofs)
5666
+ object._preserveGovernanceControls = "preserveGovernanceControls";
5667
+ }
5610
5668
  return object;
5611
5669
  };
5612
5670
 
@@ -6862,6 +6920,22 @@ const sqlanvil = $root.sqlanvil = (() => {
6862
6920
  return values;
6863
6921
  })();
6864
6922
 
6923
+ /**
6924
+ * IncrementalStrategy enum.
6925
+ * @name sqlanvil.ActionConfig.IncrementalStrategy
6926
+ * @enum {number}
6927
+ * @property {number} INCREMENTAL_STRATEGY_UNSPECIFIED=0 INCREMENTAL_STRATEGY_UNSPECIFIED value
6928
+ * @property {number} INCREMENTAL_STRATEGY_MERGE=1 INCREMENTAL_STRATEGY_MERGE value
6929
+ * @property {number} INCREMENTAL_STRATEGY_INSERT_OVERWRITE=2 INCREMENTAL_STRATEGY_INSERT_OVERWRITE value
6930
+ */
6931
+ ActionConfig.IncrementalStrategy = (function() {
6932
+ const valuesById = {}, values = Object.create(valuesById);
6933
+ values[valuesById[0] = "INCREMENTAL_STRATEGY_UNSPECIFIED"] = 0;
6934
+ values[valuesById[1] = "INCREMENTAL_STRATEGY_MERGE"] = 1;
6935
+ values[valuesById[2] = "INCREMENTAL_STRATEGY_INSERT_OVERWRITE"] = 2;
6936
+ return values;
6937
+ })();
6938
+
6865
6939
  ActionConfig.IncrementalTableConfig = (function() {
6866
6940
 
6867
6941
  /**
@@ -6898,6 +6972,8 @@ const sqlanvil = $root.sqlanvil = (() => {
6898
6972
  * @property {sqlanvil.IPostgresOptions|null} [postgres] IncrementalTableConfig postgres
6899
6973
  * @property {sqlanvil.ISupabaseOptions|null} [supabase] IncrementalTableConfig supabase
6900
6974
  * @property {sqlanvil.IMysqlOptions|null} [mysql] IncrementalTableConfig mysql
6975
+ * @property {sqlanvil.ActionConfig.IncrementalStrategy|null} [incrementalStrategy] IncrementalTableConfig incrementalStrategy
6976
+ * @property {Array.<string>|null} [incrementalPredicates] IncrementalTableConfig incrementalPredicates
6901
6977
  */
6902
6978
 
6903
6979
  /**
@@ -6918,6 +6994,7 @@ const sqlanvil = $root.sqlanvil = (() => {
6918
6994
  this.clusterBy = [];
6919
6995
  this.labels = {};
6920
6996
  this.additionalOptions = {};
6997
+ this.incrementalPredicates = [];
6921
6998
  if (properties)
6922
6999
  for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
6923
7000
  if (properties[keys[i]] != null && keys[i] !== "__proto__")
@@ -7164,6 +7241,22 @@ const sqlanvil = $root.sqlanvil = (() => {
7164
7241
  */
7165
7242
  IncrementalTableConfig.prototype.mysql = null;
7166
7243
 
7244
+ /**
7245
+ * IncrementalTableConfig incrementalStrategy.
7246
+ * @member {sqlanvil.ActionConfig.IncrementalStrategy} incrementalStrategy
7247
+ * @memberof sqlanvil.ActionConfig.IncrementalTableConfig
7248
+ * @instance
7249
+ */
7250
+ IncrementalTableConfig.prototype.incrementalStrategy = 0;
7251
+
7252
+ /**
7253
+ * IncrementalTableConfig incrementalPredicates.
7254
+ * @member {Array.<string>} incrementalPredicates
7255
+ * @memberof sqlanvil.ActionConfig.IncrementalTableConfig
7256
+ * @instance
7257
+ */
7258
+ IncrementalTableConfig.prototype.incrementalPredicates = $util.emptyArray;
7259
+
7167
7260
  /**
7168
7261
  * Creates a new IncrementalTableConfig instance using the specified properties.
7169
7262
  * @function create
@@ -7261,6 +7354,11 @@ const sqlanvil = $root.sqlanvil = (() => {
7261
7354
  $root.sqlanvil.SupabaseOptions.encode(message.supabase, writer.uint32(/* id 29, wireType 2 =*/234).fork(), q + 1).ldelim();
7262
7355
  if (message.mysql != null && Object.hasOwnProperty.call(message, "mysql"))
7263
7356
  $root.sqlanvil.MysqlOptions.encode(message.mysql, writer.uint32(/* id 30, wireType 2 =*/242).fork(), q + 1).ldelim();
7357
+ if (message.incrementalStrategy != null && Object.hasOwnProperty.call(message, "incrementalStrategy"))
7358
+ writer.uint32(/* id 31, wireType 0 =*/248).int32(message.incrementalStrategy);
7359
+ if (message.incrementalPredicates != null && message.incrementalPredicates.length)
7360
+ for (let i = 0; i < message.incrementalPredicates.length; ++i)
7361
+ writer.uint32(/* id 32, wireType 2 =*/258).string(message.incrementalPredicates[i]);
7264
7362
  return writer;
7265
7363
  };
7266
7364
 
@@ -7477,6 +7575,16 @@ const sqlanvil = $root.sqlanvil = (() => {
7477
7575
  message.mysql = $root.sqlanvil.MysqlOptions.decode(reader, reader.uint32(), undefined, long + 1);
7478
7576
  break;
7479
7577
  }
7578
+ case 31: {
7579
+ message.incrementalStrategy = reader.int32();
7580
+ break;
7581
+ }
7582
+ case 32: {
7583
+ if (!(message.incrementalPredicates && message.incrementalPredicates.length))
7584
+ message.incrementalPredicates = [];
7585
+ message.incrementalPredicates.push(reader.string());
7586
+ break;
7587
+ }
7480
7588
  default:
7481
7589
  reader.skipType(tag & 7, long);
7482
7590
  break;
@@ -7667,6 +7775,22 @@ const sqlanvil = $root.sqlanvil = (() => {
7667
7775
  if (error)
7668
7776
  return "mysql." + error;
7669
7777
  }
7778
+ if (message.incrementalStrategy != null && Object.hasOwnProperty.call(message, "incrementalStrategy"))
7779
+ switch (message.incrementalStrategy) {
7780
+ default:
7781
+ return "incrementalStrategy: enum value expected";
7782
+ case 0:
7783
+ case 1:
7784
+ case 2:
7785
+ break;
7786
+ }
7787
+ if (message.incrementalPredicates != null && Object.hasOwnProperty.call(message, "incrementalPredicates")) {
7788
+ if (!Array.isArray(message.incrementalPredicates))
7789
+ return "incrementalPredicates: array expected";
7790
+ for (let i = 0; i < message.incrementalPredicates.length; ++i)
7791
+ if (!$util.isString(message.incrementalPredicates[i]))
7792
+ return "incrementalPredicates: string[] expected";
7793
+ }
7670
7794
  return null;
7671
7795
  };
7672
7796
 
@@ -7845,6 +7969,33 @@ const sqlanvil = $root.sqlanvil = (() => {
7845
7969
  throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.mysql: object expected");
7846
7970
  message.mysql = $root.sqlanvil.MysqlOptions.fromObject(object.mysql, long + 1);
7847
7971
  }
7972
+ switch (object.incrementalStrategy) {
7973
+ default:
7974
+ if (typeof object.incrementalStrategy === "number") {
7975
+ message.incrementalStrategy = object.incrementalStrategy;
7976
+ break;
7977
+ }
7978
+ break;
7979
+ case "INCREMENTAL_STRATEGY_UNSPECIFIED":
7980
+ case 0:
7981
+ message.incrementalStrategy = 0;
7982
+ break;
7983
+ case "INCREMENTAL_STRATEGY_MERGE":
7984
+ case 1:
7985
+ message.incrementalStrategy = 1;
7986
+ break;
7987
+ case "INCREMENTAL_STRATEGY_INSERT_OVERWRITE":
7988
+ case 2:
7989
+ message.incrementalStrategy = 2;
7990
+ break;
7991
+ }
7992
+ if (object.incrementalPredicates) {
7993
+ if (!Array.isArray(object.incrementalPredicates))
7994
+ throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.incrementalPredicates: array expected");
7995
+ message.incrementalPredicates = [];
7996
+ for (let i = 0; i < object.incrementalPredicates.length; ++i)
7997
+ message.incrementalPredicates[i] = String(object.incrementalPredicates[i]);
7998
+ }
7848
7999
  return message;
7849
8000
  };
7850
8001
 
@@ -7873,6 +8024,7 @@ const sqlanvil = $root.sqlanvil = (() => {
7873
8024
  object.uniqueKey = [];
7874
8025
  object.columns = [];
7875
8026
  object.clusterBy = [];
8027
+ object.incrementalPredicates = [];
7876
8028
  }
7877
8029
  if (options.objects || options.defaults) {
7878
8030
  object.labels = {};
@@ -7900,6 +8052,7 @@ const sqlanvil = $root.sqlanvil = (() => {
7900
8052
  object.postgres = null;
7901
8053
  object.supabase = null;
7902
8054
  object.mysql = null;
8055
+ object.incrementalStrategy = options.enums === String ? "INCREMENTAL_STRATEGY_UNSPECIFIED" : 0;
7903
8056
  }
7904
8057
  if (message.name != null && Object.hasOwnProperty.call(message, "name"))
7905
8058
  object.name = message.name;
@@ -7995,6 +8148,13 @@ const sqlanvil = $root.sqlanvil = (() => {
7995
8148
  object.supabase = $root.sqlanvil.SupabaseOptions.toObject(message.supabase, options, q + 1);
7996
8149
  if (message.mysql != null && Object.hasOwnProperty.call(message, "mysql"))
7997
8150
  object.mysql = $root.sqlanvil.MysqlOptions.toObject(message.mysql, options, q + 1);
8151
+ if (message.incrementalStrategy != null && Object.hasOwnProperty.call(message, "incrementalStrategy"))
8152
+ object.incrementalStrategy = options.enums === String ? $root.sqlanvil.ActionConfig.IncrementalStrategy[message.incrementalStrategy] === undefined ? message.incrementalStrategy : $root.sqlanvil.ActionConfig.IncrementalStrategy[message.incrementalStrategy] : message.incrementalStrategy;
8153
+ if (message.incrementalPredicates && message.incrementalPredicates.length) {
8154
+ object.incrementalPredicates = [];
8155
+ for (let j = 0; j < message.incrementalPredicates.length; ++j)
8156
+ object.incrementalPredicates[j] = message.incrementalPredicates[j];
8157
+ }
7998
8158
  return object;
7999
8159
  };
8000
8160
 
@@ -21165,6 +21325,7 @@ const sqlanvil = $root.sqlanvil = (() => {
21165
21325
  * @property {boolean|null} [includeTestsInCompiledGraph] ProjectConfig includeTestsInCompiledGraph
21166
21326
  * @property {Object.<string,sqlanvil.IConnectionConfig>|null} [connections] ProjectConfig connections
21167
21327
  * @property {string|null} [warehouseConnection] ProjectConfig warehouseConnection
21328
+ * @property {boolean|null} [preserveGovernanceControls] ProjectConfig preserveGovernanceControls
21168
21329
  */
21169
21330
 
21170
21331
  /**
@@ -21320,6 +21481,14 @@ const sqlanvil = $root.sqlanvil = (() => {
21320
21481
  */
21321
21482
  ProjectConfig.prototype.warehouseConnection = "";
21322
21483
 
21484
+ /**
21485
+ * ProjectConfig preserveGovernanceControls.
21486
+ * @member {boolean} preserveGovernanceControls
21487
+ * @memberof sqlanvil.ProjectConfig
21488
+ * @instance
21489
+ */
21490
+ ProjectConfig.prototype.preserveGovernanceControls = false;
21491
+
21323
21492
  /**
21324
21493
  * Creates a new ProjectConfig instance using the specified properties.
21325
21494
  * @function create
@@ -21386,6 +21555,8 @@ const sqlanvil = $root.sqlanvil = (() => {
21386
21555
  }
21387
21556
  if (message.warehouseConnection != null && Object.hasOwnProperty.call(message, "warehouseConnection"))
21388
21557
  writer.uint32(/* id 24, wireType 2 =*/194).string(message.warehouseConnection);
21558
+ if (message.preserveGovernanceControls != null && Object.hasOwnProperty.call(message, "preserveGovernanceControls"))
21559
+ writer.uint32(/* id 25, wireType 0 =*/200).bool(message.preserveGovernanceControls);
21389
21560
  return writer;
21390
21561
  };
21391
21562
 
@@ -21536,6 +21707,10 @@ const sqlanvil = $root.sqlanvil = (() => {
21536
21707
  message.warehouseConnection = reader.string();
21537
21708
  break;
21538
21709
  }
21710
+ case 25: {
21711
+ message.preserveGovernanceControls = reader.bool();
21712
+ break;
21713
+ }
21539
21714
  default:
21540
21715
  reader.skipType(tag & 7, long);
21541
21716
  break;
@@ -21642,6 +21817,9 @@ const sqlanvil = $root.sqlanvil = (() => {
21642
21817
  if (message.warehouseConnection != null && Object.hasOwnProperty.call(message, "warehouseConnection"))
21643
21818
  if (!$util.isString(message.warehouseConnection))
21644
21819
  return "warehouseConnection: string expected";
21820
+ if (message.preserveGovernanceControls != null && Object.hasOwnProperty.call(message, "preserveGovernanceControls"))
21821
+ if (typeof message.preserveGovernanceControls !== "boolean")
21822
+ return "preserveGovernanceControls: boolean expected";
21645
21823
  return null;
21646
21824
  };
21647
21825
 
@@ -21721,6 +21899,8 @@ const sqlanvil = $root.sqlanvil = (() => {
21721
21899
  }
21722
21900
  if (object.warehouseConnection != null)
21723
21901
  message.warehouseConnection = String(object.warehouseConnection);
21902
+ if (object.preserveGovernanceControls != null)
21903
+ message.preserveGovernanceControls = Boolean(object.preserveGovernanceControls);
21724
21904
  return message;
21725
21905
  };
21726
21906
 
@@ -21761,6 +21941,7 @@ const sqlanvil = $root.sqlanvil = (() => {
21761
21941
  object.defaultReservation = "";
21762
21942
  object.includeTestsInCompiledGraph = false;
21763
21943
  object.warehouseConnection = "";
21944
+ object.preserveGovernanceControls = false;
21764
21945
  }
21765
21946
  if (message.warehouse != null && Object.hasOwnProperty.call(message, "warehouse"))
21766
21947
  object.warehouse = message.warehouse;
@@ -21809,6 +21990,8 @@ const sqlanvil = $root.sqlanvil = (() => {
21809
21990
  }
21810
21991
  if (message.warehouseConnection != null && Object.hasOwnProperty.call(message, "warehouseConnection"))
21811
21992
  object.warehouseConnection = message.warehouseConnection;
21993
+ if (message.preserveGovernanceControls != null && Object.hasOwnProperty.call(message, "preserveGovernanceControls"))
21994
+ object.preserveGovernanceControls = message.preserveGovernanceControls;
21812
21995
  return object;
21813
21996
  };
21814
21997
 
@@ -22553,6 +22736,8 @@ const sqlanvil = $root.sqlanvil = (() => {
22553
22736
  * @property {sqlanvil.TableFormat|null} [tableFormat] BigQueryOptions tableFormat
22554
22737
  * @property {sqlanvil.FileFormat|null} [fileFormat] BigQueryOptions fileFormat
22555
22738
  * @property {string|null} [storageUri] BigQueryOptions storageUri
22739
+ * @property {Array.<string>|null} [incrementalPredicates] BigQueryOptions incrementalPredicates
22740
+ * @property {boolean|null} [preserveGovernanceControls] BigQueryOptions preserveGovernanceControls
22556
22741
  */
22557
22742
 
22558
22743
  /**
@@ -22567,6 +22752,7 @@ const sqlanvil = $root.sqlanvil = (() => {
22567
22752
  this.clusterBy = [];
22568
22753
  this.labels = {};
22569
22754
  this.additionalOptions = {};
22755
+ this.incrementalPredicates = [];
22570
22756
  if (properties)
22571
22757
  for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
22572
22758
  if (properties[keys[i]] != null && keys[i] !== "__proto__")
@@ -22661,6 +22847,22 @@ const sqlanvil = $root.sqlanvil = (() => {
22661
22847
  */
22662
22848
  BigQueryOptions.prototype.storageUri = "";
22663
22849
 
22850
+ /**
22851
+ * BigQueryOptions incrementalPredicates.
22852
+ * @member {Array.<string>} incrementalPredicates
22853
+ * @memberof sqlanvil.BigQueryOptions
22854
+ * @instance
22855
+ */
22856
+ BigQueryOptions.prototype.incrementalPredicates = $util.emptyArray;
22857
+
22858
+ /**
22859
+ * BigQueryOptions preserveGovernanceControls.
22860
+ * @member {boolean} preserveGovernanceControls
22861
+ * @memberof sqlanvil.BigQueryOptions
22862
+ * @instance
22863
+ */
22864
+ BigQueryOptions.prototype.preserveGovernanceControls = false;
22865
+
22664
22866
  /**
22665
22867
  * Creates a new BigQueryOptions instance using the specified properties.
22666
22868
  * @function create
@@ -22714,6 +22916,11 @@ const sqlanvil = $root.sqlanvil = (() => {
22714
22916
  writer.uint32(/* id 10, wireType 0 =*/80).int32(message.fileFormat);
22715
22917
  if (message.storageUri != null && Object.hasOwnProperty.call(message, "storageUri"))
22716
22918
  writer.uint32(/* id 11, wireType 2 =*/90).string(message.storageUri);
22919
+ if (message.incrementalPredicates != null && message.incrementalPredicates.length)
22920
+ for (let i = 0; i < message.incrementalPredicates.length; ++i)
22921
+ writer.uint32(/* id 12, wireType 2 =*/98).string(message.incrementalPredicates[i]);
22922
+ if (message.preserveGovernanceControls != null && Object.hasOwnProperty.call(message, "preserveGovernanceControls"))
22923
+ writer.uint32(/* id 13, wireType 0 =*/104).bool(message.preserveGovernanceControls);
22717
22924
  return writer;
22718
22925
  };
22719
22926
 
@@ -22842,6 +23049,16 @@ const sqlanvil = $root.sqlanvil = (() => {
22842
23049
  message.storageUri = reader.string();
22843
23050
  break;
22844
23051
  }
23052
+ case 12: {
23053
+ if (!(message.incrementalPredicates && message.incrementalPredicates.length))
23054
+ message.incrementalPredicates = [];
23055
+ message.incrementalPredicates.push(reader.string());
23056
+ break;
23057
+ }
23058
+ case 13: {
23059
+ message.preserveGovernanceControls = reader.bool();
23060
+ break;
23061
+ }
22845
23062
  default:
22846
23063
  reader.skipType(tag & 7, long);
22847
23064
  break;
@@ -22938,6 +23155,16 @@ const sqlanvil = $root.sqlanvil = (() => {
22938
23155
  if (message.storageUri != null && Object.hasOwnProperty.call(message, "storageUri"))
22939
23156
  if (!$util.isString(message.storageUri))
22940
23157
  return "storageUri: string expected";
23158
+ if (message.incrementalPredicates != null && Object.hasOwnProperty.call(message, "incrementalPredicates")) {
23159
+ if (!Array.isArray(message.incrementalPredicates))
23160
+ return "incrementalPredicates: array expected";
23161
+ for (let i = 0; i < message.incrementalPredicates.length; ++i)
23162
+ if (!$util.isString(message.incrementalPredicates[i]))
23163
+ return "incrementalPredicates: string[] expected";
23164
+ }
23165
+ if (message.preserveGovernanceControls != null && Object.hasOwnProperty.call(message, "preserveGovernanceControls"))
23166
+ if (typeof message.preserveGovernanceControls !== "boolean")
23167
+ return "preserveGovernanceControls: boolean expected";
22941
23168
  return null;
22942
23169
  };
22943
23170
 
@@ -23030,6 +23257,15 @@ const sqlanvil = $root.sqlanvil = (() => {
23030
23257
  }
23031
23258
  if (object.storageUri != null)
23032
23259
  message.storageUri = String(object.storageUri);
23260
+ if (object.incrementalPredicates) {
23261
+ if (!Array.isArray(object.incrementalPredicates))
23262
+ throw TypeError(".sqlanvil.BigQueryOptions.incrementalPredicates: array expected");
23263
+ message.incrementalPredicates = [];
23264
+ for (let i = 0; i < object.incrementalPredicates.length; ++i)
23265
+ message.incrementalPredicates[i] = String(object.incrementalPredicates[i]);
23266
+ }
23267
+ if (object.preserveGovernanceControls != null)
23268
+ message.preserveGovernanceControls = Boolean(object.preserveGovernanceControls);
23033
23269
  return message;
23034
23270
  };
23035
23271
 
@@ -23050,8 +23286,10 @@ const sqlanvil = $root.sqlanvil = (() => {
23050
23286
  if (q > $util.recursionLimit)
23051
23287
  throw Error("max depth exceeded");
23052
23288
  let object = {};
23053
- if (options.arrays || options.defaults)
23289
+ if (options.arrays || options.defaults) {
23054
23290
  object.clusterBy = [];
23291
+ object.incrementalPredicates = [];
23292
+ }
23055
23293
  if (options.objects || options.defaults) {
23056
23294
  object.labels = {};
23057
23295
  object.additionalOptions = {};
@@ -23065,6 +23303,7 @@ const sqlanvil = $root.sqlanvil = (() => {
23065
23303
  object.tableFormat = options.enums === String ? "TABLE_FORMAT_UNSPECIFIED" : 0;
23066
23304
  object.fileFormat = options.enums === String ? "FILE_FORMAT_UNSPECIFIED" : 0;
23067
23305
  object.storageUri = "";
23306
+ object.preserveGovernanceControls = false;
23068
23307
  }
23069
23308
  if (message.partitionBy != null && Object.hasOwnProperty.call(message, "partitionBy"))
23070
23309
  object.partitionBy = message.partitionBy;
@@ -23104,6 +23343,13 @@ const sqlanvil = $root.sqlanvil = (() => {
23104
23343
  object.fileFormat = options.enums === String ? $root.sqlanvil.FileFormat[message.fileFormat] === undefined ? message.fileFormat : $root.sqlanvil.FileFormat[message.fileFormat] : message.fileFormat;
23105
23344
  if (message.storageUri != null && Object.hasOwnProperty.call(message, "storageUri"))
23106
23345
  object.storageUri = message.storageUri;
23346
+ if (message.incrementalPredicates && message.incrementalPredicates.length) {
23347
+ object.incrementalPredicates = [];
23348
+ for (let j = 0; j < message.incrementalPredicates.length; ++j)
23349
+ object.incrementalPredicates[j] = message.incrementalPredicates[j];
23350
+ }
23351
+ if (message.preserveGovernanceControls != null && Object.hasOwnProperty.call(message, "preserveGovernanceControls"))
23352
+ object.preserveGovernanceControls = message.preserveGovernanceControls;
23107
23353
  return object;
23108
23354
  };
23109
23355
 
@@ -24825,6 +25071,22 @@ const sqlanvil = $root.sqlanvil = (() => {
24825
25071
  return values;
24826
25072
  })();
24827
25073
 
25074
+ /**
25075
+ * IncrementalStrategy enum.
25076
+ * @name sqlanvil.IncrementalStrategy
25077
+ * @enum {number}
25078
+ * @property {number} INCREMENTAL_STRATEGY_UNSPECIFIED=0 INCREMENTAL_STRATEGY_UNSPECIFIED value
25079
+ * @property {number} MERGE=1 MERGE value
25080
+ * @property {number} INSERT_OVERWRITE=2 INSERT_OVERWRITE value
25081
+ */
25082
+ sqlanvil.IncrementalStrategy = (function() {
25083
+ const valuesById = {}, values = Object.create(valuesById);
25084
+ values[valuesById[0] = "INCREMENTAL_STRATEGY_UNSPECIFIED"] = 0;
25085
+ values[valuesById[1] = "MERGE"] = 1;
25086
+ values[valuesById[2] = "INSERT_OVERWRITE"] = 2;
25087
+ return values;
25088
+ })();
25089
+
24828
25090
  sqlanvil.Table = (function() {
24829
25091
 
24830
25092
  /**
@@ -24852,6 +25114,7 @@ const sqlanvil = $root.sqlanvil = (() => {
24852
25114
  * @property {Array.<string>|null} [incrementalPreOps] Table incrementalPreOps
24853
25115
  * @property {Array.<string>|null} [incrementalPostOps] Table incrementalPostOps
24854
25116
  * @property {string|null} [jitCode] Table jitCode
25117
+ * @property {sqlanvil.IncrementalStrategy|null} [incrementalStrategy] Table incrementalStrategy
24855
25118
  * @property {sqlanvil.IBigQueryOptions|null} [bigquery] Table bigquery
24856
25119
  * @property {sqlanvil.IPostgresOptions|null} [postgres] Table postgres
24857
25120
  * @property {sqlanvil.ISupabaseOptions|null} [supabase] Table supabase
@@ -25049,6 +25312,14 @@ const sqlanvil = $root.sqlanvil = (() => {
25049
25312
  */
25050
25313
  Table.prototype.jitCode = "";
25051
25314
 
25315
+ /**
25316
+ * Table incrementalStrategy.
25317
+ * @member {sqlanvil.IncrementalStrategy} incrementalStrategy
25318
+ * @memberof sqlanvil.Table
25319
+ * @instance
25320
+ */
25321
+ Table.prototype.incrementalStrategy = 0;
25322
+
25052
25323
  /**
25053
25324
  * Table bigquery.
25054
25325
  * @member {sqlanvil.IBigQueryOptions|null|undefined} bigquery
@@ -25176,6 +25447,8 @@ const sqlanvil = $root.sqlanvil = (() => {
25176
25447
  $root.sqlanvil.SupabaseOptions.encode(message.supabase, writer.uint32(/* id 40, wireType 2 =*/322).fork(), q + 1).ldelim();
25177
25448
  if (message.mysql != null && Object.hasOwnProperty.call(message, "mysql"))
25178
25449
  $root.sqlanvil.MysqlOptions.encode(message.mysql, writer.uint32(/* id 41, wireType 2 =*/330).fork(), q + 1).ldelim();
25450
+ if (message.incrementalStrategy != null && Object.hasOwnProperty.call(message, "incrementalStrategy"))
25451
+ writer.uint32(/* id 42, wireType 0 =*/336).int32(message.incrementalStrategy);
25179
25452
  return writer;
25180
25453
  };
25181
25454
 
@@ -25314,6 +25587,10 @@ const sqlanvil = $root.sqlanvil = (() => {
25314
25587
  message.jitCode = reader.string();
25315
25588
  break;
25316
25589
  }
25590
+ case 42: {
25591
+ message.incrementalStrategy = reader.int32();
25592
+ break;
25593
+ }
25317
25594
  case 22: {
25318
25595
  message.bigquery = $root.sqlanvil.BigQueryOptions.decode(reader, reader.uint32(), undefined, long + 1);
25319
25596
  break;
@@ -25492,6 +25769,15 @@ const sqlanvil = $root.sqlanvil = (() => {
25492
25769
  if (message.jitCode != null && Object.hasOwnProperty.call(message, "jitCode"))
25493
25770
  if (!$util.isString(message.jitCode))
25494
25771
  return "jitCode: string expected";
25772
+ if (message.incrementalStrategy != null && Object.hasOwnProperty.call(message, "incrementalStrategy"))
25773
+ switch (message.incrementalStrategy) {
25774
+ default:
25775
+ return "incrementalStrategy: enum value expected";
25776
+ case 0:
25777
+ case 1:
25778
+ case 2:
25779
+ break;
25780
+ }
25495
25781
  if (message.bigquery != null && Object.hasOwnProperty.call(message, "bigquery")) {
25496
25782
  let error = $root.sqlanvil.BigQueryOptions.verify(message.bigquery, long + 1);
25497
25783
  if (error)
@@ -25687,6 +25973,26 @@ const sqlanvil = $root.sqlanvil = (() => {
25687
25973
  }
25688
25974
  if (object.jitCode != null)
25689
25975
  message.jitCode = String(object.jitCode);
25976
+ switch (object.incrementalStrategy) {
25977
+ default:
25978
+ if (typeof object.incrementalStrategy === "number") {
25979
+ message.incrementalStrategy = object.incrementalStrategy;
25980
+ break;
25981
+ }
25982
+ break;
25983
+ case "INCREMENTAL_STRATEGY_UNSPECIFIED":
25984
+ case 0:
25985
+ message.incrementalStrategy = 0;
25986
+ break;
25987
+ case "MERGE":
25988
+ case 1:
25989
+ message.incrementalStrategy = 1;
25990
+ break;
25991
+ case "INSERT_OVERWRITE":
25992
+ case 2:
25993
+ message.incrementalStrategy = 2;
25994
+ break;
25995
+ }
25690
25996
  if (object.bigquery != null) {
25691
25997
  if (!$util.isObject(object.bigquery))
25692
25998
  throw TypeError(".sqlanvil.Table.bigquery: object expected");
@@ -25758,6 +26064,7 @@ const sqlanvil = $root.sqlanvil = (() => {
25758
26064
  object.postgres = null;
25759
26065
  object.supabase = null;
25760
26066
  object.mysql = null;
26067
+ object.incrementalStrategy = options.enums === String ? "INCREMENTAL_STRATEGY_UNSPECIFIED" : 0;
25761
26068
  }
25762
26069
  if (message.type != null && Object.hasOwnProperty.call(message, "type"))
25763
26070
  object.type = message.type;
@@ -25832,6 +26139,8 @@ const sqlanvil = $root.sqlanvil = (() => {
25832
26139
  object.supabase = $root.sqlanvil.SupabaseOptions.toObject(message.supabase, options, q + 1);
25833
26140
  if (message.mysql != null && Object.hasOwnProperty.call(message, "mysql"))
25834
26141
  object.mysql = $root.sqlanvil.MysqlOptions.toObject(message.mysql, options, q + 1);
26142
+ if (message.incrementalStrategy != null && Object.hasOwnProperty.call(message, "incrementalStrategy"))
26143
+ object.incrementalStrategy = options.enums === String ? $root.sqlanvil.IncrementalStrategy[message.incrementalStrategy] === undefined ? message.incrementalStrategy : $root.sqlanvil.IncrementalStrategy[message.incrementalStrategy] : message.incrementalStrategy;
25835
26144
  return object;
25836
26145
  };
25837
26146
 
@@ -37843,6 +38152,7 @@ const sqlanvil = $root.sqlanvil = (() => {
37843
38152
  * @property {boolean|null} [includeDependents] RunConfig includeDependents
37844
38153
  * @property {boolean|null} [fullRefresh] RunConfig fullRefresh
37845
38154
  * @property {number|null} [timeoutMillis] RunConfig timeoutMillis
38155
+ * @property {number|null} [jitTimeoutMillis] RunConfig jitTimeoutMillis
37846
38156
  * @property {boolean|null} [disableSetMetadata] RunConfig disableSetMetadata
37847
38157
  * @property {boolean|null} [useRunCache] RunConfig useRunCache
37848
38158
  */
@@ -37912,6 +38222,14 @@ const sqlanvil = $root.sqlanvil = (() => {
37912
38222
  */
37913
38223
  RunConfig.prototype.timeoutMillis = 0;
37914
38224
 
38225
+ /**
38226
+ * RunConfig jitTimeoutMillis.
38227
+ * @member {number} jitTimeoutMillis
38228
+ * @memberof sqlanvil.RunConfig
38229
+ * @instance
38230
+ */
38231
+ RunConfig.prototype.jitTimeoutMillis = 0;
38232
+
37915
38233
  /**
37916
38234
  * RunConfig disableSetMetadata.
37917
38235
  * @member {boolean} disableSetMetadata
@@ -37972,6 +38290,8 @@ const sqlanvil = $root.sqlanvil = (() => {
37972
38290
  writer.uint32(/* id 8, wireType 0 =*/64).bool(message.useRunCache);
37973
38291
  if (message.disableSetMetadata != null && Object.hasOwnProperty.call(message, "disableSetMetadata"))
37974
38292
  writer.uint32(/* id 9, wireType 0 =*/72).bool(message.disableSetMetadata);
38293
+ if (message.jitTimeoutMillis != null && Object.hasOwnProperty.call(message, "jitTimeoutMillis"))
38294
+ writer.uint32(/* id 10, wireType 0 =*/80).int32(message.jitTimeoutMillis);
37975
38295
  if (message.includeDependents != null && Object.hasOwnProperty.call(message, "includeDependents"))
37976
38296
  writer.uint32(/* id 11, wireType 0 =*/88).bool(message.includeDependents);
37977
38297
  return writer;
@@ -38042,6 +38362,10 @@ const sqlanvil = $root.sqlanvil = (() => {
38042
38362
  message.timeoutMillis = reader.int32();
38043
38363
  break;
38044
38364
  }
38365
+ case 10: {
38366
+ message.jitTimeoutMillis = reader.int32();
38367
+ break;
38368
+ }
38045
38369
  case 9: {
38046
38370
  message.disableSetMetadata = reader.bool();
38047
38371
  break;
@@ -38115,6 +38439,9 @@ const sqlanvil = $root.sqlanvil = (() => {
38115
38439
  if (message.timeoutMillis != null && Object.hasOwnProperty.call(message, "timeoutMillis"))
38116
38440
  if (!$util.isInteger(message.timeoutMillis))
38117
38441
  return "timeoutMillis: integer expected";
38442
+ if (message.jitTimeoutMillis != null && Object.hasOwnProperty.call(message, "jitTimeoutMillis"))
38443
+ if (!$util.isInteger(message.jitTimeoutMillis))
38444
+ return "jitTimeoutMillis: integer expected";
38118
38445
  if (message.disableSetMetadata != null && Object.hasOwnProperty.call(message, "disableSetMetadata"))
38119
38446
  if (typeof message.disableSetMetadata !== "boolean")
38120
38447
  return "disableSetMetadata: boolean expected";
@@ -38164,6 +38491,8 @@ const sqlanvil = $root.sqlanvil = (() => {
38164
38491
  message.fullRefresh = Boolean(object.fullRefresh);
38165
38492
  if (object.timeoutMillis != null)
38166
38493
  message.timeoutMillis = object.timeoutMillis | 0;
38494
+ if (object.jitTimeoutMillis != null)
38495
+ message.jitTimeoutMillis = object.jitTimeoutMillis | 0;
38167
38496
  if (object.disableSetMetadata != null)
38168
38497
  message.disableSetMetadata = Boolean(object.disableSetMetadata);
38169
38498
  if (object.useRunCache != null)
@@ -38198,6 +38527,7 @@ const sqlanvil = $root.sqlanvil = (() => {
38198
38527
  object.timeoutMillis = 0;
38199
38528
  object.useRunCache = false;
38200
38529
  object.disableSetMetadata = false;
38530
+ object.jitTimeoutMillis = 0;
38201
38531
  object.includeDependents = false;
38202
38532
  }
38203
38533
  if (message.actions && message.actions.length) {
@@ -38220,6 +38550,8 @@ const sqlanvil = $root.sqlanvil = (() => {
38220
38550
  object.useRunCache = message.useRunCache;
38221
38551
  if (message.disableSetMetadata != null && Object.hasOwnProperty.call(message, "disableSetMetadata"))
38222
38552
  object.disableSetMetadata = message.disableSetMetadata;
38553
+ if (message.jitTimeoutMillis != null && Object.hasOwnProperty.call(message, "jitTimeoutMillis"))
38554
+ object.jitTimeoutMillis = message.jitTimeoutMillis;
38223
38555
  if (message.includeDependents != null && Object.hasOwnProperty.call(message, "includeDependents"))
38224
38556
  object.includeDependents = message.includeDependents;
38225
38557
  return object;
@@ -42358,6 +42690,7 @@ const sqlanvil = $root.sqlanvil = (() => {
42358
42690
  * @property {string|null} [errorMessage] TaskResult errorMessage
42359
42691
  * @property {sqlanvil.ITiming|null} [timing] TaskResult timing
42360
42692
  * @property {sqlanvil.IExecutionMetadata|null} [metadata] TaskResult metadata
42693
+ * @property {string|null} [compiledSql] TaskResult compiledSql
42361
42694
  */
42362
42695
 
42363
42696
  /**
@@ -42407,6 +42740,14 @@ const sqlanvil = $root.sqlanvil = (() => {
42407
42740
  */
42408
42741
  TaskResult.prototype.metadata = null;
42409
42742
 
42743
+ /**
42744
+ * TaskResult compiledSql.
42745
+ * @member {string} compiledSql
42746
+ * @memberof sqlanvil.TaskResult
42747
+ * @instance
42748
+ */
42749
+ TaskResult.prototype.compiledSql = "";
42750
+
42410
42751
  /**
42411
42752
  * Creates a new TaskResult instance using the specified properties.
42412
42753
  * @function create
@@ -42443,6 +42784,8 @@ const sqlanvil = $root.sqlanvil = (() => {
42443
42784
  $root.sqlanvil.Timing.encode(message.timing, writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim();
42444
42785
  if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata"))
42445
42786
  $root.sqlanvil.ExecutionMetadata.encode(message.metadata, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim();
42787
+ if (message.compiledSql != null && Object.hasOwnProperty.call(message, "compiledSql"))
42788
+ writer.uint32(/* id 5, wireType 2 =*/42).string(message.compiledSql);
42446
42789
  return writer;
42447
42790
  };
42448
42791
 
@@ -42499,6 +42842,10 @@ const sqlanvil = $root.sqlanvil = (() => {
42499
42842
  message.metadata = $root.sqlanvil.ExecutionMetadata.decode(reader, reader.uint32(), undefined, long + 1);
42500
42843
  break;
42501
42844
  }
42845
+ case 5: {
42846
+ message.compiledSql = reader.string();
42847
+ break;
42848
+ }
42502
42849
  default:
42503
42850
  reader.skipType(tag & 7, long);
42504
42851
  break;
@@ -42563,6 +42910,9 @@ const sqlanvil = $root.sqlanvil = (() => {
42563
42910
  if (error)
42564
42911
  return "metadata." + error;
42565
42912
  }
42913
+ if (message.compiledSql != null && Object.hasOwnProperty.call(message, "compiledSql"))
42914
+ if (!$util.isString(message.compiledSql))
42915
+ return "compiledSql: string expected";
42566
42916
  return null;
42567
42917
  };
42568
42918
 
@@ -42628,6 +42978,8 @@ const sqlanvil = $root.sqlanvil = (() => {
42628
42978
  throw TypeError(".sqlanvil.TaskResult.metadata: object expected");
42629
42979
  message.metadata = $root.sqlanvil.ExecutionMetadata.fromObject(object.metadata, long + 1);
42630
42980
  }
42981
+ if (object.compiledSql != null)
42982
+ message.compiledSql = String(object.compiledSql);
42631
42983
  return message;
42632
42984
  };
42633
42985
 
@@ -42653,6 +43005,7 @@ const sqlanvil = $root.sqlanvil = (() => {
42653
43005
  object.errorMessage = "";
42654
43006
  object.timing = null;
42655
43007
  object.metadata = null;
43008
+ object.compiledSql = "";
42656
43009
  }
42657
43010
  if (message.status != null && Object.hasOwnProperty.call(message, "status"))
42658
43011
  object.status = options.enums === String ? $root.sqlanvil.TaskResult.ExecutionStatus[message.status] === undefined ? message.status : $root.sqlanvil.TaskResult.ExecutionStatus[message.status] : message.status;
@@ -42662,6 +43015,8 @@ const sqlanvil = $root.sqlanvil = (() => {
42662
43015
  object.timing = $root.sqlanvil.Timing.toObject(message.timing, options, q + 1);
42663
43016
  if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata"))
42664
43017
  object.metadata = $root.sqlanvil.ExecutionMetadata.toObject(message.metadata, options, q + 1);
43018
+ if (message.compiledSql != null && Object.hasOwnProperty.call(message, "compiledSql"))
43019
+ object.compiledSql = message.compiledSql;
42665
43020
  return object;
42666
43021
  };
42667
43022
 
@@ -49432,7 +49787,7 @@ function setOrValidateTableEnumType(table) {
49432
49787
  function prune(compiledGraph, runConfig) {
49433
49788
  compiledGraph.tables.forEach(setOrValidateTableEnumType);
49434
49789
  const includedActionNames = computeIncludedActionNames(compiledGraph, runConfig);
49435
- return Object.assign(Object.assign({}, compiledGraph), { tables: compiledGraph.tables.filter(action => includedActionNames.has(targetAsReadableString(action.target))), assertions: compiledGraph.assertions.filter(action => includedActionNames.has(targetAsReadableString(action.target))), operations: compiledGraph.operations.filter(action => includedActionNames.has(targetAsReadableString(action.target))), exports: compiledGraph.exports.filter(action => includedActionNames.has(targetAsReadableString(action.target))), imports: compiledGraph.imports.filter(action => includedActionNames.has(targetAsReadableString(action.target))), extracts: (compiledGraph.extracts || []).filter(action => includedActionNames.has(targetAsReadableString(action.target))), scripts: (compiledGraph.scripts || []).filter(action => includedActionNames.has(targetAsReadableString(action.target))) });
49790
+ return Object.assign(Object.assign({}, compiledGraph), { tables: compiledGraph.tables.filter(action => includedActionNames.has(targetAsReadableString(action.target))), assertions: compiledGraph.assertions.filter(action => includedActionNames.has(targetAsReadableString(action.target))), operations: compiledGraph.operations.filter(action => includedActionNames.has(targetAsReadableString(action.target))), exports: compiledGraph.exports.filter(action => includedActionNames.has(targetAsReadableString(action.target))), imports: compiledGraph.imports.filter(action => includedActionNames.has(targetAsReadableString(action.target))), extracts: (compiledGraph.extracts || []).filter(action => includedActionNames.has(targetAsReadableString(action.target))), scripts: (compiledGraph.scripts || []).filter(action => includedActionNames.has(targetAsReadableString(action.target))), targets: (compiledGraph.targets || []).filter(target => includedActionNames.has(targetAsReadableString(target))) });
49436
49791
  }
49437
49792
  function computeIncludedActionNames(compiledGraph, runConfig) {
49438
49793
  var _a, _b, _c;
@@ -49519,15 +49874,41 @@ function resolveExportUri(spec, actionName, opts) {
49519
49874
  return `${prefix}/${name}`;
49520
49875
  }
49521
49876
 
49877
+ function formatStatement(statement, isLast, modifier) {
49878
+ const lastLineStart = statement.lastIndexOf("\n") + 1;
49879
+ const commentIndex = statement.indexOf("--", lastLineStart);
49880
+ let code;
49881
+ let comment;
49882
+ if (commentIndex === 0) {
49883
+ code = "";
49884
+ comment = statement;
49885
+ }
49886
+ else if (commentIndex > 0) {
49887
+ code = statement.substring(0, commentIndex).trimEnd();
49888
+ comment = statement.substring(commentIndex);
49889
+ }
49890
+ else {
49891
+ code = statement;
49892
+ comment = "";
49893
+ }
49894
+ if (modifier && code.length > 0) {
49895
+ code = modifier(code);
49896
+ }
49897
+ if (!isLast && code.length > 0 && !code.endsWith(";")) {
49898
+ code = code + ";";
49899
+ }
49900
+ if (code.length > 0 && comment.length > 0) {
49901
+ return code + " " + comment;
49902
+ }
49903
+ return code || comment;
49904
+ }
49522
49905
  function concatenateQueries(statements, modifier) {
49523
- return statements
49906
+ const processed = statements
49524
49907
  .filter(statement => !!statement)
49525
49908
  .map(statement => statement.trim())
49526
- .map(statement => statement.length > 0 && statement.charAt(statement.length - 1) === ";"
49527
- ? statement.substring(0, statement.length - 1)
49528
- : statement)
49529
- .map(statement => (!!modifier ? modifier(statement) : statement))
49530
- .join("\n;\n");
49909
+ .filter(statement => statement.length > 0);
49910
+ const formattedStatements = processed.map((statement, index) => formatStatement(statement, index === processed.length - 1, modifier));
49911
+ return formattedStatements.join("\n");
49531
49912
  }
49532
49913
  class Tasks {
49533
49914
  constructor() {
@@ -49749,9 +50130,7 @@ from (${query}) as insertions`;
49749
50130
  this.buildIncrementalSchemaChangeTasks(tasks, table);
49750
50131
  case sqlanvil.OnSchemaChange.IGNORE:
49751
50132
  default:
49752
- tasks.add(Task.statement(table.uniqueKey && table.uniqueKey.length > 0
49753
- ? this.mergeInto(table.target, tableMetadata === null || tableMetadata === void 0 ? void 0 : tableMetadata.fields.map(f => f.name), this.getIncrementalQuery(table), table.uniqueKey, table.bigquery && table.bigquery.updatePartitionFilter)
49754
- : this.insertInto(table.target, tableMetadata === null || tableMetadata === void 0 ? void 0 : tableMetadata.fields.map(f => f.name).map(column => `\`${column}\``), this.getIncrementalQuery(table))));
50133
+ tasks.add(Task.statement(this.getIncrementalDmlStatement(table, (tableMetadata === null || tableMetadata === void 0 ? void 0 : tableMetadata.fields.map(f => f.name)) || [])));
49755
50134
  break;
49756
50135
  }
49757
50136
  }
@@ -49988,14 +50367,68 @@ DROP TABLE IF EXISTS ${emptyTempTableName};
49988
50367
  return `
49989
50368
  create or replace view ${this.resolveTarget(target)} as ${query}`;
49990
50369
  }
49991
- mergeInto(target, columns, query, uniqueKey, updatePartitionFilter) {
50370
+ getIncrementalDmlStatement(table, columns) {
50371
+ const incrementalQuery = this.getIncrementalQuery(table);
50372
+ switch (table.incrementalStrategy) {
50373
+ case sqlanvil.IncrementalStrategy.INSERT_OVERWRITE:
50374
+ return this.insertOverwrite(table.target, columns, incrementalQuery, table.bigquery);
50375
+ case sqlanvil.IncrementalStrategy.MERGE:
50376
+ default:
50377
+ if (table.uniqueKey && table.uniqueKey.length > 0) {
50378
+ return this.mergeInto(table.target, columns, incrementalQuery, table.uniqueKey, table.bigquery);
50379
+ }
50380
+ return this.insertInto(table.target, columns.map(column => `\`${column}\``), incrementalQuery);
50381
+ }
50382
+ }
50383
+ buildIncrementalPredicatesString(incrementalPredicates) {
50384
+ var _a;
50385
+ const valid = (_a = incrementalPredicates === null || incrementalPredicates === void 0 ? void 0 : incrementalPredicates.filter(p => p.trim() !== "")) !== null && _a !== void 0 ? _a : [];
50386
+ if (valid.length === 0) {
50387
+ return "";
50388
+ }
50389
+ return `and ${valid.map(p => `(${p})`).join(" and ")}`;
50390
+ }
50391
+ insertOverwrite(target, columns, query, bigquery) {
50392
+ const partitionBy = bigquery === null || bigquery === void 0 ? void 0 : bigquery.partitionBy;
50393
+ const updatePartitionFilter = bigquery === null || bigquery === void 0 ? void 0 : bigquery.updatePartitionFilter;
50394
+ const incrementalPredicatesString = this.buildIncrementalPredicatesString(bigquery === null || bigquery === void 0 ? void 0 : bigquery.incrementalPredicates);
50395
+ const stagingTableUnqualified = `staging_table_temp_${this.uniqueIdGenerator()}`;
50396
+ const backtickedColumns = columns.map(column => `\`${column}\``);
50397
+ return `CREATE OR REPLACE TEMP TABLE \`${stagingTableUnqualified}\` AS (
50398
+ ${query}
50399
+ );
50400
+
50401
+ BEGIN
50402
+ DECLARE partitions_for_replacement DEFAULT (
50403
+ ARRAY(
50404
+ SELECT DISTINCT ${partitionBy}
50405
+ FROM \`${stagingTableUnqualified}\`
50406
+ WHERE ${partitionBy} IS NOT NULL
50407
+ )
50408
+ );
50409
+
50410
+ MERGE ${this.resolveTarget(target)} T
50411
+ USING \`${stagingTableUnqualified}\` S
50412
+ ON FALSE
50413
+ WHEN NOT MATCHED BY SOURCE AND ${partitionBy} IN UNNEST(partitions_for_replacement)${updatePartitionFilter ? ` and T.${updatePartitionFilter}` : ""}${incrementalPredicatesString ? ` ${incrementalPredicatesString}` : ""}
50414
+ THEN
50415
+ DELETE
50416
+ WHEN NOT MATCHED BY TARGET THEN
50417
+ INSERT (${backtickedColumns.join(",")}) VALUES (${backtickedColumns.join(",")});
50418
+ END;
50419
+
50420
+ DROP TABLE IF EXISTS \`${stagingTableUnqualified}\`;`;
50421
+ }
50422
+ mergeInto(target, columns, query, uniqueKey, bigquery) {
50423
+ const updatePartitionFilter = bigquery === null || bigquery === void 0 ? void 0 : bigquery.updatePartitionFilter;
50424
+ const incrementalPredicatesString = this.buildIncrementalPredicatesString(bigquery === null || bigquery === void 0 ? void 0 : bigquery.incrementalPredicates);
49992
50425
  const backtickedColumns = columns.map(column => `\`${column}\``);
49993
50426
  return `
49994
50427
  merge ${this.resolveTarget(target)} T
49995
50428
  using (${query}
49996
50429
  ) S
49997
50430
  on ${uniqueKey.map(uniqueKeyCol => `T.${uniqueKeyCol} = S.${uniqueKeyCol}`).join(` and `)}
49998
- ${updatePartitionFilter ? `and T.${updatePartitionFilter}` : ""}
50431
+ ${updatePartitionFilter ? `and T.${updatePartitionFilter}` : ""}${incrementalPredicatesString ? `\n ${incrementalPredicatesString}` : ""}
49999
50432
  when matched then
50000
50433
  update set ${columns.map(column => `\`${column}\` = S.${column}`).join(",")}
50001
50434
  when not matched then
@@ -50646,8 +51079,8 @@ function collectEvaluationQueries(queryOrAction, concatenate, queryModifier = (q
50646
51079
  .filter(validationQuery => !!validationQuery.query);
50647
51080
  }
50648
51081
 
50649
- const version = "1.28.0";
50650
- const dataformVersion = "3.0.61";
51082
+ const version = "1.29.1";
51083
+ const dataformVersion = "3.0.63";
50651
51084
 
50652
51085
  async function build(compiledGraph, runConfig, dbadapter) {
50653
51086
  const prunedGraph = prune(compiledGraph, runConfig);
@@ -53580,7 +54013,7 @@ const flags = {
53580
54013
  };
53581
54014
  const isSuccessfulAction = (actionResult) => actionResult.status === sqlanvil.ActionResult.ExecutionStatus.SUCCESSFUL ||
53582
54015
  actionResult.status === sqlanvil.ActionResult.ExecutionStatus.DISABLED;
53583
- function run(dbadapter, graph, executionOptions, partiallyExecutedRunResult = {}, runnerNotificationPeriodMillis = flags.runnerNotificationPeriodMillis.get()) {
54016
+ function run(dbadapter, graph, executionOptions = {}, partiallyExecutedRunResult = {}, runnerNotificationPeriodMillis = flags.runnerNotificationPeriodMillis.get()) {
53584
54017
  return new Runner(dbadapter, graph, executionOptions, partiallyExecutedRunResult, runnerNotificationPeriodMillis).execute();
53585
54018
  }
53586
54019
  class Runner {
@@ -53588,17 +54021,18 @@ class Runner {
53588
54021
  var _a;
53589
54022
  this.dbadapter = dbadapter;
53590
54023
  this.graph = graph;
53591
- this.executionOptions = executionOptions;
53592
54024
  this.runnerNotificationPeriodMillis = runnerNotificationPeriodMillis;
53593
54025
  this.changeListeners = [];
53594
54026
  this.lastNotificationTimestampMillis = 0;
53595
54027
  this.stopped = false;
53596
54028
  this.cancelled = false;
53597
54029
  this.timedOut = false;
54030
+ this.skipReason = "";
53598
54031
  this.runningExtracts = 0;
53599
54032
  this.extractWaiters = [];
53600
- this.allActionTargets = new Set(graph.actions.map(action => targetStringifier.stringify(action.target)));
54033
+ this.executionOptions = Object.assign({ projectDir: "." }, executionOptions);
53601
54034
  this.runResult = Object.assign({ actions: [] }, partiallyExecutedRunResult);
54035
+ this.allActionTargets = new Set(graph.actions.map(action => targetStringifier.stringify(action.target)));
53602
54036
  this.warehouseStateByTarget = new Map();
53603
54037
  (_a = graph.warehouseState.tables) === null || _a === void 0 ? void 0 : _a.forEach(tableMetadata => this.warehouseStateByTarget.set(targetStringifier.stringify(tableMetadata.target), tableMetadata));
53604
54038
  this.executedActionTargets = new Set(this.runResult.actions
@@ -53611,6 +54045,12 @@ class Runner {
53611
54045
  this.eEmitter = new EventEmitter__default["default"]();
53612
54046
  this.eEmitter.setMaxListeners(0);
53613
54047
  }
54048
+ static create(dbadapter, graph, options = {}, runnerNotificationPeriodMillis = flags.runnerNotificationPeriodMillis.get()) {
54049
+ return new Runner(dbadapter, graph, options, {}, runnerNotificationPeriodMillis);
54050
+ }
54051
+ static resume(dbadapter, graph, runResult, runnerNotificationPeriodMillis = flags.runnerNotificationPeriodMillis.get()) {
54052
+ return new Runner(dbadapter, graph, {}, runResult, runnerNotificationPeriodMillis);
54053
+ }
53614
54054
  async acquireExtractSlot() {
53615
54055
  if (this.runningExtracts < Runner.MAX_CONCURRENT_EXTRACTS) {
53616
54056
  this.runningExtracts++;
@@ -53643,7 +54083,7 @@ class Runner {
53643
54083
  const timeoutMillis = this.graph.runConfig.timeoutMillis - elapsedTimeMillis;
53644
54084
  this.timeout = setTimeout(() => {
53645
54085
  this.timedOut = true;
53646
- this.cancel();
54086
+ this.cancel("timeout");
53647
54087
  }, timeoutMillis);
53648
54088
  }
53649
54089
  return this;
@@ -53651,7 +54091,22 @@ class Runner {
53651
54091
  stop() {
53652
54092
  this.stopped = true;
53653
54093
  }
53654
- cancel() {
54094
+ cancel(reason = "user") {
54095
+ var _a;
54096
+ if (!this.skipReason) {
54097
+ switch (reason) {
54098
+ case "timeout":
54099
+ this.skipReason = ((_a = this.graph.runConfig) === null || _a === void 0 ? void 0 : _a.timeoutMillis) ? `Run timed out after ${this.graph.runConfig.timeoutMillis / 1000} seconds`
54100
+ : "Run timed out";
54101
+ break;
54102
+ case "user":
54103
+ this.skipReason = "Run cancelled";
54104
+ break;
54105
+ case "cancellation":
54106
+ this.skipReason = "Run cancelled before action started";
54107
+ break;
54108
+ }
54109
+ }
53655
54110
  this.cancelled = true;
53656
54111
  this.eEmitter.emit(CANCEL_EVENT, undefined, undefined);
53657
54112
  }
@@ -53723,13 +54178,26 @@ class Runner {
53723
54178
  if (this.cancelled) {
53724
54179
  const allPendingActions = this.pendingActions;
53725
54180
  this.pendingActions = [];
53726
- allPendingActions.forEach(pendingAction => this.runResult.actions.push({
53727
- target: pendingAction.target,
53728
- status: sqlanvil.ActionResult.ExecutionStatus.SKIPPED,
53729
- tasks: pendingAction.tasks.map(() => ({
53730
- status: sqlanvil.TaskResult.ExecutionStatus.SKIPPED
53731
- }))
53732
- }));
54181
+ const skipErrorMessage = this.skipReason || "Run cancelled before action started";
54182
+ allPendingActions.forEach(pendingAction => {
54183
+ let tasks;
54184
+ if (pendingAction.tasks && pendingAction.tasks.length > 0) {
54185
+ tasks = pendingAction.tasks.map((_, i) => (Object.assign({ status: sqlanvil.TaskResult.ExecutionStatus.SKIPPED }, (i === 0 ? { errorMessage: skipErrorMessage } : {}))));
54186
+ }
54187
+ else {
54188
+ tasks = [
54189
+ {
54190
+ status: sqlanvil.TaskResult.ExecutionStatus.SKIPPED,
54191
+ errorMessage: skipErrorMessage
54192
+ }
54193
+ ];
54194
+ }
54195
+ this.runResult.actions.push({
54196
+ target: pendingAction.target,
54197
+ status: sqlanvil.ActionResult.ExecutionStatus.SKIPPED,
54198
+ tasks
54199
+ });
54200
+ });
53733
54201
  this.notifyListeners();
53734
54202
  return;
53735
54203
  }
@@ -53825,7 +54293,8 @@ class Runner {
53825
54293
  }
53826
54294
  else {
53827
54295
  actionResult.tasks.push({
53828
- status: sqlanvil.TaskResult.ExecutionStatus.SKIPPED
54296
+ status: sqlanvil.TaskResult.ExecutionStatus.SKIPPED,
54297
+ errorMessage: this.skipReason || "Task skipped after cancellation"
53829
54298
  });
53830
54299
  }
53831
54300
  }