@sqlanvil/cli 1.18.0 → 1.20.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.
Files changed (4) hide show
  1. package/README.md +7 -5
  2. package/bundle.js +2443 -311
  3. package/package.json +1 -1
  4. package/worker_bundle.js +1823 -33
package/bundle.js CHANGED
@@ -2288,6 +2288,7 @@ const sqlanvil = $root.sqlanvil = (() => {
2288
2288
  * @property {sqlanvil.ActionConfig.IVectorIndexConfig|null} [vectorIndex] ActionConfig vectorIndex
2289
2289
  * @property {sqlanvil.ActionConfig.IExportConfig|null} ["export"] ActionConfig export
2290
2290
  * @property {sqlanvil.ActionConfig.IImportConfig|null} ["import"] ActionConfig import
2291
+ * @property {sqlanvil.ActionConfig.IScriptConfig|null} [script] ActionConfig script
2291
2292
  */
2292
2293
 
2293
2294
  /**
@@ -2417,17 +2418,25 @@ const sqlanvil = $root.sqlanvil = (() => {
2417
2418
  */
2418
2419
  ActionConfig.prototype["import"] = null;
2419
2420
 
2421
+ /**
2422
+ * ActionConfig script.
2423
+ * @member {sqlanvil.ActionConfig.IScriptConfig|null|undefined} script
2424
+ * @memberof sqlanvil.ActionConfig
2425
+ * @instance
2426
+ */
2427
+ ActionConfig.prototype.script = null;
2428
+
2420
2429
  // OneOf field names bound to virtual getters and setters
2421
2430
  let $oneOfFields;
2422
2431
 
2423
2432
  /**
2424
2433
  * ActionConfig action.
2425
- * @member {"table"|"view"|"incrementalTable"|"assertion"|"operation"|"declaration"|"notebook"|"dataPreparation"|"rlsPolicy"|"realtimePublication"|"foreignWrapper"|"vectorIndex"|"export"|"import"|undefined} action
2434
+ * @member {"table"|"view"|"incrementalTable"|"assertion"|"operation"|"declaration"|"notebook"|"dataPreparation"|"rlsPolicy"|"realtimePublication"|"foreignWrapper"|"vectorIndex"|"export"|"import"|"script"|undefined} action
2426
2435
  * @memberof sqlanvil.ActionConfig
2427
2436
  * @instance
2428
2437
  */
2429
2438
  Object.defineProperty(ActionConfig.prototype, "action", {
2430
- get: $util.oneOfGetter($oneOfFields = ["table", "view", "incrementalTable", "assertion", "operation", "declaration", "notebook", "dataPreparation", "rlsPolicy", "realtimePublication", "foreignWrapper", "vectorIndex", "export", "import"]),
2439
+ get: $util.oneOfGetter($oneOfFields = ["table", "view", "incrementalTable", "assertion", "operation", "declaration", "notebook", "dataPreparation", "rlsPolicy", "realtimePublication", "foreignWrapper", "vectorIndex", "export", "import", "script"]),
2431
2440
  set: $util.oneOfSetter($oneOfFields)
2432
2441
  });
2433
2442
 
@@ -2487,6 +2496,8 @@ const sqlanvil = $root.sqlanvil = (() => {
2487
2496
  $root.sqlanvil.ActionConfig.ExportConfig.encode(message["export"], writer.uint32(/* id 13, wireType 2 =*/106).fork(), q + 1).ldelim();
2488
2497
  if (message["import"] != null && Object.hasOwnProperty.call(message, "import"))
2489
2498
  $root.sqlanvil.ActionConfig.ImportConfig.encode(message["import"], writer.uint32(/* id 14, wireType 2 =*/114).fork(), q + 1).ldelim();
2499
+ if (message.script != null && Object.hasOwnProperty.call(message, "script"))
2500
+ $root.sqlanvil.ActionConfig.ScriptConfig.encode(message.script, writer.uint32(/* id 15, wireType 2 =*/122).fork(), q + 1).ldelim();
2490
2501
  return writer;
2491
2502
  };
2492
2503
 
@@ -2583,6 +2594,10 @@ const sqlanvil = $root.sqlanvil = (() => {
2583
2594
  message["import"] = $root.sqlanvil.ActionConfig.ImportConfig.decode(reader, reader.uint32(), undefined, long + 1);
2584
2595
  break;
2585
2596
  }
2597
+ case 15: {
2598
+ message.script = $root.sqlanvil.ActionConfig.ScriptConfig.decode(reader, reader.uint32(), undefined, long + 1);
2599
+ break;
2600
+ }
2586
2601
  default:
2587
2602
  reader.skipType(tag & 7, long);
2588
2603
  break;
@@ -2761,6 +2776,16 @@ const sqlanvil = $root.sqlanvil = (() => {
2761
2776
  return "import." + error;
2762
2777
  }
2763
2778
  }
2779
+ if (message.script != null && Object.hasOwnProperty.call(message, "script")) {
2780
+ if (properties.action === 1)
2781
+ return "action: multiple values";
2782
+ properties.action = 1;
2783
+ {
2784
+ let error = $root.sqlanvil.ActionConfig.ScriptConfig.verify(message.script, long + 1);
2785
+ if (error)
2786
+ return "script." + error;
2787
+ }
2788
+ }
2764
2789
  return null;
2765
2790
  };
2766
2791
 
@@ -2852,6 +2877,11 @@ const sqlanvil = $root.sqlanvil = (() => {
2852
2877
  throw TypeError(".sqlanvil.ActionConfig.import: object expected");
2853
2878
  message["import"] = $root.sqlanvil.ActionConfig.ImportConfig.fromObject(object["import"], long + 1);
2854
2879
  }
2880
+ if (object.script != null) {
2881
+ if (!$util.isObject(object.script))
2882
+ throw TypeError(".sqlanvil.ActionConfig.script: object expected");
2883
+ message.script = $root.sqlanvil.ActionConfig.ScriptConfig.fromObject(object.script, long + 1);
2884
+ }
2855
2885
  return message;
2856
2886
  };
2857
2887
 
@@ -2942,6 +2972,11 @@ const sqlanvil = $root.sqlanvil = (() => {
2942
2972
  if (options.oneofs)
2943
2973
  object.action = "import";
2944
2974
  }
2975
+ if (message.script != null && Object.hasOwnProperty.call(message, "script")) {
2976
+ object.script = $root.sqlanvil.ActionConfig.ScriptConfig.toObject(message.script, options, q + 1);
2977
+ if (options.oneofs)
2978
+ object.action = "script";
2979
+ }
2945
2980
  return object;
2946
2981
  };
2947
2982
 
@@ -5888,6 +5923,7 @@ const sqlanvil = $root.sqlanvil = (() => {
5888
5923
  * @property {sqlanvil.ActionConfig.IMetadata|null} [metadata] ViewConfig metadata
5889
5924
  * @property {string|null} [reservation] ViewConfig reservation
5890
5925
  * @property {sqlanvil.IPostgresOptions|null} [postgres] ViewConfig postgres
5926
+ * @property {sqlanvil.IMysqlOptions|null} [mysql] ViewConfig mysql
5891
5927
  */
5892
5928
 
5893
5929
  /**
@@ -6089,6 +6125,14 @@ const sqlanvil = $root.sqlanvil = (() => {
6089
6125
  */
6090
6126
  ViewConfig.prototype.postgres = null;
6091
6127
 
6128
+ /**
6129
+ * ViewConfig mysql.
6130
+ * @member {sqlanvil.IMysqlOptions|null|undefined} mysql
6131
+ * @memberof sqlanvil.ActionConfig.ViewConfig
6132
+ * @instance
6133
+ */
6134
+ ViewConfig.prototype.mysql = null;
6135
+
6092
6136
  /**
6093
6137
  * Creates a new ViewConfig instance using the specified properties.
6094
6138
  * @function create
@@ -6169,6 +6213,8 @@ const sqlanvil = $root.sqlanvil = (() => {
6169
6213
  writer.uint32(/* id 21, wireType 2 =*/170).string(message.reservation);
6170
6214
  if (message.postgres != null && Object.hasOwnProperty.call(message, "postgres"))
6171
6215
  $root.sqlanvil.PostgresOptions.encode(message.postgres, writer.uint32(/* id 22, wireType 2 =*/178).fork(), q + 1).ldelim();
6216
+ if (message.mysql != null && Object.hasOwnProperty.call(message, "mysql"))
6217
+ $root.sqlanvil.MysqlOptions.encode(message.mysql, writer.uint32(/* id 23, wireType 2 =*/186).fork(), q + 1).ldelim();
6172
6218
  return writer;
6173
6219
  };
6174
6220
 
@@ -6351,6 +6397,10 @@ const sqlanvil = $root.sqlanvil = (() => {
6351
6397
  message.postgres = $root.sqlanvil.PostgresOptions.decode(reader, reader.uint32(), undefined, long + 1);
6352
6398
  break;
6353
6399
  }
6400
+ case 23: {
6401
+ message.mysql = $root.sqlanvil.MysqlOptions.decode(reader, reader.uint32(), undefined, long + 1);
6402
+ break;
6403
+ }
6354
6404
  default:
6355
6405
  reader.skipType(tag & 7, long);
6356
6406
  break;
@@ -6500,6 +6550,11 @@ const sqlanvil = $root.sqlanvil = (() => {
6500
6550
  if (error)
6501
6551
  return "postgres." + error;
6502
6552
  }
6553
+ if (message.mysql != null && Object.hasOwnProperty.call(message, "mysql")) {
6554
+ let error = $root.sqlanvil.MysqlOptions.verify(message.mysql, long + 1);
6555
+ if (error)
6556
+ return "mysql." + error;
6557
+ }
6503
6558
  return null;
6504
6559
  };
6505
6560
 
@@ -6626,6 +6681,11 @@ const sqlanvil = $root.sqlanvil = (() => {
6626
6681
  throw TypeError(".sqlanvil.ActionConfig.ViewConfig.postgres: object expected");
6627
6682
  message.postgres = $root.sqlanvil.PostgresOptions.fromObject(object.postgres, long + 1);
6628
6683
  }
6684
+ if (object.mysql != null) {
6685
+ if (!$util.isObject(object.mysql))
6686
+ throw TypeError(".sqlanvil.ActionConfig.ViewConfig.mysql: object expected");
6687
+ message.mysql = $root.sqlanvil.MysqlOptions.fromObject(object.mysql, long + 1);
6688
+ }
6629
6689
  return message;
6630
6690
  };
6631
6691
 
@@ -6673,6 +6733,7 @@ const sqlanvil = $root.sqlanvil = (() => {
6673
6733
  object.metadata = null;
6674
6734
  object.reservation = "";
6675
6735
  object.postgres = null;
6736
+ object.mysql = null;
6676
6737
  }
6677
6738
  if (message.name != null && Object.hasOwnProperty.call(message, "name"))
6678
6739
  object.name = message.name;
@@ -6749,6 +6810,8 @@ const sqlanvil = $root.sqlanvil = (() => {
6749
6810
  object.reservation = message.reservation;
6750
6811
  if (message.postgres != null && Object.hasOwnProperty.call(message, "postgres"))
6751
6812
  object.postgres = $root.sqlanvil.PostgresOptions.toObject(message.postgres, options, q + 1);
6813
+ if (message.mysql != null && Object.hasOwnProperty.call(message, "mysql"))
6814
+ object.mysql = $root.sqlanvil.MysqlOptions.toObject(message.mysql, options, q + 1);
6752
6815
  return object;
6753
6816
  };
6754
6817
 
@@ -12443,6 +12506,588 @@ const sqlanvil = $root.sqlanvil = (() => {
12443
12506
  return DataPreparationConfig;
12444
12507
  })();
12445
12508
 
12509
+ ActionConfig.ScriptConfig = (function() {
12510
+
12511
+ /**
12512
+ * Properties of a ScriptConfig.
12513
+ * @memberof sqlanvil.ActionConfig
12514
+ * @interface IScriptConfig
12515
+ * @property {string|null} [name] ScriptConfig name
12516
+ * @property {string|null} [dataset] ScriptConfig dataset
12517
+ * @property {string|null} [project] ScriptConfig project
12518
+ * @property {Array.<sqlanvil.ActionConfig.ITarget>|null} [dependencyTargets] ScriptConfig dependencyTargets
12519
+ * @property {string|null} [filename] ScriptConfig filename
12520
+ * @property {Array.<string>|null} [tags] ScriptConfig tags
12521
+ * @property {boolean|null} [disabled] ScriptConfig disabled
12522
+ * @property {string|null} [description] ScriptConfig description
12523
+ * @property {string|null} [language] ScriptConfig language
12524
+ * @property {Array.<string>|null} [args] ScriptConfig args
12525
+ * @property {string|null} [depsFile] ScriptConfig depsFile
12526
+ * @property {string|null} [runtimeVersion] ScriptConfig runtimeVersion
12527
+ * @property {string|null} [envRoot] ScriptConfig envRoot
12528
+ * @property {number|null} [timeoutMillis] ScriptConfig timeoutMillis
12529
+ */
12530
+
12531
+ /**
12532
+ * Constructs a new ScriptConfig.
12533
+ * @memberof sqlanvil.ActionConfig
12534
+ * @classdesc Represents a ScriptConfig.
12535
+ * @implements IScriptConfig
12536
+ * @constructor
12537
+ * @param {sqlanvil.ActionConfig.IScriptConfig=} [properties] Properties to set
12538
+ */
12539
+ function ScriptConfig(properties) {
12540
+ this.dependencyTargets = [];
12541
+ this.tags = [];
12542
+ this.args = [];
12543
+ if (properties)
12544
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
12545
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
12546
+ this[keys[i]] = properties[keys[i]];
12547
+ }
12548
+
12549
+ /**
12550
+ * ScriptConfig name.
12551
+ * @member {string} name
12552
+ * @memberof sqlanvil.ActionConfig.ScriptConfig
12553
+ * @instance
12554
+ */
12555
+ ScriptConfig.prototype.name = "";
12556
+
12557
+ /**
12558
+ * ScriptConfig dataset.
12559
+ * @member {string} dataset
12560
+ * @memberof sqlanvil.ActionConfig.ScriptConfig
12561
+ * @instance
12562
+ */
12563
+ ScriptConfig.prototype.dataset = "";
12564
+
12565
+ /**
12566
+ * ScriptConfig project.
12567
+ * @member {string} project
12568
+ * @memberof sqlanvil.ActionConfig.ScriptConfig
12569
+ * @instance
12570
+ */
12571
+ ScriptConfig.prototype.project = "";
12572
+
12573
+ /**
12574
+ * ScriptConfig dependencyTargets.
12575
+ * @member {Array.<sqlanvil.ActionConfig.ITarget>} dependencyTargets
12576
+ * @memberof sqlanvil.ActionConfig.ScriptConfig
12577
+ * @instance
12578
+ */
12579
+ ScriptConfig.prototype.dependencyTargets = $util.emptyArray;
12580
+
12581
+ /**
12582
+ * ScriptConfig filename.
12583
+ * @member {string} filename
12584
+ * @memberof sqlanvil.ActionConfig.ScriptConfig
12585
+ * @instance
12586
+ */
12587
+ ScriptConfig.prototype.filename = "";
12588
+
12589
+ /**
12590
+ * ScriptConfig tags.
12591
+ * @member {Array.<string>} tags
12592
+ * @memberof sqlanvil.ActionConfig.ScriptConfig
12593
+ * @instance
12594
+ */
12595
+ ScriptConfig.prototype.tags = $util.emptyArray;
12596
+
12597
+ /**
12598
+ * ScriptConfig disabled.
12599
+ * @member {boolean} disabled
12600
+ * @memberof sqlanvil.ActionConfig.ScriptConfig
12601
+ * @instance
12602
+ */
12603
+ ScriptConfig.prototype.disabled = false;
12604
+
12605
+ /**
12606
+ * ScriptConfig description.
12607
+ * @member {string} description
12608
+ * @memberof sqlanvil.ActionConfig.ScriptConfig
12609
+ * @instance
12610
+ */
12611
+ ScriptConfig.prototype.description = "";
12612
+
12613
+ /**
12614
+ * ScriptConfig language.
12615
+ * @member {string} language
12616
+ * @memberof sqlanvil.ActionConfig.ScriptConfig
12617
+ * @instance
12618
+ */
12619
+ ScriptConfig.prototype.language = "";
12620
+
12621
+ /**
12622
+ * ScriptConfig args.
12623
+ * @member {Array.<string>} args
12624
+ * @memberof sqlanvil.ActionConfig.ScriptConfig
12625
+ * @instance
12626
+ */
12627
+ ScriptConfig.prototype.args = $util.emptyArray;
12628
+
12629
+ /**
12630
+ * ScriptConfig depsFile.
12631
+ * @member {string} depsFile
12632
+ * @memberof sqlanvil.ActionConfig.ScriptConfig
12633
+ * @instance
12634
+ */
12635
+ ScriptConfig.prototype.depsFile = "";
12636
+
12637
+ /**
12638
+ * ScriptConfig runtimeVersion.
12639
+ * @member {string} runtimeVersion
12640
+ * @memberof sqlanvil.ActionConfig.ScriptConfig
12641
+ * @instance
12642
+ */
12643
+ ScriptConfig.prototype.runtimeVersion = "";
12644
+
12645
+ /**
12646
+ * ScriptConfig envRoot.
12647
+ * @member {string} envRoot
12648
+ * @memberof sqlanvil.ActionConfig.ScriptConfig
12649
+ * @instance
12650
+ */
12651
+ ScriptConfig.prototype.envRoot = "";
12652
+
12653
+ /**
12654
+ * ScriptConfig timeoutMillis.
12655
+ * @member {number} timeoutMillis
12656
+ * @memberof sqlanvil.ActionConfig.ScriptConfig
12657
+ * @instance
12658
+ */
12659
+ ScriptConfig.prototype.timeoutMillis = 0;
12660
+
12661
+ /**
12662
+ * Creates a new ScriptConfig instance using the specified properties.
12663
+ * @function create
12664
+ * @memberof sqlanvil.ActionConfig.ScriptConfig
12665
+ * @static
12666
+ * @param {sqlanvil.ActionConfig.IScriptConfig=} [properties] Properties to set
12667
+ * @returns {sqlanvil.ActionConfig.ScriptConfig} ScriptConfig instance
12668
+ */
12669
+ ScriptConfig.create = function create(properties) {
12670
+ return new ScriptConfig(properties);
12671
+ };
12672
+
12673
+ /**
12674
+ * Encodes the specified ScriptConfig message. Does not implicitly {@link sqlanvil.ActionConfig.ScriptConfig.verify|verify} messages.
12675
+ * @function encode
12676
+ * @memberof sqlanvil.ActionConfig.ScriptConfig
12677
+ * @static
12678
+ * @param {sqlanvil.ActionConfig.IScriptConfig} message ScriptConfig message or plain object to encode
12679
+ * @param {$protobuf.Writer} [writer] Writer to encode to
12680
+ * @returns {$protobuf.Writer} Writer
12681
+ */
12682
+ ScriptConfig.encode = function encode(message, writer, q) {
12683
+ if (!writer)
12684
+ writer = $Writer.create();
12685
+ if (q === undefined)
12686
+ q = 0;
12687
+ if (q > $util.recursionLimit)
12688
+ throw Error("max depth exceeded");
12689
+ if (message.name != null && Object.hasOwnProperty.call(message, "name"))
12690
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
12691
+ if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset"))
12692
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.dataset);
12693
+ if (message.project != null && Object.hasOwnProperty.call(message, "project"))
12694
+ writer.uint32(/* id 3, wireType 2 =*/26).string(message.project);
12695
+ if (message.dependencyTargets != null && message.dependencyTargets.length)
12696
+ for (let i = 0; i < message.dependencyTargets.length; ++i)
12697
+ $root.sqlanvil.ActionConfig.Target.encode(message.dependencyTargets[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim();
12698
+ if (message.filename != null && Object.hasOwnProperty.call(message, "filename"))
12699
+ writer.uint32(/* id 5, wireType 2 =*/42).string(message.filename);
12700
+ if (message.tags != null && message.tags.length)
12701
+ for (let i = 0; i < message.tags.length; ++i)
12702
+ writer.uint32(/* id 6, wireType 2 =*/50).string(message.tags[i]);
12703
+ if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled"))
12704
+ writer.uint32(/* id 7, wireType 0 =*/56).bool(message.disabled);
12705
+ if (message.description != null && Object.hasOwnProperty.call(message, "description"))
12706
+ writer.uint32(/* id 8, wireType 2 =*/66).string(message.description);
12707
+ if (message.language != null && Object.hasOwnProperty.call(message, "language"))
12708
+ writer.uint32(/* id 9, wireType 2 =*/74).string(message.language);
12709
+ if (message.args != null && message.args.length)
12710
+ for (let i = 0; i < message.args.length; ++i)
12711
+ writer.uint32(/* id 10, wireType 2 =*/82).string(message.args[i]);
12712
+ if (message.depsFile != null && Object.hasOwnProperty.call(message, "depsFile"))
12713
+ writer.uint32(/* id 11, wireType 2 =*/90).string(message.depsFile);
12714
+ if (message.runtimeVersion != null && Object.hasOwnProperty.call(message, "runtimeVersion"))
12715
+ writer.uint32(/* id 12, wireType 2 =*/98).string(message.runtimeVersion);
12716
+ if (message.envRoot != null && Object.hasOwnProperty.call(message, "envRoot"))
12717
+ writer.uint32(/* id 13, wireType 2 =*/106).string(message.envRoot);
12718
+ if (message.timeoutMillis != null && Object.hasOwnProperty.call(message, "timeoutMillis"))
12719
+ writer.uint32(/* id 14, wireType 0 =*/112).int32(message.timeoutMillis);
12720
+ return writer;
12721
+ };
12722
+
12723
+ /**
12724
+ * Encodes the specified ScriptConfig message, length delimited. Does not implicitly {@link sqlanvil.ActionConfig.ScriptConfig.verify|verify} messages.
12725
+ * @function encodeDelimited
12726
+ * @memberof sqlanvil.ActionConfig.ScriptConfig
12727
+ * @static
12728
+ * @param {sqlanvil.ActionConfig.IScriptConfig} message ScriptConfig message or plain object to encode
12729
+ * @param {$protobuf.Writer} [writer] Writer to encode to
12730
+ * @returns {$protobuf.Writer} Writer
12731
+ */
12732
+ ScriptConfig.encodeDelimited = function encodeDelimited(message, writer) {
12733
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
12734
+ };
12735
+
12736
+ /**
12737
+ * Decodes a ScriptConfig message from the specified reader or buffer.
12738
+ * @function decode
12739
+ * @memberof sqlanvil.ActionConfig.ScriptConfig
12740
+ * @static
12741
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
12742
+ * @param {number} [length] Message length if known beforehand
12743
+ * @returns {sqlanvil.ActionConfig.ScriptConfig} ScriptConfig
12744
+ * @throws {Error} If the payload is not a reader or valid buffer
12745
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
12746
+ */
12747
+ ScriptConfig.decode = function decode(reader, length, error, long) {
12748
+ if (!(reader instanceof $Reader))
12749
+ reader = $Reader.create(reader);
12750
+ if (long === undefined)
12751
+ long = 0;
12752
+ if (long > $Reader.recursionLimit)
12753
+ throw Error("maximum nesting depth exceeded");
12754
+ let end = length === undefined ? reader.len : reader.pos + length, message = new $root.sqlanvil.ActionConfig.ScriptConfig();
12755
+ while (reader.pos < end) {
12756
+ let tag = reader.uint32();
12757
+ if (tag === error)
12758
+ break;
12759
+ switch (tag >>> 3) {
12760
+ case 1: {
12761
+ message.name = reader.string();
12762
+ break;
12763
+ }
12764
+ case 2: {
12765
+ message.dataset = reader.string();
12766
+ break;
12767
+ }
12768
+ case 3: {
12769
+ message.project = reader.string();
12770
+ break;
12771
+ }
12772
+ case 4: {
12773
+ if (!(message.dependencyTargets && message.dependencyTargets.length))
12774
+ message.dependencyTargets = [];
12775
+ message.dependencyTargets.push($root.sqlanvil.ActionConfig.Target.decode(reader, reader.uint32(), undefined, long + 1));
12776
+ break;
12777
+ }
12778
+ case 5: {
12779
+ message.filename = reader.string();
12780
+ break;
12781
+ }
12782
+ case 6: {
12783
+ if (!(message.tags && message.tags.length))
12784
+ message.tags = [];
12785
+ message.tags.push(reader.string());
12786
+ break;
12787
+ }
12788
+ case 7: {
12789
+ message.disabled = reader.bool();
12790
+ break;
12791
+ }
12792
+ case 8: {
12793
+ message.description = reader.string();
12794
+ break;
12795
+ }
12796
+ case 9: {
12797
+ message.language = reader.string();
12798
+ break;
12799
+ }
12800
+ case 10: {
12801
+ if (!(message.args && message.args.length))
12802
+ message.args = [];
12803
+ message.args.push(reader.string());
12804
+ break;
12805
+ }
12806
+ case 11: {
12807
+ message.depsFile = reader.string();
12808
+ break;
12809
+ }
12810
+ case 12: {
12811
+ message.runtimeVersion = reader.string();
12812
+ break;
12813
+ }
12814
+ case 13: {
12815
+ message.envRoot = reader.string();
12816
+ break;
12817
+ }
12818
+ case 14: {
12819
+ message.timeoutMillis = reader.int32();
12820
+ break;
12821
+ }
12822
+ default:
12823
+ reader.skipType(tag & 7, long);
12824
+ break;
12825
+ }
12826
+ }
12827
+ return message;
12828
+ };
12829
+
12830
+ /**
12831
+ * Decodes a ScriptConfig message from the specified reader or buffer, length delimited.
12832
+ * @function decodeDelimited
12833
+ * @memberof sqlanvil.ActionConfig.ScriptConfig
12834
+ * @static
12835
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
12836
+ * @returns {sqlanvil.ActionConfig.ScriptConfig} ScriptConfig
12837
+ * @throws {Error} If the payload is not a reader or valid buffer
12838
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
12839
+ */
12840
+ ScriptConfig.decodeDelimited = function decodeDelimited(reader) {
12841
+ if (!(reader instanceof $Reader))
12842
+ reader = new $Reader(reader);
12843
+ return this.decode(reader, reader.uint32());
12844
+ };
12845
+
12846
+ /**
12847
+ * Verifies a ScriptConfig message.
12848
+ * @function verify
12849
+ * @memberof sqlanvil.ActionConfig.ScriptConfig
12850
+ * @static
12851
+ * @param {Object.<string,*>} message Plain object to verify
12852
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
12853
+ */
12854
+ ScriptConfig.verify = function verify(message, long) {
12855
+ if (typeof message !== "object" || message === null)
12856
+ return "object expected";
12857
+ if (long === undefined)
12858
+ long = 0;
12859
+ if (long > $util.recursionLimit)
12860
+ return "maximum nesting depth exceeded";
12861
+ if (message.name != null && Object.hasOwnProperty.call(message, "name"))
12862
+ if (!$util.isString(message.name))
12863
+ return "name: string expected";
12864
+ if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset"))
12865
+ if (!$util.isString(message.dataset))
12866
+ return "dataset: string expected";
12867
+ if (message.project != null && Object.hasOwnProperty.call(message, "project"))
12868
+ if (!$util.isString(message.project))
12869
+ return "project: string expected";
12870
+ if (message.dependencyTargets != null && Object.hasOwnProperty.call(message, "dependencyTargets")) {
12871
+ if (!Array.isArray(message.dependencyTargets))
12872
+ return "dependencyTargets: array expected";
12873
+ for (let i = 0; i < message.dependencyTargets.length; ++i) {
12874
+ let error = $root.sqlanvil.ActionConfig.Target.verify(message.dependencyTargets[i], long + 1);
12875
+ if (error)
12876
+ return "dependencyTargets." + error;
12877
+ }
12878
+ }
12879
+ if (message.filename != null && Object.hasOwnProperty.call(message, "filename"))
12880
+ if (!$util.isString(message.filename))
12881
+ return "filename: string expected";
12882
+ if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) {
12883
+ if (!Array.isArray(message.tags))
12884
+ return "tags: array expected";
12885
+ for (let i = 0; i < message.tags.length; ++i)
12886
+ if (!$util.isString(message.tags[i]))
12887
+ return "tags: string[] expected";
12888
+ }
12889
+ if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled"))
12890
+ if (typeof message.disabled !== "boolean")
12891
+ return "disabled: boolean expected";
12892
+ if (message.description != null && Object.hasOwnProperty.call(message, "description"))
12893
+ if (!$util.isString(message.description))
12894
+ return "description: string expected";
12895
+ if (message.language != null && Object.hasOwnProperty.call(message, "language"))
12896
+ if (!$util.isString(message.language))
12897
+ return "language: string expected";
12898
+ if (message.args != null && Object.hasOwnProperty.call(message, "args")) {
12899
+ if (!Array.isArray(message.args))
12900
+ return "args: array expected";
12901
+ for (let i = 0; i < message.args.length; ++i)
12902
+ if (!$util.isString(message.args[i]))
12903
+ return "args: string[] expected";
12904
+ }
12905
+ if (message.depsFile != null && Object.hasOwnProperty.call(message, "depsFile"))
12906
+ if (!$util.isString(message.depsFile))
12907
+ return "depsFile: string expected";
12908
+ if (message.runtimeVersion != null && Object.hasOwnProperty.call(message, "runtimeVersion"))
12909
+ if (!$util.isString(message.runtimeVersion))
12910
+ return "runtimeVersion: string expected";
12911
+ if (message.envRoot != null && Object.hasOwnProperty.call(message, "envRoot"))
12912
+ if (!$util.isString(message.envRoot))
12913
+ return "envRoot: string expected";
12914
+ if (message.timeoutMillis != null && Object.hasOwnProperty.call(message, "timeoutMillis"))
12915
+ if (!$util.isInteger(message.timeoutMillis))
12916
+ return "timeoutMillis: integer expected";
12917
+ return null;
12918
+ };
12919
+
12920
+ /**
12921
+ * Creates a ScriptConfig message from a plain object. Also converts values to their respective internal types.
12922
+ * @function fromObject
12923
+ * @memberof sqlanvil.ActionConfig.ScriptConfig
12924
+ * @static
12925
+ * @param {Object.<string,*>} object Plain object
12926
+ * @returns {sqlanvil.ActionConfig.ScriptConfig} ScriptConfig
12927
+ */
12928
+ ScriptConfig.fromObject = function fromObject(object, long) {
12929
+ if (object instanceof $root.sqlanvil.ActionConfig.ScriptConfig)
12930
+ return object;
12931
+ if (!$util.isObject(object))
12932
+ throw TypeError(".sqlanvil.ActionConfig.ScriptConfig: object expected");
12933
+ if (long === undefined)
12934
+ long = 0;
12935
+ if (long > $util.recursionLimit)
12936
+ throw Error("maximum nesting depth exceeded");
12937
+ let message = new $root.sqlanvil.ActionConfig.ScriptConfig();
12938
+ if (object.name != null)
12939
+ message.name = String(object.name);
12940
+ if (object.dataset != null)
12941
+ message.dataset = String(object.dataset);
12942
+ if (object.project != null)
12943
+ message.project = String(object.project);
12944
+ if (object.dependencyTargets) {
12945
+ if (!Array.isArray(object.dependencyTargets))
12946
+ throw TypeError(".sqlanvil.ActionConfig.ScriptConfig.dependencyTargets: array expected");
12947
+ message.dependencyTargets = [];
12948
+ for (let i = 0; i < object.dependencyTargets.length; ++i) {
12949
+ if (!$util.isObject(object.dependencyTargets[i]))
12950
+ throw TypeError(".sqlanvil.ActionConfig.ScriptConfig.dependencyTargets: object expected");
12951
+ message.dependencyTargets[i] = $root.sqlanvil.ActionConfig.Target.fromObject(object.dependencyTargets[i], long + 1);
12952
+ }
12953
+ }
12954
+ if (object.filename != null)
12955
+ message.filename = String(object.filename);
12956
+ if (object.tags) {
12957
+ if (!Array.isArray(object.tags))
12958
+ throw TypeError(".sqlanvil.ActionConfig.ScriptConfig.tags: array expected");
12959
+ message.tags = [];
12960
+ for (let i = 0; i < object.tags.length; ++i)
12961
+ message.tags[i] = String(object.tags[i]);
12962
+ }
12963
+ if (object.disabled != null)
12964
+ message.disabled = Boolean(object.disabled);
12965
+ if (object.description != null)
12966
+ message.description = String(object.description);
12967
+ if (object.language != null)
12968
+ message.language = String(object.language);
12969
+ if (object.args) {
12970
+ if (!Array.isArray(object.args))
12971
+ throw TypeError(".sqlanvil.ActionConfig.ScriptConfig.args: array expected");
12972
+ message.args = [];
12973
+ for (let i = 0; i < object.args.length; ++i)
12974
+ message.args[i] = String(object.args[i]);
12975
+ }
12976
+ if (object.depsFile != null)
12977
+ message.depsFile = String(object.depsFile);
12978
+ if (object.runtimeVersion != null)
12979
+ message.runtimeVersion = String(object.runtimeVersion);
12980
+ if (object.envRoot != null)
12981
+ message.envRoot = String(object.envRoot);
12982
+ if (object.timeoutMillis != null)
12983
+ message.timeoutMillis = object.timeoutMillis | 0;
12984
+ return message;
12985
+ };
12986
+
12987
+ /**
12988
+ * Creates a plain object from a ScriptConfig message. Also converts values to other types if specified.
12989
+ * @function toObject
12990
+ * @memberof sqlanvil.ActionConfig.ScriptConfig
12991
+ * @static
12992
+ * @param {sqlanvil.ActionConfig.ScriptConfig} message ScriptConfig
12993
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
12994
+ * @returns {Object.<string,*>} Plain object
12995
+ */
12996
+ ScriptConfig.toObject = function toObject(message, options, q) {
12997
+ if (!options)
12998
+ options = {};
12999
+ if (q === undefined)
13000
+ q = 0;
13001
+ if (q > $util.recursionLimit)
13002
+ throw Error("max depth exceeded");
13003
+ let object = {};
13004
+ if (options.arrays || options.defaults) {
13005
+ object.dependencyTargets = [];
13006
+ object.tags = [];
13007
+ object.args = [];
13008
+ }
13009
+ if (options.defaults) {
13010
+ object.name = "";
13011
+ object.dataset = "";
13012
+ object.project = "";
13013
+ object.filename = "";
13014
+ object.disabled = false;
13015
+ object.description = "";
13016
+ object.language = "";
13017
+ object.depsFile = "";
13018
+ object.runtimeVersion = "";
13019
+ object.envRoot = "";
13020
+ object.timeoutMillis = 0;
13021
+ }
13022
+ if (message.name != null && Object.hasOwnProperty.call(message, "name"))
13023
+ object.name = message.name;
13024
+ if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset"))
13025
+ object.dataset = message.dataset;
13026
+ if (message.project != null && Object.hasOwnProperty.call(message, "project"))
13027
+ object.project = message.project;
13028
+ if (message.dependencyTargets && message.dependencyTargets.length) {
13029
+ object.dependencyTargets = [];
13030
+ for (let j = 0; j < message.dependencyTargets.length; ++j)
13031
+ object.dependencyTargets[j] = $root.sqlanvil.ActionConfig.Target.toObject(message.dependencyTargets[j], options, q + 1);
13032
+ }
13033
+ if (message.filename != null && Object.hasOwnProperty.call(message, "filename"))
13034
+ object.filename = message.filename;
13035
+ if (message.tags && message.tags.length) {
13036
+ object.tags = [];
13037
+ for (let j = 0; j < message.tags.length; ++j)
13038
+ object.tags[j] = message.tags[j];
13039
+ }
13040
+ if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled"))
13041
+ object.disabled = message.disabled;
13042
+ if (message.description != null && Object.hasOwnProperty.call(message, "description"))
13043
+ object.description = message.description;
13044
+ if (message.language != null && Object.hasOwnProperty.call(message, "language"))
13045
+ object.language = message.language;
13046
+ if (message.args && message.args.length) {
13047
+ object.args = [];
13048
+ for (let j = 0; j < message.args.length; ++j)
13049
+ object.args[j] = message.args[j];
13050
+ }
13051
+ if (message.depsFile != null && Object.hasOwnProperty.call(message, "depsFile"))
13052
+ object.depsFile = message.depsFile;
13053
+ if (message.runtimeVersion != null && Object.hasOwnProperty.call(message, "runtimeVersion"))
13054
+ object.runtimeVersion = message.runtimeVersion;
13055
+ if (message.envRoot != null && Object.hasOwnProperty.call(message, "envRoot"))
13056
+ object.envRoot = message.envRoot;
13057
+ if (message.timeoutMillis != null && Object.hasOwnProperty.call(message, "timeoutMillis"))
13058
+ object.timeoutMillis = message.timeoutMillis;
13059
+ return object;
13060
+ };
13061
+
13062
+ /**
13063
+ * Converts this ScriptConfig to JSON.
13064
+ * @function toJSON
13065
+ * @memberof sqlanvil.ActionConfig.ScriptConfig
13066
+ * @instance
13067
+ * @returns {Object.<string,*>} JSON object
13068
+ */
13069
+ ScriptConfig.prototype.toJSON = function toJSON() {
13070
+ return this.constructor.toObject(this, $protobuf__namespace.util.toJSONOptions);
13071
+ };
13072
+
13073
+ /**
13074
+ * Gets the default type url for ScriptConfig
13075
+ * @function getTypeUrl
13076
+ * @memberof sqlanvil.ActionConfig.ScriptConfig
13077
+ * @static
13078
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
13079
+ * @returns {string} The default type url
13080
+ */
13081
+ ScriptConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
13082
+ if (typeUrlPrefix === undefined) {
13083
+ typeUrlPrefix = "type.googleapis.com";
13084
+ }
13085
+ return typeUrlPrefix + "/sqlanvil.ActionConfig.ScriptConfig";
13086
+ };
13087
+
13088
+ return ScriptConfig;
13089
+ })();
13090
+
12446
13091
  ActionConfig.RlsPolicyConfig = (function() {
12447
13092
 
12448
13093
  /**
@@ -16490,6 +17135,7 @@ const sqlanvil = $root.sqlanvil = (() => {
16490
17135
  * @property {string|null} [engine] MysqlOptions engine
16491
17136
  * @property {string|null} [charset] MysqlOptions charset
16492
17137
  * @property {string|null} [collation] MysqlOptions collation
17138
+ * @property {string|null} [rowFormat] MysqlOptions rowFormat
16493
17139
  * @property {Array.<sqlanvil.MysqlOptions.IIndex>|null} [indexes] MysqlOptions indexes
16494
17140
  * @property {sqlanvil.MysqlOptions.IPartition|null} [partition] MysqlOptions partition
16495
17141
  */
@@ -16534,6 +17180,14 @@ const sqlanvil = $root.sqlanvil = (() => {
16534
17180
  */
16535
17181
  MysqlOptions.prototype.collation = "";
16536
17182
 
17183
+ /**
17184
+ * MysqlOptions rowFormat.
17185
+ * @member {string} rowFormat
17186
+ * @memberof sqlanvil.MysqlOptions
17187
+ * @instance
17188
+ */
17189
+ MysqlOptions.prototype.rowFormat = "";
17190
+
16537
17191
  /**
16538
17192
  * MysqlOptions indexes.
16539
17193
  * @member {Array.<sqlanvil.MysqlOptions.IIndex>} indexes
@@ -16589,6 +17243,8 @@ const sqlanvil = $root.sqlanvil = (() => {
16589
17243
  $root.sqlanvil.MysqlOptions.Index.encode(message.indexes[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim();
16590
17244
  if (message.partition != null && Object.hasOwnProperty.call(message, "partition"))
16591
17245
  $root.sqlanvil.MysqlOptions.Partition.encode(message.partition, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim();
17246
+ if (message.rowFormat != null && Object.hasOwnProperty.call(message, "rowFormat"))
17247
+ writer.uint32(/* id 6, wireType 2 =*/50).string(message.rowFormat);
16592
17248
  return writer;
16593
17249
  };
16594
17250
 
@@ -16641,6 +17297,10 @@ const sqlanvil = $root.sqlanvil = (() => {
16641
17297
  message.collation = reader.string();
16642
17298
  break;
16643
17299
  }
17300
+ case 6: {
17301
+ message.rowFormat = reader.string();
17302
+ break;
17303
+ }
16644
17304
  case 4: {
16645
17305
  if (!(message.indexes && message.indexes.length))
16646
17306
  message.indexes = [];
@@ -16699,6 +17359,9 @@ const sqlanvil = $root.sqlanvil = (() => {
16699
17359
  if (message.collation != null && Object.hasOwnProperty.call(message, "collation"))
16700
17360
  if (!$util.isString(message.collation))
16701
17361
  return "collation: string expected";
17362
+ if (message.rowFormat != null && Object.hasOwnProperty.call(message, "rowFormat"))
17363
+ if (!$util.isString(message.rowFormat))
17364
+ return "rowFormat: string expected";
16702
17365
  if (message.indexes != null && Object.hasOwnProperty.call(message, "indexes")) {
16703
17366
  if (!Array.isArray(message.indexes))
16704
17367
  return "indexes: array expected";
@@ -16740,6 +17403,8 @@ const sqlanvil = $root.sqlanvil = (() => {
16740
17403
  message.charset = String(object.charset);
16741
17404
  if (object.collation != null)
16742
17405
  message.collation = String(object.collation);
17406
+ if (object.rowFormat != null)
17407
+ message.rowFormat = String(object.rowFormat);
16743
17408
  if (object.indexes) {
16744
17409
  if (!Array.isArray(object.indexes))
16745
17410
  throw TypeError(".sqlanvil.MysqlOptions.indexes: array expected");
@@ -16782,6 +17447,7 @@ const sqlanvil = $root.sqlanvil = (() => {
16782
17447
  object.charset = "";
16783
17448
  object.collation = "";
16784
17449
  object.partition = null;
17450
+ object.rowFormat = "";
16785
17451
  }
16786
17452
  if (message.engine != null && Object.hasOwnProperty.call(message, "engine"))
16787
17453
  object.engine = message.engine;
@@ -16796,6 +17462,8 @@ const sqlanvil = $root.sqlanvil = (() => {
16796
17462
  }
16797
17463
  if (message.partition != null && Object.hasOwnProperty.call(message, "partition"))
16798
17464
  object.partition = $root.sqlanvil.MysqlOptions.Partition.toObject(message.partition, options, q + 1);
17465
+ if (message.rowFormat != null && Object.hasOwnProperty.call(message, "rowFormat"))
17466
+ object.rowFormat = message.rowFormat;
16799
17467
  return object;
16800
17468
  };
16801
17469
 
@@ -16834,6 +17502,7 @@ const sqlanvil = $root.sqlanvil = (() => {
16834
17502
  * @property {string|null} [name] Index name
16835
17503
  * @property {Array.<string>|null} [columns] Index columns
16836
17504
  * @property {boolean|null} [unique] Index unique
17505
+ * @property {string|null} [type] Index type
16837
17506
  */
16838
17507
 
16839
17508
  /**
@@ -16876,6 +17545,14 @@ const sqlanvil = $root.sqlanvil = (() => {
16876
17545
  */
16877
17546
  Index.prototype.unique = false;
16878
17547
 
17548
+ /**
17549
+ * Index type.
17550
+ * @member {string} type
17551
+ * @memberof sqlanvil.MysqlOptions.Index
17552
+ * @instance
17553
+ */
17554
+ Index.prototype.type = "";
17555
+
16879
17556
  /**
16880
17557
  * Creates a new Index instance using the specified properties.
16881
17558
  * @function create
@@ -16911,6 +17588,8 @@ const sqlanvil = $root.sqlanvil = (() => {
16911
17588
  writer.uint32(/* id 2, wireType 2 =*/18).string(message.columns[i]);
16912
17589
  if (message.unique != null && Object.hasOwnProperty.call(message, "unique"))
16913
17590
  writer.uint32(/* id 3, wireType 0 =*/24).bool(message.unique);
17591
+ if (message.type != null && Object.hasOwnProperty.call(message, "type"))
17592
+ writer.uint32(/* id 4, wireType 2 =*/34).string(message.type);
16914
17593
  return writer;
16915
17594
  };
16916
17595
 
@@ -16965,6 +17644,10 @@ const sqlanvil = $root.sqlanvil = (() => {
16965
17644
  message.unique = reader.bool();
16966
17645
  break;
16967
17646
  }
17647
+ case 4: {
17648
+ message.type = reader.string();
17649
+ break;
17650
+ }
16968
17651
  default:
16969
17652
  reader.skipType(tag & 7, long);
16970
17653
  break;
@@ -17017,6 +17700,9 @@ const sqlanvil = $root.sqlanvil = (() => {
17017
17700
  if (message.unique != null && Object.hasOwnProperty.call(message, "unique"))
17018
17701
  if (typeof message.unique !== "boolean")
17019
17702
  return "unique: boolean expected";
17703
+ if (message.type != null && Object.hasOwnProperty.call(message, "type"))
17704
+ if (!$util.isString(message.type))
17705
+ return "type: string expected";
17020
17706
  return null;
17021
17707
  };
17022
17708
 
@@ -17049,6 +17735,8 @@ const sqlanvil = $root.sqlanvil = (() => {
17049
17735
  }
17050
17736
  if (object.unique != null)
17051
17737
  message.unique = Boolean(object.unique);
17738
+ if (object.type != null)
17739
+ message.type = String(object.type);
17052
17740
  return message;
17053
17741
  };
17054
17742
 
@@ -17074,6 +17762,7 @@ const sqlanvil = $root.sqlanvil = (() => {
17074
17762
  if (options.defaults) {
17075
17763
  object.name = "";
17076
17764
  object.unique = false;
17765
+ object.type = "";
17077
17766
  }
17078
17767
  if (message.name != null && Object.hasOwnProperty.call(message, "name"))
17079
17768
  object.name = message.name;
@@ -17084,6 +17773,8 @@ const sqlanvil = $root.sqlanvil = (() => {
17084
17773
  }
17085
17774
  if (message.unique != null && Object.hasOwnProperty.call(message, "unique"))
17086
17775
  object.unique = message.unique;
17776
+ if (message.type != null && Object.hasOwnProperty.call(message, "type"))
17777
+ object.type = message.type;
17087
17778
  return object;
17088
17779
  };
17089
17780
 
@@ -26972,93 +27663,787 @@ const sqlanvil = $root.sqlanvil = (() => {
26972
27663
  }
26973
27664
  if (message.actionDescriptor != null && Object.hasOwnProperty.call(message, "actionDescriptor"))
26974
27665
  object.actionDescriptor = $root.sqlanvil.ActionDescriptor.toObject(message.actionDescriptor, options, q + 1);
26975
- if (message.location != null && Object.hasOwnProperty.call(message, "location"))
26976
- object.location = message.location;
26977
- if (message.format != null && Object.hasOwnProperty.call(message, "format"))
26978
- object.format = message.format;
26979
- if (message.overwrite != null && Object.hasOwnProperty.call(message, "overwrite"))
26980
- object.overwrite = message.overwrite;
27666
+ if (message.location != null && Object.hasOwnProperty.call(message, "location"))
27667
+ object.location = message.location;
27668
+ if (message.format != null && Object.hasOwnProperty.call(message, "format"))
27669
+ object.format = message.format;
27670
+ if (message.overwrite != null && Object.hasOwnProperty.call(message, "overwrite"))
27671
+ object.overwrite = message.overwrite;
27672
+ let keys2;
27673
+ if (message.options && (keys2 = Object.keys(message.options)).length) {
27674
+ object.options = {};
27675
+ for (let j = 0; j < keys2.length; ++j) {
27676
+ if (keys2[j] === "__proto__")
27677
+ $util.makeProp(object.options, keys2[j]);
27678
+ object.options[keys2[j]] = message.options[keys2[j]];
27679
+ }
27680
+ }
27681
+ if (message.fileName != null && Object.hasOwnProperty.call(message, "fileName"))
27682
+ object.fileName = message.fileName;
27683
+ if (message.jitCode != null && Object.hasOwnProperty.call(message, "jitCode"))
27684
+ object.jitCode = message.jitCode;
27685
+ return object;
27686
+ };
27687
+
27688
+ /**
27689
+ * Converts this Import to JSON.
27690
+ * @function toJSON
27691
+ * @memberof sqlanvil.Import
27692
+ * @instance
27693
+ * @returns {Object.<string,*>} JSON object
27694
+ */
27695
+ Import.prototype.toJSON = function toJSON() {
27696
+ return this.constructor.toObject(this, $protobuf__namespace.util.toJSONOptions);
27697
+ };
27698
+
27699
+ /**
27700
+ * Gets the default type url for Import
27701
+ * @function getTypeUrl
27702
+ * @memberof sqlanvil.Import
27703
+ * @static
27704
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
27705
+ * @returns {string} The default type url
27706
+ */
27707
+ Import.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
27708
+ if (typeUrlPrefix === undefined) {
27709
+ typeUrlPrefix = "type.googleapis.com";
27710
+ }
27711
+ return typeUrlPrefix + "/sqlanvil.Import";
27712
+ };
27713
+
27714
+ return Import;
27715
+ })();
27716
+
27717
+ sqlanvil.Extract = (function() {
27718
+
27719
+ /**
27720
+ * Properties of an Extract.
27721
+ * @memberof sqlanvil
27722
+ * @interface IExtract
27723
+ * @property {sqlanvil.ITarget|null} [target] Extract target
27724
+ * @property {sqlanvil.ITarget|null} [canonicalTarget] Extract canonicalTarget
27725
+ * @property {Array.<sqlanvil.ITarget>|null} [dependencyTargets] Extract dependencyTargets
27726
+ * @property {sqlanvil.ActionHermeticity|null} [hermeticity] Extract hermeticity
27727
+ * @property {boolean|null} [disabled] Extract disabled
27728
+ * @property {Array.<string>|null} [tags] Extract tags
27729
+ * @property {sqlanvil.IActionDescriptor|null} [actionDescriptor] Extract actionDescriptor
27730
+ * @property {string|null} [connectionName] Extract connectionName
27731
+ * @property {string|null} [platform] Extract platform
27732
+ * @property {string|null} [project] Extract project
27733
+ * @property {string|null} [dataset] Extract dataset
27734
+ * @property {string|null} [sourceName] Extract sourceName
27735
+ * @property {string|null} [billingProject] Extract billingProject
27736
+ * @property {Object.<string,string>|null} [columnTypes] Extract columnTypes
27737
+ * @property {string|null} [fileName] Extract fileName
27738
+ * @property {string|null} [database] Extract database
27739
+ */
27740
+
27741
+ /**
27742
+ * Constructs a new Extract.
27743
+ * @memberof sqlanvil
27744
+ * @classdesc Represents an Extract.
27745
+ * @implements IExtract
27746
+ * @constructor
27747
+ * @param {sqlanvil.IExtract=} [properties] Properties to set
27748
+ */
27749
+ function Extract(properties) {
27750
+ this.dependencyTargets = [];
27751
+ this.tags = [];
27752
+ this.columnTypes = {};
27753
+ if (properties)
27754
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
27755
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
27756
+ this[keys[i]] = properties[keys[i]];
27757
+ }
27758
+
27759
+ /**
27760
+ * Extract target.
27761
+ * @member {sqlanvil.ITarget|null|undefined} target
27762
+ * @memberof sqlanvil.Extract
27763
+ * @instance
27764
+ */
27765
+ Extract.prototype.target = null;
27766
+
27767
+ /**
27768
+ * Extract canonicalTarget.
27769
+ * @member {sqlanvil.ITarget|null|undefined} canonicalTarget
27770
+ * @memberof sqlanvil.Extract
27771
+ * @instance
27772
+ */
27773
+ Extract.prototype.canonicalTarget = null;
27774
+
27775
+ /**
27776
+ * Extract dependencyTargets.
27777
+ * @member {Array.<sqlanvil.ITarget>} dependencyTargets
27778
+ * @memberof sqlanvil.Extract
27779
+ * @instance
27780
+ */
27781
+ Extract.prototype.dependencyTargets = $util.emptyArray;
27782
+
27783
+ /**
27784
+ * Extract hermeticity.
27785
+ * @member {sqlanvil.ActionHermeticity} hermeticity
27786
+ * @memberof sqlanvil.Extract
27787
+ * @instance
27788
+ */
27789
+ Extract.prototype.hermeticity = 0;
27790
+
27791
+ /**
27792
+ * Extract disabled.
27793
+ * @member {boolean} disabled
27794
+ * @memberof sqlanvil.Extract
27795
+ * @instance
27796
+ */
27797
+ Extract.prototype.disabled = false;
27798
+
27799
+ /**
27800
+ * Extract tags.
27801
+ * @member {Array.<string>} tags
27802
+ * @memberof sqlanvil.Extract
27803
+ * @instance
27804
+ */
27805
+ Extract.prototype.tags = $util.emptyArray;
27806
+
27807
+ /**
27808
+ * Extract actionDescriptor.
27809
+ * @member {sqlanvil.IActionDescriptor|null|undefined} actionDescriptor
27810
+ * @memberof sqlanvil.Extract
27811
+ * @instance
27812
+ */
27813
+ Extract.prototype.actionDescriptor = null;
27814
+
27815
+ /**
27816
+ * Extract connectionName.
27817
+ * @member {string} connectionName
27818
+ * @memberof sqlanvil.Extract
27819
+ * @instance
27820
+ */
27821
+ Extract.prototype.connectionName = "";
27822
+
27823
+ /**
27824
+ * Extract platform.
27825
+ * @member {string} platform
27826
+ * @memberof sqlanvil.Extract
27827
+ * @instance
27828
+ */
27829
+ Extract.prototype.platform = "";
27830
+
27831
+ /**
27832
+ * Extract project.
27833
+ * @member {string} project
27834
+ * @memberof sqlanvil.Extract
27835
+ * @instance
27836
+ */
27837
+ Extract.prototype.project = "";
27838
+
27839
+ /**
27840
+ * Extract dataset.
27841
+ * @member {string} dataset
27842
+ * @memberof sqlanvil.Extract
27843
+ * @instance
27844
+ */
27845
+ Extract.prototype.dataset = "";
27846
+
27847
+ /**
27848
+ * Extract sourceName.
27849
+ * @member {string} sourceName
27850
+ * @memberof sqlanvil.Extract
27851
+ * @instance
27852
+ */
27853
+ Extract.prototype.sourceName = "";
27854
+
27855
+ /**
27856
+ * Extract billingProject.
27857
+ * @member {string} billingProject
27858
+ * @memberof sqlanvil.Extract
27859
+ * @instance
27860
+ */
27861
+ Extract.prototype.billingProject = "";
27862
+
27863
+ /**
27864
+ * Extract columnTypes.
27865
+ * @member {Object.<string,string>} columnTypes
27866
+ * @memberof sqlanvil.Extract
27867
+ * @instance
27868
+ */
27869
+ Extract.prototype.columnTypes = $util.emptyObject;
27870
+
27871
+ /**
27872
+ * Extract fileName.
27873
+ * @member {string} fileName
27874
+ * @memberof sqlanvil.Extract
27875
+ * @instance
27876
+ */
27877
+ Extract.prototype.fileName = "";
27878
+
27879
+ /**
27880
+ * Extract database.
27881
+ * @member {string} database
27882
+ * @memberof sqlanvil.Extract
27883
+ * @instance
27884
+ */
27885
+ Extract.prototype.database = "";
27886
+
27887
+ /**
27888
+ * Creates a new Extract instance using the specified properties.
27889
+ * @function create
27890
+ * @memberof sqlanvil.Extract
27891
+ * @static
27892
+ * @param {sqlanvil.IExtract=} [properties] Properties to set
27893
+ * @returns {sqlanvil.Extract} Extract instance
27894
+ */
27895
+ Extract.create = function create(properties) {
27896
+ return new Extract(properties);
27897
+ };
27898
+
27899
+ /**
27900
+ * Encodes the specified Extract message. Does not implicitly {@link sqlanvil.Extract.verify|verify} messages.
27901
+ * @function encode
27902
+ * @memberof sqlanvil.Extract
27903
+ * @static
27904
+ * @param {sqlanvil.IExtract} message Extract message or plain object to encode
27905
+ * @param {$protobuf.Writer} [writer] Writer to encode to
27906
+ * @returns {$protobuf.Writer} Writer
27907
+ */
27908
+ Extract.encode = function encode(message, writer, q) {
27909
+ if (!writer)
27910
+ writer = $Writer.create();
27911
+ if (q === undefined)
27912
+ q = 0;
27913
+ if (q > $util.recursionLimit)
27914
+ throw Error("max depth exceeded");
27915
+ if (message.target != null && Object.hasOwnProperty.call(message, "target"))
27916
+ $root.sqlanvil.Target.encode(message.target, writer.uint32(/* id 1, wireType 2 =*/10).fork(), q + 1).ldelim();
27917
+ if (message.canonicalTarget != null && Object.hasOwnProperty.call(message, "canonicalTarget"))
27918
+ $root.sqlanvil.Target.encode(message.canonicalTarget, writer.uint32(/* id 2, wireType 2 =*/18).fork(), q + 1).ldelim();
27919
+ if (message.dependencyTargets != null && message.dependencyTargets.length)
27920
+ for (let i = 0; i < message.dependencyTargets.length; ++i)
27921
+ $root.sqlanvil.Target.encode(message.dependencyTargets[i], writer.uint32(/* id 3, wireType 2 =*/26).fork(), q + 1).ldelim();
27922
+ if (message.hermeticity != null && Object.hasOwnProperty.call(message, "hermeticity"))
27923
+ writer.uint32(/* id 4, wireType 0 =*/32).int32(message.hermeticity);
27924
+ if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled"))
27925
+ writer.uint32(/* id 5, wireType 0 =*/40).bool(message.disabled);
27926
+ if (message.tags != null && message.tags.length)
27927
+ for (let i = 0; i < message.tags.length; ++i)
27928
+ writer.uint32(/* id 6, wireType 2 =*/50).string(message.tags[i]);
27929
+ if (message.actionDescriptor != null && Object.hasOwnProperty.call(message, "actionDescriptor"))
27930
+ $root.sqlanvil.ActionDescriptor.encode(message.actionDescriptor, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim();
27931
+ if (message.connectionName != null && Object.hasOwnProperty.call(message, "connectionName"))
27932
+ writer.uint32(/* id 8, wireType 2 =*/66).string(message.connectionName);
27933
+ if (message.platform != null && Object.hasOwnProperty.call(message, "platform"))
27934
+ writer.uint32(/* id 9, wireType 2 =*/74).string(message.platform);
27935
+ if (message.project != null && Object.hasOwnProperty.call(message, "project"))
27936
+ writer.uint32(/* id 10, wireType 2 =*/82).string(message.project);
27937
+ if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset"))
27938
+ writer.uint32(/* id 11, wireType 2 =*/90).string(message.dataset);
27939
+ if (message.sourceName != null && Object.hasOwnProperty.call(message, "sourceName"))
27940
+ writer.uint32(/* id 12, wireType 2 =*/98).string(message.sourceName);
27941
+ if (message.billingProject != null && Object.hasOwnProperty.call(message, "billingProject"))
27942
+ writer.uint32(/* id 13, wireType 2 =*/106).string(message.billingProject);
27943
+ if (message.columnTypes != null && Object.hasOwnProperty.call(message, "columnTypes"))
27944
+ for (let keys = Object.keys(message.columnTypes), i = 0; i < keys.length; ++i)
27945
+ writer.uint32(/* id 14, wireType 2 =*/114).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.columnTypes[keys[i]]).ldelim();
27946
+ if (message.fileName != null && Object.hasOwnProperty.call(message, "fileName"))
27947
+ writer.uint32(/* id 15, wireType 2 =*/122).string(message.fileName);
27948
+ if (message.database != null && Object.hasOwnProperty.call(message, "database"))
27949
+ writer.uint32(/* id 16, wireType 2 =*/130).string(message.database);
27950
+ return writer;
27951
+ };
27952
+
27953
+ /**
27954
+ * Encodes the specified Extract message, length delimited. Does not implicitly {@link sqlanvil.Extract.verify|verify} messages.
27955
+ * @function encodeDelimited
27956
+ * @memberof sqlanvil.Extract
27957
+ * @static
27958
+ * @param {sqlanvil.IExtract} message Extract message or plain object to encode
27959
+ * @param {$protobuf.Writer} [writer] Writer to encode to
27960
+ * @returns {$protobuf.Writer} Writer
27961
+ */
27962
+ Extract.encodeDelimited = function encodeDelimited(message, writer) {
27963
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
27964
+ };
27965
+
27966
+ /**
27967
+ * Decodes an Extract message from the specified reader or buffer.
27968
+ * @function decode
27969
+ * @memberof sqlanvil.Extract
27970
+ * @static
27971
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
27972
+ * @param {number} [length] Message length if known beforehand
27973
+ * @returns {sqlanvil.Extract} Extract
27974
+ * @throws {Error} If the payload is not a reader or valid buffer
27975
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
27976
+ */
27977
+ Extract.decode = function decode(reader, length, error, long) {
27978
+ if (!(reader instanceof $Reader))
27979
+ reader = $Reader.create(reader);
27980
+ if (long === undefined)
27981
+ long = 0;
27982
+ if (long > $Reader.recursionLimit)
27983
+ throw Error("maximum nesting depth exceeded");
27984
+ let end = length === undefined ? reader.len : reader.pos + length, message = new $root.sqlanvil.Extract(), key, value;
27985
+ while (reader.pos < end) {
27986
+ let tag = reader.uint32();
27987
+ if (tag === error)
27988
+ break;
27989
+ switch (tag >>> 3) {
27990
+ case 1: {
27991
+ message.target = $root.sqlanvil.Target.decode(reader, reader.uint32(), undefined, long + 1);
27992
+ break;
27993
+ }
27994
+ case 2: {
27995
+ message.canonicalTarget = $root.sqlanvil.Target.decode(reader, reader.uint32(), undefined, long + 1);
27996
+ break;
27997
+ }
27998
+ case 3: {
27999
+ if (!(message.dependencyTargets && message.dependencyTargets.length))
28000
+ message.dependencyTargets = [];
28001
+ message.dependencyTargets.push($root.sqlanvil.Target.decode(reader, reader.uint32(), undefined, long + 1));
28002
+ break;
28003
+ }
28004
+ case 4: {
28005
+ message.hermeticity = reader.int32();
28006
+ break;
28007
+ }
28008
+ case 5: {
28009
+ message.disabled = reader.bool();
28010
+ break;
28011
+ }
28012
+ case 6: {
28013
+ if (!(message.tags && message.tags.length))
28014
+ message.tags = [];
28015
+ message.tags.push(reader.string());
28016
+ break;
28017
+ }
28018
+ case 7: {
28019
+ message.actionDescriptor = $root.sqlanvil.ActionDescriptor.decode(reader, reader.uint32(), undefined, long + 1);
28020
+ break;
28021
+ }
28022
+ case 8: {
28023
+ message.connectionName = reader.string();
28024
+ break;
28025
+ }
28026
+ case 9: {
28027
+ message.platform = reader.string();
28028
+ break;
28029
+ }
28030
+ case 10: {
28031
+ message.project = reader.string();
28032
+ break;
28033
+ }
28034
+ case 11: {
28035
+ message.dataset = reader.string();
28036
+ break;
28037
+ }
28038
+ case 12: {
28039
+ message.sourceName = reader.string();
28040
+ break;
28041
+ }
28042
+ case 13: {
28043
+ message.billingProject = reader.string();
28044
+ break;
28045
+ }
28046
+ case 14: {
28047
+ if (message.columnTypes === $util.emptyObject)
28048
+ message.columnTypes = {};
28049
+ let end2 = reader.uint32() + reader.pos;
28050
+ key = "";
28051
+ value = "";
28052
+ while (reader.pos < end2) {
28053
+ let tag2 = reader.uint32();
28054
+ switch (tag2 >>> 3) {
28055
+ case 1:
28056
+ key = reader.string();
28057
+ break;
28058
+ case 2:
28059
+ value = reader.string();
28060
+ break;
28061
+ default:
28062
+ reader.skipType(tag2 & 7, long);
28063
+ break;
28064
+ }
28065
+ }
28066
+ if (key === "__proto__")
28067
+ $util.makeProp(message.columnTypes, key);
28068
+ message.columnTypes[key] = value;
28069
+ break;
28070
+ }
28071
+ case 15: {
28072
+ message.fileName = reader.string();
28073
+ break;
28074
+ }
28075
+ case 16: {
28076
+ message.database = reader.string();
28077
+ break;
28078
+ }
28079
+ default:
28080
+ reader.skipType(tag & 7, long);
28081
+ break;
28082
+ }
28083
+ }
28084
+ return message;
28085
+ };
28086
+
28087
+ /**
28088
+ * Decodes an Extract message from the specified reader or buffer, length delimited.
28089
+ * @function decodeDelimited
28090
+ * @memberof sqlanvil.Extract
28091
+ * @static
28092
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
28093
+ * @returns {sqlanvil.Extract} Extract
28094
+ * @throws {Error} If the payload is not a reader or valid buffer
28095
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
28096
+ */
28097
+ Extract.decodeDelimited = function decodeDelimited(reader) {
28098
+ if (!(reader instanceof $Reader))
28099
+ reader = new $Reader(reader);
28100
+ return this.decode(reader, reader.uint32());
28101
+ };
28102
+
28103
+ /**
28104
+ * Verifies an Extract message.
28105
+ * @function verify
28106
+ * @memberof sqlanvil.Extract
28107
+ * @static
28108
+ * @param {Object.<string,*>} message Plain object to verify
28109
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
28110
+ */
28111
+ Extract.verify = function verify(message, long) {
28112
+ if (typeof message !== "object" || message === null)
28113
+ return "object expected";
28114
+ if (long === undefined)
28115
+ long = 0;
28116
+ if (long > $util.recursionLimit)
28117
+ return "maximum nesting depth exceeded";
28118
+ if (message.target != null && Object.hasOwnProperty.call(message, "target")) {
28119
+ let error = $root.sqlanvil.Target.verify(message.target, long + 1);
28120
+ if (error)
28121
+ return "target." + error;
28122
+ }
28123
+ if (message.canonicalTarget != null && Object.hasOwnProperty.call(message, "canonicalTarget")) {
28124
+ let error = $root.sqlanvil.Target.verify(message.canonicalTarget, long + 1);
28125
+ if (error)
28126
+ return "canonicalTarget." + error;
28127
+ }
28128
+ if (message.dependencyTargets != null && Object.hasOwnProperty.call(message, "dependencyTargets")) {
28129
+ if (!Array.isArray(message.dependencyTargets))
28130
+ return "dependencyTargets: array expected";
28131
+ for (let i = 0; i < message.dependencyTargets.length; ++i) {
28132
+ let error = $root.sqlanvil.Target.verify(message.dependencyTargets[i], long + 1);
28133
+ if (error)
28134
+ return "dependencyTargets." + error;
28135
+ }
28136
+ }
28137
+ if (message.hermeticity != null && Object.hasOwnProperty.call(message, "hermeticity"))
28138
+ switch (message.hermeticity) {
28139
+ default:
28140
+ return "hermeticity: enum value expected";
28141
+ case 0:
28142
+ case 1:
28143
+ case 2:
28144
+ break;
28145
+ }
28146
+ if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled"))
28147
+ if (typeof message.disabled !== "boolean")
28148
+ return "disabled: boolean expected";
28149
+ if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) {
28150
+ if (!Array.isArray(message.tags))
28151
+ return "tags: array expected";
28152
+ for (let i = 0; i < message.tags.length; ++i)
28153
+ if (!$util.isString(message.tags[i]))
28154
+ return "tags: string[] expected";
28155
+ }
28156
+ if (message.actionDescriptor != null && Object.hasOwnProperty.call(message, "actionDescriptor")) {
28157
+ let error = $root.sqlanvil.ActionDescriptor.verify(message.actionDescriptor, long + 1);
28158
+ if (error)
28159
+ return "actionDescriptor." + error;
28160
+ }
28161
+ if (message.connectionName != null && Object.hasOwnProperty.call(message, "connectionName"))
28162
+ if (!$util.isString(message.connectionName))
28163
+ return "connectionName: string expected";
28164
+ if (message.platform != null && Object.hasOwnProperty.call(message, "platform"))
28165
+ if (!$util.isString(message.platform))
28166
+ return "platform: string expected";
28167
+ if (message.project != null && Object.hasOwnProperty.call(message, "project"))
28168
+ if (!$util.isString(message.project))
28169
+ return "project: string expected";
28170
+ if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset"))
28171
+ if (!$util.isString(message.dataset))
28172
+ return "dataset: string expected";
28173
+ if (message.sourceName != null && Object.hasOwnProperty.call(message, "sourceName"))
28174
+ if (!$util.isString(message.sourceName))
28175
+ return "sourceName: string expected";
28176
+ if (message.billingProject != null && Object.hasOwnProperty.call(message, "billingProject"))
28177
+ if (!$util.isString(message.billingProject))
28178
+ return "billingProject: string expected";
28179
+ if (message.columnTypes != null && Object.hasOwnProperty.call(message, "columnTypes")) {
28180
+ if (!$util.isObject(message.columnTypes))
28181
+ return "columnTypes: object expected";
28182
+ let key = Object.keys(message.columnTypes);
28183
+ for (let i = 0; i < key.length; ++i)
28184
+ if (!$util.isString(message.columnTypes[key[i]]))
28185
+ return "columnTypes: string{k:string} expected";
28186
+ }
28187
+ if (message.fileName != null && Object.hasOwnProperty.call(message, "fileName"))
28188
+ if (!$util.isString(message.fileName))
28189
+ return "fileName: string expected";
28190
+ if (message.database != null && Object.hasOwnProperty.call(message, "database"))
28191
+ if (!$util.isString(message.database))
28192
+ return "database: string expected";
28193
+ return null;
28194
+ };
28195
+
28196
+ /**
28197
+ * Creates an Extract message from a plain object. Also converts values to their respective internal types.
28198
+ * @function fromObject
28199
+ * @memberof sqlanvil.Extract
28200
+ * @static
28201
+ * @param {Object.<string,*>} object Plain object
28202
+ * @returns {sqlanvil.Extract} Extract
28203
+ */
28204
+ Extract.fromObject = function fromObject(object, long) {
28205
+ if (object instanceof $root.sqlanvil.Extract)
28206
+ return object;
28207
+ if (!$util.isObject(object))
28208
+ throw TypeError(".sqlanvil.Extract: object expected");
28209
+ if (long === undefined)
28210
+ long = 0;
28211
+ if (long > $util.recursionLimit)
28212
+ throw Error("maximum nesting depth exceeded");
28213
+ let message = new $root.sqlanvil.Extract();
28214
+ if (object.target != null) {
28215
+ if (!$util.isObject(object.target))
28216
+ throw TypeError(".sqlanvil.Extract.target: object expected");
28217
+ message.target = $root.sqlanvil.Target.fromObject(object.target, long + 1);
28218
+ }
28219
+ if (object.canonicalTarget != null) {
28220
+ if (!$util.isObject(object.canonicalTarget))
28221
+ throw TypeError(".sqlanvil.Extract.canonicalTarget: object expected");
28222
+ message.canonicalTarget = $root.sqlanvil.Target.fromObject(object.canonicalTarget, long + 1);
28223
+ }
28224
+ if (object.dependencyTargets) {
28225
+ if (!Array.isArray(object.dependencyTargets))
28226
+ throw TypeError(".sqlanvil.Extract.dependencyTargets: array expected");
28227
+ message.dependencyTargets = [];
28228
+ for (let i = 0; i < object.dependencyTargets.length; ++i) {
28229
+ if (!$util.isObject(object.dependencyTargets[i]))
28230
+ throw TypeError(".sqlanvil.Extract.dependencyTargets: object expected");
28231
+ message.dependencyTargets[i] = $root.sqlanvil.Target.fromObject(object.dependencyTargets[i], long + 1);
28232
+ }
28233
+ }
28234
+ switch (object.hermeticity) {
28235
+ default:
28236
+ if (typeof object.hermeticity === "number") {
28237
+ message.hermeticity = object.hermeticity;
28238
+ break;
28239
+ }
28240
+ break;
28241
+ case "UNKNOWN":
28242
+ case 0:
28243
+ message.hermeticity = 0;
28244
+ break;
28245
+ case "HERMETIC":
28246
+ case 1:
28247
+ message.hermeticity = 1;
28248
+ break;
28249
+ case "NON_HERMETIC":
28250
+ case 2:
28251
+ message.hermeticity = 2;
28252
+ break;
28253
+ }
28254
+ if (object.disabled != null)
28255
+ message.disabled = Boolean(object.disabled);
28256
+ if (object.tags) {
28257
+ if (!Array.isArray(object.tags))
28258
+ throw TypeError(".sqlanvil.Extract.tags: array expected");
28259
+ message.tags = [];
28260
+ for (let i = 0; i < object.tags.length; ++i)
28261
+ message.tags[i] = String(object.tags[i]);
28262
+ }
28263
+ if (object.actionDescriptor != null) {
28264
+ if (!$util.isObject(object.actionDescriptor))
28265
+ throw TypeError(".sqlanvil.Extract.actionDescriptor: object expected");
28266
+ message.actionDescriptor = $root.sqlanvil.ActionDescriptor.fromObject(object.actionDescriptor, long + 1);
28267
+ }
28268
+ if (object.connectionName != null)
28269
+ message.connectionName = String(object.connectionName);
28270
+ if (object.platform != null)
28271
+ message.platform = String(object.platform);
28272
+ if (object.project != null)
28273
+ message.project = String(object.project);
28274
+ if (object.dataset != null)
28275
+ message.dataset = String(object.dataset);
28276
+ if (object.sourceName != null)
28277
+ message.sourceName = String(object.sourceName);
28278
+ if (object.billingProject != null)
28279
+ message.billingProject = String(object.billingProject);
28280
+ if (object.columnTypes) {
28281
+ if (!$util.isObject(object.columnTypes))
28282
+ throw TypeError(".sqlanvil.Extract.columnTypes: object expected");
28283
+ message.columnTypes = {};
28284
+ for (let keys = Object.keys(object.columnTypes), i = 0; i < keys.length; ++i) {
28285
+ if (keys[i] === "__proto__")
28286
+ $util.makeProp(message.columnTypes, keys[i]);
28287
+ message.columnTypes[keys[i]] = String(object.columnTypes[keys[i]]);
28288
+ }
28289
+ }
28290
+ if (object.fileName != null)
28291
+ message.fileName = String(object.fileName);
28292
+ if (object.database != null)
28293
+ message.database = String(object.database);
28294
+ return message;
28295
+ };
28296
+
28297
+ /**
28298
+ * Creates a plain object from an Extract message. Also converts values to other types if specified.
28299
+ * @function toObject
28300
+ * @memberof sqlanvil.Extract
28301
+ * @static
28302
+ * @param {sqlanvil.Extract} message Extract
28303
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
28304
+ * @returns {Object.<string,*>} Plain object
28305
+ */
28306
+ Extract.toObject = function toObject(message, options, q) {
28307
+ if (!options)
28308
+ options = {};
28309
+ if (q === undefined)
28310
+ q = 0;
28311
+ if (q > $util.recursionLimit)
28312
+ throw Error("max depth exceeded");
28313
+ let object = {};
28314
+ if (options.arrays || options.defaults) {
28315
+ object.dependencyTargets = [];
28316
+ object.tags = [];
28317
+ }
28318
+ if (options.objects || options.defaults)
28319
+ object.columnTypes = {};
28320
+ if (options.defaults) {
28321
+ object.target = null;
28322
+ object.canonicalTarget = null;
28323
+ object.hermeticity = options.enums === String ? "UNKNOWN" : 0;
28324
+ object.disabled = false;
28325
+ object.actionDescriptor = null;
28326
+ object.connectionName = "";
28327
+ object.platform = "";
28328
+ object.project = "";
28329
+ object.dataset = "";
28330
+ object.sourceName = "";
28331
+ object.billingProject = "";
28332
+ object.fileName = "";
28333
+ object.database = "";
28334
+ }
28335
+ if (message.target != null && Object.hasOwnProperty.call(message, "target"))
28336
+ object.target = $root.sqlanvil.Target.toObject(message.target, options, q + 1);
28337
+ if (message.canonicalTarget != null && Object.hasOwnProperty.call(message, "canonicalTarget"))
28338
+ object.canonicalTarget = $root.sqlanvil.Target.toObject(message.canonicalTarget, options, q + 1);
28339
+ if (message.dependencyTargets && message.dependencyTargets.length) {
28340
+ object.dependencyTargets = [];
28341
+ for (let j = 0; j < message.dependencyTargets.length; ++j)
28342
+ object.dependencyTargets[j] = $root.sqlanvil.Target.toObject(message.dependencyTargets[j], options, q + 1);
28343
+ }
28344
+ if (message.hermeticity != null && Object.hasOwnProperty.call(message, "hermeticity"))
28345
+ object.hermeticity = options.enums === String ? $root.sqlanvil.ActionHermeticity[message.hermeticity] === undefined ? message.hermeticity : $root.sqlanvil.ActionHermeticity[message.hermeticity] : message.hermeticity;
28346
+ if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled"))
28347
+ object.disabled = message.disabled;
28348
+ if (message.tags && message.tags.length) {
28349
+ object.tags = [];
28350
+ for (let j = 0; j < message.tags.length; ++j)
28351
+ object.tags[j] = message.tags[j];
28352
+ }
28353
+ if (message.actionDescriptor != null && Object.hasOwnProperty.call(message, "actionDescriptor"))
28354
+ object.actionDescriptor = $root.sqlanvil.ActionDescriptor.toObject(message.actionDescriptor, options, q + 1);
28355
+ if (message.connectionName != null && Object.hasOwnProperty.call(message, "connectionName"))
28356
+ object.connectionName = message.connectionName;
28357
+ if (message.platform != null && Object.hasOwnProperty.call(message, "platform"))
28358
+ object.platform = message.platform;
28359
+ if (message.project != null && Object.hasOwnProperty.call(message, "project"))
28360
+ object.project = message.project;
28361
+ if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset"))
28362
+ object.dataset = message.dataset;
28363
+ if (message.sourceName != null && Object.hasOwnProperty.call(message, "sourceName"))
28364
+ object.sourceName = message.sourceName;
28365
+ if (message.billingProject != null && Object.hasOwnProperty.call(message, "billingProject"))
28366
+ object.billingProject = message.billingProject;
26981
28367
  let keys2;
26982
- if (message.options && (keys2 = Object.keys(message.options)).length) {
26983
- object.options = {};
28368
+ if (message.columnTypes && (keys2 = Object.keys(message.columnTypes)).length) {
28369
+ object.columnTypes = {};
26984
28370
  for (let j = 0; j < keys2.length; ++j) {
26985
28371
  if (keys2[j] === "__proto__")
26986
- $util.makeProp(object.options, keys2[j]);
26987
- object.options[keys2[j]] = message.options[keys2[j]];
28372
+ $util.makeProp(object.columnTypes, keys2[j]);
28373
+ object.columnTypes[keys2[j]] = message.columnTypes[keys2[j]];
26988
28374
  }
26989
28375
  }
26990
28376
  if (message.fileName != null && Object.hasOwnProperty.call(message, "fileName"))
26991
28377
  object.fileName = message.fileName;
26992
- if (message.jitCode != null && Object.hasOwnProperty.call(message, "jitCode"))
26993
- object.jitCode = message.jitCode;
28378
+ if (message.database != null && Object.hasOwnProperty.call(message, "database"))
28379
+ object.database = message.database;
26994
28380
  return object;
26995
28381
  };
26996
28382
 
26997
28383
  /**
26998
- * Converts this Import to JSON.
28384
+ * Converts this Extract to JSON.
26999
28385
  * @function toJSON
27000
- * @memberof sqlanvil.Import
28386
+ * @memberof sqlanvil.Extract
27001
28387
  * @instance
27002
28388
  * @returns {Object.<string,*>} JSON object
27003
28389
  */
27004
- Import.prototype.toJSON = function toJSON() {
28390
+ Extract.prototype.toJSON = function toJSON() {
27005
28391
  return this.constructor.toObject(this, $protobuf__namespace.util.toJSONOptions);
27006
28392
  };
27007
28393
 
27008
28394
  /**
27009
- * Gets the default type url for Import
28395
+ * Gets the default type url for Extract
27010
28396
  * @function getTypeUrl
27011
- * @memberof sqlanvil.Import
28397
+ * @memberof sqlanvil.Extract
27012
28398
  * @static
27013
28399
  * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
27014
28400
  * @returns {string} The default type url
27015
28401
  */
27016
- Import.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
28402
+ Extract.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
27017
28403
  if (typeUrlPrefix === undefined) {
27018
28404
  typeUrlPrefix = "type.googleapis.com";
27019
28405
  }
27020
- return typeUrlPrefix + "/sqlanvil.Import";
28406
+ return typeUrlPrefix + "/sqlanvil.Extract";
27021
28407
  };
27022
28408
 
27023
- return Import;
28409
+ return Extract;
27024
28410
  })();
27025
28411
 
27026
- sqlanvil.Extract = (function() {
28412
+ sqlanvil.Script = (function() {
27027
28413
 
27028
28414
  /**
27029
- * Properties of an Extract.
28415
+ * Properties of a Script.
27030
28416
  * @memberof sqlanvil
27031
- * @interface IExtract
27032
- * @property {sqlanvil.ITarget|null} [target] Extract target
27033
- * @property {sqlanvil.ITarget|null} [canonicalTarget] Extract canonicalTarget
27034
- * @property {Array.<sqlanvil.ITarget>|null} [dependencyTargets] Extract dependencyTargets
27035
- * @property {sqlanvil.ActionHermeticity|null} [hermeticity] Extract hermeticity
27036
- * @property {boolean|null} [disabled] Extract disabled
27037
- * @property {Array.<string>|null} [tags] Extract tags
27038
- * @property {sqlanvil.IActionDescriptor|null} [actionDescriptor] Extract actionDescriptor
27039
- * @property {string|null} [connectionName] Extract connectionName
27040
- * @property {string|null} [platform] Extract platform
27041
- * @property {string|null} [project] Extract project
27042
- * @property {string|null} [dataset] Extract dataset
27043
- * @property {string|null} [sourceName] Extract sourceName
27044
- * @property {string|null} [billingProject] Extract billingProject
27045
- * @property {Object.<string,string>|null} [columnTypes] Extract columnTypes
27046
- * @property {string|null} [fileName] Extract fileName
27047
- * @property {string|null} [database] Extract database
27048
- */
27049
-
27050
- /**
27051
- * Constructs a new Extract.
28417
+ * @interface IScript
28418
+ * @property {sqlanvil.ITarget|null} [target] Script target
28419
+ * @property {sqlanvil.ITarget|null} [canonicalTarget] Script canonicalTarget
28420
+ * @property {Array.<sqlanvil.ITarget>|null} [dependencyTargets] Script dependencyTargets
28421
+ * @property {sqlanvil.ActionHermeticity|null} [hermeticity] Script hermeticity
28422
+ * @property {boolean|null} [disabled] Script disabled
28423
+ * @property {Array.<string>|null} [tags] Script tags
28424
+ * @property {sqlanvil.IActionDescriptor|null} [actionDescriptor] Script actionDescriptor
28425
+ * @property {string|null} [language] Script language
28426
+ * @property {string|null} [scriptFilename] Script scriptFilename
28427
+ * @property {Array.<string>|null} [args] Script args
28428
+ * @property {string|null} [depsFile] Script depsFile
28429
+ * @property {string|null} [runtimeVersion] Script runtimeVersion
28430
+ * @property {string|null} [envRoot] Script envRoot
28431
+ * @property {number|null} [timeoutMillis] Script timeoutMillis
28432
+ * @property {string|null} [fileName] Script fileName
28433
+ */
28434
+
28435
+ /**
28436
+ * Constructs a new Script.
27052
28437
  * @memberof sqlanvil
27053
- * @classdesc Represents an Extract.
27054
- * @implements IExtract
28438
+ * @classdesc Represents a Script.
28439
+ * @implements IScript
27055
28440
  * @constructor
27056
- * @param {sqlanvil.IExtract=} [properties] Properties to set
28441
+ * @param {sqlanvil.IScript=} [properties] Properties to set
27057
28442
  */
27058
- function Extract(properties) {
28443
+ function Script(properties) {
27059
28444
  this.dependencyTargets = [];
27060
28445
  this.tags = [];
27061
- this.columnTypes = {};
28446
+ this.args = [];
27062
28447
  if (properties)
27063
28448
  for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
27064
28449
  if (properties[keys[i]] != null && keys[i] !== "__proto__")
@@ -27066,155 +28451,147 @@ const sqlanvil = $root.sqlanvil = (() => {
27066
28451
  }
27067
28452
 
27068
28453
  /**
27069
- * Extract target.
28454
+ * Script target.
27070
28455
  * @member {sqlanvil.ITarget|null|undefined} target
27071
- * @memberof sqlanvil.Extract
28456
+ * @memberof sqlanvil.Script
27072
28457
  * @instance
27073
28458
  */
27074
- Extract.prototype.target = null;
28459
+ Script.prototype.target = null;
27075
28460
 
27076
28461
  /**
27077
- * Extract canonicalTarget.
28462
+ * Script canonicalTarget.
27078
28463
  * @member {sqlanvil.ITarget|null|undefined} canonicalTarget
27079
- * @memberof sqlanvil.Extract
28464
+ * @memberof sqlanvil.Script
27080
28465
  * @instance
27081
28466
  */
27082
- Extract.prototype.canonicalTarget = null;
28467
+ Script.prototype.canonicalTarget = null;
27083
28468
 
27084
28469
  /**
27085
- * Extract dependencyTargets.
28470
+ * Script dependencyTargets.
27086
28471
  * @member {Array.<sqlanvil.ITarget>} dependencyTargets
27087
- * @memberof sqlanvil.Extract
28472
+ * @memberof sqlanvil.Script
27088
28473
  * @instance
27089
28474
  */
27090
- Extract.prototype.dependencyTargets = $util.emptyArray;
28475
+ Script.prototype.dependencyTargets = $util.emptyArray;
27091
28476
 
27092
28477
  /**
27093
- * Extract hermeticity.
28478
+ * Script hermeticity.
27094
28479
  * @member {sqlanvil.ActionHermeticity} hermeticity
27095
- * @memberof sqlanvil.Extract
28480
+ * @memberof sqlanvil.Script
27096
28481
  * @instance
27097
28482
  */
27098
- Extract.prototype.hermeticity = 0;
28483
+ Script.prototype.hermeticity = 0;
27099
28484
 
27100
28485
  /**
27101
- * Extract disabled.
28486
+ * Script disabled.
27102
28487
  * @member {boolean} disabled
27103
- * @memberof sqlanvil.Extract
28488
+ * @memberof sqlanvil.Script
27104
28489
  * @instance
27105
28490
  */
27106
- Extract.prototype.disabled = false;
28491
+ Script.prototype.disabled = false;
27107
28492
 
27108
28493
  /**
27109
- * Extract tags.
28494
+ * Script tags.
27110
28495
  * @member {Array.<string>} tags
27111
- * @memberof sqlanvil.Extract
28496
+ * @memberof sqlanvil.Script
27112
28497
  * @instance
27113
28498
  */
27114
- Extract.prototype.tags = $util.emptyArray;
28499
+ Script.prototype.tags = $util.emptyArray;
27115
28500
 
27116
28501
  /**
27117
- * Extract actionDescriptor.
28502
+ * Script actionDescriptor.
27118
28503
  * @member {sqlanvil.IActionDescriptor|null|undefined} actionDescriptor
27119
- * @memberof sqlanvil.Extract
28504
+ * @memberof sqlanvil.Script
27120
28505
  * @instance
27121
28506
  */
27122
- Extract.prototype.actionDescriptor = null;
28507
+ Script.prototype.actionDescriptor = null;
27123
28508
 
27124
28509
  /**
27125
- * Extract connectionName.
27126
- * @member {string} connectionName
27127
- * @memberof sqlanvil.Extract
28510
+ * Script language.
28511
+ * @member {string} language
28512
+ * @memberof sqlanvil.Script
27128
28513
  * @instance
27129
28514
  */
27130
- Extract.prototype.connectionName = "";
28515
+ Script.prototype.language = "";
27131
28516
 
27132
28517
  /**
27133
- * Extract platform.
27134
- * @member {string} platform
27135
- * @memberof sqlanvil.Extract
28518
+ * Script scriptFilename.
28519
+ * @member {string} scriptFilename
28520
+ * @memberof sqlanvil.Script
27136
28521
  * @instance
27137
28522
  */
27138
- Extract.prototype.platform = "";
28523
+ Script.prototype.scriptFilename = "";
27139
28524
 
27140
28525
  /**
27141
- * Extract project.
27142
- * @member {string} project
27143
- * @memberof sqlanvil.Extract
28526
+ * Script args.
28527
+ * @member {Array.<string>} args
28528
+ * @memberof sqlanvil.Script
27144
28529
  * @instance
27145
28530
  */
27146
- Extract.prototype.project = "";
28531
+ Script.prototype.args = $util.emptyArray;
27147
28532
 
27148
28533
  /**
27149
- * Extract dataset.
27150
- * @member {string} dataset
27151
- * @memberof sqlanvil.Extract
28534
+ * Script depsFile.
28535
+ * @member {string} depsFile
28536
+ * @memberof sqlanvil.Script
27152
28537
  * @instance
27153
28538
  */
27154
- Extract.prototype.dataset = "";
28539
+ Script.prototype.depsFile = "";
27155
28540
 
27156
28541
  /**
27157
- * Extract sourceName.
27158
- * @member {string} sourceName
27159
- * @memberof sqlanvil.Extract
28542
+ * Script runtimeVersion.
28543
+ * @member {string} runtimeVersion
28544
+ * @memberof sqlanvil.Script
27160
28545
  * @instance
27161
28546
  */
27162
- Extract.prototype.sourceName = "";
28547
+ Script.prototype.runtimeVersion = "";
27163
28548
 
27164
28549
  /**
27165
- * Extract billingProject.
27166
- * @member {string} billingProject
27167
- * @memberof sqlanvil.Extract
28550
+ * Script envRoot.
28551
+ * @member {string} envRoot
28552
+ * @memberof sqlanvil.Script
27168
28553
  * @instance
27169
28554
  */
27170
- Extract.prototype.billingProject = "";
28555
+ Script.prototype.envRoot = "";
27171
28556
 
27172
28557
  /**
27173
- * Extract columnTypes.
27174
- * @member {Object.<string,string>} columnTypes
27175
- * @memberof sqlanvil.Extract
28558
+ * Script timeoutMillis.
28559
+ * @member {number} timeoutMillis
28560
+ * @memberof sqlanvil.Script
27176
28561
  * @instance
27177
28562
  */
27178
- Extract.prototype.columnTypes = $util.emptyObject;
28563
+ Script.prototype.timeoutMillis = 0;
27179
28564
 
27180
28565
  /**
27181
- * Extract fileName.
28566
+ * Script fileName.
27182
28567
  * @member {string} fileName
27183
- * @memberof sqlanvil.Extract
27184
- * @instance
27185
- */
27186
- Extract.prototype.fileName = "";
27187
-
27188
- /**
27189
- * Extract database.
27190
- * @member {string} database
27191
- * @memberof sqlanvil.Extract
28568
+ * @memberof sqlanvil.Script
27192
28569
  * @instance
27193
28570
  */
27194
- Extract.prototype.database = "";
28571
+ Script.prototype.fileName = "";
27195
28572
 
27196
28573
  /**
27197
- * Creates a new Extract instance using the specified properties.
28574
+ * Creates a new Script instance using the specified properties.
27198
28575
  * @function create
27199
- * @memberof sqlanvil.Extract
28576
+ * @memberof sqlanvil.Script
27200
28577
  * @static
27201
- * @param {sqlanvil.IExtract=} [properties] Properties to set
27202
- * @returns {sqlanvil.Extract} Extract instance
28578
+ * @param {sqlanvil.IScript=} [properties] Properties to set
28579
+ * @returns {sqlanvil.Script} Script instance
27203
28580
  */
27204
- Extract.create = function create(properties) {
27205
- return new Extract(properties);
28581
+ Script.create = function create(properties) {
28582
+ return new Script(properties);
27206
28583
  };
27207
28584
 
27208
28585
  /**
27209
- * Encodes the specified Extract message. Does not implicitly {@link sqlanvil.Extract.verify|verify} messages.
28586
+ * Encodes the specified Script message. Does not implicitly {@link sqlanvil.Script.verify|verify} messages.
27210
28587
  * @function encode
27211
- * @memberof sqlanvil.Extract
28588
+ * @memberof sqlanvil.Script
27212
28589
  * @static
27213
- * @param {sqlanvil.IExtract} message Extract message or plain object to encode
28590
+ * @param {sqlanvil.IScript} message Script message or plain object to encode
27214
28591
  * @param {$protobuf.Writer} [writer] Writer to encode to
27215
28592
  * @returns {$protobuf.Writer} Writer
27216
28593
  */
27217
- Extract.encode = function encode(message, writer, q) {
28594
+ Script.encode = function encode(message, writer, q) {
27218
28595
  if (!writer)
27219
28596
  writer = $Writer.create();
27220
28597
  if (q === undefined)
@@ -27237,60 +28614,58 @@ const sqlanvil = $root.sqlanvil = (() => {
27237
28614
  writer.uint32(/* id 6, wireType 2 =*/50).string(message.tags[i]);
27238
28615
  if (message.actionDescriptor != null && Object.hasOwnProperty.call(message, "actionDescriptor"))
27239
28616
  $root.sqlanvil.ActionDescriptor.encode(message.actionDescriptor, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim();
27240
- if (message.connectionName != null && Object.hasOwnProperty.call(message, "connectionName"))
27241
- writer.uint32(/* id 8, wireType 2 =*/66).string(message.connectionName);
27242
- if (message.platform != null && Object.hasOwnProperty.call(message, "platform"))
27243
- writer.uint32(/* id 9, wireType 2 =*/74).string(message.platform);
27244
- if (message.project != null && Object.hasOwnProperty.call(message, "project"))
27245
- writer.uint32(/* id 10, wireType 2 =*/82).string(message.project);
27246
- if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset"))
27247
- writer.uint32(/* id 11, wireType 2 =*/90).string(message.dataset);
27248
- if (message.sourceName != null && Object.hasOwnProperty.call(message, "sourceName"))
27249
- writer.uint32(/* id 12, wireType 2 =*/98).string(message.sourceName);
27250
- if (message.billingProject != null && Object.hasOwnProperty.call(message, "billingProject"))
27251
- writer.uint32(/* id 13, wireType 2 =*/106).string(message.billingProject);
27252
- if (message.columnTypes != null && Object.hasOwnProperty.call(message, "columnTypes"))
27253
- for (let keys = Object.keys(message.columnTypes), i = 0; i < keys.length; ++i)
27254
- writer.uint32(/* id 14, wireType 2 =*/114).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.columnTypes[keys[i]]).ldelim();
28617
+ if (message.language != null && Object.hasOwnProperty.call(message, "language"))
28618
+ writer.uint32(/* id 8, wireType 2 =*/66).string(message.language);
28619
+ if (message.scriptFilename != null && Object.hasOwnProperty.call(message, "scriptFilename"))
28620
+ writer.uint32(/* id 9, wireType 2 =*/74).string(message.scriptFilename);
28621
+ if (message.args != null && message.args.length)
28622
+ for (let i = 0; i < message.args.length; ++i)
28623
+ writer.uint32(/* id 10, wireType 2 =*/82).string(message.args[i]);
28624
+ if (message.depsFile != null && Object.hasOwnProperty.call(message, "depsFile"))
28625
+ writer.uint32(/* id 11, wireType 2 =*/90).string(message.depsFile);
28626
+ if (message.runtimeVersion != null && Object.hasOwnProperty.call(message, "runtimeVersion"))
28627
+ writer.uint32(/* id 12, wireType 2 =*/98).string(message.runtimeVersion);
28628
+ if (message.envRoot != null && Object.hasOwnProperty.call(message, "envRoot"))
28629
+ writer.uint32(/* id 13, wireType 2 =*/106).string(message.envRoot);
28630
+ if (message.timeoutMillis != null && Object.hasOwnProperty.call(message, "timeoutMillis"))
28631
+ writer.uint32(/* id 14, wireType 0 =*/112).int32(message.timeoutMillis);
27255
28632
  if (message.fileName != null && Object.hasOwnProperty.call(message, "fileName"))
27256
28633
  writer.uint32(/* id 15, wireType 2 =*/122).string(message.fileName);
27257
- if (message.database != null && Object.hasOwnProperty.call(message, "database"))
27258
- writer.uint32(/* id 16, wireType 2 =*/130).string(message.database);
27259
28634
  return writer;
27260
28635
  };
27261
28636
 
27262
28637
  /**
27263
- * Encodes the specified Extract message, length delimited. Does not implicitly {@link sqlanvil.Extract.verify|verify} messages.
28638
+ * Encodes the specified Script message, length delimited. Does not implicitly {@link sqlanvil.Script.verify|verify} messages.
27264
28639
  * @function encodeDelimited
27265
- * @memberof sqlanvil.Extract
28640
+ * @memberof sqlanvil.Script
27266
28641
  * @static
27267
- * @param {sqlanvil.IExtract} message Extract message or plain object to encode
28642
+ * @param {sqlanvil.IScript} message Script message or plain object to encode
27268
28643
  * @param {$protobuf.Writer} [writer] Writer to encode to
27269
28644
  * @returns {$protobuf.Writer} Writer
27270
28645
  */
27271
- Extract.encodeDelimited = function encodeDelimited(message, writer) {
28646
+ Script.encodeDelimited = function encodeDelimited(message, writer) {
27272
28647
  return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
27273
28648
  };
27274
28649
 
27275
28650
  /**
27276
- * Decodes an Extract message from the specified reader or buffer.
28651
+ * Decodes a Script message from the specified reader or buffer.
27277
28652
  * @function decode
27278
- * @memberof sqlanvil.Extract
28653
+ * @memberof sqlanvil.Script
27279
28654
  * @static
27280
28655
  * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
27281
28656
  * @param {number} [length] Message length if known beforehand
27282
- * @returns {sqlanvil.Extract} Extract
28657
+ * @returns {sqlanvil.Script} Script
27283
28658
  * @throws {Error} If the payload is not a reader or valid buffer
27284
28659
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
27285
28660
  */
27286
- Extract.decode = function decode(reader, length, error, long) {
28661
+ Script.decode = function decode(reader, length, error, long) {
27287
28662
  if (!(reader instanceof $Reader))
27288
28663
  reader = $Reader.create(reader);
27289
28664
  if (long === undefined)
27290
28665
  long = 0;
27291
28666
  if (long > $Reader.recursionLimit)
27292
28667
  throw Error("maximum nesting depth exceeded");
27293
- let end = length === undefined ? reader.len : reader.pos + length, message = new $root.sqlanvil.Extract(), key, value;
28668
+ let end = length === undefined ? reader.len : reader.pos + length, message = new $root.sqlanvil.Script();
27294
28669
  while (reader.pos < end) {
27295
28670
  let tag = reader.uint32();
27296
28671
  if (tag === error)
@@ -27329,62 +28704,39 @@ const sqlanvil = $root.sqlanvil = (() => {
27329
28704
  break;
27330
28705
  }
27331
28706
  case 8: {
27332
- message.connectionName = reader.string();
28707
+ message.language = reader.string();
27333
28708
  break;
27334
28709
  }
27335
28710
  case 9: {
27336
- message.platform = reader.string();
28711
+ message.scriptFilename = reader.string();
27337
28712
  break;
27338
28713
  }
27339
28714
  case 10: {
27340
- message.project = reader.string();
28715
+ if (!(message.args && message.args.length))
28716
+ message.args = [];
28717
+ message.args.push(reader.string());
27341
28718
  break;
27342
28719
  }
27343
28720
  case 11: {
27344
- message.dataset = reader.string();
28721
+ message.depsFile = reader.string();
27345
28722
  break;
27346
28723
  }
27347
28724
  case 12: {
27348
- message.sourceName = reader.string();
28725
+ message.runtimeVersion = reader.string();
27349
28726
  break;
27350
28727
  }
27351
28728
  case 13: {
27352
- message.billingProject = reader.string();
28729
+ message.envRoot = reader.string();
27353
28730
  break;
27354
28731
  }
27355
28732
  case 14: {
27356
- if (message.columnTypes === $util.emptyObject)
27357
- message.columnTypes = {};
27358
- let end2 = reader.uint32() + reader.pos;
27359
- key = "";
27360
- value = "";
27361
- while (reader.pos < end2) {
27362
- let tag2 = reader.uint32();
27363
- switch (tag2 >>> 3) {
27364
- case 1:
27365
- key = reader.string();
27366
- break;
27367
- case 2:
27368
- value = reader.string();
27369
- break;
27370
- default:
27371
- reader.skipType(tag2 & 7, long);
27372
- break;
27373
- }
27374
- }
27375
- if (key === "__proto__")
27376
- $util.makeProp(message.columnTypes, key);
27377
- message.columnTypes[key] = value;
28733
+ message.timeoutMillis = reader.int32();
27378
28734
  break;
27379
28735
  }
27380
28736
  case 15: {
27381
28737
  message.fileName = reader.string();
27382
28738
  break;
27383
28739
  }
27384
- case 16: {
27385
- message.database = reader.string();
27386
- break;
27387
- }
27388
28740
  default:
27389
28741
  reader.skipType(tag & 7, long);
27390
28742
  break;
@@ -27394,30 +28746,30 @@ const sqlanvil = $root.sqlanvil = (() => {
27394
28746
  };
27395
28747
 
27396
28748
  /**
27397
- * Decodes an Extract message from the specified reader or buffer, length delimited.
28749
+ * Decodes a Script message from the specified reader or buffer, length delimited.
27398
28750
  * @function decodeDelimited
27399
- * @memberof sqlanvil.Extract
28751
+ * @memberof sqlanvil.Script
27400
28752
  * @static
27401
28753
  * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
27402
- * @returns {sqlanvil.Extract} Extract
28754
+ * @returns {sqlanvil.Script} Script
27403
28755
  * @throws {Error} If the payload is not a reader or valid buffer
27404
28756
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
27405
28757
  */
27406
- Extract.decodeDelimited = function decodeDelimited(reader) {
28758
+ Script.decodeDelimited = function decodeDelimited(reader) {
27407
28759
  if (!(reader instanceof $Reader))
27408
28760
  reader = new $Reader(reader);
27409
28761
  return this.decode(reader, reader.uint32());
27410
28762
  };
27411
28763
 
27412
28764
  /**
27413
- * Verifies an Extract message.
28765
+ * Verifies a Script message.
27414
28766
  * @function verify
27415
- * @memberof sqlanvil.Extract
28767
+ * @memberof sqlanvil.Script
27416
28768
  * @static
27417
28769
  * @param {Object.<string,*>} message Plain object to verify
27418
28770
  * @returns {string|null} `null` if valid, otherwise the reason why it is not
27419
28771
  */
27420
- Extract.verify = function verify(message, long) {
28772
+ Script.verify = function verify(message, long) {
27421
28773
  if (typeof message !== "object" || message === null)
27422
28774
  return "object expected";
27423
28775
  if (long === undefined)
@@ -27467,76 +28819,72 @@ const sqlanvil = $root.sqlanvil = (() => {
27467
28819
  if (error)
27468
28820
  return "actionDescriptor." + error;
27469
28821
  }
27470
- if (message.connectionName != null && Object.hasOwnProperty.call(message, "connectionName"))
27471
- if (!$util.isString(message.connectionName))
27472
- return "connectionName: string expected";
27473
- if (message.platform != null && Object.hasOwnProperty.call(message, "platform"))
27474
- if (!$util.isString(message.platform))
27475
- return "platform: string expected";
27476
- if (message.project != null && Object.hasOwnProperty.call(message, "project"))
27477
- if (!$util.isString(message.project))
27478
- return "project: string expected";
27479
- if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset"))
27480
- if (!$util.isString(message.dataset))
27481
- return "dataset: string expected";
27482
- if (message.sourceName != null && Object.hasOwnProperty.call(message, "sourceName"))
27483
- if (!$util.isString(message.sourceName))
27484
- return "sourceName: string expected";
27485
- if (message.billingProject != null && Object.hasOwnProperty.call(message, "billingProject"))
27486
- if (!$util.isString(message.billingProject))
27487
- return "billingProject: string expected";
27488
- if (message.columnTypes != null && Object.hasOwnProperty.call(message, "columnTypes")) {
27489
- if (!$util.isObject(message.columnTypes))
27490
- return "columnTypes: object expected";
27491
- let key = Object.keys(message.columnTypes);
27492
- for (let i = 0; i < key.length; ++i)
27493
- if (!$util.isString(message.columnTypes[key[i]]))
27494
- return "columnTypes: string{k:string} expected";
27495
- }
28822
+ if (message.language != null && Object.hasOwnProperty.call(message, "language"))
28823
+ if (!$util.isString(message.language))
28824
+ return "language: string expected";
28825
+ if (message.scriptFilename != null && Object.hasOwnProperty.call(message, "scriptFilename"))
28826
+ if (!$util.isString(message.scriptFilename))
28827
+ return "scriptFilename: string expected";
28828
+ if (message.args != null && Object.hasOwnProperty.call(message, "args")) {
28829
+ if (!Array.isArray(message.args))
28830
+ return "args: array expected";
28831
+ for (let i = 0; i < message.args.length; ++i)
28832
+ if (!$util.isString(message.args[i]))
28833
+ return "args: string[] expected";
28834
+ }
28835
+ if (message.depsFile != null && Object.hasOwnProperty.call(message, "depsFile"))
28836
+ if (!$util.isString(message.depsFile))
28837
+ return "depsFile: string expected";
28838
+ if (message.runtimeVersion != null && Object.hasOwnProperty.call(message, "runtimeVersion"))
28839
+ if (!$util.isString(message.runtimeVersion))
28840
+ return "runtimeVersion: string expected";
28841
+ if (message.envRoot != null && Object.hasOwnProperty.call(message, "envRoot"))
28842
+ if (!$util.isString(message.envRoot))
28843
+ return "envRoot: string expected";
28844
+ if (message.timeoutMillis != null && Object.hasOwnProperty.call(message, "timeoutMillis"))
28845
+ if (!$util.isInteger(message.timeoutMillis))
28846
+ return "timeoutMillis: integer expected";
27496
28847
  if (message.fileName != null && Object.hasOwnProperty.call(message, "fileName"))
27497
28848
  if (!$util.isString(message.fileName))
27498
28849
  return "fileName: string expected";
27499
- if (message.database != null && Object.hasOwnProperty.call(message, "database"))
27500
- if (!$util.isString(message.database))
27501
- return "database: string expected";
27502
28850
  return null;
27503
28851
  };
27504
28852
 
27505
28853
  /**
27506
- * Creates an Extract message from a plain object. Also converts values to their respective internal types.
28854
+ * Creates a Script message from a plain object. Also converts values to their respective internal types.
27507
28855
  * @function fromObject
27508
- * @memberof sqlanvil.Extract
28856
+ * @memberof sqlanvil.Script
27509
28857
  * @static
27510
28858
  * @param {Object.<string,*>} object Plain object
27511
- * @returns {sqlanvil.Extract} Extract
28859
+ * @returns {sqlanvil.Script} Script
27512
28860
  */
27513
- Extract.fromObject = function fromObject(object, long) {
27514
- if (object instanceof $root.sqlanvil.Extract)
28861
+ Script.fromObject = function fromObject(object, long) {
28862
+ if (object instanceof $root.sqlanvil.Script)
27515
28863
  return object;
27516
28864
  if (!$util.isObject(object))
27517
- throw TypeError(".sqlanvil.Extract: object expected");
28865
+ throw TypeError(".sqlanvil.Script: object expected");
27518
28866
  if (long === undefined)
27519
28867
  long = 0;
27520
28868
  if (long > $util.recursionLimit)
27521
28869
  throw Error("maximum nesting depth exceeded");
27522
- let message = new $root.sqlanvil.Extract();
28870
+ let message = new $root.sqlanvil.Script();
27523
28871
  if (object.target != null) {
27524
28872
  if (!$util.isObject(object.target))
27525
- throw TypeError(".sqlanvil.Extract.target: object expected");
28873
+ throw TypeError(".sqlanvil.Script.target: object expected");
27526
28874
  message.target = $root.sqlanvil.Target.fromObject(object.target, long + 1);
27527
28875
  }
27528
28876
  if (object.canonicalTarget != null) {
27529
28877
  if (!$util.isObject(object.canonicalTarget))
27530
- throw TypeError(".sqlanvil.Extract.canonicalTarget: object expected");
28878
+ throw TypeError(".sqlanvil.Script.canonicalTarget: object expected");
27531
28879
  message.canonicalTarget = $root.sqlanvil.Target.fromObject(object.canonicalTarget, long + 1);
27532
28880
  }
27533
28881
  if (object.dependencyTargets) {
27534
28882
  if (!Array.isArray(object.dependencyTargets))
27535
- throw TypeError(".sqlanvil.Extract.dependencyTargets: array expected");
28883
+ throw TypeError(".sqlanvil.Script.dependencyTargets: array expected");
27536
28884
  message.dependencyTargets = [];
27537
28885
  for (let i = 0; i < object.dependencyTargets.length; ++i) {
27538
28886
  if (!$util.isObject(object.dependencyTargets[i]))
27539
- throw TypeError(".sqlanvil.Extract.dependencyTargets: object expected");
28887
+ throw TypeError(".sqlanvil.Script.dependencyTargets: object expected");
27540
28888
  message.dependencyTargets[i] = $root.sqlanvil.Target.fromObject(object.dependencyTargets[i], long + 1);
27541
28889
  }
27542
28890
  }
@@ -27564,55 +28912,50 @@ const sqlanvil = $root.sqlanvil = (() => {
27564
28912
  message.disabled = Boolean(object.disabled);
27565
28913
  if (object.tags) {
27566
28914
  if (!Array.isArray(object.tags))
27567
- throw TypeError(".sqlanvil.Extract.tags: array expected");
28915
+ throw TypeError(".sqlanvil.Script.tags: array expected");
27568
28916
  message.tags = [];
27569
28917
  for (let i = 0; i < object.tags.length; ++i)
27570
28918
  message.tags[i] = String(object.tags[i]);
27571
28919
  }
27572
28920
  if (object.actionDescriptor != null) {
27573
28921
  if (!$util.isObject(object.actionDescriptor))
27574
- throw TypeError(".sqlanvil.Extract.actionDescriptor: object expected");
28922
+ throw TypeError(".sqlanvil.Script.actionDescriptor: object expected");
27575
28923
  message.actionDescriptor = $root.sqlanvil.ActionDescriptor.fromObject(object.actionDescriptor, long + 1);
27576
28924
  }
27577
- if (object.connectionName != null)
27578
- message.connectionName = String(object.connectionName);
27579
- if (object.platform != null)
27580
- message.platform = String(object.platform);
27581
- if (object.project != null)
27582
- message.project = String(object.project);
27583
- if (object.dataset != null)
27584
- message.dataset = String(object.dataset);
27585
- if (object.sourceName != null)
27586
- message.sourceName = String(object.sourceName);
27587
- if (object.billingProject != null)
27588
- message.billingProject = String(object.billingProject);
27589
- if (object.columnTypes) {
27590
- if (!$util.isObject(object.columnTypes))
27591
- throw TypeError(".sqlanvil.Extract.columnTypes: object expected");
27592
- message.columnTypes = {};
27593
- for (let keys = Object.keys(object.columnTypes), i = 0; i < keys.length; ++i) {
27594
- if (keys[i] === "__proto__")
27595
- $util.makeProp(message.columnTypes, keys[i]);
27596
- message.columnTypes[keys[i]] = String(object.columnTypes[keys[i]]);
27597
- }
27598
- }
28925
+ if (object.language != null)
28926
+ message.language = String(object.language);
28927
+ if (object.scriptFilename != null)
28928
+ message.scriptFilename = String(object.scriptFilename);
28929
+ if (object.args) {
28930
+ if (!Array.isArray(object.args))
28931
+ throw TypeError(".sqlanvil.Script.args: array expected");
28932
+ message.args = [];
28933
+ for (let i = 0; i < object.args.length; ++i)
28934
+ message.args[i] = String(object.args[i]);
28935
+ }
28936
+ if (object.depsFile != null)
28937
+ message.depsFile = String(object.depsFile);
28938
+ if (object.runtimeVersion != null)
28939
+ message.runtimeVersion = String(object.runtimeVersion);
28940
+ if (object.envRoot != null)
28941
+ message.envRoot = String(object.envRoot);
28942
+ if (object.timeoutMillis != null)
28943
+ message.timeoutMillis = object.timeoutMillis | 0;
27599
28944
  if (object.fileName != null)
27600
28945
  message.fileName = String(object.fileName);
27601
- if (object.database != null)
27602
- message.database = String(object.database);
27603
28946
  return message;
27604
28947
  };
27605
28948
 
27606
28949
  /**
27607
- * Creates a plain object from an Extract message. Also converts values to other types if specified.
28950
+ * Creates a plain object from a Script message. Also converts values to other types if specified.
27608
28951
  * @function toObject
27609
- * @memberof sqlanvil.Extract
28952
+ * @memberof sqlanvil.Script
27610
28953
  * @static
27611
- * @param {sqlanvil.Extract} message Extract
28954
+ * @param {sqlanvil.Script} message Script
27612
28955
  * @param {$protobuf.IConversionOptions} [options] Conversion options
27613
28956
  * @returns {Object.<string,*>} Plain object
27614
28957
  */
27615
- Extract.toObject = function toObject(message, options, q) {
28958
+ Script.toObject = function toObject(message, options, q) {
27616
28959
  if (!options)
27617
28960
  options = {};
27618
28961
  if (q === undefined)
@@ -27623,23 +28966,21 @@ const sqlanvil = $root.sqlanvil = (() => {
27623
28966
  if (options.arrays || options.defaults) {
27624
28967
  object.dependencyTargets = [];
27625
28968
  object.tags = [];
28969
+ object.args = [];
27626
28970
  }
27627
- if (options.objects || options.defaults)
27628
- object.columnTypes = {};
27629
28971
  if (options.defaults) {
27630
28972
  object.target = null;
27631
28973
  object.canonicalTarget = null;
27632
28974
  object.hermeticity = options.enums === String ? "UNKNOWN" : 0;
27633
28975
  object.disabled = false;
27634
28976
  object.actionDescriptor = null;
27635
- object.connectionName = "";
27636
- object.platform = "";
27637
- object.project = "";
27638
- object.dataset = "";
27639
- object.sourceName = "";
27640
- object.billingProject = "";
28977
+ object.language = "";
28978
+ object.scriptFilename = "";
28979
+ object.depsFile = "";
28980
+ object.runtimeVersion = "";
28981
+ object.envRoot = "";
28982
+ object.timeoutMillis = 0;
27641
28983
  object.fileName = "";
27642
- object.database = "";
27643
28984
  }
27644
28985
  if (message.target != null && Object.hasOwnProperty.call(message, "target"))
27645
28986
  object.target = $root.sqlanvil.Target.toObject(message.target, options, q + 1);
@@ -27661,61 +29002,55 @@ const sqlanvil = $root.sqlanvil = (() => {
27661
29002
  }
27662
29003
  if (message.actionDescriptor != null && Object.hasOwnProperty.call(message, "actionDescriptor"))
27663
29004
  object.actionDescriptor = $root.sqlanvil.ActionDescriptor.toObject(message.actionDescriptor, options, q + 1);
27664
- if (message.connectionName != null && Object.hasOwnProperty.call(message, "connectionName"))
27665
- object.connectionName = message.connectionName;
27666
- if (message.platform != null && Object.hasOwnProperty.call(message, "platform"))
27667
- object.platform = message.platform;
27668
- if (message.project != null && Object.hasOwnProperty.call(message, "project"))
27669
- object.project = message.project;
27670
- if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset"))
27671
- object.dataset = message.dataset;
27672
- if (message.sourceName != null && Object.hasOwnProperty.call(message, "sourceName"))
27673
- object.sourceName = message.sourceName;
27674
- if (message.billingProject != null && Object.hasOwnProperty.call(message, "billingProject"))
27675
- object.billingProject = message.billingProject;
27676
- let keys2;
27677
- if (message.columnTypes && (keys2 = Object.keys(message.columnTypes)).length) {
27678
- object.columnTypes = {};
27679
- for (let j = 0; j < keys2.length; ++j) {
27680
- if (keys2[j] === "__proto__")
27681
- $util.makeProp(object.columnTypes, keys2[j]);
27682
- object.columnTypes[keys2[j]] = message.columnTypes[keys2[j]];
27683
- }
27684
- }
29005
+ if (message.language != null && Object.hasOwnProperty.call(message, "language"))
29006
+ object.language = message.language;
29007
+ if (message.scriptFilename != null && Object.hasOwnProperty.call(message, "scriptFilename"))
29008
+ object.scriptFilename = message.scriptFilename;
29009
+ if (message.args && message.args.length) {
29010
+ object.args = [];
29011
+ for (let j = 0; j < message.args.length; ++j)
29012
+ object.args[j] = message.args[j];
29013
+ }
29014
+ if (message.depsFile != null && Object.hasOwnProperty.call(message, "depsFile"))
29015
+ object.depsFile = message.depsFile;
29016
+ if (message.runtimeVersion != null && Object.hasOwnProperty.call(message, "runtimeVersion"))
29017
+ object.runtimeVersion = message.runtimeVersion;
29018
+ if (message.envRoot != null && Object.hasOwnProperty.call(message, "envRoot"))
29019
+ object.envRoot = message.envRoot;
29020
+ if (message.timeoutMillis != null && Object.hasOwnProperty.call(message, "timeoutMillis"))
29021
+ object.timeoutMillis = message.timeoutMillis;
27685
29022
  if (message.fileName != null && Object.hasOwnProperty.call(message, "fileName"))
27686
29023
  object.fileName = message.fileName;
27687
- if (message.database != null && Object.hasOwnProperty.call(message, "database"))
27688
- object.database = message.database;
27689
29024
  return object;
27690
29025
  };
27691
29026
 
27692
29027
  /**
27693
- * Converts this Extract to JSON.
29028
+ * Converts this Script to JSON.
27694
29029
  * @function toJSON
27695
- * @memberof sqlanvil.Extract
29030
+ * @memberof sqlanvil.Script
27696
29031
  * @instance
27697
29032
  * @returns {Object.<string,*>} JSON object
27698
29033
  */
27699
- Extract.prototype.toJSON = function toJSON() {
29034
+ Script.prototype.toJSON = function toJSON() {
27700
29035
  return this.constructor.toObject(this, $protobuf__namespace.util.toJSONOptions);
27701
29036
  };
27702
29037
 
27703
29038
  /**
27704
- * Gets the default type url for Extract
29039
+ * Gets the default type url for Script
27705
29040
  * @function getTypeUrl
27706
- * @memberof sqlanvil.Extract
29041
+ * @memberof sqlanvil.Script
27707
29042
  * @static
27708
29043
  * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
27709
29044
  * @returns {string} The default type url
27710
29045
  */
27711
- Extract.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
29046
+ Script.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
27712
29047
  if (typeUrlPrefix === undefined) {
27713
29048
  typeUrlPrefix = "type.googleapis.com";
27714
29049
  }
27715
- return typeUrlPrefix + "/sqlanvil.Extract";
29050
+ return typeUrlPrefix + "/sqlanvil.Script";
27716
29051
  };
27717
29052
 
27718
- return Extract;
29053
+ return Script;
27719
29054
  })();
27720
29055
 
27721
29056
  sqlanvil.Assertion = (function() {
@@ -31795,6 +33130,7 @@ const sqlanvil = $root.sqlanvil = (() => {
31795
33130
  * @property {Array.<sqlanvil.IExport>|null} [exports] CompiledGraph exports
31796
33131
  * @property {Array.<sqlanvil.IImport>|null} [imports] CompiledGraph imports
31797
33132
  * @property {Array.<sqlanvil.IExtract>|null} [extracts] CompiledGraph extracts
33133
+ * @property {Array.<sqlanvil.IScript>|null} [scripts] CompiledGraph scripts
31798
33134
  * @property {sqlanvil.IGraphErrors|null} [graphErrors] CompiledGraph graphErrors
31799
33135
  * @property {string|null} [sqlanvilCoreVersion] CompiledGraph sqlanvilCoreVersion
31800
33136
  * @property {Array.<sqlanvil.ITarget>|null} [targets] CompiledGraph targets
@@ -31820,6 +33156,7 @@ const sqlanvil = $root.sqlanvil = (() => {
31820
33156
  this.exports = [];
31821
33157
  this.imports = [];
31822
33158
  this.extracts = [];
33159
+ this.scripts = [];
31823
33160
  this.targets = [];
31824
33161
  if (properties)
31825
33162
  for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
@@ -31915,6 +33252,14 @@ const sqlanvil = $root.sqlanvil = (() => {
31915
33252
  */
31916
33253
  CompiledGraph.prototype.extracts = $util.emptyArray;
31917
33254
 
33255
+ /**
33256
+ * CompiledGraph scripts.
33257
+ * @member {Array.<sqlanvil.IScript>} scripts
33258
+ * @memberof sqlanvil.CompiledGraph
33259
+ * @instance
33260
+ */
33261
+ CompiledGraph.prototype.scripts = $util.emptyArray;
33262
+
31918
33263
  /**
31919
33264
  * CompiledGraph graphErrors.
31920
33265
  * @member {sqlanvil.IGraphErrors|null|undefined} graphErrors
@@ -32016,6 +33361,9 @@ const sqlanvil = $root.sqlanvil = (() => {
32016
33361
  if (message.extracts != null && message.extracts.length)
32017
33362
  for (let i = 0; i < message.extracts.length; ++i)
32018
33363
  $root.sqlanvil.Extract.encode(message.extracts[i], writer.uint32(/* id 17, wireType 2 =*/138).fork(), q + 1).ldelim();
33364
+ if (message.scripts != null && message.scripts.length)
33365
+ for (let i = 0; i < message.scripts.length; ++i)
33366
+ $root.sqlanvil.Script.encode(message.scripts[i], writer.uint32(/* id 18, wireType 2 =*/146).fork(), q + 1).ldelim();
32019
33367
  return writer;
32020
33368
  };
32021
33369
 
@@ -32120,6 +33468,12 @@ const sqlanvil = $root.sqlanvil = (() => {
32120
33468
  message.extracts.push($root.sqlanvil.Extract.decode(reader, reader.uint32(), undefined, long + 1));
32121
33469
  break;
32122
33470
  }
33471
+ case 18: {
33472
+ if (!(message.scripts && message.scripts.length))
33473
+ message.scripts = [];
33474
+ message.scripts.push($root.sqlanvil.Script.decode(reader, reader.uint32(), undefined, long + 1));
33475
+ break;
33476
+ }
32123
33477
  case 7: {
32124
33478
  message.graphErrors = $root.sqlanvil.GraphErrors.decode(reader, reader.uint32(), undefined, long + 1);
32125
33479
  break;
@@ -32272,6 +33626,15 @@ const sqlanvil = $root.sqlanvil = (() => {
32272
33626
  return "extracts." + error;
32273
33627
  }
32274
33628
  }
33629
+ if (message.scripts != null && Object.hasOwnProperty.call(message, "scripts")) {
33630
+ if (!Array.isArray(message.scripts))
33631
+ return "scripts: array expected";
33632
+ for (let i = 0; i < message.scripts.length; ++i) {
33633
+ let error = $root.sqlanvil.Script.verify(message.scripts[i], long + 1);
33634
+ if (error)
33635
+ return "scripts." + error;
33636
+ }
33637
+ }
32275
33638
  if (message.graphErrors != null && Object.hasOwnProperty.call(message, "graphErrors")) {
32276
33639
  let error = $root.sqlanvil.GraphErrors.verify(message.graphErrors, long + 1);
32277
33640
  if (error)
@@ -32420,6 +33783,16 @@ const sqlanvil = $root.sqlanvil = (() => {
32420
33783
  message.extracts[i] = $root.sqlanvil.Extract.fromObject(object.extracts[i], long + 1);
32421
33784
  }
32422
33785
  }
33786
+ if (object.scripts) {
33787
+ if (!Array.isArray(object.scripts))
33788
+ throw TypeError(".sqlanvil.CompiledGraph.scripts: array expected");
33789
+ message.scripts = [];
33790
+ for (let i = 0; i < object.scripts.length; ++i) {
33791
+ if (!$util.isObject(object.scripts[i]))
33792
+ throw TypeError(".sqlanvil.CompiledGraph.scripts: object expected");
33793
+ message.scripts[i] = $root.sqlanvil.Script.fromObject(object.scripts[i], long + 1);
33794
+ }
33795
+ }
32423
33796
  if (object.graphErrors != null) {
32424
33797
  if (!$util.isObject(object.graphErrors))
32425
33798
  throw TypeError(".sqlanvil.CompiledGraph.graphErrors: object expected");
@@ -32474,6 +33847,7 @@ const sqlanvil = $root.sqlanvil = (() => {
32474
33847
  object.exports = [];
32475
33848
  object.imports = [];
32476
33849
  object.extracts = [];
33850
+ object.scripts = [];
32477
33851
  }
32478
33852
  if (options.defaults) {
32479
33853
  object.projectConfig = null;
@@ -32544,6 +33918,11 @@ const sqlanvil = $root.sqlanvil = (() => {
32544
33918
  for (let j = 0; j < message.extracts.length; ++j)
32545
33919
  object.extracts[j] = $root.sqlanvil.Extract.toObject(message.extracts[j], options, q + 1);
32546
33920
  }
33921
+ if (message.scripts && message.scripts.length) {
33922
+ object.scripts = [];
33923
+ for (let j = 0; j < message.scripts.length; ++j)
33924
+ object.scripts[j] = $root.sqlanvil.Script.toObject(message.scripts[j], options, q + 1);
33925
+ }
32547
33926
  return object;
32548
33927
  };
32549
33928
 
@@ -38287,6 +39666,389 @@ const sqlanvil = $root.sqlanvil = (() => {
38287
39666
  return ExtractSpec;
38288
39667
  })();
38289
39668
 
39669
+ sqlanvil.ScriptSpec = (function() {
39670
+
39671
+ /**
39672
+ * Properties of a ScriptSpec.
39673
+ * @memberof sqlanvil
39674
+ * @interface IScriptSpec
39675
+ * @property {string|null} [language] ScriptSpec language
39676
+ * @property {string|null} [filename] ScriptSpec filename
39677
+ * @property {Array.<string>|null} [args] ScriptSpec args
39678
+ * @property {string|null} [depsFile] ScriptSpec depsFile
39679
+ * @property {string|null} [runtimeVersion] ScriptSpec runtimeVersion
39680
+ * @property {string|null} [envRoot] ScriptSpec envRoot
39681
+ * @property {number|null} [timeoutMillis] ScriptSpec timeoutMillis
39682
+ */
39683
+
39684
+ /**
39685
+ * Constructs a new ScriptSpec.
39686
+ * @memberof sqlanvil
39687
+ * @classdesc Represents a ScriptSpec.
39688
+ * @implements IScriptSpec
39689
+ * @constructor
39690
+ * @param {sqlanvil.IScriptSpec=} [properties] Properties to set
39691
+ */
39692
+ function ScriptSpec(properties) {
39693
+ this.args = [];
39694
+ if (properties)
39695
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
39696
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
39697
+ this[keys[i]] = properties[keys[i]];
39698
+ }
39699
+
39700
+ /**
39701
+ * ScriptSpec language.
39702
+ * @member {string} language
39703
+ * @memberof sqlanvil.ScriptSpec
39704
+ * @instance
39705
+ */
39706
+ ScriptSpec.prototype.language = "";
39707
+
39708
+ /**
39709
+ * ScriptSpec filename.
39710
+ * @member {string} filename
39711
+ * @memberof sqlanvil.ScriptSpec
39712
+ * @instance
39713
+ */
39714
+ ScriptSpec.prototype.filename = "";
39715
+
39716
+ /**
39717
+ * ScriptSpec args.
39718
+ * @member {Array.<string>} args
39719
+ * @memberof sqlanvil.ScriptSpec
39720
+ * @instance
39721
+ */
39722
+ ScriptSpec.prototype.args = $util.emptyArray;
39723
+
39724
+ /**
39725
+ * ScriptSpec depsFile.
39726
+ * @member {string} depsFile
39727
+ * @memberof sqlanvil.ScriptSpec
39728
+ * @instance
39729
+ */
39730
+ ScriptSpec.prototype.depsFile = "";
39731
+
39732
+ /**
39733
+ * ScriptSpec runtimeVersion.
39734
+ * @member {string} runtimeVersion
39735
+ * @memberof sqlanvil.ScriptSpec
39736
+ * @instance
39737
+ */
39738
+ ScriptSpec.prototype.runtimeVersion = "";
39739
+
39740
+ /**
39741
+ * ScriptSpec envRoot.
39742
+ * @member {string} envRoot
39743
+ * @memberof sqlanvil.ScriptSpec
39744
+ * @instance
39745
+ */
39746
+ ScriptSpec.prototype.envRoot = "";
39747
+
39748
+ /**
39749
+ * ScriptSpec timeoutMillis.
39750
+ * @member {number} timeoutMillis
39751
+ * @memberof sqlanvil.ScriptSpec
39752
+ * @instance
39753
+ */
39754
+ ScriptSpec.prototype.timeoutMillis = 0;
39755
+
39756
+ /**
39757
+ * Creates a new ScriptSpec instance using the specified properties.
39758
+ * @function create
39759
+ * @memberof sqlanvil.ScriptSpec
39760
+ * @static
39761
+ * @param {sqlanvil.IScriptSpec=} [properties] Properties to set
39762
+ * @returns {sqlanvil.ScriptSpec} ScriptSpec instance
39763
+ */
39764
+ ScriptSpec.create = function create(properties) {
39765
+ return new ScriptSpec(properties);
39766
+ };
39767
+
39768
+ /**
39769
+ * Encodes the specified ScriptSpec message. Does not implicitly {@link sqlanvil.ScriptSpec.verify|verify} messages.
39770
+ * @function encode
39771
+ * @memberof sqlanvil.ScriptSpec
39772
+ * @static
39773
+ * @param {sqlanvil.IScriptSpec} message ScriptSpec message or plain object to encode
39774
+ * @param {$protobuf.Writer} [writer] Writer to encode to
39775
+ * @returns {$protobuf.Writer} Writer
39776
+ */
39777
+ ScriptSpec.encode = function encode(message, writer, q) {
39778
+ if (!writer)
39779
+ writer = $Writer.create();
39780
+ if (q === undefined)
39781
+ q = 0;
39782
+ if (q > $util.recursionLimit)
39783
+ throw Error("max depth exceeded");
39784
+ if (message.language != null && Object.hasOwnProperty.call(message, "language"))
39785
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.language);
39786
+ if (message.filename != null && Object.hasOwnProperty.call(message, "filename"))
39787
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.filename);
39788
+ if (message.args != null && message.args.length)
39789
+ for (let i = 0; i < message.args.length; ++i)
39790
+ writer.uint32(/* id 3, wireType 2 =*/26).string(message.args[i]);
39791
+ if (message.depsFile != null && Object.hasOwnProperty.call(message, "depsFile"))
39792
+ writer.uint32(/* id 4, wireType 2 =*/34).string(message.depsFile);
39793
+ if (message.runtimeVersion != null && Object.hasOwnProperty.call(message, "runtimeVersion"))
39794
+ writer.uint32(/* id 5, wireType 2 =*/42).string(message.runtimeVersion);
39795
+ if (message.envRoot != null && Object.hasOwnProperty.call(message, "envRoot"))
39796
+ writer.uint32(/* id 6, wireType 2 =*/50).string(message.envRoot);
39797
+ if (message.timeoutMillis != null && Object.hasOwnProperty.call(message, "timeoutMillis"))
39798
+ writer.uint32(/* id 7, wireType 0 =*/56).int32(message.timeoutMillis);
39799
+ return writer;
39800
+ };
39801
+
39802
+ /**
39803
+ * Encodes the specified ScriptSpec message, length delimited. Does not implicitly {@link sqlanvil.ScriptSpec.verify|verify} messages.
39804
+ * @function encodeDelimited
39805
+ * @memberof sqlanvil.ScriptSpec
39806
+ * @static
39807
+ * @param {sqlanvil.IScriptSpec} message ScriptSpec message or plain object to encode
39808
+ * @param {$protobuf.Writer} [writer] Writer to encode to
39809
+ * @returns {$protobuf.Writer} Writer
39810
+ */
39811
+ ScriptSpec.encodeDelimited = function encodeDelimited(message, writer) {
39812
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
39813
+ };
39814
+
39815
+ /**
39816
+ * Decodes a ScriptSpec message from the specified reader or buffer.
39817
+ * @function decode
39818
+ * @memberof sqlanvil.ScriptSpec
39819
+ * @static
39820
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
39821
+ * @param {number} [length] Message length if known beforehand
39822
+ * @returns {sqlanvil.ScriptSpec} ScriptSpec
39823
+ * @throws {Error} If the payload is not a reader or valid buffer
39824
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
39825
+ */
39826
+ ScriptSpec.decode = function decode(reader, length, error, long) {
39827
+ if (!(reader instanceof $Reader))
39828
+ reader = $Reader.create(reader);
39829
+ if (long === undefined)
39830
+ long = 0;
39831
+ if (long > $Reader.recursionLimit)
39832
+ throw Error("maximum nesting depth exceeded");
39833
+ let end = length === undefined ? reader.len : reader.pos + length, message = new $root.sqlanvil.ScriptSpec();
39834
+ while (reader.pos < end) {
39835
+ let tag = reader.uint32();
39836
+ if (tag === error)
39837
+ break;
39838
+ switch (tag >>> 3) {
39839
+ case 1: {
39840
+ message.language = reader.string();
39841
+ break;
39842
+ }
39843
+ case 2: {
39844
+ message.filename = reader.string();
39845
+ break;
39846
+ }
39847
+ case 3: {
39848
+ if (!(message.args && message.args.length))
39849
+ message.args = [];
39850
+ message.args.push(reader.string());
39851
+ break;
39852
+ }
39853
+ case 4: {
39854
+ message.depsFile = reader.string();
39855
+ break;
39856
+ }
39857
+ case 5: {
39858
+ message.runtimeVersion = reader.string();
39859
+ break;
39860
+ }
39861
+ case 6: {
39862
+ message.envRoot = reader.string();
39863
+ break;
39864
+ }
39865
+ case 7: {
39866
+ message.timeoutMillis = reader.int32();
39867
+ break;
39868
+ }
39869
+ default:
39870
+ reader.skipType(tag & 7, long);
39871
+ break;
39872
+ }
39873
+ }
39874
+ return message;
39875
+ };
39876
+
39877
+ /**
39878
+ * Decodes a ScriptSpec message from the specified reader or buffer, length delimited.
39879
+ * @function decodeDelimited
39880
+ * @memberof sqlanvil.ScriptSpec
39881
+ * @static
39882
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
39883
+ * @returns {sqlanvil.ScriptSpec} ScriptSpec
39884
+ * @throws {Error} If the payload is not a reader or valid buffer
39885
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
39886
+ */
39887
+ ScriptSpec.decodeDelimited = function decodeDelimited(reader) {
39888
+ if (!(reader instanceof $Reader))
39889
+ reader = new $Reader(reader);
39890
+ return this.decode(reader, reader.uint32());
39891
+ };
39892
+
39893
+ /**
39894
+ * Verifies a ScriptSpec message.
39895
+ * @function verify
39896
+ * @memberof sqlanvil.ScriptSpec
39897
+ * @static
39898
+ * @param {Object.<string,*>} message Plain object to verify
39899
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
39900
+ */
39901
+ ScriptSpec.verify = function verify(message, long) {
39902
+ if (typeof message !== "object" || message === null)
39903
+ return "object expected";
39904
+ if (long === undefined)
39905
+ long = 0;
39906
+ if (long > $util.recursionLimit)
39907
+ return "maximum nesting depth exceeded";
39908
+ if (message.language != null && Object.hasOwnProperty.call(message, "language"))
39909
+ if (!$util.isString(message.language))
39910
+ return "language: string expected";
39911
+ if (message.filename != null && Object.hasOwnProperty.call(message, "filename"))
39912
+ if (!$util.isString(message.filename))
39913
+ return "filename: string expected";
39914
+ if (message.args != null && Object.hasOwnProperty.call(message, "args")) {
39915
+ if (!Array.isArray(message.args))
39916
+ return "args: array expected";
39917
+ for (let i = 0; i < message.args.length; ++i)
39918
+ if (!$util.isString(message.args[i]))
39919
+ return "args: string[] expected";
39920
+ }
39921
+ if (message.depsFile != null && Object.hasOwnProperty.call(message, "depsFile"))
39922
+ if (!$util.isString(message.depsFile))
39923
+ return "depsFile: string expected";
39924
+ if (message.runtimeVersion != null && Object.hasOwnProperty.call(message, "runtimeVersion"))
39925
+ if (!$util.isString(message.runtimeVersion))
39926
+ return "runtimeVersion: string expected";
39927
+ if (message.envRoot != null && Object.hasOwnProperty.call(message, "envRoot"))
39928
+ if (!$util.isString(message.envRoot))
39929
+ return "envRoot: string expected";
39930
+ if (message.timeoutMillis != null && Object.hasOwnProperty.call(message, "timeoutMillis"))
39931
+ if (!$util.isInteger(message.timeoutMillis))
39932
+ return "timeoutMillis: integer expected";
39933
+ return null;
39934
+ };
39935
+
39936
+ /**
39937
+ * Creates a ScriptSpec message from a plain object. Also converts values to their respective internal types.
39938
+ * @function fromObject
39939
+ * @memberof sqlanvil.ScriptSpec
39940
+ * @static
39941
+ * @param {Object.<string,*>} object Plain object
39942
+ * @returns {sqlanvil.ScriptSpec} ScriptSpec
39943
+ */
39944
+ ScriptSpec.fromObject = function fromObject(object, long) {
39945
+ if (object instanceof $root.sqlanvil.ScriptSpec)
39946
+ return object;
39947
+ if (!$util.isObject(object))
39948
+ throw TypeError(".sqlanvil.ScriptSpec: object expected");
39949
+ if (long === undefined)
39950
+ long = 0;
39951
+ if (long > $util.recursionLimit)
39952
+ throw Error("maximum nesting depth exceeded");
39953
+ let message = new $root.sqlanvil.ScriptSpec();
39954
+ if (object.language != null)
39955
+ message.language = String(object.language);
39956
+ if (object.filename != null)
39957
+ message.filename = String(object.filename);
39958
+ if (object.args) {
39959
+ if (!Array.isArray(object.args))
39960
+ throw TypeError(".sqlanvil.ScriptSpec.args: array expected");
39961
+ message.args = [];
39962
+ for (let i = 0; i < object.args.length; ++i)
39963
+ message.args[i] = String(object.args[i]);
39964
+ }
39965
+ if (object.depsFile != null)
39966
+ message.depsFile = String(object.depsFile);
39967
+ if (object.runtimeVersion != null)
39968
+ message.runtimeVersion = String(object.runtimeVersion);
39969
+ if (object.envRoot != null)
39970
+ message.envRoot = String(object.envRoot);
39971
+ if (object.timeoutMillis != null)
39972
+ message.timeoutMillis = object.timeoutMillis | 0;
39973
+ return message;
39974
+ };
39975
+
39976
+ /**
39977
+ * Creates a plain object from a ScriptSpec message. Also converts values to other types if specified.
39978
+ * @function toObject
39979
+ * @memberof sqlanvil.ScriptSpec
39980
+ * @static
39981
+ * @param {sqlanvil.ScriptSpec} message ScriptSpec
39982
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
39983
+ * @returns {Object.<string,*>} Plain object
39984
+ */
39985
+ ScriptSpec.toObject = function toObject(message, options, q) {
39986
+ if (!options)
39987
+ options = {};
39988
+ if (q === undefined)
39989
+ q = 0;
39990
+ if (q > $util.recursionLimit)
39991
+ throw Error("max depth exceeded");
39992
+ let object = {};
39993
+ if (options.arrays || options.defaults)
39994
+ object.args = [];
39995
+ if (options.defaults) {
39996
+ object.language = "";
39997
+ object.filename = "";
39998
+ object.depsFile = "";
39999
+ object.runtimeVersion = "";
40000
+ object.envRoot = "";
40001
+ object.timeoutMillis = 0;
40002
+ }
40003
+ if (message.language != null && Object.hasOwnProperty.call(message, "language"))
40004
+ object.language = message.language;
40005
+ if (message.filename != null && Object.hasOwnProperty.call(message, "filename"))
40006
+ object.filename = message.filename;
40007
+ if (message.args && message.args.length) {
40008
+ object.args = [];
40009
+ for (let j = 0; j < message.args.length; ++j)
40010
+ object.args[j] = message.args[j];
40011
+ }
40012
+ if (message.depsFile != null && Object.hasOwnProperty.call(message, "depsFile"))
40013
+ object.depsFile = message.depsFile;
40014
+ if (message.runtimeVersion != null && Object.hasOwnProperty.call(message, "runtimeVersion"))
40015
+ object.runtimeVersion = message.runtimeVersion;
40016
+ if (message.envRoot != null && Object.hasOwnProperty.call(message, "envRoot"))
40017
+ object.envRoot = message.envRoot;
40018
+ if (message.timeoutMillis != null && Object.hasOwnProperty.call(message, "timeoutMillis"))
40019
+ object.timeoutMillis = message.timeoutMillis;
40020
+ return object;
40021
+ };
40022
+
40023
+ /**
40024
+ * Converts this ScriptSpec to JSON.
40025
+ * @function toJSON
40026
+ * @memberof sqlanvil.ScriptSpec
40027
+ * @instance
40028
+ * @returns {Object.<string,*>} JSON object
40029
+ */
40030
+ ScriptSpec.prototype.toJSON = function toJSON() {
40031
+ return this.constructor.toObject(this, $protobuf__namespace.util.toJSONOptions);
40032
+ };
40033
+
40034
+ /**
40035
+ * Gets the default type url for ScriptSpec
40036
+ * @function getTypeUrl
40037
+ * @memberof sqlanvil.ScriptSpec
40038
+ * @static
40039
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
40040
+ * @returns {string} The default type url
40041
+ */
40042
+ ScriptSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
40043
+ if (typeUrlPrefix === undefined) {
40044
+ typeUrlPrefix = "type.googleapis.com";
40045
+ }
40046
+ return typeUrlPrefix + "/sqlanvil.ScriptSpec";
40047
+ };
40048
+
40049
+ return ScriptSpec;
40050
+ })();
40051
+
38290
40052
  sqlanvil.ExecutionAction = (function() {
38291
40053
 
38292
40054
  /**
@@ -38305,6 +40067,7 @@ const sqlanvil = $root.sqlanvil = (() => {
38305
40067
  * @property {sqlanvil.IExportSpec|null} ["export"] ExecutionAction export
38306
40068
  * @property {sqlanvil.IImportSpec|null} ["import"] ExecutionAction import
38307
40069
  * @property {sqlanvil.IExtractSpec|null} [extract] ExecutionAction extract
40070
+ * @property {sqlanvil.IScriptSpec|null} [script] ExecutionAction script
38308
40071
  */
38309
40072
 
38310
40073
  /**
@@ -38420,6 +40183,14 @@ const sqlanvil = $root.sqlanvil = (() => {
38420
40183
  */
38421
40184
  ExecutionAction.prototype.extract = null;
38422
40185
 
40186
+ /**
40187
+ * ExecutionAction script.
40188
+ * @member {sqlanvil.IScriptSpec|null|undefined} script
40189
+ * @memberof sqlanvil.ExecutionAction
40190
+ * @instance
40191
+ */
40192
+ ExecutionAction.prototype.script = null;
40193
+
38423
40194
  /**
38424
40195
  * Creates a new ExecutionAction instance using the specified properties.
38425
40196
  * @function create
@@ -38474,6 +40245,8 @@ const sqlanvil = $root.sqlanvil = (() => {
38474
40245
  $root.sqlanvil.ImportSpec.encode(message["import"], writer.uint32(/* id 14, wireType 2 =*/114).fork(), q + 1).ldelim();
38475
40246
  if (message.extract != null && Object.hasOwnProperty.call(message, "extract"))
38476
40247
  $root.sqlanvil.ExtractSpec.encode(message.extract, writer.uint32(/* id 15, wireType 2 =*/122).fork(), q + 1).ldelim();
40248
+ if (message.script != null && Object.hasOwnProperty.call(message, "script"))
40249
+ $root.sqlanvil.ScriptSpec.encode(message.script, writer.uint32(/* id 16, wireType 2 =*/130).fork(), q + 1).ldelim();
38477
40250
  return writer;
38478
40251
  };
38479
40252
 
@@ -38566,6 +40339,10 @@ const sqlanvil = $root.sqlanvil = (() => {
38566
40339
  message.extract = $root.sqlanvil.ExtractSpec.decode(reader, reader.uint32(), undefined, long + 1);
38567
40340
  break;
38568
40341
  }
40342
+ case 16: {
40343
+ message.script = $root.sqlanvil.ScriptSpec.decode(reader, reader.uint32(), undefined, long + 1);
40344
+ break;
40345
+ }
38569
40346
  default:
38570
40347
  reader.skipType(tag & 7, long);
38571
40348
  break;
@@ -38669,6 +40446,11 @@ const sqlanvil = $root.sqlanvil = (() => {
38669
40446
  if (error)
38670
40447
  return "extract." + error;
38671
40448
  }
40449
+ if (message.script != null && Object.hasOwnProperty.call(message, "script")) {
40450
+ let error = $root.sqlanvil.ScriptSpec.verify(message.script, long + 1);
40451
+ if (error)
40452
+ return "script." + error;
40453
+ }
38672
40454
  return null;
38673
40455
  };
38674
40456
 
@@ -38763,6 +40545,11 @@ const sqlanvil = $root.sqlanvil = (() => {
38763
40545
  throw TypeError(".sqlanvil.ExecutionAction.extract: object expected");
38764
40546
  message.extract = $root.sqlanvil.ExtractSpec.fromObject(object.extract, long + 1);
38765
40547
  }
40548
+ if (object.script != null) {
40549
+ if (!$util.isObject(object.script))
40550
+ throw TypeError(".sqlanvil.ExecutionAction.script: object expected");
40551
+ message.script = $root.sqlanvil.ScriptSpec.fromObject(object.script, long + 1);
40552
+ }
38766
40553
  return message;
38767
40554
  };
38768
40555
 
@@ -38798,6 +40585,7 @@ const sqlanvil = $root.sqlanvil = (() => {
38798
40585
  object["export"] = null;
38799
40586
  object["import"] = null;
38800
40587
  object.extract = null;
40588
+ object.script = null;
38801
40589
  }
38802
40590
  if (message.tasks && message.tasks.length) {
38803
40591
  object.tasks = [];
@@ -38829,6 +40617,8 @@ const sqlanvil = $root.sqlanvil = (() => {
38829
40617
  object["import"] = $root.sqlanvil.ImportSpec.toObject(message["import"], options, q + 1);
38830
40618
  if (message.extract != null && Object.hasOwnProperty.call(message, "extract"))
38831
40619
  object.extract = $root.sqlanvil.ExtractSpec.toObject(message.extract, options, q + 1);
40620
+ if (message.script != null && Object.hasOwnProperty.call(message, "script"))
40621
+ object.script = $root.sqlanvil.ScriptSpec.toObject(message.script, options, q + 1);
38832
40622
  return object;
38833
40623
  };
38834
40624
 
@@ -47602,11 +49392,11 @@ function setOrValidateTableEnumType(table) {
47602
49392
  function prune(compiledGraph, runConfig) {
47603
49393
  compiledGraph.tables.forEach(setOrValidateTableEnumType);
47604
49394
  const includedActionNames = computeIncludedActionNames(compiledGraph, runConfig);
47605
- 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))) });
49395
+ 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))), scripts: (compiledGraph.scripts || []).filter(action => includedActionNames.has(targetAsReadableString(action.target))) });
47606
49396
  }
47607
49397
  function computeIncludedActionNames(compiledGraph, runConfig) {
47608
49398
  var _a, _b, _c;
47609
- const allActions = [].concat(compiledGraph.tables, compiledGraph.operations, compiledGraph.assertions, compiledGraph.exports, compiledGraph.imports);
49399
+ const allActions = [].concat(compiledGraph.tables, compiledGraph.operations, compiledGraph.assertions, compiledGraph.exports, compiledGraph.imports, compiledGraph.scripts || []);
47610
49400
  const allActionNames = new Set(allActions.map(action => targetAsReadableString(action.target)));
47611
49401
  const allActionsByName = new Map(allActions.map(action => [targetAsReadableString(action.target), action]));
47612
49402
  const hasActionSelector = ((_a = runConfig.actions) === null || _a === void 0 ? void 0 : _a.length) > 0;
@@ -48342,6 +50132,9 @@ class MysqlExecutionSql {
48342
50132
  if (opts.collation) {
48343
50133
  suffix += ` collate=${opts.collation}`;
48344
50134
  }
50135
+ if (opts.rowFormat) {
50136
+ suffix += ` row_format=${opts.rowFormat}`;
50137
+ }
48345
50138
  return suffix;
48346
50139
  }
48347
50140
  createIndexes(table) {
@@ -48352,12 +50145,28 @@ class MysqlExecutionSql {
48352
50145
  }
48353
50146
  const target = this.resolveTarget(table.target);
48354
50147
  return indexes.map(index => {
48355
- const unique = index.unique ? "unique " : "";
48356
- const cols = (index.columns || []).map(c => `\`${c}\``).join(", ");
48357
- const name = index.name || this.defaultIndexName(table.target.name, index.columns, !!index.unique);
48358
- return `alter table ${target} add ${unique}index \`${name}\` (${cols})`;
50148
+ const kind = (index.type || "").toLowerCase();
50149
+ if (kind && kind !== "fulltext" && kind !== "spatial") {
50150
+ throw new Error(`mysql index type must be "fulltext" or "spatial" (or omitted); got "${index.type}".`);
50151
+ }
50152
+ if (kind && index.unique) {
50153
+ throw new Error(`a mysql ${kind} index cannot also be unique.`);
50154
+ }
50155
+ const prefix = index.unique ? "unique " : kind ? `${kind} ` : "";
50156
+ const cols = (index.columns || []).map(c => this.indexColumnSql(c)).join(", ");
50157
+ const bareColumns = (index.columns || []).map(c => this.indexColumnName(c));
50158
+ const name = index.name || this.defaultIndexName(table.target.name, bareColumns, !!index.unique);
50159
+ return `alter table ${target} add ${prefix}index \`${name}\` (${cols})`;
48359
50160
  });
48360
50161
  }
50162
+ indexColumnSql(column) {
50163
+ const m = /^(.*?)\((\d+)\)$/.exec(column.trim());
50164
+ return m ? `\`${m[1].trim()}\`(${m[2]})` : `\`${column}\``;
50165
+ }
50166
+ indexColumnName(column) {
50167
+ const m = /^(.*?)\((\d+)\)$/.exec(column.trim());
50168
+ return m ? m[1].trim() : column;
50169
+ }
48361
50170
  defaultIndexName(tableName, columns, unique) {
48362
50171
  const parts = [tableName, ...(columns || [])].filter(Boolean);
48363
50172
  const suffix = unique ? "_key" : "_idx";
@@ -48797,7 +50606,7 @@ function collectEvaluationQueries(queryOrAction, concatenate, queryModifier = (q
48797
50606
  .filter(validationQuery => !!validationQuery.query);
48798
50607
  }
48799
50608
 
48800
- const version = "1.18.0";
50609
+ const version = "1.20.0";
48801
50610
  const dataformVersion = "3.0.61";
48802
50611
 
48803
50612
  async function build(compiledGraph, runConfig, dbadapter) {
@@ -48821,7 +50630,7 @@ class Builder {
48821
50630
  this.warehouseState.tables.forEach(tableState => {
48822
50631
  tableMetadataByTarget.set(targetStringifier.stringify(tableState.target), tableState);
48823
50632
  });
48824
- const actions = [].concat(this.prunedGraph.tables.map(t => this.buildTable(t, tableMetadataByTarget.get(targetStringifier.stringify(t.target)), this.runConfig)), this.prunedGraph.operations.map(o => this.buildOperation(o)), this.prunedGraph.assertions.map(a => this.buildAssertion(a)), this.prunedGraph.exports.map(e => this.buildExport(e)), this.prunedGraph.imports.map(i => this.buildImport(i)), this.prunedGraph.extracts.map(e => this.buildExtract(e)));
50633
+ const actions = [].concat(this.prunedGraph.tables.map(t => this.buildTable(t, tableMetadataByTarget.get(targetStringifier.stringify(t.target)), this.runConfig)), this.prunedGraph.operations.map(o => this.buildOperation(o)), this.prunedGraph.assertions.map(a => this.buildAssertion(a)), this.prunedGraph.exports.map(e => this.buildExport(e)), this.prunedGraph.imports.map(i => this.buildImport(i)), this.prunedGraph.extracts.map(e => this.buildExtract(e)), (this.prunedGraph.scripts || []).map(s => this.buildScript(s)));
48825
50634
  return sqlanvil.ExecutionGraph.create({
48826
50635
  projectConfig: this.prunedGraph.projectConfig,
48827
50636
  runConfig: this.runConfig,
@@ -48869,6 +50678,19 @@ class Builder {
48869
50678
  columnTypes: ext.columnTypes
48870
50679
  }) });
48871
50680
  }
50681
+ buildScript(script) {
50682
+ return Object.assign(Object.assign({}, this.toPartialExecutionAction(script)), { type: "script", tasks: script.disabled
50683
+ ? []
50684
+ : [sqlanvil.ExecutionTask.create({ type: "script", statement: "" })], hermeticity: script.hermeticity || sqlanvil.ActionHermeticity.NON_HERMETIC, script: sqlanvil.ScriptSpec.create({
50685
+ language: script.language,
50686
+ filename: script.scriptFilename,
50687
+ args: script.args,
50688
+ depsFile: script.depsFile,
50689
+ runtimeVersion: script.runtimeVersion,
50690
+ envRoot: script.envRoot,
50691
+ timeoutMillis: script.timeoutMillis
50692
+ }) });
50693
+ }
48872
50694
  toPartialExecutionAction(action) {
48873
50695
  return sqlanvil.ExecutionAction.create({
48874
50696
  target: action.target,
@@ -51134,6 +52956,95 @@ async function runDuckdbImport(args) {
51134
52956
  });
51135
52957
  }
51136
52958
 
52959
+ const DEFAULT_SCRIPT_TIMEOUT_MILLIS = 30 * 60 * 1000;
52960
+ const SCRIPT_OUTPUT_TAIL_CHARS = 8 * 1024;
52961
+ function resolveInterpreter(spec, projectDir) {
52962
+ if (spec.language !== "python") {
52963
+ throw new Error(`No script runner for language "${spec.language}".`);
52964
+ }
52965
+ if (spec.envRoot) {
52966
+ const candidates = process.platform === "win32"
52967
+ ? [path__namespace.join(projectDir, spec.envRoot, "Scripts", "python.exe")]
52968
+ : [path__namespace.join(projectDir, spec.envRoot, "bin", "python3"),
52969
+ path__namespace.join(projectDir, spec.envRoot, "bin", "python")];
52970
+ for (const candidate of candidates) {
52971
+ if (fs__namespace$1.existsSync(candidate)) {
52972
+ return candidate;
52973
+ }
52974
+ }
52975
+ throw new Error(`Declared venv "${spec.envRoot}" has no python interpreter under ${path__namespace.join(projectDir, spec.envRoot)}. Create it (python3 -m venv ${spec.envRoot}) or remove the venv setting.`);
52976
+ }
52977
+ return "python3";
52978
+ }
52979
+ class TailBuffer {
52980
+ constructor(limit) {
52981
+ this.limit = limit;
52982
+ this.buffer = "";
52983
+ }
52984
+ append(chunk) {
52985
+ this.buffer = (this.buffer + chunk).slice(-this.limit);
52986
+ }
52987
+ toString() {
52988
+ return this.buffer;
52989
+ }
52990
+ }
52991
+ async function runScript(args) {
52992
+ const { spec, target, projectDir } = args;
52993
+ const interpreter = resolveInterpreter(spec, projectDir);
52994
+ const scriptPath = path__namespace.join(projectDir, spec.filename);
52995
+ if (!fs__namespace$1.existsSync(scriptPath)) {
52996
+ throw new Error(`Script file not found: ${scriptPath}`);
52997
+ }
52998
+ const timeoutMillis = spec.timeoutMillis || DEFAULT_SCRIPT_TIMEOUT_MILLIS;
52999
+ const onOutput = args.onOutput ||
53000
+ ((line) => process.stdout.write(` [${(target === null || target === void 0 ? void 0 : target.name) || spec.filename}] ${line}\n`));
53001
+ return new Promise((resolve, reject) => {
53002
+ const tail = new TailBuffer(SCRIPT_OUTPUT_TAIL_CHARS);
53003
+ const child = childProcess.spawn(interpreter, [spec.filename, ...(spec.args || [])], {
53004
+ cwd: projectDir,
53005
+ env: Object.assign(Object.assign({}, process.env), { SA_VARS: JSON.stringify(args.vars || {}), SA_ACTION_NAME: (target === null || target === void 0 ? void 0 : target.name) || "" }),
53006
+ stdio: ["ignore", "pipe", "pipe"]
53007
+ });
53008
+ let timedOut = false;
53009
+ const timer = setTimeout(() => {
53010
+ timedOut = true;
53011
+ child.kill("SIGKILL");
53012
+ }, timeoutMillis);
53013
+ const onChunk = (chunk) => {
53014
+ const text = chunk.toString("utf8");
53015
+ tail.append(text);
53016
+ for (const line of text.split("\n")) {
53017
+ if (line.length > 0) {
53018
+ onOutput(line);
53019
+ }
53020
+ }
53021
+ };
53022
+ child.stdout.on("data", onChunk);
53023
+ child.stderr.on("data", onChunk);
53024
+ child.on("error", err => {
53025
+ clearTimeout(timer);
53026
+ reject(new Error(`Failed to spawn ${interpreter}: ${err.message}`));
53027
+ });
53028
+ child.on("close", (code, signal) => {
53029
+ clearTimeout(timer);
53030
+ if (timedOut) {
53031
+ reject(new Error(`Script timed out after ${timeoutMillis}ms and was killed.` + tailSuffix(tail)));
53032
+ }
53033
+ else if (code === 0) {
53034
+ resolve({ exitCode: 0 });
53035
+ }
53036
+ else {
53037
+ reject(new Error(`Script exited with ${code !== null ? `code ${code}` : `signal ${signal}`}.` +
53038
+ tailSuffix(tail)));
53039
+ }
53040
+ });
53041
+ });
53042
+ }
53043
+ function tailSuffix(tail) {
53044
+ const text = tail.toString().trim();
53045
+ return text ? ` Last output:\n${text}` : "";
53046
+ }
53047
+
51137
53048
  class Flags {
51138
53049
  static boolean(name, defaultValue = false) {
51139
53050
  return new SingleValueFlag(name, defaultValue, (stringValue) => {
@@ -51504,7 +53415,7 @@ class Runner {
51504
53415
  return actionResult;
51505
53416
  }
51506
53417
  async executeTask(client, task, parentAction, options, action) {
51507
- var _a, _b, _c, _d, _e, _f;
53418
+ var _a, _b, _c, _d, _e, _f, _g;
51508
53419
  const timer = Timer.start();
51509
53420
  const taskResult = {
51510
53421
  status: sqlanvil.TaskResult.ExecutionStatus.RUNNING,
@@ -51553,9 +53464,30 @@ class Runner {
51553
53464
  taskResult.errorMessage = `${this.graph.projectConfig.warehouse} import error: ${e.message}`;
51554
53465
  }
51555
53466
  }
53467
+ else if (task.type === "script") {
53468
+ try {
53469
+ if (!this.executionOptions.projectDir) {
53470
+ throw new Error("script actions need the project directory (internal: projectDir unset)");
53471
+ }
53472
+ const scriptRunner = this.executionOptions.scriptRun || runScript;
53473
+ await scriptRunner({
53474
+ spec: action === null || action === void 0 ? void 0 : action.script,
53475
+ target: action === null || action === void 0 ? void 0 : action.target,
53476
+ projectDir: this.executionOptions.projectDir,
53477
+ vars: ((_c = this.graph.projectConfig) === null || _c === void 0 ? void 0 : _c.vars) || {}
53478
+ });
53479
+ taskResult.status = sqlanvil.TaskResult.ExecutionStatus.SUCCESSFUL;
53480
+ }
53481
+ catch (e) {
53482
+ taskResult.status = this.cancelled
53483
+ ? sqlanvil.TaskResult.ExecutionStatus.CANCELLED
53484
+ : sqlanvil.TaskResult.ExecutionStatus.FAILED;
53485
+ taskResult.errorMessage = `script error: ${e.message}`;
53486
+ }
53487
+ }
51556
53488
  else if (task.type === "extract") {
51557
53489
  try {
51558
- const extractor = ((_c = action === null || action === void 0 ? void 0 : action.extract) === null || _c === void 0 ? void 0 : _c.platform) === "mysql"
53490
+ const extractor = ((_d = action === null || action === void 0 ? void 0 : action.extract) === null || _d === void 0 ? void 0 : _d.platform) === "mysql"
51559
53491
  ? this.executionOptions.mysqlExtract || runMysqlExtract
51560
53492
  : this.executionOptions.bigQueryExtract || runBigQueryExtract;
51561
53493
  await extractor({
@@ -51585,7 +53517,7 @@ class Runner {
51585
53517
  }), task.type === "operation" ? 1 : options.bigquery.actionRetryLimit + 1 || 1);
51586
53518
  taskResult.metadata = metadata;
51587
53519
  if (task.type === "assertion") {
51588
- const rowCount = (_d = rows[0]) === null || _d === void 0 ? void 0 : _d[Object.keys(rows[0])[0]];
53520
+ const rowCount = (_e = rows[0]) === null || _e === void 0 ? void 0 : _e[Object.keys(rows[0])[0]];
51589
53521
  if (rowCount > 0) {
51590
53522
  throw new Error(`Assertion failed: query returned ${rowCount} row(s).`);
51591
53523
  }
@@ -51597,7 +53529,7 @@ class Runner {
51597
53529
  ? sqlanvil.TaskResult.ExecutionStatus.CANCELLED
51598
53530
  : sqlanvil.TaskResult.ExecutionStatus.FAILED;
51599
53531
  taskResult.errorMessage = `${this.graph.projectConfig.warehouse} error: ${e.message}`;
51600
- if ((_f = (_e = e.metadata) === null || _e === void 0 ? void 0 : _e.bigquery) === null || _f === void 0 ? void 0 : _f.jobId) {
53532
+ if ((_g = (_f = e.metadata) === null || _f === void 0 ? void 0 : _f.bigquery) === null || _g === void 0 ? void 0 : _g.jobId) {
51601
53533
  taskResult.metadata = {
51602
53534
  bigquery: {
51603
53535
  jobId: e.metadata.bigquery.jobId
@@ -51866,6 +53798,9 @@ function catalogRows(compiledGraph) {
51866
53798
  for (const imp of compiledGraph.imports || []) {
51867
53799
  add(imp, "import");
51868
53800
  }
53801
+ for (const script of compiledGraph.scripts || []) {
53802
+ add(script, "script");
53803
+ }
51869
53804
  for (const declaration of compiledGraph.declarations || []) {
51870
53805
  add(declaration, "declaration");
51871
53806
  }
@@ -52114,6 +54049,183 @@ ${columnRows || '<tr><td colspan="3" class="meta">No documented columns.</td></t
52114
54049
  `;
52115
54050
  }
52116
54051
 
54052
+ const CHECKER_SOURCE = `
54053
+ import json, os, sys
54054
+
54055
+ script_path, requirements_path, version_spec = sys.argv[1], sys.argv[2], sys.argv[3]
54056
+ errors = []
54057
+
54058
+ import platform
54059
+ py_version = platform.python_version()
54060
+
54061
+ def load_packaging():
54062
+ try:
54063
+ from packaging.specifiers import SpecifierSet
54064
+ from packaging.requirements import Requirement
54065
+ return SpecifierSet, Requirement
54066
+ except ImportError:
54067
+ pass
54068
+ try:
54069
+ from pip._vendor.packaging.specifiers import SpecifierSet
54070
+ from pip._vendor.packaging.requirements import Requirement
54071
+ return SpecifierSet, Requirement
54072
+ except ImportError:
54073
+ return None, None
54074
+
54075
+ SpecifierSet, Requirement = load_packaging()
54076
+
54077
+ def mini_parse(v):
54078
+ import re
54079
+ return [int(x) for x in re.findall(r"[0-9]+", v.split("+")[0])][:4]
54080
+
54081
+ def mini_check(version, spec):
54082
+ import re
54083
+ ok = True
54084
+ for clause in spec.split(","):
54085
+ clause = clause.strip()
54086
+ m = re.match(r"(===|==|!=|<=|>=|~=|<|>)\\s*(.+)", clause)
54087
+ if not m:
54088
+ return None
54089
+ op, want = m.group(1), m.group(2).strip()
54090
+ if want.endswith(".*"):
54091
+ prefix = mini_parse(want[:-2])
54092
+ have = mini_parse(version)[:len(prefix)]
54093
+ eq = have == prefix
54094
+ if (op in ("==", "===") and not eq) or (op == "!=" and eq):
54095
+ ok = False
54096
+ continue
54097
+ a, b = mini_parse(version), mini_parse(want)
54098
+ n = max(len(a), len(b))
54099
+ a = a + [0] * (n - len(a))
54100
+ b = b + [0] * (n - len(b))
54101
+ if op in ("==", "==="):
54102
+ res = a == b
54103
+ elif op == "!=":
54104
+ res = a != b
54105
+ elif op == "<=":
54106
+ res = a <= b
54107
+ elif op == ">=":
54108
+ res = a >= b
54109
+ elif op == "<":
54110
+ res = a < b
54111
+ elif op == ">":
54112
+ res = a > b
54113
+ else: # ~= : at least b, within b's series
54114
+ wb = mini_parse(want)
54115
+ res = a >= b and a[:max(len(wb) - 1, 1)] == b[:max(len(wb) - 1, 1)]
54116
+ if not res:
54117
+ ok = False
54118
+ return ok
54119
+
54120
+ def check_version(version, spec, what):
54121
+ if SpecifierSet is not None:
54122
+ try:
54123
+ if version not in SpecifierSet(spec, prereleases=True):
54124
+ errors.append('%s: installed %s does not satisfy "%s"' % (what, version, spec))
54125
+ return
54126
+ except Exception as e:
54127
+ errors.append('%s: could not evaluate specifier "%s": %s' % (what, spec, e))
54128
+ return
54129
+ if mini_check(version, spec) is False:
54130
+ errors.append('%s: installed %s does not satisfy "%s"' % (what, version, spec))
54131
+
54132
+ if version_spec:
54133
+ check_version(py_version, version_spec, "python interpreter")
54134
+
54135
+ if requirements_path:
54136
+ from importlib import metadata
54137
+ try:
54138
+ lines = open(requirements_path).read().splitlines()
54139
+ except OSError as e:
54140
+ errors.append("requirements: cannot read %s: %s" % (requirements_path, e))
54141
+ lines = []
54142
+ for raw in lines:
54143
+ line = raw.split("#")[0].strip()
54144
+ if not line or line.startswith("-"):
54145
+ continue
54146
+ if Requirement is not None:
54147
+ try:
54148
+ req = Requirement(line)
54149
+ except Exception:
54150
+ errors.append('requirements: cannot parse "%s"' % line)
54151
+ continue
54152
+ if req.marker is not None and not req.marker.evaluate():
54153
+ continue
54154
+ name, spec = req.name, str(req.specifier)
54155
+ else:
54156
+ import re
54157
+ if ";" in line:
54158
+ line = line.split(";")[0].strip()
54159
+ m = re.match(r"^([A-Za-z0-9][A-Za-z0-9._-]*)\\s*(\\[[^\\]]*\\])?\\s*(.*)$", line)
54160
+ if not m:
54161
+ errors.append('requirements: cannot parse "%s"' % line)
54162
+ continue
54163
+ name, spec = m.group(1), (m.group(3) or "").strip()
54164
+ try:
54165
+ installed = metadata.version(name)
54166
+ except metadata.PackageNotFoundError:
54167
+ errors.append(
54168
+ "requirements: %s is not installed%s" % (name, " (need %s)" % spec if spec else "")
54169
+ )
54170
+ continue
54171
+ if spec:
54172
+ check_version(installed, spec, "requirements: %s" % name)
54173
+
54174
+ try:
54175
+ with open(script_path, "rb") as f:
54176
+ compile(f.read(), script_path, "exec")
54177
+ except SyntaxError as e:
54178
+ errors.append("syntax: %s (line %s)" % (e.msg, e.lineno))
54179
+ except (OSError, ValueError) as e:
54180
+ errors.append("syntax: cannot compile %s: %s" % (script_path, e))
54181
+
54182
+ print(json.dumps({"interpreter_version": py_version, "errors": errors}))
54183
+ `;
54184
+ const defaultCheckerExec = (interpreter, args, cwd) => new Promise((resolve, reject) => {
54185
+ childProcess.execFile(interpreter, args, { cwd, timeout: 60000, maxBuffer: 1024 * 1024 }, (err, stdout, stderr) => {
54186
+ if (err) {
54187
+ reject(new Error(`checker failed under ${interpreter}: ${err.message}\n${stderr}`.trim()));
54188
+ }
54189
+ else {
54190
+ resolve(stdout);
54191
+ }
54192
+ });
54193
+ });
54194
+ const failure = (message) => ({
54195
+ status: sqlanvil.QueryEvaluation.QueryEvaluationStatus.FAILURE,
54196
+ error: { message }
54197
+ });
54198
+ async function checkScriptAction(script, projectDir, checkerExec = defaultCheckerExec) {
54199
+ if (script.language !== "python") {
54200
+ return [failure(`no validator for script language "${script.language}"`)];
54201
+ }
54202
+ let interpreter;
54203
+ try {
54204
+ interpreter = resolveInterpreter({ language: script.language, envRoot: script.envRoot }, projectDir);
54205
+ }
54206
+ catch (e) {
54207
+ return [failure(e.message)];
54208
+ }
54209
+ let stdout;
54210
+ try {
54211
+ stdout = await checkerExec(interpreter, ["-c", CHECKER_SOURCE, script.scriptFilename, script.depsFile || "", script.runtimeVersion || ""], projectDir);
54212
+ }
54213
+ catch (e) {
54214
+ return [failure(e.message)];
54215
+ }
54216
+ let parsed;
54217
+ try {
54218
+ parsed = JSON.parse(stdout);
54219
+ }
54220
+ catch (e) {
54221
+ return [failure(`checker returned unparseable output: ${stdout.slice(0, 500)}`)];
54222
+ }
54223
+ if (parsed.errors && parsed.errors.length > 0) {
54224
+ return parsed.errors.map(failure);
54225
+ }
54226
+ return [{ status: sqlanvil.QueryEvaluation.QueryEvaluationStatus.SUCCESS }];
54227
+ }
54228
+
52117
54229
  function targetKey(target) {
52118
54230
  return [target.database, target.schema, target.name].filter(Boolean).join(".");
52119
54231
  }
@@ -52257,6 +54369,20 @@ async function validate(compiledGraph, deps, options = {}) {
52257
54369
  action: undefined
52258
54370
  });
52259
54371
  }
54372
+ for (const script of compiledGraph.scripts || []) {
54373
+ if (!script.target) {
54374
+ continue;
54375
+ }
54376
+ nodes.push({
54377
+ key: targetKey(script.target),
54378
+ dependencyKeys: depKeys(script.dependencyTargets),
54379
+ kind: "script",
54380
+ type: "script",
54381
+ target: script.target,
54382
+ script,
54383
+ action: undefined
54384
+ });
54385
+ }
52260
54386
  const ordered = topoOrder(nodes);
52261
54387
  const shadowSchemas = Array.from(new Set(nodes.filter(n => n.kind === "table").map(n => n.target.schema)));
52262
54388
  const statusByKey = new Map();
@@ -52266,7 +54392,9 @@ async function validate(compiledGraph, deps, options = {}) {
52266
54392
  await deps.execute(deps.createSchemaSql(schema));
52267
54393
  }
52268
54394
  for (const node of ordered) {
52269
- if (node.kind === "operation" || node.kind === "import") {
54395
+ if (node.kind === "operation" ||
54396
+ node.kind === "import" ||
54397
+ (node.kind === "script" && !deps.checkScript)) {
52270
54398
  statusByKey.set(node.key, "SKIPPED");
52271
54399
  results.push({ target: node.target, type: node.type, status: "SKIPPED", errors: [] });
52272
54400
  continue;
@@ -52276,7 +54404,9 @@ async function validate(compiledGraph, deps, options = {}) {
52276
54404
  results.push({ target: node.target, type: node.type, status: "BLOCKED", errors: [] });
52277
54405
  continue;
52278
54406
  }
52279
- const evaluations = await deps.evaluate(node.action);
54407
+ const evaluations = node.kind === "script"
54408
+ ? await deps.checkScript(node.script)
54409
+ : await deps.evaluate(node.action);
52280
54410
  const failed = evaluations.some(e => e.status === sqlanvil.QueryEvaluation.QueryEvaluationStatus.FAILURE);
52281
54411
  const status = failed ? "FAILURE" : "PASS";
52282
54412
  statusByKey.set(node.key, status);
@@ -53858,7 +55988,8 @@ async function runValidate(argv) {
53858
55988
  listSchemas: async () => {
53859
55989
  const result = await dbadapter.execute("select schema_name as name from information_schema.schemata");
53860
55990
  return ((result && result.rows) || []).map((row) => row.name);
53861
- }
55991
+ },
55992
+ checkScript: script => checkScriptAction(script, projectDir)
53862
55993
  };
53863
55994
  await sweepOrphanShadows(deps, Date.now());
53864
55995
  if (!argv[jsonOutputOption.name]) {
@@ -54429,7 +56560,8 @@ function runCli() {
54429
56560
  bigquery: bigqueryOptions,
54430
56561
  connectionCredentials,
54431
56562
  warehouseConnection: isPostgresLike ? readCredentials : undefined,
54432
- storageCredentials
56563
+ storageCredentials,
56564
+ projectDir: argv[projectDirOption.name]
54433
56565
  });
54434
56566
  process.on("SIGINT", () => {
54435
56567
  runner.cancel();