@sqlanvil/cli 1.0.3 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/bundle.js +819 -9
  2. package/package.json +1 -1
  3. package/worker_bundle.js +605 -3
package/worker_bundle.js CHANGED
@@ -87,6 +87,7 @@ const sqlanvil = $root.sqlanvil = (() => {
87
87
  * @property {sqlanvil.IExtension|null} [extension] WorkflowSettings extension
88
88
  * @property {boolean|null} [includeTestsInCompiledGraph] WorkflowSettings includeTestsInCompiledGraph
89
89
  * @property {string|null} [warehouse] WorkflowSettings warehouse
90
+ * @property {Object.<string,sqlanvil.IConnectionConfig>|null} [connections] WorkflowSettings connections
90
91
  */
91
92
 
92
93
  /**
@@ -99,6 +100,7 @@ const sqlanvil = $root.sqlanvil = (() => {
99
100
  */
100
101
  function WorkflowSettings(properties) {
101
102
  this.vars = {};
103
+ this.connections = {};
102
104
  if (properties)
103
105
  for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
104
106
  if (properties[keys[i]] != null)
@@ -241,6 +243,14 @@ const sqlanvil = $root.sqlanvil = (() => {
241
243
  */
242
244
  WorkflowSettings.prototype.warehouse = "";
243
245
 
246
+ /**
247
+ * WorkflowSettings connections.
248
+ * @member {Object.<string,sqlanvil.IConnectionConfig>} connections
249
+ * @memberof sqlanvil.WorkflowSettings
250
+ * @instance
251
+ */
252
+ WorkflowSettings.prototype.connections = $util.emptyObject;
253
+
244
254
  /**
245
255
  * Creates a new WorkflowSettings instance using the specified properties.
246
256
  * @function create
@@ -300,6 +310,11 @@ const sqlanvil = $root.sqlanvil = (() => {
300
310
  writer.uint32(/* id 16, wireType 0 =*/128).bool(message.includeTestsInCompiledGraph);
301
311
  if (message.warehouse != null && Object.hasOwnProperty.call(message, "warehouse"))
302
312
  writer.uint32(/* id 17, wireType 2 =*/138).string(message.warehouse);
313
+ if (message.connections != null && Object.hasOwnProperty.call(message, "connections"))
314
+ for (let keys = Object.keys(message.connections), i = 0; i < keys.length; ++i) {
315
+ writer.uint32(/* id 18, wireType 2 =*/146).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]);
316
+ $root.sqlanvil.ConnectionConfig.encode(message.connections[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
317
+ }
303
318
  return writer;
304
319
  };
305
320
 
@@ -423,6 +438,29 @@ const sqlanvil = $root.sqlanvil = (() => {
423
438
  message.warehouse = reader.string();
424
439
  break;
425
440
  }
441
+ case 18: {
442
+ if (message.connections === $util.emptyObject)
443
+ message.connections = {};
444
+ let end2 = reader.uint32() + reader.pos;
445
+ key = "";
446
+ value = null;
447
+ while (reader.pos < end2) {
448
+ let tag2 = reader.uint32();
449
+ switch (tag2 >>> 3) {
450
+ case 1:
451
+ key = reader.string();
452
+ break;
453
+ case 2:
454
+ value = $root.sqlanvil.ConnectionConfig.decode(reader, reader.uint32());
455
+ break;
456
+ default:
457
+ reader.skipType(tag2 & 7);
458
+ break;
459
+ }
460
+ }
461
+ message.connections[key] = value;
462
+ break;
463
+ }
426
464
  default:
427
465
  reader.skipType(tag & 7);
428
466
  break;
@@ -520,6 +558,16 @@ const sqlanvil = $root.sqlanvil = (() => {
520
558
  if (message.warehouse != null && message.hasOwnProperty("warehouse"))
521
559
  if (!$util.isString(message.warehouse))
522
560
  return "warehouse: string expected";
561
+ if (message.connections != null && message.hasOwnProperty("connections")) {
562
+ if (!$util.isObject(message.connections))
563
+ return "connections: object expected";
564
+ let key = Object.keys(message.connections);
565
+ for (let i = 0; i < key.length; ++i) {
566
+ let error = $root.sqlanvil.ConnectionConfig.verify(message.connections[key[i]]);
567
+ if (error)
568
+ return "connections." + error;
569
+ }
570
+ }
523
571
  return null;
524
572
  };
525
573
 
@@ -583,6 +631,16 @@ const sqlanvil = $root.sqlanvil = (() => {
583
631
  message.includeTestsInCompiledGraph = Boolean(object.includeTestsInCompiledGraph);
584
632
  if (object.warehouse != null)
585
633
  message.warehouse = String(object.warehouse);
634
+ if (object.connections) {
635
+ if (typeof object.connections !== "object")
636
+ throw TypeError(".sqlanvil.WorkflowSettings.connections: object expected");
637
+ message.connections = {};
638
+ for (let keys = Object.keys(object.connections), i = 0; i < keys.length; ++i) {
639
+ if (typeof object.connections[keys[i]] !== "object")
640
+ throw TypeError(".sqlanvil.WorkflowSettings.connections: object expected");
641
+ message.connections[keys[i]] = $root.sqlanvil.ConnectionConfig.fromObject(object.connections[keys[i]]);
642
+ }
643
+ }
586
644
  return message;
587
645
  };
588
646
 
@@ -599,8 +657,10 @@ const sqlanvil = $root.sqlanvil = (() => {
599
657
  if (!options)
600
658
  options = {};
601
659
  let object = {};
602
- if (options.objects || options.defaults)
660
+ if (options.objects || options.defaults) {
603
661
  object.vars = {};
662
+ object.connections = {};
663
+ }
604
664
  if (options.defaults) {
605
665
  object.sqlanvilCoreVersion = "";
606
666
  object.defaultProject = "";
@@ -657,6 +717,11 @@ const sqlanvil = $root.sqlanvil = (() => {
657
717
  object.includeTestsInCompiledGraph = message.includeTestsInCompiledGraph;
658
718
  if (message.warehouse != null && message.hasOwnProperty("warehouse"))
659
719
  object.warehouse = message.warehouse;
720
+ if (message.connections && (keys2 = Object.keys(message.connections)).length) {
721
+ object.connections = {};
722
+ for (let j = 0; j < keys2.length; ++j)
723
+ object.connections[keys2[j]] = $root.sqlanvil.ConnectionConfig.toObject(message.connections[keys2[j]], options);
724
+ }
660
725
  return object;
661
726
  };
662
727
 
@@ -689,6 +754,373 @@ const sqlanvil = $root.sqlanvil = (() => {
689
754
  return WorkflowSettings;
690
755
  })();
691
756
 
757
+ sqlanvil.ConnectionConfig = (function() {
758
+
759
+ /**
760
+ * Properties of a ConnectionConfig.
761
+ * @memberof sqlanvil
762
+ * @interface IConnectionConfig
763
+ * @property {string|null} [platform] ConnectionConfig platform
764
+ * @property {string|null} [project] ConnectionConfig project
765
+ * @property {string|null} [dataset] ConnectionConfig dataset
766
+ * @property {string|null} [saKeyId] ConnectionConfig saKeyId
767
+ * @property {string|null} [host] ConnectionConfig host
768
+ * @property {number|null} [port] ConnectionConfig port
769
+ * @property {string|null} [database] ConnectionConfig database
770
+ * @property {string|null} [defaultSchema] ConnectionConfig defaultSchema
771
+ */
772
+
773
+ /**
774
+ * Constructs a new ConnectionConfig.
775
+ * @memberof sqlanvil
776
+ * @classdesc Represents a ConnectionConfig.
777
+ * @implements IConnectionConfig
778
+ * @constructor
779
+ * @param {sqlanvil.IConnectionConfig=} [properties] Properties to set
780
+ */
781
+ function ConnectionConfig(properties) {
782
+ if (properties)
783
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
784
+ if (properties[keys[i]] != null)
785
+ this[keys[i]] = properties[keys[i]];
786
+ }
787
+
788
+ /**
789
+ * ConnectionConfig platform.
790
+ * @member {string} platform
791
+ * @memberof sqlanvil.ConnectionConfig
792
+ * @instance
793
+ */
794
+ ConnectionConfig.prototype.platform = "";
795
+
796
+ /**
797
+ * ConnectionConfig project.
798
+ * @member {string} project
799
+ * @memberof sqlanvil.ConnectionConfig
800
+ * @instance
801
+ */
802
+ ConnectionConfig.prototype.project = "";
803
+
804
+ /**
805
+ * ConnectionConfig dataset.
806
+ * @member {string} dataset
807
+ * @memberof sqlanvil.ConnectionConfig
808
+ * @instance
809
+ */
810
+ ConnectionConfig.prototype.dataset = "";
811
+
812
+ /**
813
+ * ConnectionConfig saKeyId.
814
+ * @member {string} saKeyId
815
+ * @memberof sqlanvil.ConnectionConfig
816
+ * @instance
817
+ */
818
+ ConnectionConfig.prototype.saKeyId = "";
819
+
820
+ /**
821
+ * ConnectionConfig host.
822
+ * @member {string} host
823
+ * @memberof sqlanvil.ConnectionConfig
824
+ * @instance
825
+ */
826
+ ConnectionConfig.prototype.host = "";
827
+
828
+ /**
829
+ * ConnectionConfig port.
830
+ * @member {number} port
831
+ * @memberof sqlanvil.ConnectionConfig
832
+ * @instance
833
+ */
834
+ ConnectionConfig.prototype.port = 0;
835
+
836
+ /**
837
+ * ConnectionConfig database.
838
+ * @member {string} database
839
+ * @memberof sqlanvil.ConnectionConfig
840
+ * @instance
841
+ */
842
+ ConnectionConfig.prototype.database = "";
843
+
844
+ /**
845
+ * ConnectionConfig defaultSchema.
846
+ * @member {string} defaultSchema
847
+ * @memberof sqlanvil.ConnectionConfig
848
+ * @instance
849
+ */
850
+ ConnectionConfig.prototype.defaultSchema = "";
851
+
852
+ /**
853
+ * Creates a new ConnectionConfig instance using the specified properties.
854
+ * @function create
855
+ * @memberof sqlanvil.ConnectionConfig
856
+ * @static
857
+ * @param {sqlanvil.IConnectionConfig=} [properties] Properties to set
858
+ * @returns {sqlanvil.ConnectionConfig} ConnectionConfig instance
859
+ */
860
+ ConnectionConfig.create = function create(properties) {
861
+ return new ConnectionConfig(properties);
862
+ };
863
+
864
+ /**
865
+ * Encodes the specified ConnectionConfig message. Does not implicitly {@link sqlanvil.ConnectionConfig.verify|verify} messages.
866
+ * @function encode
867
+ * @memberof sqlanvil.ConnectionConfig
868
+ * @static
869
+ * @param {sqlanvil.IConnectionConfig} message ConnectionConfig message or plain object to encode
870
+ * @param {$protobuf.Writer} [writer] Writer to encode to
871
+ * @returns {$protobuf.Writer} Writer
872
+ */
873
+ ConnectionConfig.encode = function encode(message, writer) {
874
+ if (!writer)
875
+ writer = $Writer.create();
876
+ if (message.platform != null && Object.hasOwnProperty.call(message, "platform"))
877
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.platform);
878
+ if (message.project != null && Object.hasOwnProperty.call(message, "project"))
879
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.project);
880
+ if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset"))
881
+ writer.uint32(/* id 3, wireType 2 =*/26).string(message.dataset);
882
+ if (message.saKeyId != null && Object.hasOwnProperty.call(message, "saKeyId"))
883
+ writer.uint32(/* id 4, wireType 2 =*/34).string(message.saKeyId);
884
+ if (message.host != null && Object.hasOwnProperty.call(message, "host"))
885
+ writer.uint32(/* id 5, wireType 2 =*/42).string(message.host);
886
+ if (message.port != null && Object.hasOwnProperty.call(message, "port"))
887
+ writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.port);
888
+ if (message.database != null && Object.hasOwnProperty.call(message, "database"))
889
+ writer.uint32(/* id 7, wireType 2 =*/58).string(message.database);
890
+ if (message.defaultSchema != null && Object.hasOwnProperty.call(message, "defaultSchema"))
891
+ writer.uint32(/* id 8, wireType 2 =*/66).string(message.defaultSchema);
892
+ return writer;
893
+ };
894
+
895
+ /**
896
+ * Encodes the specified ConnectionConfig message, length delimited. Does not implicitly {@link sqlanvil.ConnectionConfig.verify|verify} messages.
897
+ * @function encodeDelimited
898
+ * @memberof sqlanvil.ConnectionConfig
899
+ * @static
900
+ * @param {sqlanvil.IConnectionConfig} message ConnectionConfig message or plain object to encode
901
+ * @param {$protobuf.Writer} [writer] Writer to encode to
902
+ * @returns {$protobuf.Writer} Writer
903
+ */
904
+ ConnectionConfig.encodeDelimited = function encodeDelimited(message, writer) {
905
+ return this.encode(message, writer).ldelim();
906
+ };
907
+
908
+ /**
909
+ * Decodes a ConnectionConfig message from the specified reader or buffer.
910
+ * @function decode
911
+ * @memberof sqlanvil.ConnectionConfig
912
+ * @static
913
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
914
+ * @param {number} [length] Message length if known beforehand
915
+ * @returns {sqlanvil.ConnectionConfig} ConnectionConfig
916
+ * @throws {Error} If the payload is not a reader or valid buffer
917
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
918
+ */
919
+ ConnectionConfig.decode = function decode(reader, length, error) {
920
+ if (!(reader instanceof $Reader))
921
+ reader = $Reader.create(reader);
922
+ let end = length === undefined ? reader.len : reader.pos + length, message = new $root.sqlanvil.ConnectionConfig();
923
+ while (reader.pos < end) {
924
+ let tag = reader.uint32();
925
+ if (tag === error)
926
+ break;
927
+ switch (tag >>> 3) {
928
+ case 1: {
929
+ message.platform = reader.string();
930
+ break;
931
+ }
932
+ case 2: {
933
+ message.project = reader.string();
934
+ break;
935
+ }
936
+ case 3: {
937
+ message.dataset = reader.string();
938
+ break;
939
+ }
940
+ case 4: {
941
+ message.saKeyId = reader.string();
942
+ break;
943
+ }
944
+ case 5: {
945
+ message.host = reader.string();
946
+ break;
947
+ }
948
+ case 6: {
949
+ message.port = reader.uint32();
950
+ break;
951
+ }
952
+ case 7: {
953
+ message.database = reader.string();
954
+ break;
955
+ }
956
+ case 8: {
957
+ message.defaultSchema = reader.string();
958
+ break;
959
+ }
960
+ default:
961
+ reader.skipType(tag & 7);
962
+ break;
963
+ }
964
+ }
965
+ return message;
966
+ };
967
+
968
+ /**
969
+ * Decodes a ConnectionConfig message from the specified reader or buffer, length delimited.
970
+ * @function decodeDelimited
971
+ * @memberof sqlanvil.ConnectionConfig
972
+ * @static
973
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
974
+ * @returns {sqlanvil.ConnectionConfig} ConnectionConfig
975
+ * @throws {Error} If the payload is not a reader or valid buffer
976
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
977
+ */
978
+ ConnectionConfig.decodeDelimited = function decodeDelimited(reader) {
979
+ if (!(reader instanceof $Reader))
980
+ reader = new $Reader(reader);
981
+ return this.decode(reader, reader.uint32());
982
+ };
983
+
984
+ /**
985
+ * Verifies a ConnectionConfig message.
986
+ * @function verify
987
+ * @memberof sqlanvil.ConnectionConfig
988
+ * @static
989
+ * @param {Object.<string,*>} message Plain object to verify
990
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
991
+ */
992
+ ConnectionConfig.verify = function verify(message) {
993
+ if (typeof message !== "object" || message === null)
994
+ return "object expected";
995
+ if (message.platform != null && message.hasOwnProperty("platform"))
996
+ if (!$util.isString(message.platform))
997
+ return "platform: string expected";
998
+ if (message.project != null && message.hasOwnProperty("project"))
999
+ if (!$util.isString(message.project))
1000
+ return "project: string expected";
1001
+ if (message.dataset != null && message.hasOwnProperty("dataset"))
1002
+ if (!$util.isString(message.dataset))
1003
+ return "dataset: string expected";
1004
+ if (message.saKeyId != null && message.hasOwnProperty("saKeyId"))
1005
+ if (!$util.isString(message.saKeyId))
1006
+ return "saKeyId: string expected";
1007
+ if (message.host != null && message.hasOwnProperty("host"))
1008
+ if (!$util.isString(message.host))
1009
+ return "host: string expected";
1010
+ if (message.port != null && message.hasOwnProperty("port"))
1011
+ if (!$util.isInteger(message.port))
1012
+ return "port: integer expected";
1013
+ if (message.database != null && message.hasOwnProperty("database"))
1014
+ if (!$util.isString(message.database))
1015
+ return "database: string expected";
1016
+ if (message.defaultSchema != null && message.hasOwnProperty("defaultSchema"))
1017
+ if (!$util.isString(message.defaultSchema))
1018
+ return "defaultSchema: string expected";
1019
+ return null;
1020
+ };
1021
+
1022
+ /**
1023
+ * Creates a ConnectionConfig message from a plain object. Also converts values to their respective internal types.
1024
+ * @function fromObject
1025
+ * @memberof sqlanvil.ConnectionConfig
1026
+ * @static
1027
+ * @param {Object.<string,*>} object Plain object
1028
+ * @returns {sqlanvil.ConnectionConfig} ConnectionConfig
1029
+ */
1030
+ ConnectionConfig.fromObject = function fromObject(object) {
1031
+ if (object instanceof $root.sqlanvil.ConnectionConfig)
1032
+ return object;
1033
+ let message = new $root.sqlanvil.ConnectionConfig();
1034
+ if (object.platform != null)
1035
+ message.platform = String(object.platform);
1036
+ if (object.project != null)
1037
+ message.project = String(object.project);
1038
+ if (object.dataset != null)
1039
+ message.dataset = String(object.dataset);
1040
+ if (object.saKeyId != null)
1041
+ message.saKeyId = String(object.saKeyId);
1042
+ if (object.host != null)
1043
+ message.host = String(object.host);
1044
+ if (object.port != null)
1045
+ message.port = object.port >>> 0;
1046
+ if (object.database != null)
1047
+ message.database = String(object.database);
1048
+ if (object.defaultSchema != null)
1049
+ message.defaultSchema = String(object.defaultSchema);
1050
+ return message;
1051
+ };
1052
+
1053
+ /**
1054
+ * Creates a plain object from a ConnectionConfig message. Also converts values to other types if specified.
1055
+ * @function toObject
1056
+ * @memberof sqlanvil.ConnectionConfig
1057
+ * @static
1058
+ * @param {sqlanvil.ConnectionConfig} message ConnectionConfig
1059
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
1060
+ * @returns {Object.<string,*>} Plain object
1061
+ */
1062
+ ConnectionConfig.toObject = function toObject(message, options) {
1063
+ if (!options)
1064
+ options = {};
1065
+ let object = {};
1066
+ if (options.defaults) {
1067
+ object.platform = "";
1068
+ object.project = "";
1069
+ object.dataset = "";
1070
+ object.saKeyId = "";
1071
+ object.host = "";
1072
+ object.port = 0;
1073
+ object.database = "";
1074
+ object.defaultSchema = "";
1075
+ }
1076
+ if (message.platform != null && message.hasOwnProperty("platform"))
1077
+ object.platform = message.platform;
1078
+ if (message.project != null && message.hasOwnProperty("project"))
1079
+ object.project = message.project;
1080
+ if (message.dataset != null && message.hasOwnProperty("dataset"))
1081
+ object.dataset = message.dataset;
1082
+ if (message.saKeyId != null && message.hasOwnProperty("saKeyId"))
1083
+ object.saKeyId = message.saKeyId;
1084
+ if (message.host != null && message.hasOwnProperty("host"))
1085
+ object.host = message.host;
1086
+ if (message.port != null && message.hasOwnProperty("port"))
1087
+ object.port = message.port;
1088
+ if (message.database != null && message.hasOwnProperty("database"))
1089
+ object.database = message.database;
1090
+ if (message.defaultSchema != null && message.hasOwnProperty("defaultSchema"))
1091
+ object.defaultSchema = message.defaultSchema;
1092
+ return object;
1093
+ };
1094
+
1095
+ /**
1096
+ * Converts this ConnectionConfig to JSON.
1097
+ * @function toJSON
1098
+ * @memberof sqlanvil.ConnectionConfig
1099
+ * @instance
1100
+ * @returns {Object.<string,*>} JSON object
1101
+ */
1102
+ ConnectionConfig.prototype.toJSON = function toJSON() {
1103
+ return this.constructor.toObject(this, $protobuf__namespace.util.toJSONOptions);
1104
+ };
1105
+
1106
+ /**
1107
+ * Gets the default type url for ConnectionConfig
1108
+ * @function getTypeUrl
1109
+ * @memberof sqlanvil.ConnectionConfig
1110
+ * @static
1111
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
1112
+ * @returns {string} The default type url
1113
+ */
1114
+ ConnectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
1115
+ if (typeUrlPrefix === undefined) {
1116
+ typeUrlPrefix = "type.googleapis.com";
1117
+ }
1118
+ return typeUrlPrefix + "/sqlanvil.ConnectionConfig";
1119
+ };
1120
+
1121
+ return ConnectionConfig;
1122
+ })();
1123
+
692
1124
  sqlanvil.DefaultIcebergConfig = (function() {
693
1125
 
694
1126
  /**
@@ -7522,6 +7954,8 @@ const sqlanvil = $root.sqlanvil = (() => {
7522
7954
  * @property {Array.<sqlanvil.ActionConfig.IColumnDescriptor>|null} [columns] DeclarationConfig columns
7523
7955
  * @property {string|null} [filename] DeclarationConfig filename
7524
7956
  * @property {Array.<string>|null} [tags] DeclarationConfig tags
7957
+ * @property {string|null} [connection] DeclarationConfig connection
7958
+ * @property {Object.<string,string>|null} [columnTypes] DeclarationConfig columnTypes
7525
7959
  */
7526
7960
 
7527
7961
  /**
@@ -7535,6 +7969,7 @@ const sqlanvil = $root.sqlanvil = (() => {
7535
7969
  function DeclarationConfig(properties) {
7536
7970
  this.columns = [];
7537
7971
  this.tags = [];
7972
+ this.columnTypes = {};
7538
7973
  if (properties)
7539
7974
  for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
7540
7975
  if (properties[keys[i]] != null)
@@ -7597,6 +8032,22 @@ const sqlanvil = $root.sqlanvil = (() => {
7597
8032
  */
7598
8033
  DeclarationConfig.prototype.tags = $util.emptyArray;
7599
8034
 
8035
+ /**
8036
+ * DeclarationConfig connection.
8037
+ * @member {string} connection
8038
+ * @memberof sqlanvil.ActionConfig.DeclarationConfig
8039
+ * @instance
8040
+ */
8041
+ DeclarationConfig.prototype.connection = "";
8042
+
8043
+ /**
8044
+ * DeclarationConfig columnTypes.
8045
+ * @member {Object.<string,string>} columnTypes
8046
+ * @memberof sqlanvil.ActionConfig.DeclarationConfig
8047
+ * @instance
8048
+ */
8049
+ DeclarationConfig.prototype.columnTypes = $util.emptyObject;
8050
+
7600
8051
  /**
7601
8052
  * Creates a new DeclarationConfig instance using the specified properties.
7602
8053
  * @function create
@@ -7637,6 +8088,11 @@ const sqlanvil = $root.sqlanvil = (() => {
7637
8088
  if (message.tags != null && message.tags.length)
7638
8089
  for (let i = 0; i < message.tags.length; ++i)
7639
8090
  writer.uint32(/* id 7, wireType 2 =*/58).string(message.tags[i]);
8091
+ if (message.connection != null && Object.hasOwnProperty.call(message, "connection"))
8092
+ writer.uint32(/* id 8, wireType 2 =*/66).string(message.connection);
8093
+ if (message.columnTypes != null && Object.hasOwnProperty.call(message, "columnTypes"))
8094
+ for (let keys = Object.keys(message.columnTypes), i = 0; i < keys.length; ++i)
8095
+ writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.columnTypes[keys[i]]).ldelim();
7640
8096
  return writer;
7641
8097
  };
7642
8098
 
@@ -7667,7 +8123,7 @@ const sqlanvil = $root.sqlanvil = (() => {
7667
8123
  DeclarationConfig.decode = function decode(reader, length, error) {
7668
8124
  if (!(reader instanceof $Reader))
7669
8125
  reader = $Reader.create(reader);
7670
- let end = length === undefined ? reader.len : reader.pos + length, message = new $root.sqlanvil.ActionConfig.DeclarationConfig();
8126
+ let end = length === undefined ? reader.len : reader.pos + length, message = new $root.sqlanvil.ActionConfig.DeclarationConfig(), key, value;
7671
8127
  while (reader.pos < end) {
7672
8128
  let tag = reader.uint32();
7673
8129
  if (tag === error)
@@ -7705,6 +8161,33 @@ const sqlanvil = $root.sqlanvil = (() => {
7705
8161
  message.tags.push(reader.string());
7706
8162
  break;
7707
8163
  }
8164
+ case 8: {
8165
+ message.connection = reader.string();
8166
+ break;
8167
+ }
8168
+ case 9: {
8169
+ if (message.columnTypes === $util.emptyObject)
8170
+ message.columnTypes = {};
8171
+ let end2 = reader.uint32() + reader.pos;
8172
+ key = "";
8173
+ value = "";
8174
+ while (reader.pos < end2) {
8175
+ let tag2 = reader.uint32();
8176
+ switch (tag2 >>> 3) {
8177
+ case 1:
8178
+ key = reader.string();
8179
+ break;
8180
+ case 2:
8181
+ value = reader.string();
8182
+ break;
8183
+ default:
8184
+ reader.skipType(tag2 & 7);
8185
+ break;
8186
+ }
8187
+ }
8188
+ message.columnTypes[key] = value;
8189
+ break;
8190
+ }
7708
8191
  default:
7709
8192
  reader.skipType(tag & 7);
7710
8193
  break;
@@ -7771,6 +8254,17 @@ const sqlanvil = $root.sqlanvil = (() => {
7771
8254
  if (!$util.isString(message.tags[i]))
7772
8255
  return "tags: string[] expected";
7773
8256
  }
8257
+ if (message.connection != null && message.hasOwnProperty("connection"))
8258
+ if (!$util.isString(message.connection))
8259
+ return "connection: string expected";
8260
+ if (message.columnTypes != null && message.hasOwnProperty("columnTypes")) {
8261
+ if (!$util.isObject(message.columnTypes))
8262
+ return "columnTypes: object expected";
8263
+ let key = Object.keys(message.columnTypes);
8264
+ for (let i = 0; i < key.length; ++i)
8265
+ if (!$util.isString(message.columnTypes[key[i]]))
8266
+ return "columnTypes: string{k:string} expected";
8267
+ }
7774
8268
  return null;
7775
8269
  };
7776
8270
 
@@ -7813,6 +8307,15 @@ const sqlanvil = $root.sqlanvil = (() => {
7813
8307
  for (let i = 0; i < object.tags.length; ++i)
7814
8308
  message.tags[i] = String(object.tags[i]);
7815
8309
  }
8310
+ if (object.connection != null)
8311
+ message.connection = String(object.connection);
8312
+ if (object.columnTypes) {
8313
+ if (typeof object.columnTypes !== "object")
8314
+ throw TypeError(".sqlanvil.ActionConfig.DeclarationConfig.columnTypes: object expected");
8315
+ message.columnTypes = {};
8316
+ for (let keys = Object.keys(object.columnTypes), i = 0; i < keys.length; ++i)
8317
+ message.columnTypes[keys[i]] = String(object.columnTypes[keys[i]]);
8318
+ }
7816
8319
  return message;
7817
8320
  };
7818
8321
 
@@ -7833,12 +8336,15 @@ const sqlanvil = $root.sqlanvil = (() => {
7833
8336
  object.columns = [];
7834
8337
  object.tags = [];
7835
8338
  }
8339
+ if (options.objects || options.defaults)
8340
+ object.columnTypes = {};
7836
8341
  if (options.defaults) {
7837
8342
  object.name = "";
7838
8343
  object.dataset = "";
7839
8344
  object.project = "";
7840
8345
  object.description = "";
7841
8346
  object.filename = "";
8347
+ object.connection = "";
7842
8348
  }
7843
8349
  if (message.name != null && message.hasOwnProperty("name"))
7844
8350
  object.name = message.name;
@@ -7860,6 +8366,14 @@ const sqlanvil = $root.sqlanvil = (() => {
7860
8366
  for (let j = 0; j < message.tags.length; ++j)
7861
8367
  object.tags[j] = message.tags[j];
7862
8368
  }
8369
+ if (message.connection != null && message.hasOwnProperty("connection"))
8370
+ object.connection = message.connection;
8371
+ let keys2;
8372
+ if (message.columnTypes && (keys2 = Object.keys(message.columnTypes)).length) {
8373
+ object.columnTypes = {};
8374
+ for (let j = 0; j < keys2.length; ++j)
8375
+ object.columnTypes[keys2[j]] = message.columnTypes[keys2[j]];
8376
+ }
7863
8377
  return object;
7864
8378
  };
7865
8379
 
@@ -14998,6 +15512,8 @@ const sqlanvil = $root.sqlanvil = (() => {
14998
15512
  * @property {boolean|null} [disableAssertions] ProjectConfig disableAssertions
14999
15513
  * @property {string|null} [defaultReservation] ProjectConfig defaultReservation
15000
15514
  * @property {boolean|null} [includeTestsInCompiledGraph] ProjectConfig includeTestsInCompiledGraph
15515
+ * @property {Object.<string,sqlanvil.IConnectionConfig>|null} [connections] ProjectConfig connections
15516
+ * @property {string|null} [warehouseConnection] ProjectConfig warehouseConnection
15001
15517
  */
15002
15518
 
15003
15519
  /**
@@ -15010,6 +15526,7 @@ const sqlanvil = $root.sqlanvil = (() => {
15010
15526
  */
15011
15527
  function ProjectConfig(properties) {
15012
15528
  this.vars = {};
15529
+ this.connections = {};
15013
15530
  if (properties)
15014
15531
  for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
15015
15532
  if (properties[keys[i]] != null)
@@ -15136,6 +15653,22 @@ const sqlanvil = $root.sqlanvil = (() => {
15136
15653
  */
15137
15654
  ProjectConfig.prototype.includeTestsInCompiledGraph = false;
15138
15655
 
15656
+ /**
15657
+ * ProjectConfig connections.
15658
+ * @member {Object.<string,sqlanvil.IConnectionConfig>} connections
15659
+ * @memberof sqlanvil.ProjectConfig
15660
+ * @instance
15661
+ */
15662
+ ProjectConfig.prototype.connections = $util.emptyObject;
15663
+
15664
+ /**
15665
+ * ProjectConfig warehouseConnection.
15666
+ * @member {string} warehouseConnection
15667
+ * @memberof sqlanvil.ProjectConfig
15668
+ * @instance
15669
+ */
15670
+ ProjectConfig.prototype.warehouseConnection = "";
15671
+
15139
15672
  /**
15140
15673
  * Creates a new ProjectConfig instance using the specified properties.
15141
15674
  * @function create
@@ -15191,6 +15724,13 @@ const sqlanvil = $root.sqlanvil = (() => {
15191
15724
  writer.uint32(/* id 21, wireType 2 =*/170).string(message.defaultReservation);
15192
15725
  if (message.includeTestsInCompiledGraph != null && Object.hasOwnProperty.call(message, "includeTestsInCompiledGraph"))
15193
15726
  writer.uint32(/* id 22, wireType 0 =*/176).bool(message.includeTestsInCompiledGraph);
15727
+ if (message.connections != null && Object.hasOwnProperty.call(message, "connections"))
15728
+ for (let keys = Object.keys(message.connections), i = 0; i < keys.length; ++i) {
15729
+ writer.uint32(/* id 23, wireType 2 =*/186).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]);
15730
+ $root.sqlanvil.ConnectionConfig.encode(message.connections[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
15731
+ }
15732
+ if (message.warehouseConnection != null && Object.hasOwnProperty.call(message, "warehouseConnection"))
15733
+ writer.uint32(/* id 24, wireType 2 =*/194).string(message.warehouseConnection);
15194
15734
  return writer;
15195
15735
  };
15196
15736
 
@@ -15306,6 +15846,33 @@ const sqlanvil = $root.sqlanvil = (() => {
15306
15846
  message.includeTestsInCompiledGraph = reader.bool();
15307
15847
  break;
15308
15848
  }
15849
+ case 23: {
15850
+ if (message.connections === $util.emptyObject)
15851
+ message.connections = {};
15852
+ let end2 = reader.uint32() + reader.pos;
15853
+ key = "";
15854
+ value = null;
15855
+ while (reader.pos < end2) {
15856
+ let tag2 = reader.uint32();
15857
+ switch (tag2 >>> 3) {
15858
+ case 1:
15859
+ key = reader.string();
15860
+ break;
15861
+ case 2:
15862
+ value = $root.sqlanvil.ConnectionConfig.decode(reader, reader.uint32());
15863
+ break;
15864
+ default:
15865
+ reader.skipType(tag2 & 7);
15866
+ break;
15867
+ }
15868
+ }
15869
+ message.connections[key] = value;
15870
+ break;
15871
+ }
15872
+ case 24: {
15873
+ message.warehouseConnection = reader.string();
15874
+ break;
15875
+ }
15309
15876
  default:
15310
15877
  reader.skipType(tag & 7);
15311
15878
  break;
@@ -15395,6 +15962,19 @@ const sqlanvil = $root.sqlanvil = (() => {
15395
15962
  if (message.includeTestsInCompiledGraph != null && message.hasOwnProperty("includeTestsInCompiledGraph"))
15396
15963
  if (typeof message.includeTestsInCompiledGraph !== "boolean")
15397
15964
  return "includeTestsInCompiledGraph: boolean expected";
15965
+ if (message.connections != null && message.hasOwnProperty("connections")) {
15966
+ if (!$util.isObject(message.connections))
15967
+ return "connections: object expected";
15968
+ let key = Object.keys(message.connections);
15969
+ for (let i = 0; i < key.length; ++i) {
15970
+ let error = $root.sqlanvil.ConnectionConfig.verify(message.connections[key[i]]);
15971
+ if (error)
15972
+ return "connections." + error;
15973
+ }
15974
+ }
15975
+ if (message.warehouseConnection != null && message.hasOwnProperty("warehouseConnection"))
15976
+ if (!$util.isString(message.warehouseConnection))
15977
+ return "warehouseConnection: string expected";
15398
15978
  return null;
15399
15979
  };
15400
15980
 
@@ -15451,6 +16031,18 @@ const sqlanvil = $root.sqlanvil = (() => {
15451
16031
  message.defaultReservation = String(object.defaultReservation);
15452
16032
  if (object.includeTestsInCompiledGraph != null)
15453
16033
  message.includeTestsInCompiledGraph = Boolean(object.includeTestsInCompiledGraph);
16034
+ if (object.connections) {
16035
+ if (typeof object.connections !== "object")
16036
+ throw TypeError(".sqlanvil.ProjectConfig.connections: object expected");
16037
+ message.connections = {};
16038
+ for (let keys = Object.keys(object.connections), i = 0; i < keys.length; ++i) {
16039
+ if (typeof object.connections[keys[i]] !== "object")
16040
+ throw TypeError(".sqlanvil.ProjectConfig.connections: object expected");
16041
+ message.connections[keys[i]] = $root.sqlanvil.ConnectionConfig.fromObject(object.connections[keys[i]]);
16042
+ }
16043
+ }
16044
+ if (object.warehouseConnection != null)
16045
+ message.warehouseConnection = String(object.warehouseConnection);
15454
16046
  return message;
15455
16047
  };
15456
16048
 
@@ -15467,8 +16059,10 @@ const sqlanvil = $root.sqlanvil = (() => {
15467
16059
  if (!options)
15468
16060
  options = {};
15469
16061
  let object = {};
15470
- if (options.objects || options.defaults)
16062
+ if (options.objects || options.defaults) {
15471
16063
  object.vars = {};
16064
+ object.connections = {};
16065
+ }
15472
16066
  if (options.defaults) {
15473
16067
  object.warehouse = "";
15474
16068
  object.defaultSchema = "";
@@ -15484,6 +16078,7 @@ const sqlanvil = $root.sqlanvil = (() => {
15484
16078
  object.disableAssertions = false;
15485
16079
  object.defaultReservation = "";
15486
16080
  object.includeTestsInCompiledGraph = false;
16081
+ object.warehouseConnection = "";
15487
16082
  }
15488
16083
  if (message.warehouse != null && message.hasOwnProperty("warehouse"))
15489
16084
  object.warehouse = message.warehouse;
@@ -15519,6 +16114,13 @@ const sqlanvil = $root.sqlanvil = (() => {
15519
16114
  object.defaultReservation = message.defaultReservation;
15520
16115
  if (message.includeTestsInCompiledGraph != null && message.hasOwnProperty("includeTestsInCompiledGraph"))
15521
16116
  object.includeTestsInCompiledGraph = message.includeTestsInCompiledGraph;
16117
+ if (message.connections && (keys2 = Object.keys(message.connections)).length) {
16118
+ object.connections = {};
16119
+ for (let j = 0; j < keys2.length; ++j)
16120
+ object.connections[keys2[j]] = $root.sqlanvil.ConnectionConfig.toObject(message.connections[keys2[j]], options);
16121
+ }
16122
+ if (message.warehouseConnection != null && message.hasOwnProperty("warehouseConnection"))
16123
+ object.warehouseConnection = message.warehouseConnection;
15522
16124
  return object;
15523
16125
  };
15524
16126