@sqlanvil/cli 1.19.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 +2346 -307
  3. package/package.json +1 -1
  4. package/worker_bundle.js +1749 -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
 
@@ -12471,6 +12506,588 @@ const sqlanvil = $root.sqlanvil = (() => {
12471
12506
  return DataPreparationConfig;
12472
12507
  })();
12473
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
+
12474
13091
  ActionConfig.RlsPolicyConfig = (function() {
12475
13092
 
12476
13093
  /**
@@ -27046,93 +27663,787 @@ const sqlanvil = $root.sqlanvil = (() => {
27046
27663
  }
27047
27664
  if (message.actionDescriptor != null && Object.hasOwnProperty.call(message, "actionDescriptor"))
27048
27665
  object.actionDescriptor = $root.sqlanvil.ActionDescriptor.toObject(message.actionDescriptor, options, q + 1);
27049
- if (message.location != null && Object.hasOwnProperty.call(message, "location"))
27050
- object.location = message.location;
27051
- if (message.format != null && Object.hasOwnProperty.call(message, "format"))
27052
- object.format = message.format;
27053
- if (message.overwrite != null && Object.hasOwnProperty.call(message, "overwrite"))
27054
- 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;
27055
28367
  let keys2;
27056
- if (message.options && (keys2 = Object.keys(message.options)).length) {
27057
- object.options = {};
28368
+ if (message.columnTypes && (keys2 = Object.keys(message.columnTypes)).length) {
28369
+ object.columnTypes = {};
27058
28370
  for (let j = 0; j < keys2.length; ++j) {
27059
28371
  if (keys2[j] === "__proto__")
27060
- $util.makeProp(object.options, keys2[j]);
27061
- object.options[keys2[j]] = message.options[keys2[j]];
28372
+ $util.makeProp(object.columnTypes, keys2[j]);
28373
+ object.columnTypes[keys2[j]] = message.columnTypes[keys2[j]];
27062
28374
  }
27063
28375
  }
27064
28376
  if (message.fileName != null && Object.hasOwnProperty.call(message, "fileName"))
27065
28377
  object.fileName = message.fileName;
27066
- if (message.jitCode != null && Object.hasOwnProperty.call(message, "jitCode"))
27067
- object.jitCode = message.jitCode;
28378
+ if (message.database != null && Object.hasOwnProperty.call(message, "database"))
28379
+ object.database = message.database;
27068
28380
  return object;
27069
28381
  };
27070
28382
 
27071
28383
  /**
27072
- * Converts this Import to JSON.
28384
+ * Converts this Extract to JSON.
27073
28385
  * @function toJSON
27074
- * @memberof sqlanvil.Import
28386
+ * @memberof sqlanvil.Extract
27075
28387
  * @instance
27076
28388
  * @returns {Object.<string,*>} JSON object
27077
28389
  */
27078
- Import.prototype.toJSON = function toJSON() {
28390
+ Extract.prototype.toJSON = function toJSON() {
27079
28391
  return this.constructor.toObject(this, $protobuf__namespace.util.toJSONOptions);
27080
28392
  };
27081
28393
 
27082
28394
  /**
27083
- * Gets the default type url for Import
28395
+ * Gets the default type url for Extract
27084
28396
  * @function getTypeUrl
27085
- * @memberof sqlanvil.Import
28397
+ * @memberof sqlanvil.Extract
27086
28398
  * @static
27087
28399
  * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
27088
28400
  * @returns {string} The default type url
27089
28401
  */
27090
- Import.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
28402
+ Extract.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
27091
28403
  if (typeUrlPrefix === undefined) {
27092
28404
  typeUrlPrefix = "type.googleapis.com";
27093
28405
  }
27094
- return typeUrlPrefix + "/sqlanvil.Import";
28406
+ return typeUrlPrefix + "/sqlanvil.Extract";
27095
28407
  };
27096
28408
 
27097
- return Import;
28409
+ return Extract;
27098
28410
  })();
27099
28411
 
27100
- sqlanvil.Extract = (function() {
28412
+ sqlanvil.Script = (function() {
27101
28413
 
27102
28414
  /**
27103
- * Properties of an Extract.
28415
+ * Properties of a Script.
27104
28416
  * @memberof sqlanvil
27105
- * @interface IExtract
27106
- * @property {sqlanvil.ITarget|null} [target] Extract target
27107
- * @property {sqlanvil.ITarget|null} [canonicalTarget] Extract canonicalTarget
27108
- * @property {Array.<sqlanvil.ITarget>|null} [dependencyTargets] Extract dependencyTargets
27109
- * @property {sqlanvil.ActionHermeticity|null} [hermeticity] Extract hermeticity
27110
- * @property {boolean|null} [disabled] Extract disabled
27111
- * @property {Array.<string>|null} [tags] Extract tags
27112
- * @property {sqlanvil.IActionDescriptor|null} [actionDescriptor] Extract actionDescriptor
27113
- * @property {string|null} [connectionName] Extract connectionName
27114
- * @property {string|null} [platform] Extract platform
27115
- * @property {string|null} [project] Extract project
27116
- * @property {string|null} [dataset] Extract dataset
27117
- * @property {string|null} [sourceName] Extract sourceName
27118
- * @property {string|null} [billingProject] Extract billingProject
27119
- * @property {Object.<string,string>|null} [columnTypes] Extract columnTypes
27120
- * @property {string|null} [fileName] Extract fileName
27121
- * @property {string|null} [database] Extract database
27122
- */
27123
-
27124
- /**
27125
- * 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.
27126
28437
  * @memberof sqlanvil
27127
- * @classdesc Represents an Extract.
27128
- * @implements IExtract
28438
+ * @classdesc Represents a Script.
28439
+ * @implements IScript
27129
28440
  * @constructor
27130
- * @param {sqlanvil.IExtract=} [properties] Properties to set
28441
+ * @param {sqlanvil.IScript=} [properties] Properties to set
27131
28442
  */
27132
- function Extract(properties) {
28443
+ function Script(properties) {
27133
28444
  this.dependencyTargets = [];
27134
28445
  this.tags = [];
27135
- this.columnTypes = {};
28446
+ this.args = [];
27136
28447
  if (properties)
27137
28448
  for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
27138
28449
  if (properties[keys[i]] != null && keys[i] !== "__proto__")
@@ -27140,155 +28451,147 @@ const sqlanvil = $root.sqlanvil = (() => {
27140
28451
  }
27141
28452
 
27142
28453
  /**
27143
- * Extract target.
28454
+ * Script target.
27144
28455
  * @member {sqlanvil.ITarget|null|undefined} target
27145
- * @memberof sqlanvil.Extract
28456
+ * @memberof sqlanvil.Script
27146
28457
  * @instance
27147
28458
  */
27148
- Extract.prototype.target = null;
28459
+ Script.prototype.target = null;
27149
28460
 
27150
28461
  /**
27151
- * Extract canonicalTarget.
28462
+ * Script canonicalTarget.
27152
28463
  * @member {sqlanvil.ITarget|null|undefined} canonicalTarget
27153
- * @memberof sqlanvil.Extract
28464
+ * @memberof sqlanvil.Script
27154
28465
  * @instance
27155
28466
  */
27156
- Extract.prototype.canonicalTarget = null;
28467
+ Script.prototype.canonicalTarget = null;
27157
28468
 
27158
28469
  /**
27159
- * Extract dependencyTargets.
28470
+ * Script dependencyTargets.
27160
28471
  * @member {Array.<sqlanvil.ITarget>} dependencyTargets
27161
- * @memberof sqlanvil.Extract
28472
+ * @memberof sqlanvil.Script
27162
28473
  * @instance
27163
28474
  */
27164
- Extract.prototype.dependencyTargets = $util.emptyArray;
28475
+ Script.prototype.dependencyTargets = $util.emptyArray;
27165
28476
 
27166
28477
  /**
27167
- * Extract hermeticity.
28478
+ * Script hermeticity.
27168
28479
  * @member {sqlanvil.ActionHermeticity} hermeticity
27169
- * @memberof sqlanvil.Extract
28480
+ * @memberof sqlanvil.Script
27170
28481
  * @instance
27171
28482
  */
27172
- Extract.prototype.hermeticity = 0;
28483
+ Script.prototype.hermeticity = 0;
27173
28484
 
27174
28485
  /**
27175
- * Extract disabled.
28486
+ * Script disabled.
27176
28487
  * @member {boolean} disabled
27177
- * @memberof sqlanvil.Extract
28488
+ * @memberof sqlanvil.Script
27178
28489
  * @instance
27179
28490
  */
27180
- Extract.prototype.disabled = false;
28491
+ Script.prototype.disabled = false;
27181
28492
 
27182
28493
  /**
27183
- * Extract tags.
28494
+ * Script tags.
27184
28495
  * @member {Array.<string>} tags
27185
- * @memberof sqlanvil.Extract
28496
+ * @memberof sqlanvil.Script
27186
28497
  * @instance
27187
28498
  */
27188
- Extract.prototype.tags = $util.emptyArray;
28499
+ Script.prototype.tags = $util.emptyArray;
27189
28500
 
27190
28501
  /**
27191
- * Extract actionDescriptor.
28502
+ * Script actionDescriptor.
27192
28503
  * @member {sqlanvil.IActionDescriptor|null|undefined} actionDescriptor
27193
- * @memberof sqlanvil.Extract
28504
+ * @memberof sqlanvil.Script
27194
28505
  * @instance
27195
28506
  */
27196
- Extract.prototype.actionDescriptor = null;
28507
+ Script.prototype.actionDescriptor = null;
27197
28508
 
27198
28509
  /**
27199
- * Extract connectionName.
27200
- * @member {string} connectionName
27201
- * @memberof sqlanvil.Extract
28510
+ * Script language.
28511
+ * @member {string} language
28512
+ * @memberof sqlanvil.Script
27202
28513
  * @instance
27203
28514
  */
27204
- Extract.prototype.connectionName = "";
28515
+ Script.prototype.language = "";
27205
28516
 
27206
28517
  /**
27207
- * Extract platform.
27208
- * @member {string} platform
27209
- * @memberof sqlanvil.Extract
28518
+ * Script scriptFilename.
28519
+ * @member {string} scriptFilename
28520
+ * @memberof sqlanvil.Script
27210
28521
  * @instance
27211
28522
  */
27212
- Extract.prototype.platform = "";
28523
+ Script.prototype.scriptFilename = "";
27213
28524
 
27214
28525
  /**
27215
- * Extract project.
27216
- * @member {string} project
27217
- * @memberof sqlanvil.Extract
28526
+ * Script args.
28527
+ * @member {Array.<string>} args
28528
+ * @memberof sqlanvil.Script
27218
28529
  * @instance
27219
28530
  */
27220
- Extract.prototype.project = "";
28531
+ Script.prototype.args = $util.emptyArray;
27221
28532
 
27222
28533
  /**
27223
- * Extract dataset.
27224
- * @member {string} dataset
27225
- * @memberof sqlanvil.Extract
28534
+ * Script depsFile.
28535
+ * @member {string} depsFile
28536
+ * @memberof sqlanvil.Script
27226
28537
  * @instance
27227
28538
  */
27228
- Extract.prototype.dataset = "";
28539
+ Script.prototype.depsFile = "";
27229
28540
 
27230
28541
  /**
27231
- * Extract sourceName.
27232
- * @member {string} sourceName
27233
- * @memberof sqlanvil.Extract
28542
+ * Script runtimeVersion.
28543
+ * @member {string} runtimeVersion
28544
+ * @memberof sqlanvil.Script
27234
28545
  * @instance
27235
28546
  */
27236
- Extract.prototype.sourceName = "";
28547
+ Script.prototype.runtimeVersion = "";
27237
28548
 
27238
28549
  /**
27239
- * Extract billingProject.
27240
- * @member {string} billingProject
27241
- * @memberof sqlanvil.Extract
28550
+ * Script envRoot.
28551
+ * @member {string} envRoot
28552
+ * @memberof sqlanvil.Script
27242
28553
  * @instance
27243
28554
  */
27244
- Extract.prototype.billingProject = "";
28555
+ Script.prototype.envRoot = "";
27245
28556
 
27246
28557
  /**
27247
- * Extract columnTypes.
27248
- * @member {Object.<string,string>} columnTypes
27249
- * @memberof sqlanvil.Extract
28558
+ * Script timeoutMillis.
28559
+ * @member {number} timeoutMillis
28560
+ * @memberof sqlanvil.Script
27250
28561
  * @instance
27251
28562
  */
27252
- Extract.prototype.columnTypes = $util.emptyObject;
28563
+ Script.prototype.timeoutMillis = 0;
27253
28564
 
27254
28565
  /**
27255
- * Extract fileName.
28566
+ * Script fileName.
27256
28567
  * @member {string} fileName
27257
- * @memberof sqlanvil.Extract
27258
- * @instance
27259
- */
27260
- Extract.prototype.fileName = "";
27261
-
27262
- /**
27263
- * Extract database.
27264
- * @member {string} database
27265
- * @memberof sqlanvil.Extract
28568
+ * @memberof sqlanvil.Script
27266
28569
  * @instance
27267
28570
  */
27268
- Extract.prototype.database = "";
28571
+ Script.prototype.fileName = "";
27269
28572
 
27270
28573
  /**
27271
- * Creates a new Extract instance using the specified properties.
28574
+ * Creates a new Script instance using the specified properties.
27272
28575
  * @function create
27273
- * @memberof sqlanvil.Extract
28576
+ * @memberof sqlanvil.Script
27274
28577
  * @static
27275
- * @param {sqlanvil.IExtract=} [properties] Properties to set
27276
- * @returns {sqlanvil.Extract} Extract instance
28578
+ * @param {sqlanvil.IScript=} [properties] Properties to set
28579
+ * @returns {sqlanvil.Script} Script instance
27277
28580
  */
27278
- Extract.create = function create(properties) {
27279
- return new Extract(properties);
28581
+ Script.create = function create(properties) {
28582
+ return new Script(properties);
27280
28583
  };
27281
28584
 
27282
28585
  /**
27283
- * 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.
27284
28587
  * @function encode
27285
- * @memberof sqlanvil.Extract
28588
+ * @memberof sqlanvil.Script
27286
28589
  * @static
27287
- * @param {sqlanvil.IExtract} message Extract message or plain object to encode
28590
+ * @param {sqlanvil.IScript} message Script message or plain object to encode
27288
28591
  * @param {$protobuf.Writer} [writer] Writer to encode to
27289
28592
  * @returns {$protobuf.Writer} Writer
27290
28593
  */
27291
- Extract.encode = function encode(message, writer, q) {
28594
+ Script.encode = function encode(message, writer, q) {
27292
28595
  if (!writer)
27293
28596
  writer = $Writer.create();
27294
28597
  if (q === undefined)
@@ -27311,60 +28614,58 @@ const sqlanvil = $root.sqlanvil = (() => {
27311
28614
  writer.uint32(/* id 6, wireType 2 =*/50).string(message.tags[i]);
27312
28615
  if (message.actionDescriptor != null && Object.hasOwnProperty.call(message, "actionDescriptor"))
27313
28616
  $root.sqlanvil.ActionDescriptor.encode(message.actionDescriptor, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim();
27314
- if (message.connectionName != null && Object.hasOwnProperty.call(message, "connectionName"))
27315
- writer.uint32(/* id 8, wireType 2 =*/66).string(message.connectionName);
27316
- if (message.platform != null && Object.hasOwnProperty.call(message, "platform"))
27317
- writer.uint32(/* id 9, wireType 2 =*/74).string(message.platform);
27318
- if (message.project != null && Object.hasOwnProperty.call(message, "project"))
27319
- writer.uint32(/* id 10, wireType 2 =*/82).string(message.project);
27320
- if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset"))
27321
- writer.uint32(/* id 11, wireType 2 =*/90).string(message.dataset);
27322
- if (message.sourceName != null && Object.hasOwnProperty.call(message, "sourceName"))
27323
- writer.uint32(/* id 12, wireType 2 =*/98).string(message.sourceName);
27324
- if (message.billingProject != null && Object.hasOwnProperty.call(message, "billingProject"))
27325
- writer.uint32(/* id 13, wireType 2 =*/106).string(message.billingProject);
27326
- if (message.columnTypes != null && Object.hasOwnProperty.call(message, "columnTypes"))
27327
- for (let keys = Object.keys(message.columnTypes), i = 0; i < keys.length; ++i)
27328
- 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);
27329
28632
  if (message.fileName != null && Object.hasOwnProperty.call(message, "fileName"))
27330
28633
  writer.uint32(/* id 15, wireType 2 =*/122).string(message.fileName);
27331
- if (message.database != null && Object.hasOwnProperty.call(message, "database"))
27332
- writer.uint32(/* id 16, wireType 2 =*/130).string(message.database);
27333
28634
  return writer;
27334
28635
  };
27335
28636
 
27336
28637
  /**
27337
- * 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.
27338
28639
  * @function encodeDelimited
27339
- * @memberof sqlanvil.Extract
28640
+ * @memberof sqlanvil.Script
27340
28641
  * @static
27341
- * @param {sqlanvil.IExtract} message Extract message or plain object to encode
28642
+ * @param {sqlanvil.IScript} message Script message or plain object to encode
27342
28643
  * @param {$protobuf.Writer} [writer] Writer to encode to
27343
28644
  * @returns {$protobuf.Writer} Writer
27344
28645
  */
27345
- Extract.encodeDelimited = function encodeDelimited(message, writer) {
28646
+ Script.encodeDelimited = function encodeDelimited(message, writer) {
27346
28647
  return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
27347
28648
  };
27348
28649
 
27349
28650
  /**
27350
- * Decodes an Extract message from the specified reader or buffer.
28651
+ * Decodes a Script message from the specified reader or buffer.
27351
28652
  * @function decode
27352
- * @memberof sqlanvil.Extract
28653
+ * @memberof sqlanvil.Script
27353
28654
  * @static
27354
28655
  * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
27355
28656
  * @param {number} [length] Message length if known beforehand
27356
- * @returns {sqlanvil.Extract} Extract
28657
+ * @returns {sqlanvil.Script} Script
27357
28658
  * @throws {Error} If the payload is not a reader or valid buffer
27358
28659
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
27359
28660
  */
27360
- Extract.decode = function decode(reader, length, error, long) {
28661
+ Script.decode = function decode(reader, length, error, long) {
27361
28662
  if (!(reader instanceof $Reader))
27362
28663
  reader = $Reader.create(reader);
27363
28664
  if (long === undefined)
27364
28665
  long = 0;
27365
28666
  if (long > $Reader.recursionLimit)
27366
28667
  throw Error("maximum nesting depth exceeded");
27367
- 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();
27368
28669
  while (reader.pos < end) {
27369
28670
  let tag = reader.uint32();
27370
28671
  if (tag === error)
@@ -27403,62 +28704,39 @@ const sqlanvil = $root.sqlanvil = (() => {
27403
28704
  break;
27404
28705
  }
27405
28706
  case 8: {
27406
- message.connectionName = reader.string();
28707
+ message.language = reader.string();
27407
28708
  break;
27408
28709
  }
27409
28710
  case 9: {
27410
- message.platform = reader.string();
28711
+ message.scriptFilename = reader.string();
27411
28712
  break;
27412
28713
  }
27413
28714
  case 10: {
27414
- message.project = reader.string();
28715
+ if (!(message.args && message.args.length))
28716
+ message.args = [];
28717
+ message.args.push(reader.string());
27415
28718
  break;
27416
28719
  }
27417
28720
  case 11: {
27418
- message.dataset = reader.string();
28721
+ message.depsFile = reader.string();
27419
28722
  break;
27420
28723
  }
27421
28724
  case 12: {
27422
- message.sourceName = reader.string();
28725
+ message.runtimeVersion = reader.string();
27423
28726
  break;
27424
28727
  }
27425
28728
  case 13: {
27426
- message.billingProject = reader.string();
28729
+ message.envRoot = reader.string();
27427
28730
  break;
27428
28731
  }
27429
28732
  case 14: {
27430
- if (message.columnTypes === $util.emptyObject)
27431
- message.columnTypes = {};
27432
- let end2 = reader.uint32() + reader.pos;
27433
- key = "";
27434
- value = "";
27435
- while (reader.pos < end2) {
27436
- let tag2 = reader.uint32();
27437
- switch (tag2 >>> 3) {
27438
- case 1:
27439
- key = reader.string();
27440
- break;
27441
- case 2:
27442
- value = reader.string();
27443
- break;
27444
- default:
27445
- reader.skipType(tag2 & 7, long);
27446
- break;
27447
- }
27448
- }
27449
- if (key === "__proto__")
27450
- $util.makeProp(message.columnTypes, key);
27451
- message.columnTypes[key] = value;
28733
+ message.timeoutMillis = reader.int32();
27452
28734
  break;
27453
28735
  }
27454
28736
  case 15: {
27455
28737
  message.fileName = reader.string();
27456
28738
  break;
27457
28739
  }
27458
- case 16: {
27459
- message.database = reader.string();
27460
- break;
27461
- }
27462
28740
  default:
27463
28741
  reader.skipType(tag & 7, long);
27464
28742
  break;
@@ -27468,30 +28746,30 @@ const sqlanvil = $root.sqlanvil = (() => {
27468
28746
  };
27469
28747
 
27470
28748
  /**
27471
- * 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.
27472
28750
  * @function decodeDelimited
27473
- * @memberof sqlanvil.Extract
28751
+ * @memberof sqlanvil.Script
27474
28752
  * @static
27475
28753
  * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
27476
- * @returns {sqlanvil.Extract} Extract
28754
+ * @returns {sqlanvil.Script} Script
27477
28755
  * @throws {Error} If the payload is not a reader or valid buffer
27478
28756
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
27479
28757
  */
27480
- Extract.decodeDelimited = function decodeDelimited(reader) {
28758
+ Script.decodeDelimited = function decodeDelimited(reader) {
27481
28759
  if (!(reader instanceof $Reader))
27482
28760
  reader = new $Reader(reader);
27483
28761
  return this.decode(reader, reader.uint32());
27484
28762
  };
27485
28763
 
27486
28764
  /**
27487
- * Verifies an Extract message.
28765
+ * Verifies a Script message.
27488
28766
  * @function verify
27489
- * @memberof sqlanvil.Extract
28767
+ * @memberof sqlanvil.Script
27490
28768
  * @static
27491
28769
  * @param {Object.<string,*>} message Plain object to verify
27492
28770
  * @returns {string|null} `null` if valid, otherwise the reason why it is not
27493
28771
  */
27494
- Extract.verify = function verify(message, long) {
28772
+ Script.verify = function verify(message, long) {
27495
28773
  if (typeof message !== "object" || message === null)
27496
28774
  return "object expected";
27497
28775
  if (long === undefined)
@@ -27541,76 +28819,72 @@ const sqlanvil = $root.sqlanvil = (() => {
27541
28819
  if (error)
27542
28820
  return "actionDescriptor." + error;
27543
28821
  }
27544
- if (message.connectionName != null && Object.hasOwnProperty.call(message, "connectionName"))
27545
- if (!$util.isString(message.connectionName))
27546
- return "connectionName: string expected";
27547
- if (message.platform != null && Object.hasOwnProperty.call(message, "platform"))
27548
- if (!$util.isString(message.platform))
27549
- return "platform: string expected";
27550
- if (message.project != null && Object.hasOwnProperty.call(message, "project"))
27551
- if (!$util.isString(message.project))
27552
- return "project: string expected";
27553
- if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset"))
27554
- if (!$util.isString(message.dataset))
27555
- return "dataset: string expected";
27556
- if (message.sourceName != null && Object.hasOwnProperty.call(message, "sourceName"))
27557
- if (!$util.isString(message.sourceName))
27558
- return "sourceName: string expected";
27559
- if (message.billingProject != null && Object.hasOwnProperty.call(message, "billingProject"))
27560
- if (!$util.isString(message.billingProject))
27561
- return "billingProject: string expected";
27562
- if (message.columnTypes != null && Object.hasOwnProperty.call(message, "columnTypes")) {
27563
- if (!$util.isObject(message.columnTypes))
27564
- return "columnTypes: object expected";
27565
- let key = Object.keys(message.columnTypes);
27566
- for (let i = 0; i < key.length; ++i)
27567
- if (!$util.isString(message.columnTypes[key[i]]))
27568
- return "columnTypes: string{k:string} expected";
27569
- }
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";
27570
28847
  if (message.fileName != null && Object.hasOwnProperty.call(message, "fileName"))
27571
28848
  if (!$util.isString(message.fileName))
27572
28849
  return "fileName: string expected";
27573
- if (message.database != null && Object.hasOwnProperty.call(message, "database"))
27574
- if (!$util.isString(message.database))
27575
- return "database: string expected";
27576
28850
  return null;
27577
28851
  };
27578
28852
 
27579
28853
  /**
27580
- * 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.
27581
28855
  * @function fromObject
27582
- * @memberof sqlanvil.Extract
28856
+ * @memberof sqlanvil.Script
27583
28857
  * @static
27584
28858
  * @param {Object.<string,*>} object Plain object
27585
- * @returns {sqlanvil.Extract} Extract
28859
+ * @returns {sqlanvil.Script} Script
27586
28860
  */
27587
- Extract.fromObject = function fromObject(object, long) {
27588
- if (object instanceof $root.sqlanvil.Extract)
28861
+ Script.fromObject = function fromObject(object, long) {
28862
+ if (object instanceof $root.sqlanvil.Script)
27589
28863
  return object;
27590
28864
  if (!$util.isObject(object))
27591
- throw TypeError(".sqlanvil.Extract: object expected");
28865
+ throw TypeError(".sqlanvil.Script: object expected");
27592
28866
  if (long === undefined)
27593
28867
  long = 0;
27594
28868
  if (long > $util.recursionLimit)
27595
28869
  throw Error("maximum nesting depth exceeded");
27596
- let message = new $root.sqlanvil.Extract();
28870
+ let message = new $root.sqlanvil.Script();
27597
28871
  if (object.target != null) {
27598
28872
  if (!$util.isObject(object.target))
27599
- throw TypeError(".sqlanvil.Extract.target: object expected");
28873
+ throw TypeError(".sqlanvil.Script.target: object expected");
27600
28874
  message.target = $root.sqlanvil.Target.fromObject(object.target, long + 1);
27601
28875
  }
27602
28876
  if (object.canonicalTarget != null) {
27603
28877
  if (!$util.isObject(object.canonicalTarget))
27604
- throw TypeError(".sqlanvil.Extract.canonicalTarget: object expected");
28878
+ throw TypeError(".sqlanvil.Script.canonicalTarget: object expected");
27605
28879
  message.canonicalTarget = $root.sqlanvil.Target.fromObject(object.canonicalTarget, long + 1);
27606
28880
  }
27607
28881
  if (object.dependencyTargets) {
27608
28882
  if (!Array.isArray(object.dependencyTargets))
27609
- throw TypeError(".sqlanvil.Extract.dependencyTargets: array expected");
28883
+ throw TypeError(".sqlanvil.Script.dependencyTargets: array expected");
27610
28884
  message.dependencyTargets = [];
27611
28885
  for (let i = 0; i < object.dependencyTargets.length; ++i) {
27612
28886
  if (!$util.isObject(object.dependencyTargets[i]))
27613
- throw TypeError(".sqlanvil.Extract.dependencyTargets: object expected");
28887
+ throw TypeError(".sqlanvil.Script.dependencyTargets: object expected");
27614
28888
  message.dependencyTargets[i] = $root.sqlanvil.Target.fromObject(object.dependencyTargets[i], long + 1);
27615
28889
  }
27616
28890
  }
@@ -27638,55 +28912,50 @@ const sqlanvil = $root.sqlanvil = (() => {
27638
28912
  message.disabled = Boolean(object.disabled);
27639
28913
  if (object.tags) {
27640
28914
  if (!Array.isArray(object.tags))
27641
- throw TypeError(".sqlanvil.Extract.tags: array expected");
28915
+ throw TypeError(".sqlanvil.Script.tags: array expected");
27642
28916
  message.tags = [];
27643
28917
  for (let i = 0; i < object.tags.length; ++i)
27644
28918
  message.tags[i] = String(object.tags[i]);
27645
28919
  }
27646
28920
  if (object.actionDescriptor != null) {
27647
28921
  if (!$util.isObject(object.actionDescriptor))
27648
- throw TypeError(".sqlanvil.Extract.actionDescriptor: object expected");
28922
+ throw TypeError(".sqlanvil.Script.actionDescriptor: object expected");
27649
28923
  message.actionDescriptor = $root.sqlanvil.ActionDescriptor.fromObject(object.actionDescriptor, long + 1);
27650
28924
  }
27651
- if (object.connectionName != null)
27652
- message.connectionName = String(object.connectionName);
27653
- if (object.platform != null)
27654
- message.platform = String(object.platform);
27655
- if (object.project != null)
27656
- message.project = String(object.project);
27657
- if (object.dataset != null)
27658
- message.dataset = String(object.dataset);
27659
- if (object.sourceName != null)
27660
- message.sourceName = String(object.sourceName);
27661
- if (object.billingProject != null)
27662
- message.billingProject = String(object.billingProject);
27663
- if (object.columnTypes) {
27664
- if (!$util.isObject(object.columnTypes))
27665
- throw TypeError(".sqlanvil.Extract.columnTypes: object expected");
27666
- message.columnTypes = {};
27667
- for (let keys = Object.keys(object.columnTypes), i = 0; i < keys.length; ++i) {
27668
- if (keys[i] === "__proto__")
27669
- $util.makeProp(message.columnTypes, keys[i]);
27670
- message.columnTypes[keys[i]] = String(object.columnTypes[keys[i]]);
27671
- }
27672
- }
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;
27673
28944
  if (object.fileName != null)
27674
28945
  message.fileName = String(object.fileName);
27675
- if (object.database != null)
27676
- message.database = String(object.database);
27677
28946
  return message;
27678
28947
  };
27679
28948
 
27680
28949
  /**
27681
- * 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.
27682
28951
  * @function toObject
27683
- * @memberof sqlanvil.Extract
28952
+ * @memberof sqlanvil.Script
27684
28953
  * @static
27685
- * @param {sqlanvil.Extract} message Extract
28954
+ * @param {sqlanvil.Script} message Script
27686
28955
  * @param {$protobuf.IConversionOptions} [options] Conversion options
27687
28956
  * @returns {Object.<string,*>} Plain object
27688
28957
  */
27689
- Extract.toObject = function toObject(message, options, q) {
28958
+ Script.toObject = function toObject(message, options, q) {
27690
28959
  if (!options)
27691
28960
  options = {};
27692
28961
  if (q === undefined)
@@ -27697,23 +28966,21 @@ const sqlanvil = $root.sqlanvil = (() => {
27697
28966
  if (options.arrays || options.defaults) {
27698
28967
  object.dependencyTargets = [];
27699
28968
  object.tags = [];
28969
+ object.args = [];
27700
28970
  }
27701
- if (options.objects || options.defaults)
27702
- object.columnTypes = {};
27703
28971
  if (options.defaults) {
27704
28972
  object.target = null;
27705
28973
  object.canonicalTarget = null;
27706
28974
  object.hermeticity = options.enums === String ? "UNKNOWN" : 0;
27707
28975
  object.disabled = false;
27708
28976
  object.actionDescriptor = null;
27709
- object.connectionName = "";
27710
- object.platform = "";
27711
- object.project = "";
27712
- object.dataset = "";
27713
- object.sourceName = "";
27714
- object.billingProject = "";
28977
+ object.language = "";
28978
+ object.scriptFilename = "";
28979
+ object.depsFile = "";
28980
+ object.runtimeVersion = "";
28981
+ object.envRoot = "";
28982
+ object.timeoutMillis = 0;
27715
28983
  object.fileName = "";
27716
- object.database = "";
27717
28984
  }
27718
28985
  if (message.target != null && Object.hasOwnProperty.call(message, "target"))
27719
28986
  object.target = $root.sqlanvil.Target.toObject(message.target, options, q + 1);
@@ -27735,61 +29002,55 @@ const sqlanvil = $root.sqlanvil = (() => {
27735
29002
  }
27736
29003
  if (message.actionDescriptor != null && Object.hasOwnProperty.call(message, "actionDescriptor"))
27737
29004
  object.actionDescriptor = $root.sqlanvil.ActionDescriptor.toObject(message.actionDescriptor, options, q + 1);
27738
- if (message.connectionName != null && Object.hasOwnProperty.call(message, "connectionName"))
27739
- object.connectionName = message.connectionName;
27740
- if (message.platform != null && Object.hasOwnProperty.call(message, "platform"))
27741
- object.platform = message.platform;
27742
- if (message.project != null && Object.hasOwnProperty.call(message, "project"))
27743
- object.project = message.project;
27744
- if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset"))
27745
- object.dataset = message.dataset;
27746
- if (message.sourceName != null && Object.hasOwnProperty.call(message, "sourceName"))
27747
- object.sourceName = message.sourceName;
27748
- if (message.billingProject != null && Object.hasOwnProperty.call(message, "billingProject"))
27749
- object.billingProject = message.billingProject;
27750
- let keys2;
27751
- if (message.columnTypes && (keys2 = Object.keys(message.columnTypes)).length) {
27752
- object.columnTypes = {};
27753
- for (let j = 0; j < keys2.length; ++j) {
27754
- if (keys2[j] === "__proto__")
27755
- $util.makeProp(object.columnTypes, keys2[j]);
27756
- object.columnTypes[keys2[j]] = message.columnTypes[keys2[j]];
27757
- }
27758
- }
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;
27759
29022
  if (message.fileName != null && Object.hasOwnProperty.call(message, "fileName"))
27760
29023
  object.fileName = message.fileName;
27761
- if (message.database != null && Object.hasOwnProperty.call(message, "database"))
27762
- object.database = message.database;
27763
29024
  return object;
27764
29025
  };
27765
29026
 
27766
29027
  /**
27767
- * Converts this Extract to JSON.
29028
+ * Converts this Script to JSON.
27768
29029
  * @function toJSON
27769
- * @memberof sqlanvil.Extract
29030
+ * @memberof sqlanvil.Script
27770
29031
  * @instance
27771
29032
  * @returns {Object.<string,*>} JSON object
27772
29033
  */
27773
- Extract.prototype.toJSON = function toJSON() {
29034
+ Script.prototype.toJSON = function toJSON() {
27774
29035
  return this.constructor.toObject(this, $protobuf__namespace.util.toJSONOptions);
27775
29036
  };
27776
29037
 
27777
29038
  /**
27778
- * Gets the default type url for Extract
29039
+ * Gets the default type url for Script
27779
29040
  * @function getTypeUrl
27780
- * @memberof sqlanvil.Extract
29041
+ * @memberof sqlanvil.Script
27781
29042
  * @static
27782
29043
  * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
27783
29044
  * @returns {string} The default type url
27784
29045
  */
27785
- Extract.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
29046
+ Script.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
27786
29047
  if (typeUrlPrefix === undefined) {
27787
29048
  typeUrlPrefix = "type.googleapis.com";
27788
29049
  }
27789
- return typeUrlPrefix + "/sqlanvil.Extract";
29050
+ return typeUrlPrefix + "/sqlanvil.Script";
27790
29051
  };
27791
29052
 
27792
- return Extract;
29053
+ return Script;
27793
29054
  })();
27794
29055
 
27795
29056
  sqlanvil.Assertion = (function() {
@@ -31869,6 +33130,7 @@ const sqlanvil = $root.sqlanvil = (() => {
31869
33130
  * @property {Array.<sqlanvil.IExport>|null} [exports] CompiledGraph exports
31870
33131
  * @property {Array.<sqlanvil.IImport>|null} [imports] CompiledGraph imports
31871
33132
  * @property {Array.<sqlanvil.IExtract>|null} [extracts] CompiledGraph extracts
33133
+ * @property {Array.<sqlanvil.IScript>|null} [scripts] CompiledGraph scripts
31872
33134
  * @property {sqlanvil.IGraphErrors|null} [graphErrors] CompiledGraph graphErrors
31873
33135
  * @property {string|null} [sqlanvilCoreVersion] CompiledGraph sqlanvilCoreVersion
31874
33136
  * @property {Array.<sqlanvil.ITarget>|null} [targets] CompiledGraph targets
@@ -31894,6 +33156,7 @@ const sqlanvil = $root.sqlanvil = (() => {
31894
33156
  this.exports = [];
31895
33157
  this.imports = [];
31896
33158
  this.extracts = [];
33159
+ this.scripts = [];
31897
33160
  this.targets = [];
31898
33161
  if (properties)
31899
33162
  for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
@@ -31989,6 +33252,14 @@ const sqlanvil = $root.sqlanvil = (() => {
31989
33252
  */
31990
33253
  CompiledGraph.prototype.extracts = $util.emptyArray;
31991
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
+
31992
33263
  /**
31993
33264
  * CompiledGraph graphErrors.
31994
33265
  * @member {sqlanvil.IGraphErrors|null|undefined} graphErrors
@@ -32090,6 +33361,9 @@ const sqlanvil = $root.sqlanvil = (() => {
32090
33361
  if (message.extracts != null && message.extracts.length)
32091
33362
  for (let i = 0; i < message.extracts.length; ++i)
32092
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();
32093
33367
  return writer;
32094
33368
  };
32095
33369
 
@@ -32194,6 +33468,12 @@ const sqlanvil = $root.sqlanvil = (() => {
32194
33468
  message.extracts.push($root.sqlanvil.Extract.decode(reader, reader.uint32(), undefined, long + 1));
32195
33469
  break;
32196
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
+ }
32197
33477
  case 7: {
32198
33478
  message.graphErrors = $root.sqlanvil.GraphErrors.decode(reader, reader.uint32(), undefined, long + 1);
32199
33479
  break;
@@ -32346,6 +33626,15 @@ const sqlanvil = $root.sqlanvil = (() => {
32346
33626
  return "extracts." + error;
32347
33627
  }
32348
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
+ }
32349
33638
  if (message.graphErrors != null && Object.hasOwnProperty.call(message, "graphErrors")) {
32350
33639
  let error = $root.sqlanvil.GraphErrors.verify(message.graphErrors, long + 1);
32351
33640
  if (error)
@@ -32494,6 +33783,16 @@ const sqlanvil = $root.sqlanvil = (() => {
32494
33783
  message.extracts[i] = $root.sqlanvil.Extract.fromObject(object.extracts[i], long + 1);
32495
33784
  }
32496
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
+ }
32497
33796
  if (object.graphErrors != null) {
32498
33797
  if (!$util.isObject(object.graphErrors))
32499
33798
  throw TypeError(".sqlanvil.CompiledGraph.graphErrors: object expected");
@@ -32548,6 +33847,7 @@ const sqlanvil = $root.sqlanvil = (() => {
32548
33847
  object.exports = [];
32549
33848
  object.imports = [];
32550
33849
  object.extracts = [];
33850
+ object.scripts = [];
32551
33851
  }
32552
33852
  if (options.defaults) {
32553
33853
  object.projectConfig = null;
@@ -32618,6 +33918,11 @@ const sqlanvil = $root.sqlanvil = (() => {
32618
33918
  for (let j = 0; j < message.extracts.length; ++j)
32619
33919
  object.extracts[j] = $root.sqlanvil.Extract.toObject(message.extracts[j], options, q + 1);
32620
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
+ }
32621
33926
  return object;
32622
33927
  };
32623
33928
 
@@ -38361,6 +39666,389 @@ const sqlanvil = $root.sqlanvil = (() => {
38361
39666
  return ExtractSpec;
38362
39667
  })();
38363
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
+
38364
40052
  sqlanvil.ExecutionAction = (function() {
38365
40053
 
38366
40054
  /**
@@ -38379,6 +40067,7 @@ const sqlanvil = $root.sqlanvil = (() => {
38379
40067
  * @property {sqlanvil.IExportSpec|null} ["export"] ExecutionAction export
38380
40068
  * @property {sqlanvil.IImportSpec|null} ["import"] ExecutionAction import
38381
40069
  * @property {sqlanvil.IExtractSpec|null} [extract] ExecutionAction extract
40070
+ * @property {sqlanvil.IScriptSpec|null} [script] ExecutionAction script
38382
40071
  */
38383
40072
 
38384
40073
  /**
@@ -38494,6 +40183,14 @@ const sqlanvil = $root.sqlanvil = (() => {
38494
40183
  */
38495
40184
  ExecutionAction.prototype.extract = null;
38496
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
+
38497
40194
  /**
38498
40195
  * Creates a new ExecutionAction instance using the specified properties.
38499
40196
  * @function create
@@ -38548,6 +40245,8 @@ const sqlanvil = $root.sqlanvil = (() => {
38548
40245
  $root.sqlanvil.ImportSpec.encode(message["import"], writer.uint32(/* id 14, wireType 2 =*/114).fork(), q + 1).ldelim();
38549
40246
  if (message.extract != null && Object.hasOwnProperty.call(message, "extract"))
38550
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();
38551
40250
  return writer;
38552
40251
  };
38553
40252
 
@@ -38640,6 +40339,10 @@ const sqlanvil = $root.sqlanvil = (() => {
38640
40339
  message.extract = $root.sqlanvil.ExtractSpec.decode(reader, reader.uint32(), undefined, long + 1);
38641
40340
  break;
38642
40341
  }
40342
+ case 16: {
40343
+ message.script = $root.sqlanvil.ScriptSpec.decode(reader, reader.uint32(), undefined, long + 1);
40344
+ break;
40345
+ }
38643
40346
  default:
38644
40347
  reader.skipType(tag & 7, long);
38645
40348
  break;
@@ -38743,6 +40446,11 @@ const sqlanvil = $root.sqlanvil = (() => {
38743
40446
  if (error)
38744
40447
  return "extract." + error;
38745
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
+ }
38746
40454
  return null;
38747
40455
  };
38748
40456
 
@@ -38837,6 +40545,11 @@ const sqlanvil = $root.sqlanvil = (() => {
38837
40545
  throw TypeError(".sqlanvil.ExecutionAction.extract: object expected");
38838
40546
  message.extract = $root.sqlanvil.ExtractSpec.fromObject(object.extract, long + 1);
38839
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
+ }
38840
40553
  return message;
38841
40554
  };
38842
40555
 
@@ -38872,6 +40585,7 @@ const sqlanvil = $root.sqlanvil = (() => {
38872
40585
  object["export"] = null;
38873
40586
  object["import"] = null;
38874
40587
  object.extract = null;
40588
+ object.script = null;
38875
40589
  }
38876
40590
  if (message.tasks && message.tasks.length) {
38877
40591
  object.tasks = [];
@@ -38903,6 +40617,8 @@ const sqlanvil = $root.sqlanvil = (() => {
38903
40617
  object["import"] = $root.sqlanvil.ImportSpec.toObject(message["import"], options, q + 1);
38904
40618
  if (message.extract != null && Object.hasOwnProperty.call(message, "extract"))
38905
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);
38906
40622
  return object;
38907
40623
  };
38908
40624
 
@@ -47676,11 +49392,11 @@ function setOrValidateTableEnumType(table) {
47676
49392
  function prune(compiledGraph, runConfig) {
47677
49393
  compiledGraph.tables.forEach(setOrValidateTableEnumType);
47678
49394
  const includedActionNames = computeIncludedActionNames(compiledGraph, runConfig);
47679
- 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))) });
47680
49396
  }
47681
49397
  function computeIncludedActionNames(compiledGraph, runConfig) {
47682
49398
  var _a, _b, _c;
47683
- 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 || []);
47684
49400
  const allActionNames = new Set(allActions.map(action => targetAsReadableString(action.target)));
47685
49401
  const allActionsByName = new Map(allActions.map(action => [targetAsReadableString(action.target), action]));
47686
49402
  const hasActionSelector = ((_a = runConfig.actions) === null || _a === void 0 ? void 0 : _a.length) > 0;
@@ -48890,7 +50606,7 @@ function collectEvaluationQueries(queryOrAction, concatenate, queryModifier = (q
48890
50606
  .filter(validationQuery => !!validationQuery.query);
48891
50607
  }
48892
50608
 
48893
- const version = "1.19.0";
50609
+ const version = "1.20.0";
48894
50610
  const dataformVersion = "3.0.61";
48895
50611
 
48896
50612
  async function build(compiledGraph, runConfig, dbadapter) {
@@ -48914,7 +50630,7 @@ class Builder {
48914
50630
  this.warehouseState.tables.forEach(tableState => {
48915
50631
  tableMetadataByTarget.set(targetStringifier.stringify(tableState.target), tableState);
48916
50632
  });
48917
- 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)));
48918
50634
  return sqlanvil.ExecutionGraph.create({
48919
50635
  projectConfig: this.prunedGraph.projectConfig,
48920
50636
  runConfig: this.runConfig,
@@ -48962,6 +50678,19 @@ class Builder {
48962
50678
  columnTypes: ext.columnTypes
48963
50679
  }) });
48964
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
+ }
48965
50694
  toPartialExecutionAction(action) {
48966
50695
  return sqlanvil.ExecutionAction.create({
48967
50696
  target: action.target,
@@ -51227,6 +52956,95 @@ async function runDuckdbImport(args) {
51227
52956
  });
51228
52957
  }
51229
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
+
51230
53048
  class Flags {
51231
53049
  static boolean(name, defaultValue = false) {
51232
53050
  return new SingleValueFlag(name, defaultValue, (stringValue) => {
@@ -51597,7 +53415,7 @@ class Runner {
51597
53415
  return actionResult;
51598
53416
  }
51599
53417
  async executeTask(client, task, parentAction, options, action) {
51600
- var _a, _b, _c, _d, _e, _f;
53418
+ var _a, _b, _c, _d, _e, _f, _g;
51601
53419
  const timer = Timer.start();
51602
53420
  const taskResult = {
51603
53421
  status: sqlanvil.TaskResult.ExecutionStatus.RUNNING,
@@ -51646,9 +53464,30 @@ class Runner {
51646
53464
  taskResult.errorMessage = `${this.graph.projectConfig.warehouse} import error: ${e.message}`;
51647
53465
  }
51648
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
+ }
51649
53488
  else if (task.type === "extract") {
51650
53489
  try {
51651
- 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"
51652
53491
  ? this.executionOptions.mysqlExtract || runMysqlExtract
51653
53492
  : this.executionOptions.bigQueryExtract || runBigQueryExtract;
51654
53493
  await extractor({
@@ -51678,7 +53517,7 @@ class Runner {
51678
53517
  }), task.type === "operation" ? 1 : options.bigquery.actionRetryLimit + 1 || 1);
51679
53518
  taskResult.metadata = metadata;
51680
53519
  if (task.type === "assertion") {
51681
- 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]];
51682
53521
  if (rowCount > 0) {
51683
53522
  throw new Error(`Assertion failed: query returned ${rowCount} row(s).`);
51684
53523
  }
@@ -51690,7 +53529,7 @@ class Runner {
51690
53529
  ? sqlanvil.TaskResult.ExecutionStatus.CANCELLED
51691
53530
  : sqlanvil.TaskResult.ExecutionStatus.FAILED;
51692
53531
  taskResult.errorMessage = `${this.graph.projectConfig.warehouse} error: ${e.message}`;
51693
- 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) {
51694
53533
  taskResult.metadata = {
51695
53534
  bigquery: {
51696
53535
  jobId: e.metadata.bigquery.jobId
@@ -51959,6 +53798,9 @@ function catalogRows(compiledGraph) {
51959
53798
  for (const imp of compiledGraph.imports || []) {
51960
53799
  add(imp, "import");
51961
53800
  }
53801
+ for (const script of compiledGraph.scripts || []) {
53802
+ add(script, "script");
53803
+ }
51962
53804
  for (const declaration of compiledGraph.declarations || []) {
51963
53805
  add(declaration, "declaration");
51964
53806
  }
@@ -52207,6 +54049,183 @@ ${columnRows || '<tr><td colspan="3" class="meta">No documented columns.</td></t
52207
54049
  `;
52208
54050
  }
52209
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
+
52210
54229
  function targetKey(target) {
52211
54230
  return [target.database, target.schema, target.name].filter(Boolean).join(".");
52212
54231
  }
@@ -52350,6 +54369,20 @@ async function validate(compiledGraph, deps, options = {}) {
52350
54369
  action: undefined
52351
54370
  });
52352
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
+ }
52353
54386
  const ordered = topoOrder(nodes);
52354
54387
  const shadowSchemas = Array.from(new Set(nodes.filter(n => n.kind === "table").map(n => n.target.schema)));
52355
54388
  const statusByKey = new Map();
@@ -52359,7 +54392,9 @@ async function validate(compiledGraph, deps, options = {}) {
52359
54392
  await deps.execute(deps.createSchemaSql(schema));
52360
54393
  }
52361
54394
  for (const node of ordered) {
52362
- if (node.kind === "operation" || node.kind === "import") {
54395
+ if (node.kind === "operation" ||
54396
+ node.kind === "import" ||
54397
+ (node.kind === "script" && !deps.checkScript)) {
52363
54398
  statusByKey.set(node.key, "SKIPPED");
52364
54399
  results.push({ target: node.target, type: node.type, status: "SKIPPED", errors: [] });
52365
54400
  continue;
@@ -52369,7 +54404,9 @@ async function validate(compiledGraph, deps, options = {}) {
52369
54404
  results.push({ target: node.target, type: node.type, status: "BLOCKED", errors: [] });
52370
54405
  continue;
52371
54406
  }
52372
- 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);
52373
54410
  const failed = evaluations.some(e => e.status === sqlanvil.QueryEvaluation.QueryEvaluationStatus.FAILURE);
52374
54411
  const status = failed ? "FAILURE" : "PASS";
52375
54412
  statusByKey.set(node.key, status);
@@ -53951,7 +55988,8 @@ async function runValidate(argv) {
53951
55988
  listSchemas: async () => {
53952
55989
  const result = await dbadapter.execute("select schema_name as name from information_schema.schemata");
53953
55990
  return ((result && result.rows) || []).map((row) => row.name);
53954
- }
55991
+ },
55992
+ checkScript: script => checkScriptAction(script, projectDir)
53955
55993
  };
53956
55994
  await sweepOrphanShadows(deps, Date.now());
53957
55995
  if (!argv[jsonOutputOption.name]) {
@@ -54522,7 +56560,8 @@ function runCli() {
54522
56560
  bigquery: bigqueryOptions,
54523
56561
  connectionCredentials,
54524
56562
  warehouseConnection: isPostgresLike ? readCredentials : undefined,
54525
- storageCredentials
56563
+ storageCredentials,
56564
+ projectDir: argv[projectDirOption.name]
54526
56565
  });
54527
56566
  process.on("SIGINT", () => {
54528
56567
  runner.cancel();