@sqlanvil/cli 1.6.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bundle.js +2930 -356
- package/package.json +2 -1
- package/worker_bundle.js +10403 -8108
package/bundle.js
CHANGED
|
@@ -33,6 +33,7 @@ var pg = require('pg');
|
|
|
33
33
|
var bigquery = require('@google-cloud/bigquery');
|
|
34
34
|
var EventEmitter = require('events');
|
|
35
35
|
var Long = require('long');
|
|
36
|
+
var os = require('os');
|
|
36
37
|
var promisePoolExecutor = require('promise-pool-executor');
|
|
37
38
|
var sizeof = require('object-sizeof');
|
|
38
39
|
var mysql = require('mysql2/promise');
|
|
@@ -78,6 +79,7 @@ var tmp__namespace = /*#__PURE__*/_interopNamespace(tmp);
|
|
|
78
79
|
var pg__namespace = /*#__PURE__*/_interopNamespace(pg);
|
|
79
80
|
var EventEmitter__default = /*#__PURE__*/_interopDefaultLegacy(EventEmitter);
|
|
80
81
|
var Long__default = /*#__PURE__*/_interopDefaultLegacy(Long);
|
|
82
|
+
var os__namespace = /*#__PURE__*/_interopNamespace(os);
|
|
81
83
|
var sizeof__default = /*#__PURE__*/_interopDefaultLegacy(sizeof);
|
|
82
84
|
var mysql__namespace = /*#__PURE__*/_interopNamespace(mysql);
|
|
83
85
|
var QueryStream__default = /*#__PURE__*/_interopDefaultLegacy(QueryStream);
|
|
@@ -147,6 +149,7 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
147
149
|
* @property {boolean|null} [includeTestsInCompiledGraph] WorkflowSettings includeTestsInCompiledGraph
|
|
148
150
|
* @property {string|null} [warehouse] WorkflowSettings warehouse
|
|
149
151
|
* @property {Object.<string,sqlanvil.IConnectionConfig>|null} [connections] WorkflowSettings connections
|
|
152
|
+
* @property {Object.<string,sqlanvil.IEnvironment>|null} [environments] WorkflowSettings environments
|
|
150
153
|
*/
|
|
151
154
|
|
|
152
155
|
/**
|
|
@@ -160,6 +163,7 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
160
163
|
function WorkflowSettings(properties) {
|
|
161
164
|
this.vars = {};
|
|
162
165
|
this.connections = {};
|
|
166
|
+
this.environments = {};
|
|
163
167
|
if (properties)
|
|
164
168
|
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
165
169
|
if (properties[keys[i]] != null)
|
|
@@ -310,6 +314,14 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
310
314
|
*/
|
|
311
315
|
WorkflowSettings.prototype.connections = $util.emptyObject;
|
|
312
316
|
|
|
317
|
+
/**
|
|
318
|
+
* WorkflowSettings environments.
|
|
319
|
+
* @member {Object.<string,sqlanvil.IEnvironment>} environments
|
|
320
|
+
* @memberof sqlanvil.WorkflowSettings
|
|
321
|
+
* @instance
|
|
322
|
+
*/
|
|
323
|
+
WorkflowSettings.prototype.environments = $util.emptyObject;
|
|
324
|
+
|
|
313
325
|
/**
|
|
314
326
|
* Creates a new WorkflowSettings instance using the specified properties.
|
|
315
327
|
* @function create
|
|
@@ -374,6 +386,11 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
374
386
|
writer.uint32(/* id 18, wireType 2 =*/146).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]);
|
|
375
387
|
$root.sqlanvil.ConnectionConfig.encode(message.connections[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
|
|
376
388
|
}
|
|
389
|
+
if (message.environments != null && Object.hasOwnProperty.call(message, "environments"))
|
|
390
|
+
for (let keys = Object.keys(message.environments), i = 0; i < keys.length; ++i) {
|
|
391
|
+
writer.uint32(/* id 19, wireType 2 =*/154).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]);
|
|
392
|
+
$root.sqlanvil.Environment.encode(message.environments[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
|
|
393
|
+
}
|
|
377
394
|
return writer;
|
|
378
395
|
};
|
|
379
396
|
|
|
@@ -520,6 +537,29 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
520
537
|
message.connections[key] = value;
|
|
521
538
|
break;
|
|
522
539
|
}
|
|
540
|
+
case 19: {
|
|
541
|
+
if (message.environments === $util.emptyObject)
|
|
542
|
+
message.environments = {};
|
|
543
|
+
let end2 = reader.uint32() + reader.pos;
|
|
544
|
+
key = "";
|
|
545
|
+
value = null;
|
|
546
|
+
while (reader.pos < end2) {
|
|
547
|
+
let tag2 = reader.uint32();
|
|
548
|
+
switch (tag2 >>> 3) {
|
|
549
|
+
case 1:
|
|
550
|
+
key = reader.string();
|
|
551
|
+
break;
|
|
552
|
+
case 2:
|
|
553
|
+
value = $root.sqlanvil.Environment.decode(reader, reader.uint32());
|
|
554
|
+
break;
|
|
555
|
+
default:
|
|
556
|
+
reader.skipType(tag2 & 7);
|
|
557
|
+
break;
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
message.environments[key] = value;
|
|
561
|
+
break;
|
|
562
|
+
}
|
|
523
563
|
default:
|
|
524
564
|
reader.skipType(tag & 7);
|
|
525
565
|
break;
|
|
@@ -627,6 +667,16 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
627
667
|
return "connections." + error;
|
|
628
668
|
}
|
|
629
669
|
}
|
|
670
|
+
if (message.environments != null && message.hasOwnProperty("environments")) {
|
|
671
|
+
if (!$util.isObject(message.environments))
|
|
672
|
+
return "environments: object expected";
|
|
673
|
+
let key = Object.keys(message.environments);
|
|
674
|
+
for (let i = 0; i < key.length; ++i) {
|
|
675
|
+
let error = $root.sqlanvil.Environment.verify(message.environments[key[i]]);
|
|
676
|
+
if (error)
|
|
677
|
+
return "environments." + error;
|
|
678
|
+
}
|
|
679
|
+
}
|
|
630
680
|
return null;
|
|
631
681
|
};
|
|
632
682
|
|
|
@@ -700,6 +750,16 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
700
750
|
message.connections[keys[i]] = $root.sqlanvil.ConnectionConfig.fromObject(object.connections[keys[i]]);
|
|
701
751
|
}
|
|
702
752
|
}
|
|
753
|
+
if (object.environments) {
|
|
754
|
+
if (typeof object.environments !== "object")
|
|
755
|
+
throw TypeError(".sqlanvil.WorkflowSettings.environments: object expected");
|
|
756
|
+
message.environments = {};
|
|
757
|
+
for (let keys = Object.keys(object.environments), i = 0; i < keys.length; ++i) {
|
|
758
|
+
if (typeof object.environments[keys[i]] !== "object")
|
|
759
|
+
throw TypeError(".sqlanvil.WorkflowSettings.environments: object expected");
|
|
760
|
+
message.environments[keys[i]] = $root.sqlanvil.Environment.fromObject(object.environments[keys[i]]);
|
|
761
|
+
}
|
|
762
|
+
}
|
|
703
763
|
return message;
|
|
704
764
|
};
|
|
705
765
|
|
|
@@ -719,6 +779,7 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
719
779
|
if (options.objects || options.defaults) {
|
|
720
780
|
object.vars = {};
|
|
721
781
|
object.connections = {};
|
|
782
|
+
object.environments = {};
|
|
722
783
|
}
|
|
723
784
|
if (options.defaults) {
|
|
724
785
|
object.sqlanvilCoreVersion = "";
|
|
@@ -781,6 +842,11 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
781
842
|
for (let j = 0; j < keys2.length; ++j)
|
|
782
843
|
object.connections[keys2[j]] = $root.sqlanvil.ConnectionConfig.toObject(message.connections[keys2[j]], options);
|
|
783
844
|
}
|
|
845
|
+
if (message.environments && (keys2 = Object.keys(message.environments)).length) {
|
|
846
|
+
object.environments = {};
|
|
847
|
+
for (let j = 0; j < keys2.length; ++j)
|
|
848
|
+
object.environments[keys2[j]] = $root.sqlanvil.Environment.toObject(message.environments[keys2[j]], options);
|
|
849
|
+
}
|
|
784
850
|
return object;
|
|
785
851
|
};
|
|
786
852
|
|
|
@@ -813,6 +879,340 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
813
879
|
return WorkflowSettings;
|
|
814
880
|
})();
|
|
815
881
|
|
|
882
|
+
sqlanvil.Environment = (function() {
|
|
883
|
+
|
|
884
|
+
/**
|
|
885
|
+
* Properties of an Environment.
|
|
886
|
+
* @memberof sqlanvil
|
|
887
|
+
* @interface IEnvironment
|
|
888
|
+
* @property {string|null} [schemaSuffix] Environment schemaSuffix
|
|
889
|
+
* @property {Object.<string,string>|null} [vars] Environment vars
|
|
890
|
+
* @property {string|null} [defaultDatabase] Environment defaultDatabase
|
|
891
|
+
* @property {string|null} [defaultLocation] Environment defaultLocation
|
|
892
|
+
* @property {string|null} [credentials] Environment credentials
|
|
893
|
+
*/
|
|
894
|
+
|
|
895
|
+
/**
|
|
896
|
+
* Constructs a new Environment.
|
|
897
|
+
* @memberof sqlanvil
|
|
898
|
+
* @classdesc Represents an Environment.
|
|
899
|
+
* @implements IEnvironment
|
|
900
|
+
* @constructor
|
|
901
|
+
* @param {sqlanvil.IEnvironment=} [properties] Properties to set
|
|
902
|
+
*/
|
|
903
|
+
function Environment(properties) {
|
|
904
|
+
this.vars = {};
|
|
905
|
+
if (properties)
|
|
906
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
907
|
+
if (properties[keys[i]] != null)
|
|
908
|
+
this[keys[i]] = properties[keys[i]];
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
/**
|
|
912
|
+
* Environment schemaSuffix.
|
|
913
|
+
* @member {string} schemaSuffix
|
|
914
|
+
* @memberof sqlanvil.Environment
|
|
915
|
+
* @instance
|
|
916
|
+
*/
|
|
917
|
+
Environment.prototype.schemaSuffix = "";
|
|
918
|
+
|
|
919
|
+
/**
|
|
920
|
+
* Environment vars.
|
|
921
|
+
* @member {Object.<string,string>} vars
|
|
922
|
+
* @memberof sqlanvil.Environment
|
|
923
|
+
* @instance
|
|
924
|
+
*/
|
|
925
|
+
Environment.prototype.vars = $util.emptyObject;
|
|
926
|
+
|
|
927
|
+
/**
|
|
928
|
+
* Environment defaultDatabase.
|
|
929
|
+
* @member {string} defaultDatabase
|
|
930
|
+
* @memberof sqlanvil.Environment
|
|
931
|
+
* @instance
|
|
932
|
+
*/
|
|
933
|
+
Environment.prototype.defaultDatabase = "";
|
|
934
|
+
|
|
935
|
+
/**
|
|
936
|
+
* Environment defaultLocation.
|
|
937
|
+
* @member {string} defaultLocation
|
|
938
|
+
* @memberof sqlanvil.Environment
|
|
939
|
+
* @instance
|
|
940
|
+
*/
|
|
941
|
+
Environment.prototype.defaultLocation = "";
|
|
942
|
+
|
|
943
|
+
/**
|
|
944
|
+
* Environment credentials.
|
|
945
|
+
* @member {string} credentials
|
|
946
|
+
* @memberof sqlanvil.Environment
|
|
947
|
+
* @instance
|
|
948
|
+
*/
|
|
949
|
+
Environment.prototype.credentials = "";
|
|
950
|
+
|
|
951
|
+
/**
|
|
952
|
+
* Creates a new Environment instance using the specified properties.
|
|
953
|
+
* @function create
|
|
954
|
+
* @memberof sqlanvil.Environment
|
|
955
|
+
* @static
|
|
956
|
+
* @param {sqlanvil.IEnvironment=} [properties] Properties to set
|
|
957
|
+
* @returns {sqlanvil.Environment} Environment instance
|
|
958
|
+
*/
|
|
959
|
+
Environment.create = function create(properties) {
|
|
960
|
+
return new Environment(properties);
|
|
961
|
+
};
|
|
962
|
+
|
|
963
|
+
/**
|
|
964
|
+
* Encodes the specified Environment message. Does not implicitly {@link sqlanvil.Environment.verify|verify} messages.
|
|
965
|
+
* @function encode
|
|
966
|
+
* @memberof sqlanvil.Environment
|
|
967
|
+
* @static
|
|
968
|
+
* @param {sqlanvil.IEnvironment} message Environment message or plain object to encode
|
|
969
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
970
|
+
* @returns {$protobuf.Writer} Writer
|
|
971
|
+
*/
|
|
972
|
+
Environment.encode = function encode(message, writer) {
|
|
973
|
+
if (!writer)
|
|
974
|
+
writer = $Writer.create();
|
|
975
|
+
if (message.schemaSuffix != null && Object.hasOwnProperty.call(message, "schemaSuffix"))
|
|
976
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.schemaSuffix);
|
|
977
|
+
if (message.vars != null && Object.hasOwnProperty.call(message, "vars"))
|
|
978
|
+
for (let keys = Object.keys(message.vars), i = 0; i < keys.length; ++i)
|
|
979
|
+
writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.vars[keys[i]]).ldelim();
|
|
980
|
+
if (message.defaultDatabase != null && Object.hasOwnProperty.call(message, "defaultDatabase"))
|
|
981
|
+
writer.uint32(/* id 3, wireType 2 =*/26).string(message.defaultDatabase);
|
|
982
|
+
if (message.defaultLocation != null && Object.hasOwnProperty.call(message, "defaultLocation"))
|
|
983
|
+
writer.uint32(/* id 4, wireType 2 =*/34).string(message.defaultLocation);
|
|
984
|
+
if (message.credentials != null && Object.hasOwnProperty.call(message, "credentials"))
|
|
985
|
+
writer.uint32(/* id 5, wireType 2 =*/42).string(message.credentials);
|
|
986
|
+
return writer;
|
|
987
|
+
};
|
|
988
|
+
|
|
989
|
+
/**
|
|
990
|
+
* Encodes the specified Environment message, length delimited. Does not implicitly {@link sqlanvil.Environment.verify|verify} messages.
|
|
991
|
+
* @function encodeDelimited
|
|
992
|
+
* @memberof sqlanvil.Environment
|
|
993
|
+
* @static
|
|
994
|
+
* @param {sqlanvil.IEnvironment} message Environment message or plain object to encode
|
|
995
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
996
|
+
* @returns {$protobuf.Writer} Writer
|
|
997
|
+
*/
|
|
998
|
+
Environment.encodeDelimited = function encodeDelimited(message, writer) {
|
|
999
|
+
return this.encode(message, writer).ldelim();
|
|
1000
|
+
};
|
|
1001
|
+
|
|
1002
|
+
/**
|
|
1003
|
+
* Decodes an Environment message from the specified reader or buffer.
|
|
1004
|
+
* @function decode
|
|
1005
|
+
* @memberof sqlanvil.Environment
|
|
1006
|
+
* @static
|
|
1007
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
1008
|
+
* @param {number} [length] Message length if known beforehand
|
|
1009
|
+
* @returns {sqlanvil.Environment} Environment
|
|
1010
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
1011
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
1012
|
+
*/
|
|
1013
|
+
Environment.decode = function decode(reader, length, error) {
|
|
1014
|
+
if (!(reader instanceof $Reader))
|
|
1015
|
+
reader = $Reader.create(reader);
|
|
1016
|
+
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.sqlanvil.Environment(), key, value;
|
|
1017
|
+
while (reader.pos < end) {
|
|
1018
|
+
let tag = reader.uint32();
|
|
1019
|
+
if (tag === error)
|
|
1020
|
+
break;
|
|
1021
|
+
switch (tag >>> 3) {
|
|
1022
|
+
case 1: {
|
|
1023
|
+
message.schemaSuffix = reader.string();
|
|
1024
|
+
break;
|
|
1025
|
+
}
|
|
1026
|
+
case 2: {
|
|
1027
|
+
if (message.vars === $util.emptyObject)
|
|
1028
|
+
message.vars = {};
|
|
1029
|
+
let end2 = reader.uint32() + reader.pos;
|
|
1030
|
+
key = "";
|
|
1031
|
+
value = "";
|
|
1032
|
+
while (reader.pos < end2) {
|
|
1033
|
+
let tag2 = reader.uint32();
|
|
1034
|
+
switch (tag2 >>> 3) {
|
|
1035
|
+
case 1:
|
|
1036
|
+
key = reader.string();
|
|
1037
|
+
break;
|
|
1038
|
+
case 2:
|
|
1039
|
+
value = reader.string();
|
|
1040
|
+
break;
|
|
1041
|
+
default:
|
|
1042
|
+
reader.skipType(tag2 & 7);
|
|
1043
|
+
break;
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
message.vars[key] = value;
|
|
1047
|
+
break;
|
|
1048
|
+
}
|
|
1049
|
+
case 3: {
|
|
1050
|
+
message.defaultDatabase = reader.string();
|
|
1051
|
+
break;
|
|
1052
|
+
}
|
|
1053
|
+
case 4: {
|
|
1054
|
+
message.defaultLocation = reader.string();
|
|
1055
|
+
break;
|
|
1056
|
+
}
|
|
1057
|
+
case 5: {
|
|
1058
|
+
message.credentials = reader.string();
|
|
1059
|
+
break;
|
|
1060
|
+
}
|
|
1061
|
+
default:
|
|
1062
|
+
reader.skipType(tag & 7);
|
|
1063
|
+
break;
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
return message;
|
|
1067
|
+
};
|
|
1068
|
+
|
|
1069
|
+
/**
|
|
1070
|
+
* Decodes an Environment message from the specified reader or buffer, length delimited.
|
|
1071
|
+
* @function decodeDelimited
|
|
1072
|
+
* @memberof sqlanvil.Environment
|
|
1073
|
+
* @static
|
|
1074
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
1075
|
+
* @returns {sqlanvil.Environment} Environment
|
|
1076
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
1077
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
1078
|
+
*/
|
|
1079
|
+
Environment.decodeDelimited = function decodeDelimited(reader) {
|
|
1080
|
+
if (!(reader instanceof $Reader))
|
|
1081
|
+
reader = new $Reader(reader);
|
|
1082
|
+
return this.decode(reader, reader.uint32());
|
|
1083
|
+
};
|
|
1084
|
+
|
|
1085
|
+
/**
|
|
1086
|
+
* Verifies an Environment message.
|
|
1087
|
+
* @function verify
|
|
1088
|
+
* @memberof sqlanvil.Environment
|
|
1089
|
+
* @static
|
|
1090
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
1091
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
1092
|
+
*/
|
|
1093
|
+
Environment.verify = function verify(message) {
|
|
1094
|
+
if (typeof message !== "object" || message === null)
|
|
1095
|
+
return "object expected";
|
|
1096
|
+
if (message.schemaSuffix != null && message.hasOwnProperty("schemaSuffix"))
|
|
1097
|
+
if (!$util.isString(message.schemaSuffix))
|
|
1098
|
+
return "schemaSuffix: string expected";
|
|
1099
|
+
if (message.vars != null && message.hasOwnProperty("vars")) {
|
|
1100
|
+
if (!$util.isObject(message.vars))
|
|
1101
|
+
return "vars: object expected";
|
|
1102
|
+
let key = Object.keys(message.vars);
|
|
1103
|
+
for (let i = 0; i < key.length; ++i)
|
|
1104
|
+
if (!$util.isString(message.vars[key[i]]))
|
|
1105
|
+
return "vars: string{k:string} expected";
|
|
1106
|
+
}
|
|
1107
|
+
if (message.defaultDatabase != null && message.hasOwnProperty("defaultDatabase"))
|
|
1108
|
+
if (!$util.isString(message.defaultDatabase))
|
|
1109
|
+
return "defaultDatabase: string expected";
|
|
1110
|
+
if (message.defaultLocation != null && message.hasOwnProperty("defaultLocation"))
|
|
1111
|
+
if (!$util.isString(message.defaultLocation))
|
|
1112
|
+
return "defaultLocation: string expected";
|
|
1113
|
+
if (message.credentials != null && message.hasOwnProperty("credentials"))
|
|
1114
|
+
if (!$util.isString(message.credentials))
|
|
1115
|
+
return "credentials: string expected";
|
|
1116
|
+
return null;
|
|
1117
|
+
};
|
|
1118
|
+
|
|
1119
|
+
/**
|
|
1120
|
+
* Creates an Environment message from a plain object. Also converts values to their respective internal types.
|
|
1121
|
+
* @function fromObject
|
|
1122
|
+
* @memberof sqlanvil.Environment
|
|
1123
|
+
* @static
|
|
1124
|
+
* @param {Object.<string,*>} object Plain object
|
|
1125
|
+
* @returns {sqlanvil.Environment} Environment
|
|
1126
|
+
*/
|
|
1127
|
+
Environment.fromObject = function fromObject(object) {
|
|
1128
|
+
if (object instanceof $root.sqlanvil.Environment)
|
|
1129
|
+
return object;
|
|
1130
|
+
let message = new $root.sqlanvil.Environment();
|
|
1131
|
+
if (object.schemaSuffix != null)
|
|
1132
|
+
message.schemaSuffix = String(object.schemaSuffix);
|
|
1133
|
+
if (object.vars) {
|
|
1134
|
+
if (typeof object.vars !== "object")
|
|
1135
|
+
throw TypeError(".sqlanvil.Environment.vars: object expected");
|
|
1136
|
+
message.vars = {};
|
|
1137
|
+
for (let keys = Object.keys(object.vars), i = 0; i < keys.length; ++i)
|
|
1138
|
+
message.vars[keys[i]] = String(object.vars[keys[i]]);
|
|
1139
|
+
}
|
|
1140
|
+
if (object.defaultDatabase != null)
|
|
1141
|
+
message.defaultDatabase = String(object.defaultDatabase);
|
|
1142
|
+
if (object.defaultLocation != null)
|
|
1143
|
+
message.defaultLocation = String(object.defaultLocation);
|
|
1144
|
+
if (object.credentials != null)
|
|
1145
|
+
message.credentials = String(object.credentials);
|
|
1146
|
+
return message;
|
|
1147
|
+
};
|
|
1148
|
+
|
|
1149
|
+
/**
|
|
1150
|
+
* Creates a plain object from an Environment message. Also converts values to other types if specified.
|
|
1151
|
+
* @function toObject
|
|
1152
|
+
* @memberof sqlanvil.Environment
|
|
1153
|
+
* @static
|
|
1154
|
+
* @param {sqlanvil.Environment} message Environment
|
|
1155
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
1156
|
+
* @returns {Object.<string,*>} Plain object
|
|
1157
|
+
*/
|
|
1158
|
+
Environment.toObject = function toObject(message, options) {
|
|
1159
|
+
if (!options)
|
|
1160
|
+
options = {};
|
|
1161
|
+
let object = {};
|
|
1162
|
+
if (options.objects || options.defaults)
|
|
1163
|
+
object.vars = {};
|
|
1164
|
+
if (options.defaults) {
|
|
1165
|
+
object.schemaSuffix = "";
|
|
1166
|
+
object.defaultDatabase = "";
|
|
1167
|
+
object.defaultLocation = "";
|
|
1168
|
+
object.credentials = "";
|
|
1169
|
+
}
|
|
1170
|
+
if (message.schemaSuffix != null && message.hasOwnProperty("schemaSuffix"))
|
|
1171
|
+
object.schemaSuffix = message.schemaSuffix;
|
|
1172
|
+
let keys2;
|
|
1173
|
+
if (message.vars && (keys2 = Object.keys(message.vars)).length) {
|
|
1174
|
+
object.vars = {};
|
|
1175
|
+
for (let j = 0; j < keys2.length; ++j)
|
|
1176
|
+
object.vars[keys2[j]] = message.vars[keys2[j]];
|
|
1177
|
+
}
|
|
1178
|
+
if (message.defaultDatabase != null && message.hasOwnProperty("defaultDatabase"))
|
|
1179
|
+
object.defaultDatabase = message.defaultDatabase;
|
|
1180
|
+
if (message.defaultLocation != null && message.hasOwnProperty("defaultLocation"))
|
|
1181
|
+
object.defaultLocation = message.defaultLocation;
|
|
1182
|
+
if (message.credentials != null && message.hasOwnProperty("credentials"))
|
|
1183
|
+
object.credentials = message.credentials;
|
|
1184
|
+
return object;
|
|
1185
|
+
};
|
|
1186
|
+
|
|
1187
|
+
/**
|
|
1188
|
+
* Converts this Environment to JSON.
|
|
1189
|
+
* @function toJSON
|
|
1190
|
+
* @memberof sqlanvil.Environment
|
|
1191
|
+
* @instance
|
|
1192
|
+
* @returns {Object.<string,*>} JSON object
|
|
1193
|
+
*/
|
|
1194
|
+
Environment.prototype.toJSON = function toJSON() {
|
|
1195
|
+
return this.constructor.toObject(this, $protobuf__namespace.util.toJSONOptions);
|
|
1196
|
+
};
|
|
1197
|
+
|
|
1198
|
+
/**
|
|
1199
|
+
* Gets the default type url for Environment
|
|
1200
|
+
* @function getTypeUrl
|
|
1201
|
+
* @memberof sqlanvil.Environment
|
|
1202
|
+
* @static
|
|
1203
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
1204
|
+
* @returns {string} The default type url
|
|
1205
|
+
*/
|
|
1206
|
+
Environment.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
1207
|
+
if (typeUrlPrefix === undefined) {
|
|
1208
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
1209
|
+
}
|
|
1210
|
+
return typeUrlPrefix + "/sqlanvil.Environment";
|
|
1211
|
+
};
|
|
1212
|
+
|
|
1213
|
+
return Environment;
|
|
1214
|
+
})();
|
|
1215
|
+
|
|
816
1216
|
sqlanvil.ConnectionConfig = (function() {
|
|
817
1217
|
|
|
818
1218
|
/**
|
|
@@ -1699,6 +2099,7 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
1699
2099
|
* @property {sqlanvil.ActionConfig.IRealtimePublicationConfig|null} [realtimePublication] ActionConfig realtimePublication
|
|
1700
2100
|
* @property {sqlanvil.ActionConfig.IForeignWrapperConfig|null} [foreignWrapper] ActionConfig foreignWrapper
|
|
1701
2101
|
* @property {sqlanvil.ActionConfig.IVectorIndexConfig|null} [vectorIndex] ActionConfig vectorIndex
|
|
2102
|
+
* @property {sqlanvil.ActionConfig.IExportConfig|null} ["export"] ActionConfig export
|
|
1702
2103
|
*/
|
|
1703
2104
|
|
|
1704
2105
|
/**
|
|
@@ -1812,17 +2213,25 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
1812
2213
|
*/
|
|
1813
2214
|
ActionConfig.prototype.vectorIndex = null;
|
|
1814
2215
|
|
|
2216
|
+
/**
|
|
2217
|
+
* ActionConfig export.
|
|
2218
|
+
* @member {sqlanvil.ActionConfig.IExportConfig|null|undefined} export
|
|
2219
|
+
* @memberof sqlanvil.ActionConfig
|
|
2220
|
+
* @instance
|
|
2221
|
+
*/
|
|
2222
|
+
ActionConfig.prototype["export"] = null;
|
|
2223
|
+
|
|
1815
2224
|
// OneOf field names bound to virtual getters and setters
|
|
1816
2225
|
let $oneOfFields;
|
|
1817
2226
|
|
|
1818
2227
|
/**
|
|
1819
2228
|
* ActionConfig action.
|
|
1820
|
-
* @member {"table"|"view"|"incrementalTable"|"assertion"|"operation"|"declaration"|"notebook"|"dataPreparation"|"rlsPolicy"|"realtimePublication"|"foreignWrapper"|"vectorIndex"|undefined} action
|
|
2229
|
+
* @member {"table"|"view"|"incrementalTable"|"assertion"|"operation"|"declaration"|"notebook"|"dataPreparation"|"rlsPolicy"|"realtimePublication"|"foreignWrapper"|"vectorIndex"|"export"|undefined} action
|
|
1821
2230
|
* @memberof sqlanvil.ActionConfig
|
|
1822
2231
|
* @instance
|
|
1823
2232
|
*/
|
|
1824
2233
|
Object.defineProperty(ActionConfig.prototype, "action", {
|
|
1825
|
-
get: $util.oneOfGetter($oneOfFields = ["table", "view", "incrementalTable", "assertion", "operation", "declaration", "notebook", "dataPreparation", "rlsPolicy", "realtimePublication", "foreignWrapper", "vectorIndex"]),
|
|
2234
|
+
get: $util.oneOfGetter($oneOfFields = ["table", "view", "incrementalTable", "assertion", "operation", "declaration", "notebook", "dataPreparation", "rlsPolicy", "realtimePublication", "foreignWrapper", "vectorIndex", "export"]),
|
|
1826
2235
|
set: $util.oneOfSetter($oneOfFields)
|
|
1827
2236
|
});
|
|
1828
2237
|
|
|
@@ -1874,6 +2283,8 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
1874
2283
|
$root.sqlanvil.ActionConfig.ForeignWrapperConfig.encode(message.foreignWrapper, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
|
|
1875
2284
|
if (message.vectorIndex != null && Object.hasOwnProperty.call(message, "vectorIndex"))
|
|
1876
2285
|
$root.sqlanvil.ActionConfig.VectorIndexConfig.encode(message.vectorIndex, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim();
|
|
2286
|
+
if (message["export"] != null && Object.hasOwnProperty.call(message, "export"))
|
|
2287
|
+
$root.sqlanvil.ActionConfig.ExportConfig.encode(message["export"], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim();
|
|
1877
2288
|
return writer;
|
|
1878
2289
|
};
|
|
1879
2290
|
|
|
@@ -1958,6 +2369,10 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
1958
2369
|
message.vectorIndex = $root.sqlanvil.ActionConfig.VectorIndexConfig.decode(reader, reader.uint32());
|
|
1959
2370
|
break;
|
|
1960
2371
|
}
|
|
2372
|
+
case 13: {
|
|
2373
|
+
message["export"] = $root.sqlanvil.ActionConfig.ExportConfig.decode(reader, reader.uint32());
|
|
2374
|
+
break;
|
|
2375
|
+
}
|
|
1961
2376
|
default:
|
|
1962
2377
|
reader.skipType(tag & 7);
|
|
1963
2378
|
break;
|
|
@@ -2112,6 +2527,16 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
2112
2527
|
return "vectorIndex." + error;
|
|
2113
2528
|
}
|
|
2114
2529
|
}
|
|
2530
|
+
if (message["export"] != null && message.hasOwnProperty("export")) {
|
|
2531
|
+
if (properties.action === 1)
|
|
2532
|
+
return "action: multiple values";
|
|
2533
|
+
properties.action = 1;
|
|
2534
|
+
{
|
|
2535
|
+
let error = $root.sqlanvil.ActionConfig.ExportConfig.verify(message["export"]);
|
|
2536
|
+
if (error)
|
|
2537
|
+
return "export." + error;
|
|
2538
|
+
}
|
|
2539
|
+
}
|
|
2115
2540
|
return null;
|
|
2116
2541
|
};
|
|
2117
2542
|
|
|
@@ -2187,6 +2612,11 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
2187
2612
|
throw TypeError(".sqlanvil.ActionConfig.vectorIndex: object expected");
|
|
2188
2613
|
message.vectorIndex = $root.sqlanvil.ActionConfig.VectorIndexConfig.fromObject(object.vectorIndex);
|
|
2189
2614
|
}
|
|
2615
|
+
if (object["export"] != null) {
|
|
2616
|
+
if (typeof object["export"] !== "object")
|
|
2617
|
+
throw TypeError(".sqlanvil.ActionConfig.export: object expected");
|
|
2618
|
+
message["export"] = $root.sqlanvil.ActionConfig.ExportConfig.fromObject(object["export"]);
|
|
2619
|
+
}
|
|
2190
2620
|
return message;
|
|
2191
2621
|
};
|
|
2192
2622
|
|
|
@@ -2263,6 +2693,11 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
2263
2693
|
if (options.oneofs)
|
|
2264
2694
|
object.action = "vectorIndex";
|
|
2265
2695
|
}
|
|
2696
|
+
if (message["export"] != null && message.hasOwnProperty("export")) {
|
|
2697
|
+
object["export"] = $root.sqlanvil.ActionConfig.ExportConfig.toObject(message["export"], options);
|
|
2698
|
+
if (options.oneofs)
|
|
2699
|
+
object.action = "export";
|
|
2700
|
+
}
|
|
2266
2701
|
return object;
|
|
2267
2702
|
};
|
|
2268
2703
|
|
|
@@ -8056,35 +8491,29 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
8056
8491
|
return OperationConfig;
|
|
8057
8492
|
})();
|
|
8058
8493
|
|
|
8059
|
-
ActionConfig.
|
|
8494
|
+
ActionConfig.ExportOptions = (function() {
|
|
8060
8495
|
|
|
8061
8496
|
/**
|
|
8062
|
-
* Properties of
|
|
8497
|
+
* Properties of an ExportOptions.
|
|
8063
8498
|
* @memberof sqlanvil.ActionConfig
|
|
8064
|
-
* @interface
|
|
8065
|
-
* @property {string|null} [
|
|
8066
|
-
* @property {string|null} [
|
|
8067
|
-
* @property {
|
|
8068
|
-
* @property {string|null} [
|
|
8069
|
-
* @property {
|
|
8070
|
-
* @property {string|null} [filename] DeclarationConfig filename
|
|
8071
|
-
* @property {Array.<string>|null} [tags] DeclarationConfig tags
|
|
8072
|
-
* @property {string|null} [connection] DeclarationConfig connection
|
|
8073
|
-
* @property {Object.<string,string>|null} [columnTypes] DeclarationConfig columnTypes
|
|
8499
|
+
* @interface IExportOptions
|
|
8500
|
+
* @property {string|null} [location] ExportOptions location
|
|
8501
|
+
* @property {string|null} [format] ExportOptions format
|
|
8502
|
+
* @property {boolean|null} [overwrite] ExportOptions overwrite
|
|
8503
|
+
* @property {string|null} [filename] ExportOptions filename
|
|
8504
|
+
* @property {Object.<string,string>|null} [options] ExportOptions options
|
|
8074
8505
|
*/
|
|
8075
8506
|
|
|
8076
8507
|
/**
|
|
8077
|
-
* Constructs a new
|
|
8508
|
+
* Constructs a new ExportOptions.
|
|
8078
8509
|
* @memberof sqlanvil.ActionConfig
|
|
8079
|
-
* @classdesc Represents
|
|
8080
|
-
* @implements
|
|
8510
|
+
* @classdesc Represents an ExportOptions.
|
|
8511
|
+
* @implements IExportOptions
|
|
8081
8512
|
* @constructor
|
|
8082
|
-
* @param {sqlanvil.ActionConfig.
|
|
8513
|
+
* @param {sqlanvil.ActionConfig.IExportOptions=} [properties] Properties to set
|
|
8083
8514
|
*/
|
|
8084
|
-
function
|
|
8085
|
-
this.
|
|
8086
|
-
this.tags = [];
|
|
8087
|
-
this.columnTypes = {};
|
|
8515
|
+
function ExportOptions(properties) {
|
|
8516
|
+
this.options = {};
|
|
8088
8517
|
if (properties)
|
|
8089
8518
|
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
8090
8519
|
if (properties[keys[i]] != null)
|
|
@@ -8092,197 +8521,135 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
8092
8521
|
}
|
|
8093
8522
|
|
|
8094
8523
|
/**
|
|
8095
|
-
*
|
|
8096
|
-
* @member {string}
|
|
8097
|
-
* @memberof sqlanvil.ActionConfig.
|
|
8098
|
-
* @instance
|
|
8099
|
-
*/
|
|
8100
|
-
DeclarationConfig.prototype.name = "";
|
|
8101
|
-
|
|
8102
|
-
/**
|
|
8103
|
-
* DeclarationConfig dataset.
|
|
8104
|
-
* @member {string} dataset
|
|
8105
|
-
* @memberof sqlanvil.ActionConfig.DeclarationConfig
|
|
8106
|
-
* @instance
|
|
8107
|
-
*/
|
|
8108
|
-
DeclarationConfig.prototype.dataset = "";
|
|
8109
|
-
|
|
8110
|
-
/**
|
|
8111
|
-
* DeclarationConfig project.
|
|
8112
|
-
* @member {string} project
|
|
8113
|
-
* @memberof sqlanvil.ActionConfig.DeclarationConfig
|
|
8524
|
+
* ExportOptions location.
|
|
8525
|
+
* @member {string} location
|
|
8526
|
+
* @memberof sqlanvil.ActionConfig.ExportOptions
|
|
8114
8527
|
* @instance
|
|
8115
8528
|
*/
|
|
8116
|
-
|
|
8529
|
+
ExportOptions.prototype.location = "";
|
|
8117
8530
|
|
|
8118
8531
|
/**
|
|
8119
|
-
*
|
|
8120
|
-
* @member {string}
|
|
8121
|
-
* @memberof sqlanvil.ActionConfig.
|
|
8532
|
+
* ExportOptions format.
|
|
8533
|
+
* @member {string} format
|
|
8534
|
+
* @memberof sqlanvil.ActionConfig.ExportOptions
|
|
8122
8535
|
* @instance
|
|
8123
8536
|
*/
|
|
8124
|
-
|
|
8537
|
+
ExportOptions.prototype.format = "";
|
|
8125
8538
|
|
|
8126
8539
|
/**
|
|
8127
|
-
*
|
|
8128
|
-
* @member {
|
|
8129
|
-
* @memberof sqlanvil.ActionConfig.
|
|
8540
|
+
* ExportOptions overwrite.
|
|
8541
|
+
* @member {boolean} overwrite
|
|
8542
|
+
* @memberof sqlanvil.ActionConfig.ExportOptions
|
|
8130
8543
|
* @instance
|
|
8131
8544
|
*/
|
|
8132
|
-
|
|
8545
|
+
ExportOptions.prototype.overwrite = false;
|
|
8133
8546
|
|
|
8134
8547
|
/**
|
|
8135
|
-
*
|
|
8548
|
+
* ExportOptions filename.
|
|
8136
8549
|
* @member {string} filename
|
|
8137
|
-
* @memberof sqlanvil.ActionConfig.
|
|
8138
|
-
* @instance
|
|
8139
|
-
*/
|
|
8140
|
-
DeclarationConfig.prototype.filename = "";
|
|
8141
|
-
|
|
8142
|
-
/**
|
|
8143
|
-
* DeclarationConfig tags.
|
|
8144
|
-
* @member {Array.<string>} tags
|
|
8145
|
-
* @memberof sqlanvil.ActionConfig.DeclarationConfig
|
|
8550
|
+
* @memberof sqlanvil.ActionConfig.ExportOptions
|
|
8146
8551
|
* @instance
|
|
8147
8552
|
*/
|
|
8148
|
-
|
|
8553
|
+
ExportOptions.prototype.filename = "";
|
|
8149
8554
|
|
|
8150
8555
|
/**
|
|
8151
|
-
*
|
|
8152
|
-
* @member {string}
|
|
8153
|
-
* @memberof sqlanvil.ActionConfig.
|
|
8154
|
-
* @instance
|
|
8155
|
-
*/
|
|
8156
|
-
DeclarationConfig.prototype.connection = "";
|
|
8157
|
-
|
|
8158
|
-
/**
|
|
8159
|
-
* DeclarationConfig columnTypes.
|
|
8160
|
-
* @member {Object.<string,string>} columnTypes
|
|
8161
|
-
* @memberof sqlanvil.ActionConfig.DeclarationConfig
|
|
8556
|
+
* ExportOptions options.
|
|
8557
|
+
* @member {Object.<string,string>} options
|
|
8558
|
+
* @memberof sqlanvil.ActionConfig.ExportOptions
|
|
8162
8559
|
* @instance
|
|
8163
8560
|
*/
|
|
8164
|
-
|
|
8561
|
+
ExportOptions.prototype.options = $util.emptyObject;
|
|
8165
8562
|
|
|
8166
8563
|
/**
|
|
8167
|
-
* Creates a new
|
|
8564
|
+
* Creates a new ExportOptions instance using the specified properties.
|
|
8168
8565
|
* @function create
|
|
8169
|
-
* @memberof sqlanvil.ActionConfig.
|
|
8566
|
+
* @memberof sqlanvil.ActionConfig.ExportOptions
|
|
8170
8567
|
* @static
|
|
8171
|
-
* @param {sqlanvil.ActionConfig.
|
|
8172
|
-
* @returns {sqlanvil.ActionConfig.
|
|
8568
|
+
* @param {sqlanvil.ActionConfig.IExportOptions=} [properties] Properties to set
|
|
8569
|
+
* @returns {sqlanvil.ActionConfig.ExportOptions} ExportOptions instance
|
|
8173
8570
|
*/
|
|
8174
|
-
|
|
8175
|
-
return new
|
|
8571
|
+
ExportOptions.create = function create(properties) {
|
|
8572
|
+
return new ExportOptions(properties);
|
|
8176
8573
|
};
|
|
8177
8574
|
|
|
8178
8575
|
/**
|
|
8179
|
-
* Encodes the specified
|
|
8576
|
+
* Encodes the specified ExportOptions message. Does not implicitly {@link sqlanvil.ActionConfig.ExportOptions.verify|verify} messages.
|
|
8180
8577
|
* @function encode
|
|
8181
|
-
* @memberof sqlanvil.ActionConfig.
|
|
8578
|
+
* @memberof sqlanvil.ActionConfig.ExportOptions
|
|
8182
8579
|
* @static
|
|
8183
|
-
* @param {sqlanvil.ActionConfig.
|
|
8580
|
+
* @param {sqlanvil.ActionConfig.IExportOptions} message ExportOptions message or plain object to encode
|
|
8184
8581
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
8185
8582
|
* @returns {$protobuf.Writer} Writer
|
|
8186
8583
|
*/
|
|
8187
|
-
|
|
8584
|
+
ExportOptions.encode = function encode(message, writer) {
|
|
8188
8585
|
if (!writer)
|
|
8189
8586
|
writer = $Writer.create();
|
|
8190
|
-
if (message.
|
|
8191
|
-
writer.uint32(/* id 1, wireType 2 =*/10).string(message.
|
|
8192
|
-
if (message.
|
|
8193
|
-
writer.uint32(/* id 2, wireType 2 =*/18).string(message.
|
|
8194
|
-
if (message.
|
|
8195
|
-
writer.uint32(/* id 3, wireType
|
|
8196
|
-
if (message.description != null && Object.hasOwnProperty.call(message, "description"))
|
|
8197
|
-
writer.uint32(/* id 4, wireType 2 =*/34).string(message.description);
|
|
8198
|
-
if (message.columns != null && message.columns.length)
|
|
8199
|
-
for (let i = 0; i < message.columns.length; ++i)
|
|
8200
|
-
$root.sqlanvil.ActionConfig.ColumnDescriptor.encode(message.columns[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
|
|
8587
|
+
if (message.location != null && Object.hasOwnProperty.call(message, "location"))
|
|
8588
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.location);
|
|
8589
|
+
if (message.format != null && Object.hasOwnProperty.call(message, "format"))
|
|
8590
|
+
writer.uint32(/* id 2, wireType 2 =*/18).string(message.format);
|
|
8591
|
+
if (message.overwrite != null && Object.hasOwnProperty.call(message, "overwrite"))
|
|
8592
|
+
writer.uint32(/* id 3, wireType 0 =*/24).bool(message.overwrite);
|
|
8201
8593
|
if (message.filename != null && Object.hasOwnProperty.call(message, "filename"))
|
|
8202
|
-
writer.uint32(/* id
|
|
8203
|
-
if (message.
|
|
8204
|
-
for (let i = 0; i <
|
|
8205
|
-
writer.uint32(/* id
|
|
8206
|
-
if (message.connection != null && Object.hasOwnProperty.call(message, "connection"))
|
|
8207
|
-
writer.uint32(/* id 8, wireType 2 =*/66).string(message.connection);
|
|
8208
|
-
if (message.columnTypes != null && Object.hasOwnProperty.call(message, "columnTypes"))
|
|
8209
|
-
for (let keys = Object.keys(message.columnTypes), i = 0; i < keys.length; ++i)
|
|
8210
|
-
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();
|
|
8594
|
+
writer.uint32(/* id 4, wireType 2 =*/34).string(message.filename);
|
|
8595
|
+
if (message.options != null && Object.hasOwnProperty.call(message, "options"))
|
|
8596
|
+
for (let keys = Object.keys(message.options), i = 0; i < keys.length; ++i)
|
|
8597
|
+
writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.options[keys[i]]).ldelim();
|
|
8211
8598
|
return writer;
|
|
8212
8599
|
};
|
|
8213
8600
|
|
|
8214
8601
|
/**
|
|
8215
|
-
* Encodes the specified
|
|
8602
|
+
* Encodes the specified ExportOptions message, length delimited. Does not implicitly {@link sqlanvil.ActionConfig.ExportOptions.verify|verify} messages.
|
|
8216
8603
|
* @function encodeDelimited
|
|
8217
|
-
* @memberof sqlanvil.ActionConfig.
|
|
8604
|
+
* @memberof sqlanvil.ActionConfig.ExportOptions
|
|
8218
8605
|
* @static
|
|
8219
|
-
* @param {sqlanvil.ActionConfig.
|
|
8606
|
+
* @param {sqlanvil.ActionConfig.IExportOptions} message ExportOptions message or plain object to encode
|
|
8220
8607
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
8221
8608
|
* @returns {$protobuf.Writer} Writer
|
|
8222
8609
|
*/
|
|
8223
|
-
|
|
8610
|
+
ExportOptions.encodeDelimited = function encodeDelimited(message, writer) {
|
|
8224
8611
|
return this.encode(message, writer).ldelim();
|
|
8225
8612
|
};
|
|
8226
8613
|
|
|
8227
8614
|
/**
|
|
8228
|
-
* Decodes
|
|
8615
|
+
* Decodes an ExportOptions message from the specified reader or buffer.
|
|
8229
8616
|
* @function decode
|
|
8230
|
-
* @memberof sqlanvil.ActionConfig.
|
|
8617
|
+
* @memberof sqlanvil.ActionConfig.ExportOptions
|
|
8231
8618
|
* @static
|
|
8232
8619
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
8233
8620
|
* @param {number} [length] Message length if known beforehand
|
|
8234
|
-
* @returns {sqlanvil.ActionConfig.
|
|
8621
|
+
* @returns {sqlanvil.ActionConfig.ExportOptions} ExportOptions
|
|
8235
8622
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
8236
8623
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
8237
8624
|
*/
|
|
8238
|
-
|
|
8625
|
+
ExportOptions.decode = function decode(reader, length, error) {
|
|
8239
8626
|
if (!(reader instanceof $Reader))
|
|
8240
8627
|
reader = $Reader.create(reader);
|
|
8241
|
-
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.sqlanvil.ActionConfig.
|
|
8628
|
+
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.sqlanvil.ActionConfig.ExportOptions(), key, value;
|
|
8242
8629
|
while (reader.pos < end) {
|
|
8243
8630
|
let tag = reader.uint32();
|
|
8244
8631
|
if (tag === error)
|
|
8245
8632
|
break;
|
|
8246
8633
|
switch (tag >>> 3) {
|
|
8247
8634
|
case 1: {
|
|
8248
|
-
message.
|
|
8635
|
+
message.location = reader.string();
|
|
8249
8636
|
break;
|
|
8250
8637
|
}
|
|
8251
8638
|
case 2: {
|
|
8252
|
-
message.
|
|
8639
|
+
message.format = reader.string();
|
|
8253
8640
|
break;
|
|
8254
8641
|
}
|
|
8255
8642
|
case 3: {
|
|
8256
|
-
message.
|
|
8643
|
+
message.overwrite = reader.bool();
|
|
8257
8644
|
break;
|
|
8258
8645
|
}
|
|
8259
8646
|
case 4: {
|
|
8260
|
-
message.description = reader.string();
|
|
8261
|
-
break;
|
|
8262
|
-
}
|
|
8263
|
-
case 5: {
|
|
8264
|
-
if (!(message.columns && message.columns.length))
|
|
8265
|
-
message.columns = [];
|
|
8266
|
-
message.columns.push($root.sqlanvil.ActionConfig.ColumnDescriptor.decode(reader, reader.uint32()));
|
|
8267
|
-
break;
|
|
8268
|
-
}
|
|
8269
|
-
case 6: {
|
|
8270
8647
|
message.filename = reader.string();
|
|
8271
8648
|
break;
|
|
8272
8649
|
}
|
|
8273
|
-
case
|
|
8274
|
-
if (
|
|
8275
|
-
message.
|
|
8276
|
-
message.tags.push(reader.string());
|
|
8277
|
-
break;
|
|
8278
|
-
}
|
|
8279
|
-
case 8: {
|
|
8280
|
-
message.connection = reader.string();
|
|
8281
|
-
break;
|
|
8282
|
-
}
|
|
8283
|
-
case 9: {
|
|
8284
|
-
if (message.columnTypes === $util.emptyObject)
|
|
8285
|
-
message.columnTypes = {};
|
|
8650
|
+
case 5: {
|
|
8651
|
+
if (message.options === $util.emptyObject)
|
|
8652
|
+
message.options = {};
|
|
8286
8653
|
let end2 = reader.uint32() + reader.pos;
|
|
8287
8654
|
key = "";
|
|
8288
8655
|
value = "";
|
|
@@ -8300,7 +8667,7 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
8300
8667
|
break;
|
|
8301
8668
|
}
|
|
8302
8669
|
}
|
|
8303
|
-
message.
|
|
8670
|
+
message.options[key] = value;
|
|
8304
8671
|
break;
|
|
8305
8672
|
}
|
|
8306
8673
|
default:
|
|
@@ -8312,241 +8679,179 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
8312
8679
|
};
|
|
8313
8680
|
|
|
8314
8681
|
/**
|
|
8315
|
-
* Decodes
|
|
8682
|
+
* Decodes an ExportOptions message from the specified reader or buffer, length delimited.
|
|
8316
8683
|
* @function decodeDelimited
|
|
8317
|
-
* @memberof sqlanvil.ActionConfig.
|
|
8684
|
+
* @memberof sqlanvil.ActionConfig.ExportOptions
|
|
8318
8685
|
* @static
|
|
8319
8686
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
8320
|
-
* @returns {sqlanvil.ActionConfig.
|
|
8687
|
+
* @returns {sqlanvil.ActionConfig.ExportOptions} ExportOptions
|
|
8321
8688
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
8322
8689
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
8323
8690
|
*/
|
|
8324
|
-
|
|
8691
|
+
ExportOptions.decodeDelimited = function decodeDelimited(reader) {
|
|
8325
8692
|
if (!(reader instanceof $Reader))
|
|
8326
8693
|
reader = new $Reader(reader);
|
|
8327
8694
|
return this.decode(reader, reader.uint32());
|
|
8328
8695
|
};
|
|
8329
8696
|
|
|
8330
8697
|
/**
|
|
8331
|
-
* Verifies
|
|
8698
|
+
* Verifies an ExportOptions message.
|
|
8332
8699
|
* @function verify
|
|
8333
|
-
* @memberof sqlanvil.ActionConfig.
|
|
8700
|
+
* @memberof sqlanvil.ActionConfig.ExportOptions
|
|
8334
8701
|
* @static
|
|
8335
8702
|
* @param {Object.<string,*>} message Plain object to verify
|
|
8336
8703
|
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
8337
8704
|
*/
|
|
8338
|
-
|
|
8705
|
+
ExportOptions.verify = function verify(message) {
|
|
8339
8706
|
if (typeof message !== "object" || message === null)
|
|
8340
8707
|
return "object expected";
|
|
8341
|
-
if (message.
|
|
8342
|
-
if (!$util.isString(message.
|
|
8343
|
-
return "
|
|
8344
|
-
if (message.
|
|
8345
|
-
if (!$util.isString(message.
|
|
8346
|
-
return "
|
|
8347
|
-
if (message.
|
|
8348
|
-
if (
|
|
8349
|
-
return "
|
|
8350
|
-
if (message.description != null && message.hasOwnProperty("description"))
|
|
8351
|
-
if (!$util.isString(message.description))
|
|
8352
|
-
return "description: string expected";
|
|
8353
|
-
if (message.columns != null && message.hasOwnProperty("columns")) {
|
|
8354
|
-
if (!Array.isArray(message.columns))
|
|
8355
|
-
return "columns: array expected";
|
|
8356
|
-
for (let i = 0; i < message.columns.length; ++i) {
|
|
8357
|
-
let error = $root.sqlanvil.ActionConfig.ColumnDescriptor.verify(message.columns[i]);
|
|
8358
|
-
if (error)
|
|
8359
|
-
return "columns." + error;
|
|
8360
|
-
}
|
|
8361
|
-
}
|
|
8708
|
+
if (message.location != null && message.hasOwnProperty("location"))
|
|
8709
|
+
if (!$util.isString(message.location))
|
|
8710
|
+
return "location: string expected";
|
|
8711
|
+
if (message.format != null && message.hasOwnProperty("format"))
|
|
8712
|
+
if (!$util.isString(message.format))
|
|
8713
|
+
return "format: string expected";
|
|
8714
|
+
if (message.overwrite != null && message.hasOwnProperty("overwrite"))
|
|
8715
|
+
if (typeof message.overwrite !== "boolean")
|
|
8716
|
+
return "overwrite: boolean expected";
|
|
8362
8717
|
if (message.filename != null && message.hasOwnProperty("filename"))
|
|
8363
8718
|
if (!$util.isString(message.filename))
|
|
8364
8719
|
return "filename: string expected";
|
|
8365
|
-
if (message.
|
|
8366
|
-
if (
|
|
8367
|
-
return "
|
|
8368
|
-
|
|
8369
|
-
if (!$util.isString(message.tags[i]))
|
|
8370
|
-
return "tags: string[] expected";
|
|
8371
|
-
}
|
|
8372
|
-
if (message.connection != null && message.hasOwnProperty("connection"))
|
|
8373
|
-
if (!$util.isString(message.connection))
|
|
8374
|
-
return "connection: string expected";
|
|
8375
|
-
if (message.columnTypes != null && message.hasOwnProperty("columnTypes")) {
|
|
8376
|
-
if (!$util.isObject(message.columnTypes))
|
|
8377
|
-
return "columnTypes: object expected";
|
|
8378
|
-
let key = Object.keys(message.columnTypes);
|
|
8720
|
+
if (message.options != null && message.hasOwnProperty("options")) {
|
|
8721
|
+
if (!$util.isObject(message.options))
|
|
8722
|
+
return "options: object expected";
|
|
8723
|
+
let key = Object.keys(message.options);
|
|
8379
8724
|
for (let i = 0; i < key.length; ++i)
|
|
8380
|
-
if (!$util.isString(message.
|
|
8381
|
-
return "
|
|
8725
|
+
if (!$util.isString(message.options[key[i]]))
|
|
8726
|
+
return "options: string{k:string} expected";
|
|
8382
8727
|
}
|
|
8383
8728
|
return null;
|
|
8384
8729
|
};
|
|
8385
8730
|
|
|
8386
8731
|
/**
|
|
8387
|
-
* Creates
|
|
8732
|
+
* Creates an ExportOptions message from a plain object. Also converts values to their respective internal types.
|
|
8388
8733
|
* @function fromObject
|
|
8389
|
-
* @memberof sqlanvil.ActionConfig.
|
|
8734
|
+
* @memberof sqlanvil.ActionConfig.ExportOptions
|
|
8390
8735
|
* @static
|
|
8391
8736
|
* @param {Object.<string,*>} object Plain object
|
|
8392
|
-
* @returns {sqlanvil.ActionConfig.
|
|
8737
|
+
* @returns {sqlanvil.ActionConfig.ExportOptions} ExportOptions
|
|
8393
8738
|
*/
|
|
8394
|
-
|
|
8395
|
-
if (object instanceof $root.sqlanvil.ActionConfig.
|
|
8739
|
+
ExportOptions.fromObject = function fromObject(object) {
|
|
8740
|
+
if (object instanceof $root.sqlanvil.ActionConfig.ExportOptions)
|
|
8396
8741
|
return object;
|
|
8397
|
-
let message = new $root.sqlanvil.ActionConfig.
|
|
8398
|
-
if (object.
|
|
8399
|
-
message.
|
|
8400
|
-
if (object.
|
|
8401
|
-
message.
|
|
8402
|
-
if (object.
|
|
8403
|
-
message.
|
|
8404
|
-
if (object.description != null)
|
|
8405
|
-
message.description = String(object.description);
|
|
8406
|
-
if (object.columns) {
|
|
8407
|
-
if (!Array.isArray(object.columns))
|
|
8408
|
-
throw TypeError(".sqlanvil.ActionConfig.DeclarationConfig.columns: array expected");
|
|
8409
|
-
message.columns = [];
|
|
8410
|
-
for (let i = 0; i < object.columns.length; ++i) {
|
|
8411
|
-
if (typeof object.columns[i] !== "object")
|
|
8412
|
-
throw TypeError(".sqlanvil.ActionConfig.DeclarationConfig.columns: object expected");
|
|
8413
|
-
message.columns[i] = $root.sqlanvil.ActionConfig.ColumnDescriptor.fromObject(object.columns[i]);
|
|
8414
|
-
}
|
|
8415
|
-
}
|
|
8742
|
+
let message = new $root.sqlanvil.ActionConfig.ExportOptions();
|
|
8743
|
+
if (object.location != null)
|
|
8744
|
+
message.location = String(object.location);
|
|
8745
|
+
if (object.format != null)
|
|
8746
|
+
message.format = String(object.format);
|
|
8747
|
+
if (object.overwrite != null)
|
|
8748
|
+
message.overwrite = Boolean(object.overwrite);
|
|
8416
8749
|
if (object.filename != null)
|
|
8417
8750
|
message.filename = String(object.filename);
|
|
8418
|
-
if (object.
|
|
8419
|
-
if (
|
|
8420
|
-
throw TypeError(".sqlanvil.ActionConfig.
|
|
8421
|
-
message.
|
|
8422
|
-
for (let i = 0; i <
|
|
8423
|
-
message.
|
|
8424
|
-
}
|
|
8425
|
-
if (object.connection != null)
|
|
8426
|
-
message.connection = String(object.connection);
|
|
8427
|
-
if (object.columnTypes) {
|
|
8428
|
-
if (typeof object.columnTypes !== "object")
|
|
8429
|
-
throw TypeError(".sqlanvil.ActionConfig.DeclarationConfig.columnTypes: object expected");
|
|
8430
|
-
message.columnTypes = {};
|
|
8431
|
-
for (let keys = Object.keys(object.columnTypes), i = 0; i < keys.length; ++i)
|
|
8432
|
-
message.columnTypes[keys[i]] = String(object.columnTypes[keys[i]]);
|
|
8751
|
+
if (object.options) {
|
|
8752
|
+
if (typeof object.options !== "object")
|
|
8753
|
+
throw TypeError(".sqlanvil.ActionConfig.ExportOptions.options: object expected");
|
|
8754
|
+
message.options = {};
|
|
8755
|
+
for (let keys = Object.keys(object.options), i = 0; i < keys.length; ++i)
|
|
8756
|
+
message.options[keys[i]] = String(object.options[keys[i]]);
|
|
8433
8757
|
}
|
|
8434
8758
|
return message;
|
|
8435
8759
|
};
|
|
8436
8760
|
|
|
8437
8761
|
/**
|
|
8438
|
-
* Creates a plain object from
|
|
8762
|
+
* Creates a plain object from an ExportOptions message. Also converts values to other types if specified.
|
|
8439
8763
|
* @function toObject
|
|
8440
|
-
* @memberof sqlanvil.ActionConfig.
|
|
8764
|
+
* @memberof sqlanvil.ActionConfig.ExportOptions
|
|
8441
8765
|
* @static
|
|
8442
|
-
* @param {sqlanvil.ActionConfig.
|
|
8766
|
+
* @param {sqlanvil.ActionConfig.ExportOptions} message ExportOptions
|
|
8443
8767
|
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
8444
8768
|
* @returns {Object.<string,*>} Plain object
|
|
8445
8769
|
*/
|
|
8446
|
-
|
|
8770
|
+
ExportOptions.toObject = function toObject(message, options) {
|
|
8447
8771
|
if (!options)
|
|
8448
8772
|
options = {};
|
|
8449
8773
|
let object = {};
|
|
8450
|
-
if (options.arrays || options.defaults) {
|
|
8451
|
-
object.columns = [];
|
|
8452
|
-
object.tags = [];
|
|
8453
|
-
}
|
|
8454
8774
|
if (options.objects || options.defaults)
|
|
8455
|
-
object.
|
|
8775
|
+
object.options = {};
|
|
8456
8776
|
if (options.defaults) {
|
|
8457
|
-
object.
|
|
8458
|
-
object.
|
|
8459
|
-
object.
|
|
8460
|
-
object.description = "";
|
|
8777
|
+
object.location = "";
|
|
8778
|
+
object.format = "";
|
|
8779
|
+
object.overwrite = false;
|
|
8461
8780
|
object.filename = "";
|
|
8462
|
-
object.connection = "";
|
|
8463
|
-
}
|
|
8464
|
-
if (message.name != null && message.hasOwnProperty("name"))
|
|
8465
|
-
object.name = message.name;
|
|
8466
|
-
if (message.dataset != null && message.hasOwnProperty("dataset"))
|
|
8467
|
-
object.dataset = message.dataset;
|
|
8468
|
-
if (message.project != null && message.hasOwnProperty("project"))
|
|
8469
|
-
object.project = message.project;
|
|
8470
|
-
if (message.description != null && message.hasOwnProperty("description"))
|
|
8471
|
-
object.description = message.description;
|
|
8472
|
-
if (message.columns && message.columns.length) {
|
|
8473
|
-
object.columns = [];
|
|
8474
|
-
for (let j = 0; j < message.columns.length; ++j)
|
|
8475
|
-
object.columns[j] = $root.sqlanvil.ActionConfig.ColumnDescriptor.toObject(message.columns[j], options);
|
|
8476
8781
|
}
|
|
8782
|
+
if (message.location != null && message.hasOwnProperty("location"))
|
|
8783
|
+
object.location = message.location;
|
|
8784
|
+
if (message.format != null && message.hasOwnProperty("format"))
|
|
8785
|
+
object.format = message.format;
|
|
8786
|
+
if (message.overwrite != null && message.hasOwnProperty("overwrite"))
|
|
8787
|
+
object.overwrite = message.overwrite;
|
|
8477
8788
|
if (message.filename != null && message.hasOwnProperty("filename"))
|
|
8478
8789
|
object.filename = message.filename;
|
|
8479
|
-
if (message.tags && message.tags.length) {
|
|
8480
|
-
object.tags = [];
|
|
8481
|
-
for (let j = 0; j < message.tags.length; ++j)
|
|
8482
|
-
object.tags[j] = message.tags[j];
|
|
8483
|
-
}
|
|
8484
|
-
if (message.connection != null && message.hasOwnProperty("connection"))
|
|
8485
|
-
object.connection = message.connection;
|
|
8486
8790
|
let keys2;
|
|
8487
|
-
if (message.
|
|
8488
|
-
object.
|
|
8791
|
+
if (message.options && (keys2 = Object.keys(message.options)).length) {
|
|
8792
|
+
object.options = {};
|
|
8489
8793
|
for (let j = 0; j < keys2.length; ++j)
|
|
8490
|
-
object.
|
|
8794
|
+
object.options[keys2[j]] = message.options[keys2[j]];
|
|
8491
8795
|
}
|
|
8492
8796
|
return object;
|
|
8493
8797
|
};
|
|
8494
8798
|
|
|
8495
8799
|
/**
|
|
8496
|
-
* Converts this
|
|
8800
|
+
* Converts this ExportOptions to JSON.
|
|
8497
8801
|
* @function toJSON
|
|
8498
|
-
* @memberof sqlanvil.ActionConfig.
|
|
8802
|
+
* @memberof sqlanvil.ActionConfig.ExportOptions
|
|
8499
8803
|
* @instance
|
|
8500
8804
|
* @returns {Object.<string,*>} JSON object
|
|
8501
8805
|
*/
|
|
8502
|
-
|
|
8806
|
+
ExportOptions.prototype.toJSON = function toJSON() {
|
|
8503
8807
|
return this.constructor.toObject(this, $protobuf__namespace.util.toJSONOptions);
|
|
8504
8808
|
};
|
|
8505
8809
|
|
|
8506
8810
|
/**
|
|
8507
|
-
* Gets the default type url for
|
|
8811
|
+
* Gets the default type url for ExportOptions
|
|
8508
8812
|
* @function getTypeUrl
|
|
8509
|
-
* @memberof sqlanvil.ActionConfig.
|
|
8813
|
+
* @memberof sqlanvil.ActionConfig.ExportOptions
|
|
8510
8814
|
* @static
|
|
8511
8815
|
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
8512
8816
|
* @returns {string} The default type url
|
|
8513
8817
|
*/
|
|
8514
|
-
|
|
8818
|
+
ExportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
8515
8819
|
if (typeUrlPrefix === undefined) {
|
|
8516
8820
|
typeUrlPrefix = "type.googleapis.com";
|
|
8517
8821
|
}
|
|
8518
|
-
return typeUrlPrefix + "/sqlanvil.ActionConfig.
|
|
8822
|
+
return typeUrlPrefix + "/sqlanvil.ActionConfig.ExportOptions";
|
|
8519
8823
|
};
|
|
8520
8824
|
|
|
8521
|
-
return
|
|
8825
|
+
return ExportOptions;
|
|
8522
8826
|
})();
|
|
8523
8827
|
|
|
8524
|
-
ActionConfig.
|
|
8828
|
+
ActionConfig.ExportConfig = (function() {
|
|
8525
8829
|
|
|
8526
8830
|
/**
|
|
8527
|
-
* Properties of
|
|
8831
|
+
* Properties of an ExportConfig.
|
|
8528
8832
|
* @memberof sqlanvil.ActionConfig
|
|
8529
|
-
* @interface
|
|
8530
|
-
* @property {string|null} [name]
|
|
8531
|
-
* @property {string|null} [
|
|
8532
|
-
* @property {string|null} [project]
|
|
8533
|
-
* @property {Array.<sqlanvil.ActionConfig.ITarget>|null} [dependencyTargets]
|
|
8534
|
-
* @property {string|null} [filename]
|
|
8535
|
-
* @property {Array.<string>|null} [tags]
|
|
8536
|
-
* @property {boolean|null} [disabled]
|
|
8537
|
-
* @property {string|null} [description]
|
|
8538
|
-
* @property {boolean|null} [
|
|
8833
|
+
* @interface IExportConfig
|
|
8834
|
+
* @property {string|null} [name] ExportConfig name
|
|
8835
|
+
* @property {string|null} [dataset] ExportConfig dataset
|
|
8836
|
+
* @property {string|null} [project] ExportConfig project
|
|
8837
|
+
* @property {Array.<sqlanvil.ActionConfig.ITarget>|null} [dependencyTargets] ExportConfig dependencyTargets
|
|
8838
|
+
* @property {string|null} [filename] ExportConfig filename
|
|
8839
|
+
* @property {Array.<string>|null} [tags] ExportConfig tags
|
|
8840
|
+
* @property {boolean|null} [disabled] ExportConfig disabled
|
|
8841
|
+
* @property {string|null} [description] ExportConfig description
|
|
8842
|
+
* @property {boolean|null} [hermetic] ExportConfig hermetic
|
|
8843
|
+
* @property {sqlanvil.ActionConfig.IExportOptions|null} ["export"] ExportConfig export
|
|
8539
8844
|
*/
|
|
8540
8845
|
|
|
8541
8846
|
/**
|
|
8542
|
-
* Constructs a new
|
|
8847
|
+
* Constructs a new ExportConfig.
|
|
8543
8848
|
* @memberof sqlanvil.ActionConfig
|
|
8544
|
-
* @classdesc Represents
|
|
8545
|
-
* @implements
|
|
8849
|
+
* @classdesc Represents an ExportConfig.
|
|
8850
|
+
* @implements IExportConfig
|
|
8546
8851
|
* @constructor
|
|
8547
|
-
* @param {sqlanvil.ActionConfig.
|
|
8852
|
+
* @param {sqlanvil.ActionConfig.IExportConfig=} [properties] Properties to set
|
|
8548
8853
|
*/
|
|
8549
|
-
function
|
|
8854
|
+
function ExportConfig(properties) {
|
|
8550
8855
|
this.dependencyTargets = [];
|
|
8551
8856
|
this.tags = [];
|
|
8552
8857
|
if (properties)
|
|
@@ -8556,105 +8861,113 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
8556
8861
|
}
|
|
8557
8862
|
|
|
8558
8863
|
/**
|
|
8559
|
-
*
|
|
8864
|
+
* ExportConfig name.
|
|
8560
8865
|
* @member {string} name
|
|
8561
|
-
* @memberof sqlanvil.ActionConfig.
|
|
8866
|
+
* @memberof sqlanvil.ActionConfig.ExportConfig
|
|
8562
8867
|
* @instance
|
|
8563
8868
|
*/
|
|
8564
|
-
|
|
8869
|
+
ExportConfig.prototype.name = "";
|
|
8565
8870
|
|
|
8566
8871
|
/**
|
|
8567
|
-
*
|
|
8568
|
-
* @member {string}
|
|
8569
|
-
* @memberof sqlanvil.ActionConfig.
|
|
8872
|
+
* ExportConfig dataset.
|
|
8873
|
+
* @member {string} dataset
|
|
8874
|
+
* @memberof sqlanvil.ActionConfig.ExportConfig
|
|
8570
8875
|
* @instance
|
|
8571
8876
|
*/
|
|
8572
|
-
|
|
8877
|
+
ExportConfig.prototype.dataset = "";
|
|
8573
8878
|
|
|
8574
8879
|
/**
|
|
8575
|
-
*
|
|
8880
|
+
* ExportConfig project.
|
|
8576
8881
|
* @member {string} project
|
|
8577
|
-
* @memberof sqlanvil.ActionConfig.
|
|
8882
|
+
* @memberof sqlanvil.ActionConfig.ExportConfig
|
|
8578
8883
|
* @instance
|
|
8579
8884
|
*/
|
|
8580
|
-
|
|
8885
|
+
ExportConfig.prototype.project = "";
|
|
8581
8886
|
|
|
8582
8887
|
/**
|
|
8583
|
-
*
|
|
8888
|
+
* ExportConfig dependencyTargets.
|
|
8584
8889
|
* @member {Array.<sqlanvil.ActionConfig.ITarget>} dependencyTargets
|
|
8585
|
-
* @memberof sqlanvil.ActionConfig.
|
|
8890
|
+
* @memberof sqlanvil.ActionConfig.ExportConfig
|
|
8586
8891
|
* @instance
|
|
8587
8892
|
*/
|
|
8588
|
-
|
|
8893
|
+
ExportConfig.prototype.dependencyTargets = $util.emptyArray;
|
|
8589
8894
|
|
|
8590
8895
|
/**
|
|
8591
|
-
*
|
|
8896
|
+
* ExportConfig filename.
|
|
8592
8897
|
* @member {string} filename
|
|
8593
|
-
* @memberof sqlanvil.ActionConfig.
|
|
8898
|
+
* @memberof sqlanvil.ActionConfig.ExportConfig
|
|
8594
8899
|
* @instance
|
|
8595
8900
|
*/
|
|
8596
|
-
|
|
8901
|
+
ExportConfig.prototype.filename = "";
|
|
8597
8902
|
|
|
8598
8903
|
/**
|
|
8599
|
-
*
|
|
8904
|
+
* ExportConfig tags.
|
|
8600
8905
|
* @member {Array.<string>} tags
|
|
8601
|
-
* @memberof sqlanvil.ActionConfig.
|
|
8906
|
+
* @memberof sqlanvil.ActionConfig.ExportConfig
|
|
8602
8907
|
* @instance
|
|
8603
8908
|
*/
|
|
8604
|
-
|
|
8909
|
+
ExportConfig.prototype.tags = $util.emptyArray;
|
|
8605
8910
|
|
|
8606
8911
|
/**
|
|
8607
|
-
*
|
|
8912
|
+
* ExportConfig disabled.
|
|
8608
8913
|
* @member {boolean} disabled
|
|
8609
|
-
* @memberof sqlanvil.ActionConfig.
|
|
8914
|
+
* @memberof sqlanvil.ActionConfig.ExportConfig
|
|
8610
8915
|
* @instance
|
|
8611
8916
|
*/
|
|
8612
|
-
|
|
8917
|
+
ExportConfig.prototype.disabled = false;
|
|
8613
8918
|
|
|
8614
8919
|
/**
|
|
8615
|
-
*
|
|
8920
|
+
* ExportConfig description.
|
|
8616
8921
|
* @member {string} description
|
|
8617
|
-
* @memberof sqlanvil.ActionConfig.
|
|
8922
|
+
* @memberof sqlanvil.ActionConfig.ExportConfig
|
|
8618
8923
|
* @instance
|
|
8619
8924
|
*/
|
|
8620
|
-
|
|
8925
|
+
ExportConfig.prototype.description = "";
|
|
8621
8926
|
|
|
8622
8927
|
/**
|
|
8623
|
-
*
|
|
8624
|
-
* @member {boolean}
|
|
8625
|
-
* @memberof sqlanvil.ActionConfig.
|
|
8928
|
+
* ExportConfig hermetic.
|
|
8929
|
+
* @member {boolean} hermetic
|
|
8930
|
+
* @memberof sqlanvil.ActionConfig.ExportConfig
|
|
8626
8931
|
* @instance
|
|
8627
8932
|
*/
|
|
8628
|
-
|
|
8933
|
+
ExportConfig.prototype.hermetic = false;
|
|
8629
8934
|
|
|
8630
8935
|
/**
|
|
8631
|
-
*
|
|
8936
|
+
* ExportConfig export.
|
|
8937
|
+
* @member {sqlanvil.ActionConfig.IExportOptions|null|undefined} export
|
|
8938
|
+
* @memberof sqlanvil.ActionConfig.ExportConfig
|
|
8939
|
+
* @instance
|
|
8940
|
+
*/
|
|
8941
|
+
ExportConfig.prototype["export"] = null;
|
|
8942
|
+
|
|
8943
|
+
/**
|
|
8944
|
+
* Creates a new ExportConfig instance using the specified properties.
|
|
8632
8945
|
* @function create
|
|
8633
|
-
* @memberof sqlanvil.ActionConfig.
|
|
8946
|
+
* @memberof sqlanvil.ActionConfig.ExportConfig
|
|
8634
8947
|
* @static
|
|
8635
|
-
* @param {sqlanvil.ActionConfig.
|
|
8636
|
-
* @returns {sqlanvil.ActionConfig.
|
|
8948
|
+
* @param {sqlanvil.ActionConfig.IExportConfig=} [properties] Properties to set
|
|
8949
|
+
* @returns {sqlanvil.ActionConfig.ExportConfig} ExportConfig instance
|
|
8637
8950
|
*/
|
|
8638
|
-
|
|
8639
|
-
return new
|
|
8951
|
+
ExportConfig.create = function create(properties) {
|
|
8952
|
+
return new ExportConfig(properties);
|
|
8640
8953
|
};
|
|
8641
8954
|
|
|
8642
8955
|
/**
|
|
8643
|
-
* Encodes the specified
|
|
8956
|
+
* Encodes the specified ExportConfig message. Does not implicitly {@link sqlanvil.ActionConfig.ExportConfig.verify|verify} messages.
|
|
8644
8957
|
* @function encode
|
|
8645
|
-
* @memberof sqlanvil.ActionConfig.
|
|
8958
|
+
* @memberof sqlanvil.ActionConfig.ExportConfig
|
|
8646
8959
|
* @static
|
|
8647
|
-
* @param {sqlanvil.ActionConfig.
|
|
8960
|
+
* @param {sqlanvil.ActionConfig.IExportConfig} message ExportConfig message or plain object to encode
|
|
8648
8961
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
8649
8962
|
* @returns {$protobuf.Writer} Writer
|
|
8650
8963
|
*/
|
|
8651
|
-
|
|
8964
|
+
ExportConfig.encode = function encode(message, writer) {
|
|
8652
8965
|
if (!writer)
|
|
8653
8966
|
writer = $Writer.create();
|
|
8654
8967
|
if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
|
8655
8968
|
writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
|
8656
|
-
if (message.
|
|
8657
|
-
writer.uint32(/* id 2, wireType 2 =*/18).string(message.
|
|
8969
|
+
if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset"))
|
|
8970
|
+
writer.uint32(/* id 2, wireType 2 =*/18).string(message.dataset);
|
|
8658
8971
|
if (message.project != null && Object.hasOwnProperty.call(message, "project"))
|
|
8659
8972
|
writer.uint32(/* id 3, wireType 2 =*/26).string(message.project);
|
|
8660
8973
|
if (message.dependencyTargets != null && message.dependencyTargets.length)
|
|
@@ -8669,39 +8982,41 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
8669
8982
|
writer.uint32(/* id 7, wireType 0 =*/56).bool(message.disabled);
|
|
8670
8983
|
if (message.description != null && Object.hasOwnProperty.call(message, "description"))
|
|
8671
8984
|
writer.uint32(/* id 8, wireType 2 =*/66).string(message.description);
|
|
8672
|
-
if (message.
|
|
8673
|
-
writer.uint32(/* id 9, wireType 0 =*/72).bool(message.
|
|
8985
|
+
if (message.hermetic != null && Object.hasOwnProperty.call(message, "hermetic"))
|
|
8986
|
+
writer.uint32(/* id 9, wireType 0 =*/72).bool(message.hermetic);
|
|
8987
|
+
if (message["export"] != null && Object.hasOwnProperty.call(message, "export"))
|
|
8988
|
+
$root.sqlanvil.ActionConfig.ExportOptions.encode(message["export"], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
|
|
8674
8989
|
return writer;
|
|
8675
8990
|
};
|
|
8676
8991
|
|
|
8677
8992
|
/**
|
|
8678
|
-
* Encodes the specified
|
|
8993
|
+
* Encodes the specified ExportConfig message, length delimited. Does not implicitly {@link sqlanvil.ActionConfig.ExportConfig.verify|verify} messages.
|
|
8679
8994
|
* @function encodeDelimited
|
|
8680
|
-
* @memberof sqlanvil.ActionConfig.
|
|
8995
|
+
* @memberof sqlanvil.ActionConfig.ExportConfig
|
|
8681
8996
|
* @static
|
|
8682
|
-
* @param {sqlanvil.ActionConfig.
|
|
8997
|
+
* @param {sqlanvil.ActionConfig.IExportConfig} message ExportConfig message or plain object to encode
|
|
8683
8998
|
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
8684
8999
|
* @returns {$protobuf.Writer} Writer
|
|
8685
9000
|
*/
|
|
8686
|
-
|
|
9001
|
+
ExportConfig.encodeDelimited = function encodeDelimited(message, writer) {
|
|
8687
9002
|
return this.encode(message, writer).ldelim();
|
|
8688
9003
|
};
|
|
8689
9004
|
|
|
8690
9005
|
/**
|
|
8691
|
-
* Decodes
|
|
9006
|
+
* Decodes an ExportConfig message from the specified reader or buffer.
|
|
8692
9007
|
* @function decode
|
|
8693
|
-
* @memberof sqlanvil.ActionConfig.
|
|
9008
|
+
* @memberof sqlanvil.ActionConfig.ExportConfig
|
|
8694
9009
|
* @static
|
|
8695
9010
|
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
8696
9011
|
* @param {number} [length] Message length if known beforehand
|
|
8697
|
-
* @returns {sqlanvil.ActionConfig.
|
|
9012
|
+
* @returns {sqlanvil.ActionConfig.ExportConfig} ExportConfig
|
|
8698
9013
|
* @throws {Error} If the payload is not a reader or valid buffer
|
|
8699
9014
|
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
8700
9015
|
*/
|
|
8701
|
-
|
|
9016
|
+
ExportConfig.decode = function decode(reader, length, error) {
|
|
8702
9017
|
if (!(reader instanceof $Reader))
|
|
8703
9018
|
reader = $Reader.create(reader);
|
|
8704
|
-
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.sqlanvil.ActionConfig.
|
|
9019
|
+
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.sqlanvil.ActionConfig.ExportConfig();
|
|
8705
9020
|
while (reader.pos < end) {
|
|
8706
9021
|
let tag = reader.uint32();
|
|
8707
9022
|
if (tag === error)
|
|
@@ -8712,7 +9027,918 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
8712
9027
|
break;
|
|
8713
9028
|
}
|
|
8714
9029
|
case 2: {
|
|
8715
|
-
message.
|
|
9030
|
+
message.dataset = reader.string();
|
|
9031
|
+
break;
|
|
9032
|
+
}
|
|
9033
|
+
case 3: {
|
|
9034
|
+
message.project = reader.string();
|
|
9035
|
+
break;
|
|
9036
|
+
}
|
|
9037
|
+
case 4: {
|
|
9038
|
+
if (!(message.dependencyTargets && message.dependencyTargets.length))
|
|
9039
|
+
message.dependencyTargets = [];
|
|
9040
|
+
message.dependencyTargets.push($root.sqlanvil.ActionConfig.Target.decode(reader, reader.uint32()));
|
|
9041
|
+
break;
|
|
9042
|
+
}
|
|
9043
|
+
case 5: {
|
|
9044
|
+
message.filename = reader.string();
|
|
9045
|
+
break;
|
|
9046
|
+
}
|
|
9047
|
+
case 6: {
|
|
9048
|
+
if (!(message.tags && message.tags.length))
|
|
9049
|
+
message.tags = [];
|
|
9050
|
+
message.tags.push(reader.string());
|
|
9051
|
+
break;
|
|
9052
|
+
}
|
|
9053
|
+
case 7: {
|
|
9054
|
+
message.disabled = reader.bool();
|
|
9055
|
+
break;
|
|
9056
|
+
}
|
|
9057
|
+
case 8: {
|
|
9058
|
+
message.description = reader.string();
|
|
9059
|
+
break;
|
|
9060
|
+
}
|
|
9061
|
+
case 9: {
|
|
9062
|
+
message.hermetic = reader.bool();
|
|
9063
|
+
break;
|
|
9064
|
+
}
|
|
9065
|
+
case 10: {
|
|
9066
|
+
message["export"] = $root.sqlanvil.ActionConfig.ExportOptions.decode(reader, reader.uint32());
|
|
9067
|
+
break;
|
|
9068
|
+
}
|
|
9069
|
+
default:
|
|
9070
|
+
reader.skipType(tag & 7);
|
|
9071
|
+
break;
|
|
9072
|
+
}
|
|
9073
|
+
}
|
|
9074
|
+
return message;
|
|
9075
|
+
};
|
|
9076
|
+
|
|
9077
|
+
/**
|
|
9078
|
+
* Decodes an ExportConfig message from the specified reader or buffer, length delimited.
|
|
9079
|
+
* @function decodeDelimited
|
|
9080
|
+
* @memberof sqlanvil.ActionConfig.ExportConfig
|
|
9081
|
+
* @static
|
|
9082
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
9083
|
+
* @returns {sqlanvil.ActionConfig.ExportConfig} ExportConfig
|
|
9084
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
9085
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
9086
|
+
*/
|
|
9087
|
+
ExportConfig.decodeDelimited = function decodeDelimited(reader) {
|
|
9088
|
+
if (!(reader instanceof $Reader))
|
|
9089
|
+
reader = new $Reader(reader);
|
|
9090
|
+
return this.decode(reader, reader.uint32());
|
|
9091
|
+
};
|
|
9092
|
+
|
|
9093
|
+
/**
|
|
9094
|
+
* Verifies an ExportConfig message.
|
|
9095
|
+
* @function verify
|
|
9096
|
+
* @memberof sqlanvil.ActionConfig.ExportConfig
|
|
9097
|
+
* @static
|
|
9098
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
9099
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
9100
|
+
*/
|
|
9101
|
+
ExportConfig.verify = function verify(message) {
|
|
9102
|
+
if (typeof message !== "object" || message === null)
|
|
9103
|
+
return "object expected";
|
|
9104
|
+
if (message.name != null && message.hasOwnProperty("name"))
|
|
9105
|
+
if (!$util.isString(message.name))
|
|
9106
|
+
return "name: string expected";
|
|
9107
|
+
if (message.dataset != null && message.hasOwnProperty("dataset"))
|
|
9108
|
+
if (!$util.isString(message.dataset))
|
|
9109
|
+
return "dataset: string expected";
|
|
9110
|
+
if (message.project != null && message.hasOwnProperty("project"))
|
|
9111
|
+
if (!$util.isString(message.project))
|
|
9112
|
+
return "project: string expected";
|
|
9113
|
+
if (message.dependencyTargets != null && message.hasOwnProperty("dependencyTargets")) {
|
|
9114
|
+
if (!Array.isArray(message.dependencyTargets))
|
|
9115
|
+
return "dependencyTargets: array expected";
|
|
9116
|
+
for (let i = 0; i < message.dependencyTargets.length; ++i) {
|
|
9117
|
+
let error = $root.sqlanvil.ActionConfig.Target.verify(message.dependencyTargets[i]);
|
|
9118
|
+
if (error)
|
|
9119
|
+
return "dependencyTargets." + error;
|
|
9120
|
+
}
|
|
9121
|
+
}
|
|
9122
|
+
if (message.filename != null && message.hasOwnProperty("filename"))
|
|
9123
|
+
if (!$util.isString(message.filename))
|
|
9124
|
+
return "filename: string expected";
|
|
9125
|
+
if (message.tags != null && message.hasOwnProperty("tags")) {
|
|
9126
|
+
if (!Array.isArray(message.tags))
|
|
9127
|
+
return "tags: array expected";
|
|
9128
|
+
for (let i = 0; i < message.tags.length; ++i)
|
|
9129
|
+
if (!$util.isString(message.tags[i]))
|
|
9130
|
+
return "tags: string[] expected";
|
|
9131
|
+
}
|
|
9132
|
+
if (message.disabled != null && message.hasOwnProperty("disabled"))
|
|
9133
|
+
if (typeof message.disabled !== "boolean")
|
|
9134
|
+
return "disabled: boolean expected";
|
|
9135
|
+
if (message.description != null && message.hasOwnProperty("description"))
|
|
9136
|
+
if (!$util.isString(message.description))
|
|
9137
|
+
return "description: string expected";
|
|
9138
|
+
if (message.hermetic != null && message.hasOwnProperty("hermetic"))
|
|
9139
|
+
if (typeof message.hermetic !== "boolean")
|
|
9140
|
+
return "hermetic: boolean expected";
|
|
9141
|
+
if (message["export"] != null && message.hasOwnProperty("export")) {
|
|
9142
|
+
let error = $root.sqlanvil.ActionConfig.ExportOptions.verify(message["export"]);
|
|
9143
|
+
if (error)
|
|
9144
|
+
return "export." + error;
|
|
9145
|
+
}
|
|
9146
|
+
return null;
|
|
9147
|
+
};
|
|
9148
|
+
|
|
9149
|
+
/**
|
|
9150
|
+
* Creates an ExportConfig message from a plain object. Also converts values to their respective internal types.
|
|
9151
|
+
* @function fromObject
|
|
9152
|
+
* @memberof sqlanvil.ActionConfig.ExportConfig
|
|
9153
|
+
* @static
|
|
9154
|
+
* @param {Object.<string,*>} object Plain object
|
|
9155
|
+
* @returns {sqlanvil.ActionConfig.ExportConfig} ExportConfig
|
|
9156
|
+
*/
|
|
9157
|
+
ExportConfig.fromObject = function fromObject(object) {
|
|
9158
|
+
if (object instanceof $root.sqlanvil.ActionConfig.ExportConfig)
|
|
9159
|
+
return object;
|
|
9160
|
+
let message = new $root.sqlanvil.ActionConfig.ExportConfig();
|
|
9161
|
+
if (object.name != null)
|
|
9162
|
+
message.name = String(object.name);
|
|
9163
|
+
if (object.dataset != null)
|
|
9164
|
+
message.dataset = String(object.dataset);
|
|
9165
|
+
if (object.project != null)
|
|
9166
|
+
message.project = String(object.project);
|
|
9167
|
+
if (object.dependencyTargets) {
|
|
9168
|
+
if (!Array.isArray(object.dependencyTargets))
|
|
9169
|
+
throw TypeError(".sqlanvil.ActionConfig.ExportConfig.dependencyTargets: array expected");
|
|
9170
|
+
message.dependencyTargets = [];
|
|
9171
|
+
for (let i = 0; i < object.dependencyTargets.length; ++i) {
|
|
9172
|
+
if (typeof object.dependencyTargets[i] !== "object")
|
|
9173
|
+
throw TypeError(".sqlanvil.ActionConfig.ExportConfig.dependencyTargets: object expected");
|
|
9174
|
+
message.dependencyTargets[i] = $root.sqlanvil.ActionConfig.Target.fromObject(object.dependencyTargets[i]);
|
|
9175
|
+
}
|
|
9176
|
+
}
|
|
9177
|
+
if (object.filename != null)
|
|
9178
|
+
message.filename = String(object.filename);
|
|
9179
|
+
if (object.tags) {
|
|
9180
|
+
if (!Array.isArray(object.tags))
|
|
9181
|
+
throw TypeError(".sqlanvil.ActionConfig.ExportConfig.tags: array expected");
|
|
9182
|
+
message.tags = [];
|
|
9183
|
+
for (let i = 0; i < object.tags.length; ++i)
|
|
9184
|
+
message.tags[i] = String(object.tags[i]);
|
|
9185
|
+
}
|
|
9186
|
+
if (object.disabled != null)
|
|
9187
|
+
message.disabled = Boolean(object.disabled);
|
|
9188
|
+
if (object.description != null)
|
|
9189
|
+
message.description = String(object.description);
|
|
9190
|
+
if (object.hermetic != null)
|
|
9191
|
+
message.hermetic = Boolean(object.hermetic);
|
|
9192
|
+
if (object["export"] != null) {
|
|
9193
|
+
if (typeof object["export"] !== "object")
|
|
9194
|
+
throw TypeError(".sqlanvil.ActionConfig.ExportConfig.export: object expected");
|
|
9195
|
+
message["export"] = $root.sqlanvil.ActionConfig.ExportOptions.fromObject(object["export"]);
|
|
9196
|
+
}
|
|
9197
|
+
return message;
|
|
9198
|
+
};
|
|
9199
|
+
|
|
9200
|
+
/**
|
|
9201
|
+
* Creates a plain object from an ExportConfig message. Also converts values to other types if specified.
|
|
9202
|
+
* @function toObject
|
|
9203
|
+
* @memberof sqlanvil.ActionConfig.ExportConfig
|
|
9204
|
+
* @static
|
|
9205
|
+
* @param {sqlanvil.ActionConfig.ExportConfig} message ExportConfig
|
|
9206
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
9207
|
+
* @returns {Object.<string,*>} Plain object
|
|
9208
|
+
*/
|
|
9209
|
+
ExportConfig.toObject = function toObject(message, options) {
|
|
9210
|
+
if (!options)
|
|
9211
|
+
options = {};
|
|
9212
|
+
let object = {};
|
|
9213
|
+
if (options.arrays || options.defaults) {
|
|
9214
|
+
object.dependencyTargets = [];
|
|
9215
|
+
object.tags = [];
|
|
9216
|
+
}
|
|
9217
|
+
if (options.defaults) {
|
|
9218
|
+
object.name = "";
|
|
9219
|
+
object.dataset = "";
|
|
9220
|
+
object.project = "";
|
|
9221
|
+
object.filename = "";
|
|
9222
|
+
object.disabled = false;
|
|
9223
|
+
object.description = "";
|
|
9224
|
+
object.hermetic = false;
|
|
9225
|
+
object["export"] = null;
|
|
9226
|
+
}
|
|
9227
|
+
if (message.name != null && message.hasOwnProperty("name"))
|
|
9228
|
+
object.name = message.name;
|
|
9229
|
+
if (message.dataset != null && message.hasOwnProperty("dataset"))
|
|
9230
|
+
object.dataset = message.dataset;
|
|
9231
|
+
if (message.project != null && message.hasOwnProperty("project"))
|
|
9232
|
+
object.project = message.project;
|
|
9233
|
+
if (message.dependencyTargets && message.dependencyTargets.length) {
|
|
9234
|
+
object.dependencyTargets = [];
|
|
9235
|
+
for (let j = 0; j < message.dependencyTargets.length; ++j)
|
|
9236
|
+
object.dependencyTargets[j] = $root.sqlanvil.ActionConfig.Target.toObject(message.dependencyTargets[j], options);
|
|
9237
|
+
}
|
|
9238
|
+
if (message.filename != null && message.hasOwnProperty("filename"))
|
|
9239
|
+
object.filename = message.filename;
|
|
9240
|
+
if (message.tags && message.tags.length) {
|
|
9241
|
+
object.tags = [];
|
|
9242
|
+
for (let j = 0; j < message.tags.length; ++j)
|
|
9243
|
+
object.tags[j] = message.tags[j];
|
|
9244
|
+
}
|
|
9245
|
+
if (message.disabled != null && message.hasOwnProperty("disabled"))
|
|
9246
|
+
object.disabled = message.disabled;
|
|
9247
|
+
if (message.description != null && message.hasOwnProperty("description"))
|
|
9248
|
+
object.description = message.description;
|
|
9249
|
+
if (message.hermetic != null && message.hasOwnProperty("hermetic"))
|
|
9250
|
+
object.hermetic = message.hermetic;
|
|
9251
|
+
if (message["export"] != null && message.hasOwnProperty("export"))
|
|
9252
|
+
object["export"] = $root.sqlanvil.ActionConfig.ExportOptions.toObject(message["export"], options);
|
|
9253
|
+
return object;
|
|
9254
|
+
};
|
|
9255
|
+
|
|
9256
|
+
/**
|
|
9257
|
+
* Converts this ExportConfig to JSON.
|
|
9258
|
+
* @function toJSON
|
|
9259
|
+
* @memberof sqlanvil.ActionConfig.ExportConfig
|
|
9260
|
+
* @instance
|
|
9261
|
+
* @returns {Object.<string,*>} JSON object
|
|
9262
|
+
*/
|
|
9263
|
+
ExportConfig.prototype.toJSON = function toJSON() {
|
|
9264
|
+
return this.constructor.toObject(this, $protobuf__namespace.util.toJSONOptions);
|
|
9265
|
+
};
|
|
9266
|
+
|
|
9267
|
+
/**
|
|
9268
|
+
* Gets the default type url for ExportConfig
|
|
9269
|
+
* @function getTypeUrl
|
|
9270
|
+
* @memberof sqlanvil.ActionConfig.ExportConfig
|
|
9271
|
+
* @static
|
|
9272
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
9273
|
+
* @returns {string} The default type url
|
|
9274
|
+
*/
|
|
9275
|
+
ExportConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
9276
|
+
if (typeUrlPrefix === undefined) {
|
|
9277
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
9278
|
+
}
|
|
9279
|
+
return typeUrlPrefix + "/sqlanvil.ActionConfig.ExportConfig";
|
|
9280
|
+
};
|
|
9281
|
+
|
|
9282
|
+
return ExportConfig;
|
|
9283
|
+
})();
|
|
9284
|
+
|
|
9285
|
+
ActionConfig.DeclarationConfig = (function() {
|
|
9286
|
+
|
|
9287
|
+
/**
|
|
9288
|
+
* Properties of a DeclarationConfig.
|
|
9289
|
+
* @memberof sqlanvil.ActionConfig
|
|
9290
|
+
* @interface IDeclarationConfig
|
|
9291
|
+
* @property {string|null} [name] DeclarationConfig name
|
|
9292
|
+
* @property {string|null} [dataset] DeclarationConfig dataset
|
|
9293
|
+
* @property {string|null} [project] DeclarationConfig project
|
|
9294
|
+
* @property {string|null} [description] DeclarationConfig description
|
|
9295
|
+
* @property {Array.<sqlanvil.ActionConfig.IColumnDescriptor>|null} [columns] DeclarationConfig columns
|
|
9296
|
+
* @property {string|null} [filename] DeclarationConfig filename
|
|
9297
|
+
* @property {Array.<string>|null} [tags] DeclarationConfig tags
|
|
9298
|
+
* @property {string|null} [connection] DeclarationConfig connection
|
|
9299
|
+
* @property {Object.<string,string>|null} [columnTypes] DeclarationConfig columnTypes
|
|
9300
|
+
*/
|
|
9301
|
+
|
|
9302
|
+
/**
|
|
9303
|
+
* Constructs a new DeclarationConfig.
|
|
9304
|
+
* @memberof sqlanvil.ActionConfig
|
|
9305
|
+
* @classdesc Represents a DeclarationConfig.
|
|
9306
|
+
* @implements IDeclarationConfig
|
|
9307
|
+
* @constructor
|
|
9308
|
+
* @param {sqlanvil.ActionConfig.IDeclarationConfig=} [properties] Properties to set
|
|
9309
|
+
*/
|
|
9310
|
+
function DeclarationConfig(properties) {
|
|
9311
|
+
this.columns = [];
|
|
9312
|
+
this.tags = [];
|
|
9313
|
+
this.columnTypes = {};
|
|
9314
|
+
if (properties)
|
|
9315
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
9316
|
+
if (properties[keys[i]] != null)
|
|
9317
|
+
this[keys[i]] = properties[keys[i]];
|
|
9318
|
+
}
|
|
9319
|
+
|
|
9320
|
+
/**
|
|
9321
|
+
* DeclarationConfig name.
|
|
9322
|
+
* @member {string} name
|
|
9323
|
+
* @memberof sqlanvil.ActionConfig.DeclarationConfig
|
|
9324
|
+
* @instance
|
|
9325
|
+
*/
|
|
9326
|
+
DeclarationConfig.prototype.name = "";
|
|
9327
|
+
|
|
9328
|
+
/**
|
|
9329
|
+
* DeclarationConfig dataset.
|
|
9330
|
+
* @member {string} dataset
|
|
9331
|
+
* @memberof sqlanvil.ActionConfig.DeclarationConfig
|
|
9332
|
+
* @instance
|
|
9333
|
+
*/
|
|
9334
|
+
DeclarationConfig.prototype.dataset = "";
|
|
9335
|
+
|
|
9336
|
+
/**
|
|
9337
|
+
* DeclarationConfig project.
|
|
9338
|
+
* @member {string} project
|
|
9339
|
+
* @memberof sqlanvil.ActionConfig.DeclarationConfig
|
|
9340
|
+
* @instance
|
|
9341
|
+
*/
|
|
9342
|
+
DeclarationConfig.prototype.project = "";
|
|
9343
|
+
|
|
9344
|
+
/**
|
|
9345
|
+
* DeclarationConfig description.
|
|
9346
|
+
* @member {string} description
|
|
9347
|
+
* @memberof sqlanvil.ActionConfig.DeclarationConfig
|
|
9348
|
+
* @instance
|
|
9349
|
+
*/
|
|
9350
|
+
DeclarationConfig.prototype.description = "";
|
|
9351
|
+
|
|
9352
|
+
/**
|
|
9353
|
+
* DeclarationConfig columns.
|
|
9354
|
+
* @member {Array.<sqlanvil.ActionConfig.IColumnDescriptor>} columns
|
|
9355
|
+
* @memberof sqlanvil.ActionConfig.DeclarationConfig
|
|
9356
|
+
* @instance
|
|
9357
|
+
*/
|
|
9358
|
+
DeclarationConfig.prototype.columns = $util.emptyArray;
|
|
9359
|
+
|
|
9360
|
+
/**
|
|
9361
|
+
* DeclarationConfig filename.
|
|
9362
|
+
* @member {string} filename
|
|
9363
|
+
* @memberof sqlanvil.ActionConfig.DeclarationConfig
|
|
9364
|
+
* @instance
|
|
9365
|
+
*/
|
|
9366
|
+
DeclarationConfig.prototype.filename = "";
|
|
9367
|
+
|
|
9368
|
+
/**
|
|
9369
|
+
* DeclarationConfig tags.
|
|
9370
|
+
* @member {Array.<string>} tags
|
|
9371
|
+
* @memberof sqlanvil.ActionConfig.DeclarationConfig
|
|
9372
|
+
* @instance
|
|
9373
|
+
*/
|
|
9374
|
+
DeclarationConfig.prototype.tags = $util.emptyArray;
|
|
9375
|
+
|
|
9376
|
+
/**
|
|
9377
|
+
* DeclarationConfig connection.
|
|
9378
|
+
* @member {string} connection
|
|
9379
|
+
* @memberof sqlanvil.ActionConfig.DeclarationConfig
|
|
9380
|
+
* @instance
|
|
9381
|
+
*/
|
|
9382
|
+
DeclarationConfig.prototype.connection = "";
|
|
9383
|
+
|
|
9384
|
+
/**
|
|
9385
|
+
* DeclarationConfig columnTypes.
|
|
9386
|
+
* @member {Object.<string,string>} columnTypes
|
|
9387
|
+
* @memberof sqlanvil.ActionConfig.DeclarationConfig
|
|
9388
|
+
* @instance
|
|
9389
|
+
*/
|
|
9390
|
+
DeclarationConfig.prototype.columnTypes = $util.emptyObject;
|
|
9391
|
+
|
|
9392
|
+
/**
|
|
9393
|
+
* Creates a new DeclarationConfig instance using the specified properties.
|
|
9394
|
+
* @function create
|
|
9395
|
+
* @memberof sqlanvil.ActionConfig.DeclarationConfig
|
|
9396
|
+
* @static
|
|
9397
|
+
* @param {sqlanvil.ActionConfig.IDeclarationConfig=} [properties] Properties to set
|
|
9398
|
+
* @returns {sqlanvil.ActionConfig.DeclarationConfig} DeclarationConfig instance
|
|
9399
|
+
*/
|
|
9400
|
+
DeclarationConfig.create = function create(properties) {
|
|
9401
|
+
return new DeclarationConfig(properties);
|
|
9402
|
+
};
|
|
9403
|
+
|
|
9404
|
+
/**
|
|
9405
|
+
* Encodes the specified DeclarationConfig message. Does not implicitly {@link sqlanvil.ActionConfig.DeclarationConfig.verify|verify} messages.
|
|
9406
|
+
* @function encode
|
|
9407
|
+
* @memberof sqlanvil.ActionConfig.DeclarationConfig
|
|
9408
|
+
* @static
|
|
9409
|
+
* @param {sqlanvil.ActionConfig.IDeclarationConfig} message DeclarationConfig message or plain object to encode
|
|
9410
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
9411
|
+
* @returns {$protobuf.Writer} Writer
|
|
9412
|
+
*/
|
|
9413
|
+
DeclarationConfig.encode = function encode(message, writer) {
|
|
9414
|
+
if (!writer)
|
|
9415
|
+
writer = $Writer.create();
|
|
9416
|
+
if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
|
9417
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
|
9418
|
+
if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset"))
|
|
9419
|
+
writer.uint32(/* id 2, wireType 2 =*/18).string(message.dataset);
|
|
9420
|
+
if (message.project != null && Object.hasOwnProperty.call(message, "project"))
|
|
9421
|
+
writer.uint32(/* id 3, wireType 2 =*/26).string(message.project);
|
|
9422
|
+
if (message.description != null && Object.hasOwnProperty.call(message, "description"))
|
|
9423
|
+
writer.uint32(/* id 4, wireType 2 =*/34).string(message.description);
|
|
9424
|
+
if (message.columns != null && message.columns.length)
|
|
9425
|
+
for (let i = 0; i < message.columns.length; ++i)
|
|
9426
|
+
$root.sqlanvil.ActionConfig.ColumnDescriptor.encode(message.columns[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
|
|
9427
|
+
if (message.filename != null && Object.hasOwnProperty.call(message, "filename"))
|
|
9428
|
+
writer.uint32(/* id 6, wireType 2 =*/50).string(message.filename);
|
|
9429
|
+
if (message.tags != null && message.tags.length)
|
|
9430
|
+
for (let i = 0; i < message.tags.length; ++i)
|
|
9431
|
+
writer.uint32(/* id 7, wireType 2 =*/58).string(message.tags[i]);
|
|
9432
|
+
if (message.connection != null && Object.hasOwnProperty.call(message, "connection"))
|
|
9433
|
+
writer.uint32(/* id 8, wireType 2 =*/66).string(message.connection);
|
|
9434
|
+
if (message.columnTypes != null && Object.hasOwnProperty.call(message, "columnTypes"))
|
|
9435
|
+
for (let keys = Object.keys(message.columnTypes), i = 0; i < keys.length; ++i)
|
|
9436
|
+
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();
|
|
9437
|
+
return writer;
|
|
9438
|
+
};
|
|
9439
|
+
|
|
9440
|
+
/**
|
|
9441
|
+
* Encodes the specified DeclarationConfig message, length delimited. Does not implicitly {@link sqlanvil.ActionConfig.DeclarationConfig.verify|verify} messages.
|
|
9442
|
+
* @function encodeDelimited
|
|
9443
|
+
* @memberof sqlanvil.ActionConfig.DeclarationConfig
|
|
9444
|
+
* @static
|
|
9445
|
+
* @param {sqlanvil.ActionConfig.IDeclarationConfig} message DeclarationConfig message or plain object to encode
|
|
9446
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
9447
|
+
* @returns {$protobuf.Writer} Writer
|
|
9448
|
+
*/
|
|
9449
|
+
DeclarationConfig.encodeDelimited = function encodeDelimited(message, writer) {
|
|
9450
|
+
return this.encode(message, writer).ldelim();
|
|
9451
|
+
};
|
|
9452
|
+
|
|
9453
|
+
/**
|
|
9454
|
+
* Decodes a DeclarationConfig message from the specified reader or buffer.
|
|
9455
|
+
* @function decode
|
|
9456
|
+
* @memberof sqlanvil.ActionConfig.DeclarationConfig
|
|
9457
|
+
* @static
|
|
9458
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
9459
|
+
* @param {number} [length] Message length if known beforehand
|
|
9460
|
+
* @returns {sqlanvil.ActionConfig.DeclarationConfig} DeclarationConfig
|
|
9461
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
9462
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
9463
|
+
*/
|
|
9464
|
+
DeclarationConfig.decode = function decode(reader, length, error) {
|
|
9465
|
+
if (!(reader instanceof $Reader))
|
|
9466
|
+
reader = $Reader.create(reader);
|
|
9467
|
+
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.sqlanvil.ActionConfig.DeclarationConfig(), key, value;
|
|
9468
|
+
while (reader.pos < end) {
|
|
9469
|
+
let tag = reader.uint32();
|
|
9470
|
+
if (tag === error)
|
|
9471
|
+
break;
|
|
9472
|
+
switch (tag >>> 3) {
|
|
9473
|
+
case 1: {
|
|
9474
|
+
message.name = reader.string();
|
|
9475
|
+
break;
|
|
9476
|
+
}
|
|
9477
|
+
case 2: {
|
|
9478
|
+
message.dataset = reader.string();
|
|
9479
|
+
break;
|
|
9480
|
+
}
|
|
9481
|
+
case 3: {
|
|
9482
|
+
message.project = reader.string();
|
|
9483
|
+
break;
|
|
9484
|
+
}
|
|
9485
|
+
case 4: {
|
|
9486
|
+
message.description = reader.string();
|
|
9487
|
+
break;
|
|
9488
|
+
}
|
|
9489
|
+
case 5: {
|
|
9490
|
+
if (!(message.columns && message.columns.length))
|
|
9491
|
+
message.columns = [];
|
|
9492
|
+
message.columns.push($root.sqlanvil.ActionConfig.ColumnDescriptor.decode(reader, reader.uint32()));
|
|
9493
|
+
break;
|
|
9494
|
+
}
|
|
9495
|
+
case 6: {
|
|
9496
|
+
message.filename = reader.string();
|
|
9497
|
+
break;
|
|
9498
|
+
}
|
|
9499
|
+
case 7: {
|
|
9500
|
+
if (!(message.tags && message.tags.length))
|
|
9501
|
+
message.tags = [];
|
|
9502
|
+
message.tags.push(reader.string());
|
|
9503
|
+
break;
|
|
9504
|
+
}
|
|
9505
|
+
case 8: {
|
|
9506
|
+
message.connection = reader.string();
|
|
9507
|
+
break;
|
|
9508
|
+
}
|
|
9509
|
+
case 9: {
|
|
9510
|
+
if (message.columnTypes === $util.emptyObject)
|
|
9511
|
+
message.columnTypes = {};
|
|
9512
|
+
let end2 = reader.uint32() + reader.pos;
|
|
9513
|
+
key = "";
|
|
9514
|
+
value = "";
|
|
9515
|
+
while (reader.pos < end2) {
|
|
9516
|
+
let tag2 = reader.uint32();
|
|
9517
|
+
switch (tag2 >>> 3) {
|
|
9518
|
+
case 1:
|
|
9519
|
+
key = reader.string();
|
|
9520
|
+
break;
|
|
9521
|
+
case 2:
|
|
9522
|
+
value = reader.string();
|
|
9523
|
+
break;
|
|
9524
|
+
default:
|
|
9525
|
+
reader.skipType(tag2 & 7);
|
|
9526
|
+
break;
|
|
9527
|
+
}
|
|
9528
|
+
}
|
|
9529
|
+
message.columnTypes[key] = value;
|
|
9530
|
+
break;
|
|
9531
|
+
}
|
|
9532
|
+
default:
|
|
9533
|
+
reader.skipType(tag & 7);
|
|
9534
|
+
break;
|
|
9535
|
+
}
|
|
9536
|
+
}
|
|
9537
|
+
return message;
|
|
9538
|
+
};
|
|
9539
|
+
|
|
9540
|
+
/**
|
|
9541
|
+
* Decodes a DeclarationConfig message from the specified reader or buffer, length delimited.
|
|
9542
|
+
* @function decodeDelimited
|
|
9543
|
+
* @memberof sqlanvil.ActionConfig.DeclarationConfig
|
|
9544
|
+
* @static
|
|
9545
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
9546
|
+
* @returns {sqlanvil.ActionConfig.DeclarationConfig} DeclarationConfig
|
|
9547
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
9548
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
9549
|
+
*/
|
|
9550
|
+
DeclarationConfig.decodeDelimited = function decodeDelimited(reader) {
|
|
9551
|
+
if (!(reader instanceof $Reader))
|
|
9552
|
+
reader = new $Reader(reader);
|
|
9553
|
+
return this.decode(reader, reader.uint32());
|
|
9554
|
+
};
|
|
9555
|
+
|
|
9556
|
+
/**
|
|
9557
|
+
* Verifies a DeclarationConfig message.
|
|
9558
|
+
* @function verify
|
|
9559
|
+
* @memberof sqlanvil.ActionConfig.DeclarationConfig
|
|
9560
|
+
* @static
|
|
9561
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
9562
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
9563
|
+
*/
|
|
9564
|
+
DeclarationConfig.verify = function verify(message) {
|
|
9565
|
+
if (typeof message !== "object" || message === null)
|
|
9566
|
+
return "object expected";
|
|
9567
|
+
if (message.name != null && message.hasOwnProperty("name"))
|
|
9568
|
+
if (!$util.isString(message.name))
|
|
9569
|
+
return "name: string expected";
|
|
9570
|
+
if (message.dataset != null && message.hasOwnProperty("dataset"))
|
|
9571
|
+
if (!$util.isString(message.dataset))
|
|
9572
|
+
return "dataset: string expected";
|
|
9573
|
+
if (message.project != null && message.hasOwnProperty("project"))
|
|
9574
|
+
if (!$util.isString(message.project))
|
|
9575
|
+
return "project: string expected";
|
|
9576
|
+
if (message.description != null && message.hasOwnProperty("description"))
|
|
9577
|
+
if (!$util.isString(message.description))
|
|
9578
|
+
return "description: string expected";
|
|
9579
|
+
if (message.columns != null && message.hasOwnProperty("columns")) {
|
|
9580
|
+
if (!Array.isArray(message.columns))
|
|
9581
|
+
return "columns: array expected";
|
|
9582
|
+
for (let i = 0; i < message.columns.length; ++i) {
|
|
9583
|
+
let error = $root.sqlanvil.ActionConfig.ColumnDescriptor.verify(message.columns[i]);
|
|
9584
|
+
if (error)
|
|
9585
|
+
return "columns." + error;
|
|
9586
|
+
}
|
|
9587
|
+
}
|
|
9588
|
+
if (message.filename != null && message.hasOwnProperty("filename"))
|
|
9589
|
+
if (!$util.isString(message.filename))
|
|
9590
|
+
return "filename: string expected";
|
|
9591
|
+
if (message.tags != null && message.hasOwnProperty("tags")) {
|
|
9592
|
+
if (!Array.isArray(message.tags))
|
|
9593
|
+
return "tags: array expected";
|
|
9594
|
+
for (let i = 0; i < message.tags.length; ++i)
|
|
9595
|
+
if (!$util.isString(message.tags[i]))
|
|
9596
|
+
return "tags: string[] expected";
|
|
9597
|
+
}
|
|
9598
|
+
if (message.connection != null && message.hasOwnProperty("connection"))
|
|
9599
|
+
if (!$util.isString(message.connection))
|
|
9600
|
+
return "connection: string expected";
|
|
9601
|
+
if (message.columnTypes != null && message.hasOwnProperty("columnTypes")) {
|
|
9602
|
+
if (!$util.isObject(message.columnTypes))
|
|
9603
|
+
return "columnTypes: object expected";
|
|
9604
|
+
let key = Object.keys(message.columnTypes);
|
|
9605
|
+
for (let i = 0; i < key.length; ++i)
|
|
9606
|
+
if (!$util.isString(message.columnTypes[key[i]]))
|
|
9607
|
+
return "columnTypes: string{k:string} expected";
|
|
9608
|
+
}
|
|
9609
|
+
return null;
|
|
9610
|
+
};
|
|
9611
|
+
|
|
9612
|
+
/**
|
|
9613
|
+
* Creates a DeclarationConfig message from a plain object. Also converts values to their respective internal types.
|
|
9614
|
+
* @function fromObject
|
|
9615
|
+
* @memberof sqlanvil.ActionConfig.DeclarationConfig
|
|
9616
|
+
* @static
|
|
9617
|
+
* @param {Object.<string,*>} object Plain object
|
|
9618
|
+
* @returns {sqlanvil.ActionConfig.DeclarationConfig} DeclarationConfig
|
|
9619
|
+
*/
|
|
9620
|
+
DeclarationConfig.fromObject = function fromObject(object) {
|
|
9621
|
+
if (object instanceof $root.sqlanvil.ActionConfig.DeclarationConfig)
|
|
9622
|
+
return object;
|
|
9623
|
+
let message = new $root.sqlanvil.ActionConfig.DeclarationConfig();
|
|
9624
|
+
if (object.name != null)
|
|
9625
|
+
message.name = String(object.name);
|
|
9626
|
+
if (object.dataset != null)
|
|
9627
|
+
message.dataset = String(object.dataset);
|
|
9628
|
+
if (object.project != null)
|
|
9629
|
+
message.project = String(object.project);
|
|
9630
|
+
if (object.description != null)
|
|
9631
|
+
message.description = String(object.description);
|
|
9632
|
+
if (object.columns) {
|
|
9633
|
+
if (!Array.isArray(object.columns))
|
|
9634
|
+
throw TypeError(".sqlanvil.ActionConfig.DeclarationConfig.columns: array expected");
|
|
9635
|
+
message.columns = [];
|
|
9636
|
+
for (let i = 0; i < object.columns.length; ++i) {
|
|
9637
|
+
if (typeof object.columns[i] !== "object")
|
|
9638
|
+
throw TypeError(".sqlanvil.ActionConfig.DeclarationConfig.columns: object expected");
|
|
9639
|
+
message.columns[i] = $root.sqlanvil.ActionConfig.ColumnDescriptor.fromObject(object.columns[i]);
|
|
9640
|
+
}
|
|
9641
|
+
}
|
|
9642
|
+
if (object.filename != null)
|
|
9643
|
+
message.filename = String(object.filename);
|
|
9644
|
+
if (object.tags) {
|
|
9645
|
+
if (!Array.isArray(object.tags))
|
|
9646
|
+
throw TypeError(".sqlanvil.ActionConfig.DeclarationConfig.tags: array expected");
|
|
9647
|
+
message.tags = [];
|
|
9648
|
+
for (let i = 0; i < object.tags.length; ++i)
|
|
9649
|
+
message.tags[i] = String(object.tags[i]);
|
|
9650
|
+
}
|
|
9651
|
+
if (object.connection != null)
|
|
9652
|
+
message.connection = String(object.connection);
|
|
9653
|
+
if (object.columnTypes) {
|
|
9654
|
+
if (typeof object.columnTypes !== "object")
|
|
9655
|
+
throw TypeError(".sqlanvil.ActionConfig.DeclarationConfig.columnTypes: object expected");
|
|
9656
|
+
message.columnTypes = {};
|
|
9657
|
+
for (let keys = Object.keys(object.columnTypes), i = 0; i < keys.length; ++i)
|
|
9658
|
+
message.columnTypes[keys[i]] = String(object.columnTypes[keys[i]]);
|
|
9659
|
+
}
|
|
9660
|
+
return message;
|
|
9661
|
+
};
|
|
9662
|
+
|
|
9663
|
+
/**
|
|
9664
|
+
* Creates a plain object from a DeclarationConfig message. Also converts values to other types if specified.
|
|
9665
|
+
* @function toObject
|
|
9666
|
+
* @memberof sqlanvil.ActionConfig.DeclarationConfig
|
|
9667
|
+
* @static
|
|
9668
|
+
* @param {sqlanvil.ActionConfig.DeclarationConfig} message DeclarationConfig
|
|
9669
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
9670
|
+
* @returns {Object.<string,*>} Plain object
|
|
9671
|
+
*/
|
|
9672
|
+
DeclarationConfig.toObject = function toObject(message, options) {
|
|
9673
|
+
if (!options)
|
|
9674
|
+
options = {};
|
|
9675
|
+
let object = {};
|
|
9676
|
+
if (options.arrays || options.defaults) {
|
|
9677
|
+
object.columns = [];
|
|
9678
|
+
object.tags = [];
|
|
9679
|
+
}
|
|
9680
|
+
if (options.objects || options.defaults)
|
|
9681
|
+
object.columnTypes = {};
|
|
9682
|
+
if (options.defaults) {
|
|
9683
|
+
object.name = "";
|
|
9684
|
+
object.dataset = "";
|
|
9685
|
+
object.project = "";
|
|
9686
|
+
object.description = "";
|
|
9687
|
+
object.filename = "";
|
|
9688
|
+
object.connection = "";
|
|
9689
|
+
}
|
|
9690
|
+
if (message.name != null && message.hasOwnProperty("name"))
|
|
9691
|
+
object.name = message.name;
|
|
9692
|
+
if (message.dataset != null && message.hasOwnProperty("dataset"))
|
|
9693
|
+
object.dataset = message.dataset;
|
|
9694
|
+
if (message.project != null && message.hasOwnProperty("project"))
|
|
9695
|
+
object.project = message.project;
|
|
9696
|
+
if (message.description != null && message.hasOwnProperty("description"))
|
|
9697
|
+
object.description = message.description;
|
|
9698
|
+
if (message.columns && message.columns.length) {
|
|
9699
|
+
object.columns = [];
|
|
9700
|
+
for (let j = 0; j < message.columns.length; ++j)
|
|
9701
|
+
object.columns[j] = $root.sqlanvil.ActionConfig.ColumnDescriptor.toObject(message.columns[j], options);
|
|
9702
|
+
}
|
|
9703
|
+
if (message.filename != null && message.hasOwnProperty("filename"))
|
|
9704
|
+
object.filename = message.filename;
|
|
9705
|
+
if (message.tags && message.tags.length) {
|
|
9706
|
+
object.tags = [];
|
|
9707
|
+
for (let j = 0; j < message.tags.length; ++j)
|
|
9708
|
+
object.tags[j] = message.tags[j];
|
|
9709
|
+
}
|
|
9710
|
+
if (message.connection != null && message.hasOwnProperty("connection"))
|
|
9711
|
+
object.connection = message.connection;
|
|
9712
|
+
let keys2;
|
|
9713
|
+
if (message.columnTypes && (keys2 = Object.keys(message.columnTypes)).length) {
|
|
9714
|
+
object.columnTypes = {};
|
|
9715
|
+
for (let j = 0; j < keys2.length; ++j)
|
|
9716
|
+
object.columnTypes[keys2[j]] = message.columnTypes[keys2[j]];
|
|
9717
|
+
}
|
|
9718
|
+
return object;
|
|
9719
|
+
};
|
|
9720
|
+
|
|
9721
|
+
/**
|
|
9722
|
+
* Converts this DeclarationConfig to JSON.
|
|
9723
|
+
* @function toJSON
|
|
9724
|
+
* @memberof sqlanvil.ActionConfig.DeclarationConfig
|
|
9725
|
+
* @instance
|
|
9726
|
+
* @returns {Object.<string,*>} JSON object
|
|
9727
|
+
*/
|
|
9728
|
+
DeclarationConfig.prototype.toJSON = function toJSON() {
|
|
9729
|
+
return this.constructor.toObject(this, $protobuf__namespace.util.toJSONOptions);
|
|
9730
|
+
};
|
|
9731
|
+
|
|
9732
|
+
/**
|
|
9733
|
+
* Gets the default type url for DeclarationConfig
|
|
9734
|
+
* @function getTypeUrl
|
|
9735
|
+
* @memberof sqlanvil.ActionConfig.DeclarationConfig
|
|
9736
|
+
* @static
|
|
9737
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
9738
|
+
* @returns {string} The default type url
|
|
9739
|
+
*/
|
|
9740
|
+
DeclarationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
9741
|
+
if (typeUrlPrefix === undefined) {
|
|
9742
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
9743
|
+
}
|
|
9744
|
+
return typeUrlPrefix + "/sqlanvil.ActionConfig.DeclarationConfig";
|
|
9745
|
+
};
|
|
9746
|
+
|
|
9747
|
+
return DeclarationConfig;
|
|
9748
|
+
})();
|
|
9749
|
+
|
|
9750
|
+
ActionConfig.NotebookConfig = (function() {
|
|
9751
|
+
|
|
9752
|
+
/**
|
|
9753
|
+
* Properties of a NotebookConfig.
|
|
9754
|
+
* @memberof sqlanvil.ActionConfig
|
|
9755
|
+
* @interface INotebookConfig
|
|
9756
|
+
* @property {string|null} [name] NotebookConfig name
|
|
9757
|
+
* @property {string|null} [location] NotebookConfig location
|
|
9758
|
+
* @property {string|null} [project] NotebookConfig project
|
|
9759
|
+
* @property {Array.<sqlanvil.ActionConfig.ITarget>|null} [dependencyTargets] NotebookConfig dependencyTargets
|
|
9760
|
+
* @property {string|null} [filename] NotebookConfig filename
|
|
9761
|
+
* @property {Array.<string>|null} [tags] NotebookConfig tags
|
|
9762
|
+
* @property {boolean|null} [disabled] NotebookConfig disabled
|
|
9763
|
+
* @property {string|null} [description] NotebookConfig description
|
|
9764
|
+
* @property {boolean|null} [dependOnDependencyAssertions] NotebookConfig dependOnDependencyAssertions
|
|
9765
|
+
*/
|
|
9766
|
+
|
|
9767
|
+
/**
|
|
9768
|
+
* Constructs a new NotebookConfig.
|
|
9769
|
+
* @memberof sqlanvil.ActionConfig
|
|
9770
|
+
* @classdesc Represents a NotebookConfig.
|
|
9771
|
+
* @implements INotebookConfig
|
|
9772
|
+
* @constructor
|
|
9773
|
+
* @param {sqlanvil.ActionConfig.INotebookConfig=} [properties] Properties to set
|
|
9774
|
+
*/
|
|
9775
|
+
function NotebookConfig(properties) {
|
|
9776
|
+
this.dependencyTargets = [];
|
|
9777
|
+
this.tags = [];
|
|
9778
|
+
if (properties)
|
|
9779
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
9780
|
+
if (properties[keys[i]] != null)
|
|
9781
|
+
this[keys[i]] = properties[keys[i]];
|
|
9782
|
+
}
|
|
9783
|
+
|
|
9784
|
+
/**
|
|
9785
|
+
* NotebookConfig name.
|
|
9786
|
+
* @member {string} name
|
|
9787
|
+
* @memberof sqlanvil.ActionConfig.NotebookConfig
|
|
9788
|
+
* @instance
|
|
9789
|
+
*/
|
|
9790
|
+
NotebookConfig.prototype.name = "";
|
|
9791
|
+
|
|
9792
|
+
/**
|
|
9793
|
+
* NotebookConfig location.
|
|
9794
|
+
* @member {string} location
|
|
9795
|
+
* @memberof sqlanvil.ActionConfig.NotebookConfig
|
|
9796
|
+
* @instance
|
|
9797
|
+
*/
|
|
9798
|
+
NotebookConfig.prototype.location = "";
|
|
9799
|
+
|
|
9800
|
+
/**
|
|
9801
|
+
* NotebookConfig project.
|
|
9802
|
+
* @member {string} project
|
|
9803
|
+
* @memberof sqlanvil.ActionConfig.NotebookConfig
|
|
9804
|
+
* @instance
|
|
9805
|
+
*/
|
|
9806
|
+
NotebookConfig.prototype.project = "";
|
|
9807
|
+
|
|
9808
|
+
/**
|
|
9809
|
+
* NotebookConfig dependencyTargets.
|
|
9810
|
+
* @member {Array.<sqlanvil.ActionConfig.ITarget>} dependencyTargets
|
|
9811
|
+
* @memberof sqlanvil.ActionConfig.NotebookConfig
|
|
9812
|
+
* @instance
|
|
9813
|
+
*/
|
|
9814
|
+
NotebookConfig.prototype.dependencyTargets = $util.emptyArray;
|
|
9815
|
+
|
|
9816
|
+
/**
|
|
9817
|
+
* NotebookConfig filename.
|
|
9818
|
+
* @member {string} filename
|
|
9819
|
+
* @memberof sqlanvil.ActionConfig.NotebookConfig
|
|
9820
|
+
* @instance
|
|
9821
|
+
*/
|
|
9822
|
+
NotebookConfig.prototype.filename = "";
|
|
9823
|
+
|
|
9824
|
+
/**
|
|
9825
|
+
* NotebookConfig tags.
|
|
9826
|
+
* @member {Array.<string>} tags
|
|
9827
|
+
* @memberof sqlanvil.ActionConfig.NotebookConfig
|
|
9828
|
+
* @instance
|
|
9829
|
+
*/
|
|
9830
|
+
NotebookConfig.prototype.tags = $util.emptyArray;
|
|
9831
|
+
|
|
9832
|
+
/**
|
|
9833
|
+
* NotebookConfig disabled.
|
|
9834
|
+
* @member {boolean} disabled
|
|
9835
|
+
* @memberof sqlanvil.ActionConfig.NotebookConfig
|
|
9836
|
+
* @instance
|
|
9837
|
+
*/
|
|
9838
|
+
NotebookConfig.prototype.disabled = false;
|
|
9839
|
+
|
|
9840
|
+
/**
|
|
9841
|
+
* NotebookConfig description.
|
|
9842
|
+
* @member {string} description
|
|
9843
|
+
* @memberof sqlanvil.ActionConfig.NotebookConfig
|
|
9844
|
+
* @instance
|
|
9845
|
+
*/
|
|
9846
|
+
NotebookConfig.prototype.description = "";
|
|
9847
|
+
|
|
9848
|
+
/**
|
|
9849
|
+
* NotebookConfig dependOnDependencyAssertions.
|
|
9850
|
+
* @member {boolean} dependOnDependencyAssertions
|
|
9851
|
+
* @memberof sqlanvil.ActionConfig.NotebookConfig
|
|
9852
|
+
* @instance
|
|
9853
|
+
*/
|
|
9854
|
+
NotebookConfig.prototype.dependOnDependencyAssertions = false;
|
|
9855
|
+
|
|
9856
|
+
/**
|
|
9857
|
+
* Creates a new NotebookConfig instance using the specified properties.
|
|
9858
|
+
* @function create
|
|
9859
|
+
* @memberof sqlanvil.ActionConfig.NotebookConfig
|
|
9860
|
+
* @static
|
|
9861
|
+
* @param {sqlanvil.ActionConfig.INotebookConfig=} [properties] Properties to set
|
|
9862
|
+
* @returns {sqlanvil.ActionConfig.NotebookConfig} NotebookConfig instance
|
|
9863
|
+
*/
|
|
9864
|
+
NotebookConfig.create = function create(properties) {
|
|
9865
|
+
return new NotebookConfig(properties);
|
|
9866
|
+
};
|
|
9867
|
+
|
|
9868
|
+
/**
|
|
9869
|
+
* Encodes the specified NotebookConfig message. Does not implicitly {@link sqlanvil.ActionConfig.NotebookConfig.verify|verify} messages.
|
|
9870
|
+
* @function encode
|
|
9871
|
+
* @memberof sqlanvil.ActionConfig.NotebookConfig
|
|
9872
|
+
* @static
|
|
9873
|
+
* @param {sqlanvil.ActionConfig.INotebookConfig} message NotebookConfig message or plain object to encode
|
|
9874
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
9875
|
+
* @returns {$protobuf.Writer} Writer
|
|
9876
|
+
*/
|
|
9877
|
+
NotebookConfig.encode = function encode(message, writer) {
|
|
9878
|
+
if (!writer)
|
|
9879
|
+
writer = $Writer.create();
|
|
9880
|
+
if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
|
9881
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
|
9882
|
+
if (message.location != null && Object.hasOwnProperty.call(message, "location"))
|
|
9883
|
+
writer.uint32(/* id 2, wireType 2 =*/18).string(message.location);
|
|
9884
|
+
if (message.project != null && Object.hasOwnProperty.call(message, "project"))
|
|
9885
|
+
writer.uint32(/* id 3, wireType 2 =*/26).string(message.project);
|
|
9886
|
+
if (message.dependencyTargets != null && message.dependencyTargets.length)
|
|
9887
|
+
for (let i = 0; i < message.dependencyTargets.length; ++i)
|
|
9888
|
+
$root.sqlanvil.ActionConfig.Target.encode(message.dependencyTargets[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
|
9889
|
+
if (message.filename != null && Object.hasOwnProperty.call(message, "filename"))
|
|
9890
|
+
writer.uint32(/* id 5, wireType 2 =*/42).string(message.filename);
|
|
9891
|
+
if (message.tags != null && message.tags.length)
|
|
9892
|
+
for (let i = 0; i < message.tags.length; ++i)
|
|
9893
|
+
writer.uint32(/* id 6, wireType 2 =*/50).string(message.tags[i]);
|
|
9894
|
+
if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled"))
|
|
9895
|
+
writer.uint32(/* id 7, wireType 0 =*/56).bool(message.disabled);
|
|
9896
|
+
if (message.description != null && Object.hasOwnProperty.call(message, "description"))
|
|
9897
|
+
writer.uint32(/* id 8, wireType 2 =*/66).string(message.description);
|
|
9898
|
+
if (message.dependOnDependencyAssertions != null && Object.hasOwnProperty.call(message, "dependOnDependencyAssertions"))
|
|
9899
|
+
writer.uint32(/* id 9, wireType 0 =*/72).bool(message.dependOnDependencyAssertions);
|
|
9900
|
+
return writer;
|
|
9901
|
+
};
|
|
9902
|
+
|
|
9903
|
+
/**
|
|
9904
|
+
* Encodes the specified NotebookConfig message, length delimited. Does not implicitly {@link sqlanvil.ActionConfig.NotebookConfig.verify|verify} messages.
|
|
9905
|
+
* @function encodeDelimited
|
|
9906
|
+
* @memberof sqlanvil.ActionConfig.NotebookConfig
|
|
9907
|
+
* @static
|
|
9908
|
+
* @param {sqlanvil.ActionConfig.INotebookConfig} message NotebookConfig message or plain object to encode
|
|
9909
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
9910
|
+
* @returns {$protobuf.Writer} Writer
|
|
9911
|
+
*/
|
|
9912
|
+
NotebookConfig.encodeDelimited = function encodeDelimited(message, writer) {
|
|
9913
|
+
return this.encode(message, writer).ldelim();
|
|
9914
|
+
};
|
|
9915
|
+
|
|
9916
|
+
/**
|
|
9917
|
+
* Decodes a NotebookConfig message from the specified reader or buffer.
|
|
9918
|
+
* @function decode
|
|
9919
|
+
* @memberof sqlanvil.ActionConfig.NotebookConfig
|
|
9920
|
+
* @static
|
|
9921
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
9922
|
+
* @param {number} [length] Message length if known beforehand
|
|
9923
|
+
* @returns {sqlanvil.ActionConfig.NotebookConfig} NotebookConfig
|
|
9924
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
9925
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
9926
|
+
*/
|
|
9927
|
+
NotebookConfig.decode = function decode(reader, length, error) {
|
|
9928
|
+
if (!(reader instanceof $Reader))
|
|
9929
|
+
reader = $Reader.create(reader);
|
|
9930
|
+
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.sqlanvil.ActionConfig.NotebookConfig();
|
|
9931
|
+
while (reader.pos < end) {
|
|
9932
|
+
let tag = reader.uint32();
|
|
9933
|
+
if (tag === error)
|
|
9934
|
+
break;
|
|
9935
|
+
switch (tag >>> 3) {
|
|
9936
|
+
case 1: {
|
|
9937
|
+
message.name = reader.string();
|
|
9938
|
+
break;
|
|
9939
|
+
}
|
|
9940
|
+
case 2: {
|
|
9941
|
+
message.location = reader.string();
|
|
8716
9942
|
break;
|
|
8717
9943
|
}
|
|
8718
9944
|
case 3: {
|
|
@@ -21549,6 +22775,648 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
21549
22775
|
return Operation;
|
|
21550
22776
|
})();
|
|
21551
22777
|
|
|
22778
|
+
sqlanvil.Export = (function() {
|
|
22779
|
+
|
|
22780
|
+
/**
|
|
22781
|
+
* Properties of an Export.
|
|
22782
|
+
* @memberof sqlanvil
|
|
22783
|
+
* @interface IExport
|
|
22784
|
+
* @property {sqlanvil.ITarget|null} [target] Export target
|
|
22785
|
+
* @property {sqlanvil.ITarget|null} [canonicalTarget] Export canonicalTarget
|
|
22786
|
+
* @property {Array.<sqlanvil.ITarget>|null} [dependencyTargets] Export dependencyTargets
|
|
22787
|
+
* @property {sqlanvil.ActionHermeticity|null} [hermeticity] Export hermeticity
|
|
22788
|
+
* @property {boolean|null} [disabled] Export disabled
|
|
22789
|
+
* @property {Array.<string>|null} [tags] Export tags
|
|
22790
|
+
* @property {sqlanvil.IActionDescriptor|null} [actionDescriptor] Export actionDescriptor
|
|
22791
|
+
* @property {string|null} [query] Export query
|
|
22792
|
+
* @property {string|null} [location] Export location
|
|
22793
|
+
* @property {string|null} [format] Export format
|
|
22794
|
+
* @property {boolean|null} [overwrite] Export overwrite
|
|
22795
|
+
* @property {string|null} [filename] Export filename
|
|
22796
|
+
* @property {Object.<string,string>|null} [options] Export options
|
|
22797
|
+
* @property {string|null} [fileName] Export fileName
|
|
22798
|
+
* @property {string|null} [jitCode] Export jitCode
|
|
22799
|
+
*/
|
|
22800
|
+
|
|
22801
|
+
/**
|
|
22802
|
+
* Constructs a new Export.
|
|
22803
|
+
* @memberof sqlanvil
|
|
22804
|
+
* @classdesc Represents an Export.
|
|
22805
|
+
* @implements IExport
|
|
22806
|
+
* @constructor
|
|
22807
|
+
* @param {sqlanvil.IExport=} [properties] Properties to set
|
|
22808
|
+
*/
|
|
22809
|
+
function Export(properties) {
|
|
22810
|
+
this.dependencyTargets = [];
|
|
22811
|
+
this.tags = [];
|
|
22812
|
+
this.options = {};
|
|
22813
|
+
if (properties)
|
|
22814
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
22815
|
+
if (properties[keys[i]] != null)
|
|
22816
|
+
this[keys[i]] = properties[keys[i]];
|
|
22817
|
+
}
|
|
22818
|
+
|
|
22819
|
+
/**
|
|
22820
|
+
* Export target.
|
|
22821
|
+
* @member {sqlanvil.ITarget|null|undefined} target
|
|
22822
|
+
* @memberof sqlanvil.Export
|
|
22823
|
+
* @instance
|
|
22824
|
+
*/
|
|
22825
|
+
Export.prototype.target = null;
|
|
22826
|
+
|
|
22827
|
+
/**
|
|
22828
|
+
* Export canonicalTarget.
|
|
22829
|
+
* @member {sqlanvil.ITarget|null|undefined} canonicalTarget
|
|
22830
|
+
* @memberof sqlanvil.Export
|
|
22831
|
+
* @instance
|
|
22832
|
+
*/
|
|
22833
|
+
Export.prototype.canonicalTarget = null;
|
|
22834
|
+
|
|
22835
|
+
/**
|
|
22836
|
+
* Export dependencyTargets.
|
|
22837
|
+
* @member {Array.<sqlanvil.ITarget>} dependencyTargets
|
|
22838
|
+
* @memberof sqlanvil.Export
|
|
22839
|
+
* @instance
|
|
22840
|
+
*/
|
|
22841
|
+
Export.prototype.dependencyTargets = $util.emptyArray;
|
|
22842
|
+
|
|
22843
|
+
/**
|
|
22844
|
+
* Export hermeticity.
|
|
22845
|
+
* @member {sqlanvil.ActionHermeticity} hermeticity
|
|
22846
|
+
* @memberof sqlanvil.Export
|
|
22847
|
+
* @instance
|
|
22848
|
+
*/
|
|
22849
|
+
Export.prototype.hermeticity = 0;
|
|
22850
|
+
|
|
22851
|
+
/**
|
|
22852
|
+
* Export disabled.
|
|
22853
|
+
* @member {boolean} disabled
|
|
22854
|
+
* @memberof sqlanvil.Export
|
|
22855
|
+
* @instance
|
|
22856
|
+
*/
|
|
22857
|
+
Export.prototype.disabled = false;
|
|
22858
|
+
|
|
22859
|
+
/**
|
|
22860
|
+
* Export tags.
|
|
22861
|
+
* @member {Array.<string>} tags
|
|
22862
|
+
* @memberof sqlanvil.Export
|
|
22863
|
+
* @instance
|
|
22864
|
+
*/
|
|
22865
|
+
Export.prototype.tags = $util.emptyArray;
|
|
22866
|
+
|
|
22867
|
+
/**
|
|
22868
|
+
* Export actionDescriptor.
|
|
22869
|
+
* @member {sqlanvil.IActionDescriptor|null|undefined} actionDescriptor
|
|
22870
|
+
* @memberof sqlanvil.Export
|
|
22871
|
+
* @instance
|
|
22872
|
+
*/
|
|
22873
|
+
Export.prototype.actionDescriptor = null;
|
|
22874
|
+
|
|
22875
|
+
/**
|
|
22876
|
+
* Export query.
|
|
22877
|
+
* @member {string} query
|
|
22878
|
+
* @memberof sqlanvil.Export
|
|
22879
|
+
* @instance
|
|
22880
|
+
*/
|
|
22881
|
+
Export.prototype.query = "";
|
|
22882
|
+
|
|
22883
|
+
/**
|
|
22884
|
+
* Export location.
|
|
22885
|
+
* @member {string} location
|
|
22886
|
+
* @memberof sqlanvil.Export
|
|
22887
|
+
* @instance
|
|
22888
|
+
*/
|
|
22889
|
+
Export.prototype.location = "";
|
|
22890
|
+
|
|
22891
|
+
/**
|
|
22892
|
+
* Export format.
|
|
22893
|
+
* @member {string} format
|
|
22894
|
+
* @memberof sqlanvil.Export
|
|
22895
|
+
* @instance
|
|
22896
|
+
*/
|
|
22897
|
+
Export.prototype.format = "";
|
|
22898
|
+
|
|
22899
|
+
/**
|
|
22900
|
+
* Export overwrite.
|
|
22901
|
+
* @member {boolean} overwrite
|
|
22902
|
+
* @memberof sqlanvil.Export
|
|
22903
|
+
* @instance
|
|
22904
|
+
*/
|
|
22905
|
+
Export.prototype.overwrite = false;
|
|
22906
|
+
|
|
22907
|
+
/**
|
|
22908
|
+
* Export filename.
|
|
22909
|
+
* @member {string} filename
|
|
22910
|
+
* @memberof sqlanvil.Export
|
|
22911
|
+
* @instance
|
|
22912
|
+
*/
|
|
22913
|
+
Export.prototype.filename = "";
|
|
22914
|
+
|
|
22915
|
+
/**
|
|
22916
|
+
* Export options.
|
|
22917
|
+
* @member {Object.<string,string>} options
|
|
22918
|
+
* @memberof sqlanvil.Export
|
|
22919
|
+
* @instance
|
|
22920
|
+
*/
|
|
22921
|
+
Export.prototype.options = $util.emptyObject;
|
|
22922
|
+
|
|
22923
|
+
/**
|
|
22924
|
+
* Export fileName.
|
|
22925
|
+
* @member {string} fileName
|
|
22926
|
+
* @memberof sqlanvil.Export
|
|
22927
|
+
* @instance
|
|
22928
|
+
*/
|
|
22929
|
+
Export.prototype.fileName = "";
|
|
22930
|
+
|
|
22931
|
+
/**
|
|
22932
|
+
* Export jitCode.
|
|
22933
|
+
* @member {string} jitCode
|
|
22934
|
+
* @memberof sqlanvil.Export
|
|
22935
|
+
* @instance
|
|
22936
|
+
*/
|
|
22937
|
+
Export.prototype.jitCode = "";
|
|
22938
|
+
|
|
22939
|
+
/**
|
|
22940
|
+
* Creates a new Export instance using the specified properties.
|
|
22941
|
+
* @function create
|
|
22942
|
+
* @memberof sqlanvil.Export
|
|
22943
|
+
* @static
|
|
22944
|
+
* @param {sqlanvil.IExport=} [properties] Properties to set
|
|
22945
|
+
* @returns {sqlanvil.Export} Export instance
|
|
22946
|
+
*/
|
|
22947
|
+
Export.create = function create(properties) {
|
|
22948
|
+
return new Export(properties);
|
|
22949
|
+
};
|
|
22950
|
+
|
|
22951
|
+
/**
|
|
22952
|
+
* Encodes the specified Export message. Does not implicitly {@link sqlanvil.Export.verify|verify} messages.
|
|
22953
|
+
* @function encode
|
|
22954
|
+
* @memberof sqlanvil.Export
|
|
22955
|
+
* @static
|
|
22956
|
+
* @param {sqlanvil.IExport} message Export message or plain object to encode
|
|
22957
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
22958
|
+
* @returns {$protobuf.Writer} Writer
|
|
22959
|
+
*/
|
|
22960
|
+
Export.encode = function encode(message, writer) {
|
|
22961
|
+
if (!writer)
|
|
22962
|
+
writer = $Writer.create();
|
|
22963
|
+
if (message.target != null && Object.hasOwnProperty.call(message, "target"))
|
|
22964
|
+
$root.sqlanvil.Target.encode(message.target, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
|
|
22965
|
+
if (message.canonicalTarget != null && Object.hasOwnProperty.call(message, "canonicalTarget"))
|
|
22966
|
+
$root.sqlanvil.Target.encode(message.canonicalTarget, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
22967
|
+
if (message.dependencyTargets != null && message.dependencyTargets.length)
|
|
22968
|
+
for (let i = 0; i < message.dependencyTargets.length; ++i)
|
|
22969
|
+
$root.sqlanvil.Target.encode(message.dependencyTargets[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
|
22970
|
+
if (message.hermeticity != null && Object.hasOwnProperty.call(message, "hermeticity"))
|
|
22971
|
+
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.hermeticity);
|
|
22972
|
+
if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled"))
|
|
22973
|
+
writer.uint32(/* id 5, wireType 0 =*/40).bool(message.disabled);
|
|
22974
|
+
if (message.tags != null && message.tags.length)
|
|
22975
|
+
for (let i = 0; i < message.tags.length; ++i)
|
|
22976
|
+
writer.uint32(/* id 6, wireType 2 =*/50).string(message.tags[i]);
|
|
22977
|
+
if (message.actionDescriptor != null && Object.hasOwnProperty.call(message, "actionDescriptor"))
|
|
22978
|
+
$root.sqlanvil.ActionDescriptor.encode(message.actionDescriptor, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
|
|
22979
|
+
if (message.query != null && Object.hasOwnProperty.call(message, "query"))
|
|
22980
|
+
writer.uint32(/* id 8, wireType 2 =*/66).string(message.query);
|
|
22981
|
+
if (message.location != null && Object.hasOwnProperty.call(message, "location"))
|
|
22982
|
+
writer.uint32(/* id 9, wireType 2 =*/74).string(message.location);
|
|
22983
|
+
if (message.format != null && Object.hasOwnProperty.call(message, "format"))
|
|
22984
|
+
writer.uint32(/* id 10, wireType 2 =*/82).string(message.format);
|
|
22985
|
+
if (message.overwrite != null && Object.hasOwnProperty.call(message, "overwrite"))
|
|
22986
|
+
writer.uint32(/* id 11, wireType 0 =*/88).bool(message.overwrite);
|
|
22987
|
+
if (message.filename != null && Object.hasOwnProperty.call(message, "filename"))
|
|
22988
|
+
writer.uint32(/* id 12, wireType 2 =*/98).string(message.filename);
|
|
22989
|
+
if (message.options != null && Object.hasOwnProperty.call(message, "options"))
|
|
22990
|
+
for (let keys = Object.keys(message.options), i = 0; i < keys.length; ++i)
|
|
22991
|
+
writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.options[keys[i]]).ldelim();
|
|
22992
|
+
if (message.fileName != null && Object.hasOwnProperty.call(message, "fileName"))
|
|
22993
|
+
writer.uint32(/* id 14, wireType 2 =*/114).string(message.fileName);
|
|
22994
|
+
if (message.jitCode != null && Object.hasOwnProperty.call(message, "jitCode"))
|
|
22995
|
+
writer.uint32(/* id 15, wireType 2 =*/122).string(message.jitCode);
|
|
22996
|
+
return writer;
|
|
22997
|
+
};
|
|
22998
|
+
|
|
22999
|
+
/**
|
|
23000
|
+
* Encodes the specified Export message, length delimited. Does not implicitly {@link sqlanvil.Export.verify|verify} messages.
|
|
23001
|
+
* @function encodeDelimited
|
|
23002
|
+
* @memberof sqlanvil.Export
|
|
23003
|
+
* @static
|
|
23004
|
+
* @param {sqlanvil.IExport} message Export message or plain object to encode
|
|
23005
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
23006
|
+
* @returns {$protobuf.Writer} Writer
|
|
23007
|
+
*/
|
|
23008
|
+
Export.encodeDelimited = function encodeDelimited(message, writer) {
|
|
23009
|
+
return this.encode(message, writer).ldelim();
|
|
23010
|
+
};
|
|
23011
|
+
|
|
23012
|
+
/**
|
|
23013
|
+
* Decodes an Export message from the specified reader or buffer.
|
|
23014
|
+
* @function decode
|
|
23015
|
+
* @memberof sqlanvil.Export
|
|
23016
|
+
* @static
|
|
23017
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
23018
|
+
* @param {number} [length] Message length if known beforehand
|
|
23019
|
+
* @returns {sqlanvil.Export} Export
|
|
23020
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
23021
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
23022
|
+
*/
|
|
23023
|
+
Export.decode = function decode(reader, length, error) {
|
|
23024
|
+
if (!(reader instanceof $Reader))
|
|
23025
|
+
reader = $Reader.create(reader);
|
|
23026
|
+
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.sqlanvil.Export(), key, value;
|
|
23027
|
+
while (reader.pos < end) {
|
|
23028
|
+
let tag = reader.uint32();
|
|
23029
|
+
if (tag === error)
|
|
23030
|
+
break;
|
|
23031
|
+
switch (tag >>> 3) {
|
|
23032
|
+
case 1: {
|
|
23033
|
+
message.target = $root.sqlanvil.Target.decode(reader, reader.uint32());
|
|
23034
|
+
break;
|
|
23035
|
+
}
|
|
23036
|
+
case 2: {
|
|
23037
|
+
message.canonicalTarget = $root.sqlanvil.Target.decode(reader, reader.uint32());
|
|
23038
|
+
break;
|
|
23039
|
+
}
|
|
23040
|
+
case 3: {
|
|
23041
|
+
if (!(message.dependencyTargets && message.dependencyTargets.length))
|
|
23042
|
+
message.dependencyTargets = [];
|
|
23043
|
+
message.dependencyTargets.push($root.sqlanvil.Target.decode(reader, reader.uint32()));
|
|
23044
|
+
break;
|
|
23045
|
+
}
|
|
23046
|
+
case 4: {
|
|
23047
|
+
message.hermeticity = reader.int32();
|
|
23048
|
+
break;
|
|
23049
|
+
}
|
|
23050
|
+
case 5: {
|
|
23051
|
+
message.disabled = reader.bool();
|
|
23052
|
+
break;
|
|
23053
|
+
}
|
|
23054
|
+
case 6: {
|
|
23055
|
+
if (!(message.tags && message.tags.length))
|
|
23056
|
+
message.tags = [];
|
|
23057
|
+
message.tags.push(reader.string());
|
|
23058
|
+
break;
|
|
23059
|
+
}
|
|
23060
|
+
case 7: {
|
|
23061
|
+
message.actionDescriptor = $root.sqlanvil.ActionDescriptor.decode(reader, reader.uint32());
|
|
23062
|
+
break;
|
|
23063
|
+
}
|
|
23064
|
+
case 8: {
|
|
23065
|
+
message.query = reader.string();
|
|
23066
|
+
break;
|
|
23067
|
+
}
|
|
23068
|
+
case 9: {
|
|
23069
|
+
message.location = reader.string();
|
|
23070
|
+
break;
|
|
23071
|
+
}
|
|
23072
|
+
case 10: {
|
|
23073
|
+
message.format = reader.string();
|
|
23074
|
+
break;
|
|
23075
|
+
}
|
|
23076
|
+
case 11: {
|
|
23077
|
+
message.overwrite = reader.bool();
|
|
23078
|
+
break;
|
|
23079
|
+
}
|
|
23080
|
+
case 12: {
|
|
23081
|
+
message.filename = reader.string();
|
|
23082
|
+
break;
|
|
23083
|
+
}
|
|
23084
|
+
case 13: {
|
|
23085
|
+
if (message.options === $util.emptyObject)
|
|
23086
|
+
message.options = {};
|
|
23087
|
+
let end2 = reader.uint32() + reader.pos;
|
|
23088
|
+
key = "";
|
|
23089
|
+
value = "";
|
|
23090
|
+
while (reader.pos < end2) {
|
|
23091
|
+
let tag2 = reader.uint32();
|
|
23092
|
+
switch (tag2 >>> 3) {
|
|
23093
|
+
case 1:
|
|
23094
|
+
key = reader.string();
|
|
23095
|
+
break;
|
|
23096
|
+
case 2:
|
|
23097
|
+
value = reader.string();
|
|
23098
|
+
break;
|
|
23099
|
+
default:
|
|
23100
|
+
reader.skipType(tag2 & 7);
|
|
23101
|
+
break;
|
|
23102
|
+
}
|
|
23103
|
+
}
|
|
23104
|
+
message.options[key] = value;
|
|
23105
|
+
break;
|
|
23106
|
+
}
|
|
23107
|
+
case 14: {
|
|
23108
|
+
message.fileName = reader.string();
|
|
23109
|
+
break;
|
|
23110
|
+
}
|
|
23111
|
+
case 15: {
|
|
23112
|
+
message.jitCode = reader.string();
|
|
23113
|
+
break;
|
|
23114
|
+
}
|
|
23115
|
+
default:
|
|
23116
|
+
reader.skipType(tag & 7);
|
|
23117
|
+
break;
|
|
23118
|
+
}
|
|
23119
|
+
}
|
|
23120
|
+
return message;
|
|
23121
|
+
};
|
|
23122
|
+
|
|
23123
|
+
/**
|
|
23124
|
+
* Decodes an Export message from the specified reader or buffer, length delimited.
|
|
23125
|
+
* @function decodeDelimited
|
|
23126
|
+
* @memberof sqlanvil.Export
|
|
23127
|
+
* @static
|
|
23128
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
23129
|
+
* @returns {sqlanvil.Export} Export
|
|
23130
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
23131
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
23132
|
+
*/
|
|
23133
|
+
Export.decodeDelimited = function decodeDelimited(reader) {
|
|
23134
|
+
if (!(reader instanceof $Reader))
|
|
23135
|
+
reader = new $Reader(reader);
|
|
23136
|
+
return this.decode(reader, reader.uint32());
|
|
23137
|
+
};
|
|
23138
|
+
|
|
23139
|
+
/**
|
|
23140
|
+
* Verifies an Export message.
|
|
23141
|
+
* @function verify
|
|
23142
|
+
* @memberof sqlanvil.Export
|
|
23143
|
+
* @static
|
|
23144
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
23145
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
23146
|
+
*/
|
|
23147
|
+
Export.verify = function verify(message) {
|
|
23148
|
+
if (typeof message !== "object" || message === null)
|
|
23149
|
+
return "object expected";
|
|
23150
|
+
if (message.target != null && message.hasOwnProperty("target")) {
|
|
23151
|
+
let error = $root.sqlanvil.Target.verify(message.target);
|
|
23152
|
+
if (error)
|
|
23153
|
+
return "target." + error;
|
|
23154
|
+
}
|
|
23155
|
+
if (message.canonicalTarget != null && message.hasOwnProperty("canonicalTarget")) {
|
|
23156
|
+
let error = $root.sqlanvil.Target.verify(message.canonicalTarget);
|
|
23157
|
+
if (error)
|
|
23158
|
+
return "canonicalTarget." + error;
|
|
23159
|
+
}
|
|
23160
|
+
if (message.dependencyTargets != null && message.hasOwnProperty("dependencyTargets")) {
|
|
23161
|
+
if (!Array.isArray(message.dependencyTargets))
|
|
23162
|
+
return "dependencyTargets: array expected";
|
|
23163
|
+
for (let i = 0; i < message.dependencyTargets.length; ++i) {
|
|
23164
|
+
let error = $root.sqlanvil.Target.verify(message.dependencyTargets[i]);
|
|
23165
|
+
if (error)
|
|
23166
|
+
return "dependencyTargets." + error;
|
|
23167
|
+
}
|
|
23168
|
+
}
|
|
23169
|
+
if (message.hermeticity != null && message.hasOwnProperty("hermeticity"))
|
|
23170
|
+
switch (message.hermeticity) {
|
|
23171
|
+
default:
|
|
23172
|
+
return "hermeticity: enum value expected";
|
|
23173
|
+
case 0:
|
|
23174
|
+
case 1:
|
|
23175
|
+
case 2:
|
|
23176
|
+
break;
|
|
23177
|
+
}
|
|
23178
|
+
if (message.disabled != null && message.hasOwnProperty("disabled"))
|
|
23179
|
+
if (typeof message.disabled !== "boolean")
|
|
23180
|
+
return "disabled: boolean expected";
|
|
23181
|
+
if (message.tags != null && message.hasOwnProperty("tags")) {
|
|
23182
|
+
if (!Array.isArray(message.tags))
|
|
23183
|
+
return "tags: array expected";
|
|
23184
|
+
for (let i = 0; i < message.tags.length; ++i)
|
|
23185
|
+
if (!$util.isString(message.tags[i]))
|
|
23186
|
+
return "tags: string[] expected";
|
|
23187
|
+
}
|
|
23188
|
+
if (message.actionDescriptor != null && message.hasOwnProperty("actionDescriptor")) {
|
|
23189
|
+
let error = $root.sqlanvil.ActionDescriptor.verify(message.actionDescriptor);
|
|
23190
|
+
if (error)
|
|
23191
|
+
return "actionDescriptor." + error;
|
|
23192
|
+
}
|
|
23193
|
+
if (message.query != null && message.hasOwnProperty("query"))
|
|
23194
|
+
if (!$util.isString(message.query))
|
|
23195
|
+
return "query: string expected";
|
|
23196
|
+
if (message.location != null && message.hasOwnProperty("location"))
|
|
23197
|
+
if (!$util.isString(message.location))
|
|
23198
|
+
return "location: string expected";
|
|
23199
|
+
if (message.format != null && message.hasOwnProperty("format"))
|
|
23200
|
+
if (!$util.isString(message.format))
|
|
23201
|
+
return "format: string expected";
|
|
23202
|
+
if (message.overwrite != null && message.hasOwnProperty("overwrite"))
|
|
23203
|
+
if (typeof message.overwrite !== "boolean")
|
|
23204
|
+
return "overwrite: boolean expected";
|
|
23205
|
+
if (message.filename != null && message.hasOwnProperty("filename"))
|
|
23206
|
+
if (!$util.isString(message.filename))
|
|
23207
|
+
return "filename: string expected";
|
|
23208
|
+
if (message.options != null && message.hasOwnProperty("options")) {
|
|
23209
|
+
if (!$util.isObject(message.options))
|
|
23210
|
+
return "options: object expected";
|
|
23211
|
+
let key = Object.keys(message.options);
|
|
23212
|
+
for (let i = 0; i < key.length; ++i)
|
|
23213
|
+
if (!$util.isString(message.options[key[i]]))
|
|
23214
|
+
return "options: string{k:string} expected";
|
|
23215
|
+
}
|
|
23216
|
+
if (message.fileName != null && message.hasOwnProperty("fileName"))
|
|
23217
|
+
if (!$util.isString(message.fileName))
|
|
23218
|
+
return "fileName: string expected";
|
|
23219
|
+
if (message.jitCode != null && message.hasOwnProperty("jitCode"))
|
|
23220
|
+
if (!$util.isString(message.jitCode))
|
|
23221
|
+
return "jitCode: string expected";
|
|
23222
|
+
return null;
|
|
23223
|
+
};
|
|
23224
|
+
|
|
23225
|
+
/**
|
|
23226
|
+
* Creates an Export message from a plain object. Also converts values to their respective internal types.
|
|
23227
|
+
* @function fromObject
|
|
23228
|
+
* @memberof sqlanvil.Export
|
|
23229
|
+
* @static
|
|
23230
|
+
* @param {Object.<string,*>} object Plain object
|
|
23231
|
+
* @returns {sqlanvil.Export} Export
|
|
23232
|
+
*/
|
|
23233
|
+
Export.fromObject = function fromObject(object) {
|
|
23234
|
+
if (object instanceof $root.sqlanvil.Export)
|
|
23235
|
+
return object;
|
|
23236
|
+
let message = new $root.sqlanvil.Export();
|
|
23237
|
+
if (object.target != null) {
|
|
23238
|
+
if (typeof object.target !== "object")
|
|
23239
|
+
throw TypeError(".sqlanvil.Export.target: object expected");
|
|
23240
|
+
message.target = $root.sqlanvil.Target.fromObject(object.target);
|
|
23241
|
+
}
|
|
23242
|
+
if (object.canonicalTarget != null) {
|
|
23243
|
+
if (typeof object.canonicalTarget !== "object")
|
|
23244
|
+
throw TypeError(".sqlanvil.Export.canonicalTarget: object expected");
|
|
23245
|
+
message.canonicalTarget = $root.sqlanvil.Target.fromObject(object.canonicalTarget);
|
|
23246
|
+
}
|
|
23247
|
+
if (object.dependencyTargets) {
|
|
23248
|
+
if (!Array.isArray(object.dependencyTargets))
|
|
23249
|
+
throw TypeError(".sqlanvil.Export.dependencyTargets: array expected");
|
|
23250
|
+
message.dependencyTargets = [];
|
|
23251
|
+
for (let i = 0; i < object.dependencyTargets.length; ++i) {
|
|
23252
|
+
if (typeof object.dependencyTargets[i] !== "object")
|
|
23253
|
+
throw TypeError(".sqlanvil.Export.dependencyTargets: object expected");
|
|
23254
|
+
message.dependencyTargets[i] = $root.sqlanvil.Target.fromObject(object.dependencyTargets[i]);
|
|
23255
|
+
}
|
|
23256
|
+
}
|
|
23257
|
+
switch (object.hermeticity) {
|
|
23258
|
+
default:
|
|
23259
|
+
if (typeof object.hermeticity === "number") {
|
|
23260
|
+
message.hermeticity = object.hermeticity;
|
|
23261
|
+
break;
|
|
23262
|
+
}
|
|
23263
|
+
break;
|
|
23264
|
+
case "UNKNOWN":
|
|
23265
|
+
case 0:
|
|
23266
|
+
message.hermeticity = 0;
|
|
23267
|
+
break;
|
|
23268
|
+
case "HERMETIC":
|
|
23269
|
+
case 1:
|
|
23270
|
+
message.hermeticity = 1;
|
|
23271
|
+
break;
|
|
23272
|
+
case "NON_HERMETIC":
|
|
23273
|
+
case 2:
|
|
23274
|
+
message.hermeticity = 2;
|
|
23275
|
+
break;
|
|
23276
|
+
}
|
|
23277
|
+
if (object.disabled != null)
|
|
23278
|
+
message.disabled = Boolean(object.disabled);
|
|
23279
|
+
if (object.tags) {
|
|
23280
|
+
if (!Array.isArray(object.tags))
|
|
23281
|
+
throw TypeError(".sqlanvil.Export.tags: array expected");
|
|
23282
|
+
message.tags = [];
|
|
23283
|
+
for (let i = 0; i < object.tags.length; ++i)
|
|
23284
|
+
message.tags[i] = String(object.tags[i]);
|
|
23285
|
+
}
|
|
23286
|
+
if (object.actionDescriptor != null) {
|
|
23287
|
+
if (typeof object.actionDescriptor !== "object")
|
|
23288
|
+
throw TypeError(".sqlanvil.Export.actionDescriptor: object expected");
|
|
23289
|
+
message.actionDescriptor = $root.sqlanvil.ActionDescriptor.fromObject(object.actionDescriptor);
|
|
23290
|
+
}
|
|
23291
|
+
if (object.query != null)
|
|
23292
|
+
message.query = String(object.query);
|
|
23293
|
+
if (object.location != null)
|
|
23294
|
+
message.location = String(object.location);
|
|
23295
|
+
if (object.format != null)
|
|
23296
|
+
message.format = String(object.format);
|
|
23297
|
+
if (object.overwrite != null)
|
|
23298
|
+
message.overwrite = Boolean(object.overwrite);
|
|
23299
|
+
if (object.filename != null)
|
|
23300
|
+
message.filename = String(object.filename);
|
|
23301
|
+
if (object.options) {
|
|
23302
|
+
if (typeof object.options !== "object")
|
|
23303
|
+
throw TypeError(".sqlanvil.Export.options: object expected");
|
|
23304
|
+
message.options = {};
|
|
23305
|
+
for (let keys = Object.keys(object.options), i = 0; i < keys.length; ++i)
|
|
23306
|
+
message.options[keys[i]] = String(object.options[keys[i]]);
|
|
23307
|
+
}
|
|
23308
|
+
if (object.fileName != null)
|
|
23309
|
+
message.fileName = String(object.fileName);
|
|
23310
|
+
if (object.jitCode != null)
|
|
23311
|
+
message.jitCode = String(object.jitCode);
|
|
23312
|
+
return message;
|
|
23313
|
+
};
|
|
23314
|
+
|
|
23315
|
+
/**
|
|
23316
|
+
* Creates a plain object from an Export message. Also converts values to other types if specified.
|
|
23317
|
+
* @function toObject
|
|
23318
|
+
* @memberof sqlanvil.Export
|
|
23319
|
+
* @static
|
|
23320
|
+
* @param {sqlanvil.Export} message Export
|
|
23321
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
23322
|
+
* @returns {Object.<string,*>} Plain object
|
|
23323
|
+
*/
|
|
23324
|
+
Export.toObject = function toObject(message, options) {
|
|
23325
|
+
if (!options)
|
|
23326
|
+
options = {};
|
|
23327
|
+
let object = {};
|
|
23328
|
+
if (options.arrays || options.defaults) {
|
|
23329
|
+
object.dependencyTargets = [];
|
|
23330
|
+
object.tags = [];
|
|
23331
|
+
}
|
|
23332
|
+
if (options.objects || options.defaults)
|
|
23333
|
+
object.options = {};
|
|
23334
|
+
if (options.defaults) {
|
|
23335
|
+
object.target = null;
|
|
23336
|
+
object.canonicalTarget = null;
|
|
23337
|
+
object.hermeticity = options.enums === String ? "UNKNOWN" : 0;
|
|
23338
|
+
object.disabled = false;
|
|
23339
|
+
object.actionDescriptor = null;
|
|
23340
|
+
object.query = "";
|
|
23341
|
+
object.location = "";
|
|
23342
|
+
object.format = "";
|
|
23343
|
+
object.overwrite = false;
|
|
23344
|
+
object.filename = "";
|
|
23345
|
+
object.fileName = "";
|
|
23346
|
+
object.jitCode = "";
|
|
23347
|
+
}
|
|
23348
|
+
if (message.target != null && message.hasOwnProperty("target"))
|
|
23349
|
+
object.target = $root.sqlanvil.Target.toObject(message.target, options);
|
|
23350
|
+
if (message.canonicalTarget != null && message.hasOwnProperty("canonicalTarget"))
|
|
23351
|
+
object.canonicalTarget = $root.sqlanvil.Target.toObject(message.canonicalTarget, options);
|
|
23352
|
+
if (message.dependencyTargets && message.dependencyTargets.length) {
|
|
23353
|
+
object.dependencyTargets = [];
|
|
23354
|
+
for (let j = 0; j < message.dependencyTargets.length; ++j)
|
|
23355
|
+
object.dependencyTargets[j] = $root.sqlanvil.Target.toObject(message.dependencyTargets[j], options);
|
|
23356
|
+
}
|
|
23357
|
+
if (message.hermeticity != null && message.hasOwnProperty("hermeticity"))
|
|
23358
|
+
object.hermeticity = options.enums === String ? $root.sqlanvil.ActionHermeticity[message.hermeticity] === undefined ? message.hermeticity : $root.sqlanvil.ActionHermeticity[message.hermeticity] : message.hermeticity;
|
|
23359
|
+
if (message.disabled != null && message.hasOwnProperty("disabled"))
|
|
23360
|
+
object.disabled = message.disabled;
|
|
23361
|
+
if (message.tags && message.tags.length) {
|
|
23362
|
+
object.tags = [];
|
|
23363
|
+
for (let j = 0; j < message.tags.length; ++j)
|
|
23364
|
+
object.tags[j] = message.tags[j];
|
|
23365
|
+
}
|
|
23366
|
+
if (message.actionDescriptor != null && message.hasOwnProperty("actionDescriptor"))
|
|
23367
|
+
object.actionDescriptor = $root.sqlanvil.ActionDescriptor.toObject(message.actionDescriptor, options);
|
|
23368
|
+
if (message.query != null && message.hasOwnProperty("query"))
|
|
23369
|
+
object.query = message.query;
|
|
23370
|
+
if (message.location != null && message.hasOwnProperty("location"))
|
|
23371
|
+
object.location = message.location;
|
|
23372
|
+
if (message.format != null && message.hasOwnProperty("format"))
|
|
23373
|
+
object.format = message.format;
|
|
23374
|
+
if (message.overwrite != null && message.hasOwnProperty("overwrite"))
|
|
23375
|
+
object.overwrite = message.overwrite;
|
|
23376
|
+
if (message.filename != null && message.hasOwnProperty("filename"))
|
|
23377
|
+
object.filename = message.filename;
|
|
23378
|
+
let keys2;
|
|
23379
|
+
if (message.options && (keys2 = Object.keys(message.options)).length) {
|
|
23380
|
+
object.options = {};
|
|
23381
|
+
for (let j = 0; j < keys2.length; ++j)
|
|
23382
|
+
object.options[keys2[j]] = message.options[keys2[j]];
|
|
23383
|
+
}
|
|
23384
|
+
if (message.fileName != null && message.hasOwnProperty("fileName"))
|
|
23385
|
+
object.fileName = message.fileName;
|
|
23386
|
+
if (message.jitCode != null && message.hasOwnProperty("jitCode"))
|
|
23387
|
+
object.jitCode = message.jitCode;
|
|
23388
|
+
return object;
|
|
23389
|
+
};
|
|
23390
|
+
|
|
23391
|
+
/**
|
|
23392
|
+
* Converts this Export to JSON.
|
|
23393
|
+
* @function toJSON
|
|
23394
|
+
* @memberof sqlanvil.Export
|
|
23395
|
+
* @instance
|
|
23396
|
+
* @returns {Object.<string,*>} JSON object
|
|
23397
|
+
*/
|
|
23398
|
+
Export.prototype.toJSON = function toJSON() {
|
|
23399
|
+
return this.constructor.toObject(this, $protobuf__namespace.util.toJSONOptions);
|
|
23400
|
+
};
|
|
23401
|
+
|
|
23402
|
+
/**
|
|
23403
|
+
* Gets the default type url for Export
|
|
23404
|
+
* @function getTypeUrl
|
|
23405
|
+
* @memberof sqlanvil.Export
|
|
23406
|
+
* @static
|
|
23407
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
23408
|
+
* @returns {string} The default type url
|
|
23409
|
+
*/
|
|
23410
|
+
Export.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
23411
|
+
if (typeUrlPrefix === undefined) {
|
|
23412
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
23413
|
+
}
|
|
23414
|
+
return typeUrlPrefix + "/sqlanvil.Export";
|
|
23415
|
+
};
|
|
23416
|
+
|
|
23417
|
+
return Export;
|
|
23418
|
+
})();
|
|
23419
|
+
|
|
21552
23420
|
sqlanvil.Assertion = (function() {
|
|
21553
23421
|
|
|
21554
23422
|
/**
|
|
@@ -25391,6 +27259,7 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
25391
27259
|
* @property {Array.<sqlanvil.ITest>|null} [tests] CompiledGraph tests
|
|
25392
27260
|
* @property {Array.<sqlanvil.INotebook>|null} [notebooks] CompiledGraph notebooks
|
|
25393
27261
|
* @property {Array.<sqlanvil.IDataPreparation>|null} [dataPreparations] CompiledGraph dataPreparations
|
|
27262
|
+
* @property {Array.<sqlanvil.IExport>|null} [exports] CompiledGraph exports
|
|
25394
27263
|
* @property {sqlanvil.IGraphErrors|null} [graphErrors] CompiledGraph graphErrors
|
|
25395
27264
|
* @property {string|null} [sqlanvilCoreVersion] CompiledGraph sqlanvilCoreVersion
|
|
25396
27265
|
* @property {Array.<sqlanvil.ITarget>|null} [targets] CompiledGraph targets
|
|
@@ -25413,6 +27282,7 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
25413
27282
|
this.tests = [];
|
|
25414
27283
|
this.notebooks = [];
|
|
25415
27284
|
this.dataPreparations = [];
|
|
27285
|
+
this.exports = [];
|
|
25416
27286
|
this.targets = [];
|
|
25417
27287
|
if (properties)
|
|
25418
27288
|
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
@@ -25484,6 +27354,14 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
25484
27354
|
*/
|
|
25485
27355
|
CompiledGraph.prototype.dataPreparations = $util.emptyArray;
|
|
25486
27356
|
|
|
27357
|
+
/**
|
|
27358
|
+
* CompiledGraph exports.
|
|
27359
|
+
* @member {Array.<sqlanvil.IExport>} exports
|
|
27360
|
+
* @memberof sqlanvil.CompiledGraph
|
|
27361
|
+
* @instance
|
|
27362
|
+
*/
|
|
27363
|
+
CompiledGraph.prototype.exports = $util.emptyArray;
|
|
27364
|
+
|
|
25487
27365
|
/**
|
|
25488
27366
|
* CompiledGraph graphErrors.
|
|
25489
27367
|
* @member {sqlanvil.IGraphErrors|null|undefined} graphErrors
|
|
@@ -25570,6 +27448,9 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
25570
27448
|
if (message.dataPreparations != null && message.dataPreparations.length)
|
|
25571
27449
|
for (let i = 0; i < message.dataPreparations.length; ++i)
|
|
25572
27450
|
$root.sqlanvil.DataPreparation.encode(message.dataPreparations[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim();
|
|
27451
|
+
if (message.exports != null && message.exports.length)
|
|
27452
|
+
for (let i = 0; i < message.exports.length; ++i)
|
|
27453
|
+
$root.sqlanvil.Export.encode(message.exports[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim();
|
|
25573
27454
|
if (message.jitData != null && Object.hasOwnProperty.call(message, "jitData"))
|
|
25574
27455
|
$root.google.protobuf.Struct.encode(message.jitData, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim();
|
|
25575
27456
|
return writer;
|
|
@@ -25654,6 +27535,12 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
25654
27535
|
message.dataPreparations.push($root.sqlanvil.DataPreparation.decode(reader, reader.uint32()));
|
|
25655
27536
|
break;
|
|
25656
27537
|
}
|
|
27538
|
+
case 14: {
|
|
27539
|
+
if (!(message.exports && message.exports.length))
|
|
27540
|
+
message.exports = [];
|
|
27541
|
+
message.exports.push($root.sqlanvil.Export.decode(reader, reader.uint32()));
|
|
27542
|
+
break;
|
|
27543
|
+
}
|
|
25657
27544
|
case 7: {
|
|
25658
27545
|
message.graphErrors = $root.sqlanvil.GraphErrors.decode(reader, reader.uint32());
|
|
25659
27546
|
break;
|
|
@@ -25775,6 +27662,15 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
25775
27662
|
return "dataPreparations." + error;
|
|
25776
27663
|
}
|
|
25777
27664
|
}
|
|
27665
|
+
if (message.exports != null && message.hasOwnProperty("exports")) {
|
|
27666
|
+
if (!Array.isArray(message.exports))
|
|
27667
|
+
return "exports: array expected";
|
|
27668
|
+
for (let i = 0; i < message.exports.length; ++i) {
|
|
27669
|
+
let error = $root.sqlanvil.Export.verify(message.exports[i]);
|
|
27670
|
+
if (error)
|
|
27671
|
+
return "exports." + error;
|
|
27672
|
+
}
|
|
27673
|
+
}
|
|
25778
27674
|
if (message.graphErrors != null && message.hasOwnProperty("graphErrors")) {
|
|
25779
27675
|
let error = $root.sqlanvil.GraphErrors.verify(message.graphErrors);
|
|
25780
27676
|
if (error)
|
|
@@ -25887,6 +27783,16 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
25887
27783
|
message.dataPreparations[i] = $root.sqlanvil.DataPreparation.fromObject(object.dataPreparations[i]);
|
|
25888
27784
|
}
|
|
25889
27785
|
}
|
|
27786
|
+
if (object.exports) {
|
|
27787
|
+
if (!Array.isArray(object.exports))
|
|
27788
|
+
throw TypeError(".sqlanvil.CompiledGraph.exports: array expected");
|
|
27789
|
+
message.exports = [];
|
|
27790
|
+
for (let i = 0; i < object.exports.length; ++i) {
|
|
27791
|
+
if (typeof object.exports[i] !== "object")
|
|
27792
|
+
throw TypeError(".sqlanvil.CompiledGraph.exports: object expected");
|
|
27793
|
+
message.exports[i] = $root.sqlanvil.Export.fromObject(object.exports[i]);
|
|
27794
|
+
}
|
|
27795
|
+
}
|
|
25890
27796
|
if (object.graphErrors != null) {
|
|
25891
27797
|
if (typeof object.graphErrors !== "object")
|
|
25892
27798
|
throw TypeError(".sqlanvil.CompiledGraph.graphErrors: object expected");
|
|
@@ -25934,6 +27840,7 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
25934
27840
|
object.targets = [];
|
|
25935
27841
|
object.notebooks = [];
|
|
25936
27842
|
object.dataPreparations = [];
|
|
27843
|
+
object.exports = [];
|
|
25937
27844
|
}
|
|
25938
27845
|
if (options.defaults) {
|
|
25939
27846
|
object.projectConfig = null;
|
|
@@ -25987,6 +27894,11 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
25987
27894
|
for (let j = 0; j < message.dataPreparations.length; ++j)
|
|
25988
27895
|
object.dataPreparations[j] = $root.sqlanvil.DataPreparation.toObject(message.dataPreparations[j], options);
|
|
25989
27896
|
}
|
|
27897
|
+
if (message.exports && message.exports.length) {
|
|
27898
|
+
object.exports = [];
|
|
27899
|
+
for (let j = 0; j < message.exports.length; ++j)
|
|
27900
|
+
object.exports[j] = $root.sqlanvil.Export.toObject(message.exports[j], options);
|
|
27901
|
+
}
|
|
25990
27902
|
if (message.jitData != null && message.hasOwnProperty("jitData"))
|
|
25991
27903
|
object.jitData = $root.google.protobuf.Struct.toObject(message.jitData, options);
|
|
25992
27904
|
return object;
|
|
@@ -30215,6 +32127,363 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
30215
32127
|
return ExecutionTask;
|
|
30216
32128
|
})();
|
|
30217
32129
|
|
|
32130
|
+
sqlanvil.ExportSpec = (function() {
|
|
32131
|
+
|
|
32132
|
+
/**
|
|
32133
|
+
* Properties of an ExportSpec.
|
|
32134
|
+
* @memberof sqlanvil
|
|
32135
|
+
* @interface IExportSpec
|
|
32136
|
+
* @property {string|null} [query] ExportSpec query
|
|
32137
|
+
* @property {string|null} [location] ExportSpec location
|
|
32138
|
+
* @property {string|null} [format] ExportSpec format
|
|
32139
|
+
* @property {boolean|null} [overwrite] ExportSpec overwrite
|
|
32140
|
+
* @property {string|null} [filename] ExportSpec filename
|
|
32141
|
+
* @property {Object.<string,string>|null} [options] ExportSpec options
|
|
32142
|
+
*/
|
|
32143
|
+
|
|
32144
|
+
/**
|
|
32145
|
+
* Constructs a new ExportSpec.
|
|
32146
|
+
* @memberof sqlanvil
|
|
32147
|
+
* @classdesc Represents an ExportSpec.
|
|
32148
|
+
* @implements IExportSpec
|
|
32149
|
+
* @constructor
|
|
32150
|
+
* @param {sqlanvil.IExportSpec=} [properties] Properties to set
|
|
32151
|
+
*/
|
|
32152
|
+
function ExportSpec(properties) {
|
|
32153
|
+
this.options = {};
|
|
32154
|
+
if (properties)
|
|
32155
|
+
for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
32156
|
+
if (properties[keys[i]] != null)
|
|
32157
|
+
this[keys[i]] = properties[keys[i]];
|
|
32158
|
+
}
|
|
32159
|
+
|
|
32160
|
+
/**
|
|
32161
|
+
* ExportSpec query.
|
|
32162
|
+
* @member {string} query
|
|
32163
|
+
* @memberof sqlanvil.ExportSpec
|
|
32164
|
+
* @instance
|
|
32165
|
+
*/
|
|
32166
|
+
ExportSpec.prototype.query = "";
|
|
32167
|
+
|
|
32168
|
+
/**
|
|
32169
|
+
* ExportSpec location.
|
|
32170
|
+
* @member {string} location
|
|
32171
|
+
* @memberof sqlanvil.ExportSpec
|
|
32172
|
+
* @instance
|
|
32173
|
+
*/
|
|
32174
|
+
ExportSpec.prototype.location = "";
|
|
32175
|
+
|
|
32176
|
+
/**
|
|
32177
|
+
* ExportSpec format.
|
|
32178
|
+
* @member {string} format
|
|
32179
|
+
* @memberof sqlanvil.ExportSpec
|
|
32180
|
+
* @instance
|
|
32181
|
+
*/
|
|
32182
|
+
ExportSpec.prototype.format = "";
|
|
32183
|
+
|
|
32184
|
+
/**
|
|
32185
|
+
* ExportSpec overwrite.
|
|
32186
|
+
* @member {boolean} overwrite
|
|
32187
|
+
* @memberof sqlanvil.ExportSpec
|
|
32188
|
+
* @instance
|
|
32189
|
+
*/
|
|
32190
|
+
ExportSpec.prototype.overwrite = false;
|
|
32191
|
+
|
|
32192
|
+
/**
|
|
32193
|
+
* ExportSpec filename.
|
|
32194
|
+
* @member {string} filename
|
|
32195
|
+
* @memberof sqlanvil.ExportSpec
|
|
32196
|
+
* @instance
|
|
32197
|
+
*/
|
|
32198
|
+
ExportSpec.prototype.filename = "";
|
|
32199
|
+
|
|
32200
|
+
/**
|
|
32201
|
+
* ExportSpec options.
|
|
32202
|
+
* @member {Object.<string,string>} options
|
|
32203
|
+
* @memberof sqlanvil.ExportSpec
|
|
32204
|
+
* @instance
|
|
32205
|
+
*/
|
|
32206
|
+
ExportSpec.prototype.options = $util.emptyObject;
|
|
32207
|
+
|
|
32208
|
+
/**
|
|
32209
|
+
* Creates a new ExportSpec instance using the specified properties.
|
|
32210
|
+
* @function create
|
|
32211
|
+
* @memberof sqlanvil.ExportSpec
|
|
32212
|
+
* @static
|
|
32213
|
+
* @param {sqlanvil.IExportSpec=} [properties] Properties to set
|
|
32214
|
+
* @returns {sqlanvil.ExportSpec} ExportSpec instance
|
|
32215
|
+
*/
|
|
32216
|
+
ExportSpec.create = function create(properties) {
|
|
32217
|
+
return new ExportSpec(properties);
|
|
32218
|
+
};
|
|
32219
|
+
|
|
32220
|
+
/**
|
|
32221
|
+
* Encodes the specified ExportSpec message. Does not implicitly {@link sqlanvil.ExportSpec.verify|verify} messages.
|
|
32222
|
+
* @function encode
|
|
32223
|
+
* @memberof sqlanvil.ExportSpec
|
|
32224
|
+
* @static
|
|
32225
|
+
* @param {sqlanvil.IExportSpec} message ExportSpec message or plain object to encode
|
|
32226
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
32227
|
+
* @returns {$protobuf.Writer} Writer
|
|
32228
|
+
*/
|
|
32229
|
+
ExportSpec.encode = function encode(message, writer) {
|
|
32230
|
+
if (!writer)
|
|
32231
|
+
writer = $Writer.create();
|
|
32232
|
+
if (message.query != null && Object.hasOwnProperty.call(message, "query"))
|
|
32233
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.query);
|
|
32234
|
+
if (message.location != null && Object.hasOwnProperty.call(message, "location"))
|
|
32235
|
+
writer.uint32(/* id 2, wireType 2 =*/18).string(message.location);
|
|
32236
|
+
if (message.format != null && Object.hasOwnProperty.call(message, "format"))
|
|
32237
|
+
writer.uint32(/* id 3, wireType 2 =*/26).string(message.format);
|
|
32238
|
+
if (message.overwrite != null && Object.hasOwnProperty.call(message, "overwrite"))
|
|
32239
|
+
writer.uint32(/* id 4, wireType 0 =*/32).bool(message.overwrite);
|
|
32240
|
+
if (message.filename != null && Object.hasOwnProperty.call(message, "filename"))
|
|
32241
|
+
writer.uint32(/* id 5, wireType 2 =*/42).string(message.filename);
|
|
32242
|
+
if (message.options != null && Object.hasOwnProperty.call(message, "options"))
|
|
32243
|
+
for (let keys = Object.keys(message.options), i = 0; i < keys.length; ++i)
|
|
32244
|
+
writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.options[keys[i]]).ldelim();
|
|
32245
|
+
return writer;
|
|
32246
|
+
};
|
|
32247
|
+
|
|
32248
|
+
/**
|
|
32249
|
+
* Encodes the specified ExportSpec message, length delimited. Does not implicitly {@link sqlanvil.ExportSpec.verify|verify} messages.
|
|
32250
|
+
* @function encodeDelimited
|
|
32251
|
+
* @memberof sqlanvil.ExportSpec
|
|
32252
|
+
* @static
|
|
32253
|
+
* @param {sqlanvil.IExportSpec} message ExportSpec message or plain object to encode
|
|
32254
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
32255
|
+
* @returns {$protobuf.Writer} Writer
|
|
32256
|
+
*/
|
|
32257
|
+
ExportSpec.encodeDelimited = function encodeDelimited(message, writer) {
|
|
32258
|
+
return this.encode(message, writer).ldelim();
|
|
32259
|
+
};
|
|
32260
|
+
|
|
32261
|
+
/**
|
|
32262
|
+
* Decodes an ExportSpec message from the specified reader or buffer.
|
|
32263
|
+
* @function decode
|
|
32264
|
+
* @memberof sqlanvil.ExportSpec
|
|
32265
|
+
* @static
|
|
32266
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
32267
|
+
* @param {number} [length] Message length if known beforehand
|
|
32268
|
+
* @returns {sqlanvil.ExportSpec} ExportSpec
|
|
32269
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
32270
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
32271
|
+
*/
|
|
32272
|
+
ExportSpec.decode = function decode(reader, length, error) {
|
|
32273
|
+
if (!(reader instanceof $Reader))
|
|
32274
|
+
reader = $Reader.create(reader);
|
|
32275
|
+
let end = length === undefined ? reader.len : reader.pos + length, message = new $root.sqlanvil.ExportSpec(), key, value;
|
|
32276
|
+
while (reader.pos < end) {
|
|
32277
|
+
let tag = reader.uint32();
|
|
32278
|
+
if (tag === error)
|
|
32279
|
+
break;
|
|
32280
|
+
switch (tag >>> 3) {
|
|
32281
|
+
case 1: {
|
|
32282
|
+
message.query = reader.string();
|
|
32283
|
+
break;
|
|
32284
|
+
}
|
|
32285
|
+
case 2: {
|
|
32286
|
+
message.location = reader.string();
|
|
32287
|
+
break;
|
|
32288
|
+
}
|
|
32289
|
+
case 3: {
|
|
32290
|
+
message.format = reader.string();
|
|
32291
|
+
break;
|
|
32292
|
+
}
|
|
32293
|
+
case 4: {
|
|
32294
|
+
message.overwrite = reader.bool();
|
|
32295
|
+
break;
|
|
32296
|
+
}
|
|
32297
|
+
case 5: {
|
|
32298
|
+
message.filename = reader.string();
|
|
32299
|
+
break;
|
|
32300
|
+
}
|
|
32301
|
+
case 6: {
|
|
32302
|
+
if (message.options === $util.emptyObject)
|
|
32303
|
+
message.options = {};
|
|
32304
|
+
let end2 = reader.uint32() + reader.pos;
|
|
32305
|
+
key = "";
|
|
32306
|
+
value = "";
|
|
32307
|
+
while (reader.pos < end2) {
|
|
32308
|
+
let tag2 = reader.uint32();
|
|
32309
|
+
switch (tag2 >>> 3) {
|
|
32310
|
+
case 1:
|
|
32311
|
+
key = reader.string();
|
|
32312
|
+
break;
|
|
32313
|
+
case 2:
|
|
32314
|
+
value = reader.string();
|
|
32315
|
+
break;
|
|
32316
|
+
default:
|
|
32317
|
+
reader.skipType(tag2 & 7);
|
|
32318
|
+
break;
|
|
32319
|
+
}
|
|
32320
|
+
}
|
|
32321
|
+
message.options[key] = value;
|
|
32322
|
+
break;
|
|
32323
|
+
}
|
|
32324
|
+
default:
|
|
32325
|
+
reader.skipType(tag & 7);
|
|
32326
|
+
break;
|
|
32327
|
+
}
|
|
32328
|
+
}
|
|
32329
|
+
return message;
|
|
32330
|
+
};
|
|
32331
|
+
|
|
32332
|
+
/**
|
|
32333
|
+
* Decodes an ExportSpec message from the specified reader or buffer, length delimited.
|
|
32334
|
+
* @function decodeDelimited
|
|
32335
|
+
* @memberof sqlanvil.ExportSpec
|
|
32336
|
+
* @static
|
|
32337
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
32338
|
+
* @returns {sqlanvil.ExportSpec} ExportSpec
|
|
32339
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
32340
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
32341
|
+
*/
|
|
32342
|
+
ExportSpec.decodeDelimited = function decodeDelimited(reader) {
|
|
32343
|
+
if (!(reader instanceof $Reader))
|
|
32344
|
+
reader = new $Reader(reader);
|
|
32345
|
+
return this.decode(reader, reader.uint32());
|
|
32346
|
+
};
|
|
32347
|
+
|
|
32348
|
+
/**
|
|
32349
|
+
* Verifies an ExportSpec message.
|
|
32350
|
+
* @function verify
|
|
32351
|
+
* @memberof sqlanvil.ExportSpec
|
|
32352
|
+
* @static
|
|
32353
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
32354
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
32355
|
+
*/
|
|
32356
|
+
ExportSpec.verify = function verify(message) {
|
|
32357
|
+
if (typeof message !== "object" || message === null)
|
|
32358
|
+
return "object expected";
|
|
32359
|
+
if (message.query != null && message.hasOwnProperty("query"))
|
|
32360
|
+
if (!$util.isString(message.query))
|
|
32361
|
+
return "query: string expected";
|
|
32362
|
+
if (message.location != null && message.hasOwnProperty("location"))
|
|
32363
|
+
if (!$util.isString(message.location))
|
|
32364
|
+
return "location: string expected";
|
|
32365
|
+
if (message.format != null && message.hasOwnProperty("format"))
|
|
32366
|
+
if (!$util.isString(message.format))
|
|
32367
|
+
return "format: string expected";
|
|
32368
|
+
if (message.overwrite != null && message.hasOwnProperty("overwrite"))
|
|
32369
|
+
if (typeof message.overwrite !== "boolean")
|
|
32370
|
+
return "overwrite: boolean expected";
|
|
32371
|
+
if (message.filename != null && message.hasOwnProperty("filename"))
|
|
32372
|
+
if (!$util.isString(message.filename))
|
|
32373
|
+
return "filename: string expected";
|
|
32374
|
+
if (message.options != null && message.hasOwnProperty("options")) {
|
|
32375
|
+
if (!$util.isObject(message.options))
|
|
32376
|
+
return "options: object expected";
|
|
32377
|
+
let key = Object.keys(message.options);
|
|
32378
|
+
for (let i = 0; i < key.length; ++i)
|
|
32379
|
+
if (!$util.isString(message.options[key[i]]))
|
|
32380
|
+
return "options: string{k:string} expected";
|
|
32381
|
+
}
|
|
32382
|
+
return null;
|
|
32383
|
+
};
|
|
32384
|
+
|
|
32385
|
+
/**
|
|
32386
|
+
* Creates an ExportSpec message from a plain object. Also converts values to their respective internal types.
|
|
32387
|
+
* @function fromObject
|
|
32388
|
+
* @memberof sqlanvil.ExportSpec
|
|
32389
|
+
* @static
|
|
32390
|
+
* @param {Object.<string,*>} object Plain object
|
|
32391
|
+
* @returns {sqlanvil.ExportSpec} ExportSpec
|
|
32392
|
+
*/
|
|
32393
|
+
ExportSpec.fromObject = function fromObject(object) {
|
|
32394
|
+
if (object instanceof $root.sqlanvil.ExportSpec)
|
|
32395
|
+
return object;
|
|
32396
|
+
let message = new $root.sqlanvil.ExportSpec();
|
|
32397
|
+
if (object.query != null)
|
|
32398
|
+
message.query = String(object.query);
|
|
32399
|
+
if (object.location != null)
|
|
32400
|
+
message.location = String(object.location);
|
|
32401
|
+
if (object.format != null)
|
|
32402
|
+
message.format = String(object.format);
|
|
32403
|
+
if (object.overwrite != null)
|
|
32404
|
+
message.overwrite = Boolean(object.overwrite);
|
|
32405
|
+
if (object.filename != null)
|
|
32406
|
+
message.filename = String(object.filename);
|
|
32407
|
+
if (object.options) {
|
|
32408
|
+
if (typeof object.options !== "object")
|
|
32409
|
+
throw TypeError(".sqlanvil.ExportSpec.options: object expected");
|
|
32410
|
+
message.options = {};
|
|
32411
|
+
for (let keys = Object.keys(object.options), i = 0; i < keys.length; ++i)
|
|
32412
|
+
message.options[keys[i]] = String(object.options[keys[i]]);
|
|
32413
|
+
}
|
|
32414
|
+
return message;
|
|
32415
|
+
};
|
|
32416
|
+
|
|
32417
|
+
/**
|
|
32418
|
+
* Creates a plain object from an ExportSpec message. Also converts values to other types if specified.
|
|
32419
|
+
* @function toObject
|
|
32420
|
+
* @memberof sqlanvil.ExportSpec
|
|
32421
|
+
* @static
|
|
32422
|
+
* @param {sqlanvil.ExportSpec} message ExportSpec
|
|
32423
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
32424
|
+
* @returns {Object.<string,*>} Plain object
|
|
32425
|
+
*/
|
|
32426
|
+
ExportSpec.toObject = function toObject(message, options) {
|
|
32427
|
+
if (!options)
|
|
32428
|
+
options = {};
|
|
32429
|
+
let object = {};
|
|
32430
|
+
if (options.objects || options.defaults)
|
|
32431
|
+
object.options = {};
|
|
32432
|
+
if (options.defaults) {
|
|
32433
|
+
object.query = "";
|
|
32434
|
+
object.location = "";
|
|
32435
|
+
object.format = "";
|
|
32436
|
+
object.overwrite = false;
|
|
32437
|
+
object.filename = "";
|
|
32438
|
+
}
|
|
32439
|
+
if (message.query != null && message.hasOwnProperty("query"))
|
|
32440
|
+
object.query = message.query;
|
|
32441
|
+
if (message.location != null && message.hasOwnProperty("location"))
|
|
32442
|
+
object.location = message.location;
|
|
32443
|
+
if (message.format != null && message.hasOwnProperty("format"))
|
|
32444
|
+
object.format = message.format;
|
|
32445
|
+
if (message.overwrite != null && message.hasOwnProperty("overwrite"))
|
|
32446
|
+
object.overwrite = message.overwrite;
|
|
32447
|
+
if (message.filename != null && message.hasOwnProperty("filename"))
|
|
32448
|
+
object.filename = message.filename;
|
|
32449
|
+
let keys2;
|
|
32450
|
+
if (message.options && (keys2 = Object.keys(message.options)).length) {
|
|
32451
|
+
object.options = {};
|
|
32452
|
+
for (let j = 0; j < keys2.length; ++j)
|
|
32453
|
+
object.options[keys2[j]] = message.options[keys2[j]];
|
|
32454
|
+
}
|
|
32455
|
+
return object;
|
|
32456
|
+
};
|
|
32457
|
+
|
|
32458
|
+
/**
|
|
32459
|
+
* Converts this ExportSpec to JSON.
|
|
32460
|
+
* @function toJSON
|
|
32461
|
+
* @memberof sqlanvil.ExportSpec
|
|
32462
|
+
* @instance
|
|
32463
|
+
* @returns {Object.<string,*>} JSON object
|
|
32464
|
+
*/
|
|
32465
|
+
ExportSpec.prototype.toJSON = function toJSON() {
|
|
32466
|
+
return this.constructor.toObject(this, $protobuf__namespace.util.toJSONOptions);
|
|
32467
|
+
};
|
|
32468
|
+
|
|
32469
|
+
/**
|
|
32470
|
+
* Gets the default type url for ExportSpec
|
|
32471
|
+
* @function getTypeUrl
|
|
32472
|
+
* @memberof sqlanvil.ExportSpec
|
|
32473
|
+
* @static
|
|
32474
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
32475
|
+
* @returns {string} The default type url
|
|
32476
|
+
*/
|
|
32477
|
+
ExportSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
32478
|
+
if (typeUrlPrefix === undefined) {
|
|
32479
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
32480
|
+
}
|
|
32481
|
+
return typeUrlPrefix + "/sqlanvil.ExportSpec";
|
|
32482
|
+
};
|
|
32483
|
+
|
|
32484
|
+
return ExportSpec;
|
|
32485
|
+
})();
|
|
32486
|
+
|
|
30218
32487
|
sqlanvil.ExecutionAction = (function() {
|
|
30219
32488
|
|
|
30220
32489
|
/**
|
|
@@ -30230,6 +32499,7 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
30230
32499
|
* @property {Array.<sqlanvil.IExecutionTask>|null} [tasks] ExecutionAction tasks
|
|
30231
32500
|
* @property {sqlanvil.IActionDescriptor|null} [actionDescriptor] ExecutionAction actionDescriptor
|
|
30232
32501
|
* @property {string|null} [jitCode] ExecutionAction jitCode
|
|
32502
|
+
* @property {sqlanvil.IExportSpec|null} ["export"] ExecutionAction export
|
|
30233
32503
|
*/
|
|
30234
32504
|
|
|
30235
32505
|
/**
|
|
@@ -30321,6 +32591,14 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
30321
32591
|
*/
|
|
30322
32592
|
ExecutionAction.prototype.jitCode = "";
|
|
30323
32593
|
|
|
32594
|
+
/**
|
|
32595
|
+
* ExecutionAction export.
|
|
32596
|
+
* @member {sqlanvil.IExportSpec|null|undefined} export
|
|
32597
|
+
* @memberof sqlanvil.ExecutionAction
|
|
32598
|
+
* @instance
|
|
32599
|
+
*/
|
|
32600
|
+
ExecutionAction.prototype["export"] = null;
|
|
32601
|
+
|
|
30324
32602
|
/**
|
|
30325
32603
|
* Creates a new ExecutionAction instance using the specified properties.
|
|
30326
32604
|
* @function create
|
|
@@ -30365,6 +32643,8 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
30365
32643
|
$root.sqlanvil.Target.encode(message.dependencyTargets[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
|
|
30366
32644
|
if (message.jitCode != null && Object.hasOwnProperty.call(message, "jitCode"))
|
|
30367
32645
|
writer.uint32(/* id 12, wireType 2 =*/98).string(message.jitCode);
|
|
32646
|
+
if (message["export"] != null && Object.hasOwnProperty.call(message, "export"))
|
|
32647
|
+
$root.sqlanvil.ExportSpec.encode(message["export"], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim();
|
|
30368
32648
|
return writer;
|
|
30369
32649
|
};
|
|
30370
32650
|
|
|
@@ -30441,6 +32721,10 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
30441
32721
|
message.jitCode = reader.string();
|
|
30442
32722
|
break;
|
|
30443
32723
|
}
|
|
32724
|
+
case 13: {
|
|
32725
|
+
message["export"] = $root.sqlanvil.ExportSpec.decode(reader, reader.uint32());
|
|
32726
|
+
break;
|
|
32727
|
+
}
|
|
30444
32728
|
default:
|
|
30445
32729
|
reader.skipType(tag & 7);
|
|
30446
32730
|
break;
|
|
@@ -30525,6 +32809,11 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
30525
32809
|
if (message.jitCode != null && message.hasOwnProperty("jitCode"))
|
|
30526
32810
|
if (!$util.isString(message.jitCode))
|
|
30527
32811
|
return "jitCode: string expected";
|
|
32812
|
+
if (message["export"] != null && message.hasOwnProperty("export")) {
|
|
32813
|
+
let error = $root.sqlanvil.ExportSpec.verify(message["export"]);
|
|
32814
|
+
if (error)
|
|
32815
|
+
return "export." + error;
|
|
32816
|
+
}
|
|
30528
32817
|
return null;
|
|
30529
32818
|
};
|
|
30530
32819
|
|
|
@@ -30598,6 +32887,11 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
30598
32887
|
}
|
|
30599
32888
|
if (object.jitCode != null)
|
|
30600
32889
|
message.jitCode = String(object.jitCode);
|
|
32890
|
+
if (object["export"] != null) {
|
|
32891
|
+
if (typeof object["export"] !== "object")
|
|
32892
|
+
throw TypeError(".sqlanvil.ExecutionAction.export: object expected");
|
|
32893
|
+
message["export"] = $root.sqlanvil.ExportSpec.fromObject(object["export"]);
|
|
32894
|
+
}
|
|
30601
32895
|
return message;
|
|
30602
32896
|
};
|
|
30603
32897
|
|
|
@@ -30626,6 +32920,7 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
30626
32920
|
object.actionDescriptor = null;
|
|
30627
32921
|
object.hermeticity = options.enums === String ? "UNKNOWN" : 0;
|
|
30628
32922
|
object.jitCode = "";
|
|
32923
|
+
object["export"] = null;
|
|
30629
32924
|
}
|
|
30630
32925
|
if (message.tasks && message.tasks.length) {
|
|
30631
32926
|
object.tasks = [];
|
|
@@ -30651,6 +32946,8 @@ const sqlanvil = $root.sqlanvil = (() => {
|
|
|
30651
32946
|
}
|
|
30652
32947
|
if (message.jitCode != null && message.hasOwnProperty("jitCode"))
|
|
30653
32948
|
object.jitCode = message.jitCode;
|
|
32949
|
+
if (message["export"] != null && message.hasOwnProperty("export"))
|
|
32950
|
+
object["export"] = $root.sqlanvil.ExportSpec.toObject(message["export"], options);
|
|
30654
32951
|
return object;
|
|
30655
32952
|
};
|
|
30656
32953
|
|
|
@@ -38694,7 +40991,7 @@ function unknownToValueShallow(raw) {
|
|
|
38694
40991
|
return "/";
|
|
38695
40992
|
})();
|
|
38696
40993
|
|
|
38697
|
-
typeof __webpack_require__ === "function" ? __non_webpack_require__ : require;
|
|
40994
|
+
const nativeRequire = typeof __webpack_require__ === "function" ? __non_webpack_require__ : require;
|
|
38698
40995
|
function matchPatterns(patterns, values) {
|
|
38699
40996
|
const fullyQualifiedActions = [];
|
|
38700
40997
|
patterns.forEach(pattern => {
|
|
@@ -38772,11 +41069,11 @@ function setOrValidateTableEnumType(table) {
|
|
|
38772
41069
|
function prune(compiledGraph, runConfig) {
|
|
38773
41070
|
compiledGraph.tables.forEach(setOrValidateTableEnumType);
|
|
38774
41071
|
const includedActionNames = computeIncludedActionNames(compiledGraph, runConfig);
|
|
38775
|
-
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))) });
|
|
41072
|
+
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))) });
|
|
38776
41073
|
}
|
|
38777
41074
|
function computeIncludedActionNames(compiledGraph, runConfig) {
|
|
38778
41075
|
var _a, _b, _c;
|
|
38779
|
-
const allActions = [].concat(compiledGraph.tables, compiledGraph.operations, compiledGraph.assertions);
|
|
41076
|
+
const allActions = [].concat(compiledGraph.tables, compiledGraph.operations, compiledGraph.assertions, compiledGraph.exports);
|
|
38780
41077
|
const allActionNames = new Set(allActions.map(action => targetAsReadableString(action.target)));
|
|
38781
41078
|
const allActionsByName = new Map(allActions.map(action => [targetAsReadableString(action.target), action]));
|
|
38782
41079
|
const hasActionSelector = ((_a = runConfig.actions) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
@@ -38839,6 +41136,26 @@ async function state(dbadapter, targets) {
|
|
|
38839
41136
|
return { tables: tablesWithValues };
|
|
38840
41137
|
}
|
|
38841
41138
|
|
|
41139
|
+
function extensionForFormat(format) {
|
|
41140
|
+
switch ((format || "").toLowerCase()) {
|
|
41141
|
+
case "parquet":
|
|
41142
|
+
return ".parquet";
|
|
41143
|
+
case "csv":
|
|
41144
|
+
return ".csv";
|
|
41145
|
+
case "json":
|
|
41146
|
+
return ".jsonl";
|
|
41147
|
+
default:
|
|
41148
|
+
return "";
|
|
41149
|
+
}
|
|
41150
|
+
}
|
|
41151
|
+
function resolveExportUri(spec, actionName, opts) {
|
|
41152
|
+
const prefix = (spec.location || "").replace(/\/+$/, "");
|
|
41153
|
+
const base = spec.filename || actionName;
|
|
41154
|
+
const ext = extensionForFormat(spec.format || "");
|
|
41155
|
+
const name = opts.wildcard ? `${base}_*${ext}` : `${base}${ext}`;
|
|
41156
|
+
return `${prefix}/${name}`;
|
|
41157
|
+
}
|
|
41158
|
+
|
|
38842
41159
|
function concatenateQueries(statements, modifier) {
|
|
38843
41160
|
return statements
|
|
38844
41161
|
.filter(statement => !!statement)
|
|
@@ -39088,6 +41405,17 @@ from (${query}) as insertions`;
|
|
|
39088
41405
|
dropIfExists(target, type) {
|
|
39089
41406
|
return `drop ${this.tableTypeAsSql(type)} if exists ${this.resolveTarget(target)}`;
|
|
39090
41407
|
}
|
|
41408
|
+
createExportTasks(exp) {
|
|
41409
|
+
var _a;
|
|
41410
|
+
const uri = resolveExportUri(exp, ((_a = exp.target) === null || _a === void 0 ? void 0 : _a.name) || exp.filename, { wildcard: true });
|
|
41411
|
+
const format = (exp.format || "").toUpperCase();
|
|
41412
|
+
const statement = `EXPORT DATA OPTIONS(\n` +
|
|
41413
|
+
` uri='${uri}',\n` +
|
|
41414
|
+
` format='${format}',\n` +
|
|
41415
|
+
` overwrite=${exp.overwrite ? "true" : "false"}\n` +
|
|
41416
|
+
`) AS\n${exp.query}`;
|
|
41417
|
+
return [sqlanvil.ExecutionTask.create({ type: "statement", statement })];
|
|
41418
|
+
}
|
|
39091
41419
|
buildIncrementalSchemaChangeTasks(tasks, table) {
|
|
39092
41420
|
const uniqueId = this.uniqueIdGenerator();
|
|
39093
41421
|
const emptyTempTableTarget = Object.assign(Object.assign({}, table.target), { name: `${table.target.name}_sa_temp_${uniqueId}_empty` });
|
|
@@ -39295,6 +41623,9 @@ class MysqlExecutionSql {
|
|
|
39295
41623
|
}
|
|
39296
41624
|
return `drop table if exists ${this.resolveTarget(target)}`;
|
|
39297
41625
|
}
|
|
41626
|
+
createExportTasks(exp) {
|
|
41627
|
+
throw new Error("type: \"export\" is not supported on MySQL/MariaDB yet.");
|
|
41628
|
+
}
|
|
39298
41629
|
publishTasks(table, runConfig, tableMetadata) {
|
|
39299
41630
|
const tasks = new Tasks();
|
|
39300
41631
|
const target = this.resolveTarget(table.target);
|
|
@@ -39438,6 +41769,9 @@ class PostgresExecutionSql {
|
|
|
39438
41769
|
const kind = type === sqlanvil.TableMetadata.Type.VIEW ? "view" : "table";
|
|
39439
41770
|
return `drop ${kind} if exists ${this.resolveTarget(target)} cascade`;
|
|
39440
41771
|
}
|
|
41772
|
+
createExportTasks(exp) {
|
|
41773
|
+
return [sqlanvil.ExecutionTask.create({ type: "export", statement: exp.query })];
|
|
41774
|
+
}
|
|
39441
41775
|
shouldWriteIncrementally(table, runConfig, tableMetadata) {
|
|
39442
41776
|
return ((!runConfig.fullRefresh || table.protected) &&
|
|
39443
41777
|
tableMetadata &&
|
|
@@ -39735,6 +42069,9 @@ class ExecutionSql {
|
|
|
39735
42069
|
? []
|
|
39736
42070
|
: operation.queries.map(statement => sqlanvil.ExecutionTask.create({ type: "statement", statement }));
|
|
39737
42071
|
}
|
|
42072
|
+
createExportTasks(exp) {
|
|
42073
|
+
return exp.disabled ? [] : this.delegate.createExportTasks(exp);
|
|
42074
|
+
}
|
|
39738
42075
|
createAssertionTasks(assertion) {
|
|
39739
42076
|
return assertion.disabled ? [] : this.assertTasks(assertion, this.project).build();
|
|
39740
42077
|
}
|
|
@@ -39801,7 +42138,7 @@ function collectEvaluationQueries(queryOrAction, concatenate, queryModifier = (q
|
|
|
39801
42138
|
.filter(validationQuery => !!validationQuery.query);
|
|
39802
42139
|
}
|
|
39803
42140
|
|
|
39804
|
-
const version = "1.
|
|
42141
|
+
const version = "1.8.0";
|
|
39805
42142
|
const dataformVersion = "3.0.59";
|
|
39806
42143
|
|
|
39807
42144
|
async function build(compiledGraph, runConfig, dbadapter) {
|
|
@@ -39825,7 +42162,7 @@ class Builder {
|
|
|
39825
42162
|
this.warehouseState.tables.forEach(tableState => {
|
|
39826
42163
|
tableMetadataByTarget.set(targetStringifier.stringify(tableState.target), tableState);
|
|
39827
42164
|
});
|
|
39828
|
-
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)));
|
|
42165
|
+
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)));
|
|
39829
42166
|
return sqlanvil.ExecutionGraph.create({
|
|
39830
42167
|
projectConfig: this.prunedGraph.projectConfig,
|
|
39831
42168
|
runConfig: this.runConfig,
|
|
@@ -39843,6 +42180,16 @@ class Builder {
|
|
|
39843
42180
|
buildAssertion(assertion) {
|
|
39844
42181
|
return Object.assign(Object.assign({}, this.toPartialExecutionAction(assertion)), { type: "assertion", tasks: this.executionSql.createAssertionTasks(assertion), hermeticity: assertion.hermeticity || sqlanvil.ActionHermeticity.HERMETIC });
|
|
39845
42182
|
}
|
|
42183
|
+
buildExport(exp) {
|
|
42184
|
+
return Object.assign(Object.assign({}, this.toPartialExecutionAction(exp)), { type: "export", tasks: this.executionSql.createExportTasks(exp), hermeticity: exp.hermeticity || sqlanvil.ActionHermeticity.NON_HERMETIC, export: sqlanvil.ExportSpec.create({
|
|
42185
|
+
query: exp.query,
|
|
42186
|
+
location: exp.location,
|
|
42187
|
+
format: exp.format,
|
|
42188
|
+
overwrite: exp.overwrite,
|
|
42189
|
+
filename: exp.filename,
|
|
42190
|
+
options: exp.options
|
|
42191
|
+
}) });
|
|
42192
|
+
}
|
|
39846
42193
|
toPartialExecutionAction(action) {
|
|
39847
42194
|
return sqlanvil.ExecutionAction.create({
|
|
39848
42195
|
target: action.target,
|
|
@@ -40061,7 +42408,7 @@ function read(credentialsPath, warehouse = "bigquery") {
|
|
|
40061
42408
|
catch (e) {
|
|
40062
42409
|
throw new Error(`Error reading credentials file: ${e.message}`);
|
|
40063
42410
|
}
|
|
40064
|
-
const warehouseCredentials = __rest(credentialsAsJson, ["connections"]);
|
|
42411
|
+
const warehouseCredentials = __rest(credentialsAsJson, ["connections", "storage"]);
|
|
40065
42412
|
if (warehouse.toLowerCase() === "mysql") {
|
|
40066
42413
|
const credentials = verifyObjectMatchesProto(sqlanvil.MysqlConnection, warehouseCredentials);
|
|
40067
42414
|
if (!credentials.host) {
|
|
@@ -40098,6 +42445,19 @@ function readConnections(credentialsPath) {
|
|
|
40098
42445
|
}
|
|
40099
42446
|
return credentialsAsJson.connections || {};
|
|
40100
42447
|
}
|
|
42448
|
+
function readStorageCredentials(credentialsPath) {
|
|
42449
|
+
if (!fs__namespace$1.existsSync(credentialsPath)) {
|
|
42450
|
+
return undefined;
|
|
42451
|
+
}
|
|
42452
|
+
let credentialsAsJson;
|
|
42453
|
+
try {
|
|
42454
|
+
credentialsAsJson = JSON.parse(fs__namespace$1.readFileSync(credentialsPath, "utf8"));
|
|
42455
|
+
}
|
|
42456
|
+
catch (e) {
|
|
42457
|
+
throw new Error(`Error reading credentials file: ${e.message}`);
|
|
42458
|
+
}
|
|
42459
|
+
return credentialsAsJson.storage || undefined;
|
|
42460
|
+
}
|
|
40101
42461
|
var TestResultStatus;
|
|
40102
42462
|
(function (TestResultStatus) {
|
|
40103
42463
|
TestResultStatus[TestResultStatus["SUCCESSFUL"] = 0] = "SUCCESSFUL";
|
|
@@ -40128,6 +42488,7 @@ async function test$1(dbadapter, timeoutMs = 10000) {
|
|
|
40128
42488
|
|
|
40129
42489
|
const gitIgnoreContents = `
|
|
40130
42490
|
${CREDENTIALS_FILENAME}
|
|
42491
|
+
.df-credentials*.json
|
|
40131
42492
|
node_modules/
|
|
40132
42493
|
`;
|
|
40133
42494
|
function postgresCredentialsTemplate(warehouse) {
|
|
@@ -40444,6 +42805,135 @@ function assertConnectionCredentialsAvailable(graph, connections) {
|
|
|
40444
42805
|
}));
|
|
40445
42806
|
}
|
|
40446
42807
|
|
|
42808
|
+
const PG_ATTACH_ALIAS = "pg";
|
|
42809
|
+
const SECRET_NAME = "sa_export";
|
|
42810
|
+
function buildAttachSql(pg) {
|
|
42811
|
+
const dsn = [
|
|
42812
|
+
pg.host && `host=${pg.host}`,
|
|
42813
|
+
pg.port && `port=${pg.port}`,
|
|
42814
|
+
pg.database && `dbname=${pg.database}`,
|
|
42815
|
+
pg.user && `user=${pg.user}`,
|
|
42816
|
+
pg.password && `password=${pg.password}`
|
|
42817
|
+
]
|
|
42818
|
+
.filter(Boolean)
|
|
42819
|
+
.join(" ");
|
|
42820
|
+
return `ATTACH '${dsn}' AS ${PG_ATTACH_ALIAS} (TYPE postgres, READ_ONLY)`;
|
|
42821
|
+
}
|
|
42822
|
+
function buildSecretSql(scheme, creds) {
|
|
42823
|
+
if (scheme === "s3") {
|
|
42824
|
+
const fields = [
|
|
42825
|
+
"TYPE s3",
|
|
42826
|
+
creds.accessKeyId && `KEY_ID '${creds.accessKeyId}'`,
|
|
42827
|
+
creds.secretAccessKey && `SECRET '${creds.secretAccessKey}'`,
|
|
42828
|
+
creds.region && `REGION '${creds.region}'`,
|
|
42829
|
+
creds.endpoint && `ENDPOINT '${creds.endpoint}'`,
|
|
42830
|
+
creds.endpoint && `URL_STYLE 'path'`,
|
|
42831
|
+
creds.endpoint && `USE_SSL true`
|
|
42832
|
+
]
|
|
42833
|
+
.filter(Boolean)
|
|
42834
|
+
.join(", ");
|
|
42835
|
+
return `CREATE OR REPLACE SECRET ${SECRET_NAME} (${fields})`;
|
|
42836
|
+
}
|
|
42837
|
+
if (scheme === "gcs") {
|
|
42838
|
+
const fields = [
|
|
42839
|
+
"TYPE gcs",
|
|
42840
|
+
creds.keyId && `KEY_ID '${creds.keyId}'`,
|
|
42841
|
+
creds.secret && `SECRET '${creds.secret}'`
|
|
42842
|
+
]
|
|
42843
|
+
.filter(Boolean)
|
|
42844
|
+
.join(", ");
|
|
42845
|
+
return `CREATE OR REPLACE SECRET ${SECRET_NAME} (${fields})`;
|
|
42846
|
+
}
|
|
42847
|
+
return null;
|
|
42848
|
+
}
|
|
42849
|
+
function toCopyTarget(uri) {
|
|
42850
|
+
if (uri.startsWith("local://")) {
|
|
42851
|
+
return uri.slice("local://".length);
|
|
42852
|
+
}
|
|
42853
|
+
return uri;
|
|
42854
|
+
}
|
|
42855
|
+
function schemeOf(uri) {
|
|
42856
|
+
if (uri.startsWith("s3://")) {
|
|
42857
|
+
return "s3";
|
|
42858
|
+
}
|
|
42859
|
+
if (uri.startsWith("gs://") || uri.startsWith("gcs://")) {
|
|
42860
|
+
return "gcs";
|
|
42861
|
+
}
|
|
42862
|
+
return "local";
|
|
42863
|
+
}
|
|
42864
|
+
function buildCopySql(selectSql, uri, format, options = {}) {
|
|
42865
|
+
const target = toCopyTarget(uri);
|
|
42866
|
+
const fmt = (format || "").toLowerCase();
|
|
42867
|
+
const extraOptions = Object.entries(options || {}).map(([key, value]) => `${key.toUpperCase()} ${value}`);
|
|
42868
|
+
const optionList = [`FORMAT ${fmt}`, ...extraOptions].join(", ");
|
|
42869
|
+
return `COPY (SELECT * FROM postgres_query('${PG_ATTACH_ALIAS}', $sa$${selectSql}$sa$)) TO '${target}' (${optionList})`;
|
|
42870
|
+
}
|
|
42871
|
+
function loadDuckdb() {
|
|
42872
|
+
try {
|
|
42873
|
+
return nativeRequire("duckdb");
|
|
42874
|
+
}
|
|
42875
|
+
catch (e) {
|
|
42876
|
+
throw new Error(`Exporting on Postgres/Supabase requires the optional "duckdb" dependency, which failed to ` +
|
|
42877
|
+
`load: ${e.message}`);
|
|
42878
|
+
}
|
|
42879
|
+
}
|
|
42880
|
+
function allAsync(conn, sql) {
|
|
42881
|
+
return new Promise((resolve, reject) => {
|
|
42882
|
+
conn.all(sql, (err, rows) => (err ? reject(err) : resolve(rows || [])));
|
|
42883
|
+
});
|
|
42884
|
+
}
|
|
42885
|
+
function withConnection(fn) {
|
|
42886
|
+
const duckdb = loadDuckdb();
|
|
42887
|
+
const db = new duckdb.Database(":memory:");
|
|
42888
|
+
const conn = db.connect();
|
|
42889
|
+
const done = () => {
|
|
42890
|
+
var _a, _b;
|
|
42891
|
+
try {
|
|
42892
|
+
(_a = conn.close) === null || _a === void 0 ? void 0 : _a.call(conn);
|
|
42893
|
+
}
|
|
42894
|
+
catch (e) {
|
|
42895
|
+
}
|
|
42896
|
+
try {
|
|
42897
|
+
(_b = db.close) === null || _b === void 0 ? void 0 : _b.call(db);
|
|
42898
|
+
}
|
|
42899
|
+
catch (e) {
|
|
42900
|
+
}
|
|
42901
|
+
};
|
|
42902
|
+
const setup = !process.env.HOME
|
|
42903
|
+
? allAsync(conn, `SET home_directory='${os__namespace.tmpdir()}'`)
|
|
42904
|
+
: Promise.resolve([]);
|
|
42905
|
+
return setup
|
|
42906
|
+
.then(() => fn(conn))
|
|
42907
|
+
.then(result => {
|
|
42908
|
+
done();
|
|
42909
|
+
return result;
|
|
42910
|
+
}, err => {
|
|
42911
|
+
done();
|
|
42912
|
+
throw err;
|
|
42913
|
+
});
|
|
42914
|
+
}
|
|
42915
|
+
async function runDuckdbExport(args) {
|
|
42916
|
+
const { spec, selectSql, pg, storage, actionName } = args;
|
|
42917
|
+
const uri = resolveExportUri(spec, actionName, { wildcard: false });
|
|
42918
|
+
const scheme = schemeOf(uri);
|
|
42919
|
+
if (scheme !== "local" && !(storage === null || storage === void 0 ? void 0 : storage[scheme])) {
|
|
42920
|
+
throw new Error(`No "${scheme}" storage credentials found in .df-credentials.json (storage.${scheme}) for ` +
|
|
42921
|
+
`export to ${uri}.`);
|
|
42922
|
+
}
|
|
42923
|
+
return withConnection(async (conn) => {
|
|
42924
|
+
await allAsync(conn, "INSTALL postgres; LOAD postgres; INSTALL httpfs; LOAD httpfs;");
|
|
42925
|
+
await allAsync(conn, buildAttachSql(pg));
|
|
42926
|
+
if (scheme !== "local") {
|
|
42927
|
+
const secret = buildSecretSql(scheme, storage[scheme]);
|
|
42928
|
+
if (secret) {
|
|
42929
|
+
await allAsync(conn, secret);
|
|
42930
|
+
}
|
|
42931
|
+
}
|
|
42932
|
+
await allAsync(conn, buildCopySql(selectSql, uri, spec.format, spec.options || {}));
|
|
42933
|
+
return { destination: toCopyTarget(uri) };
|
|
42934
|
+
});
|
|
42935
|
+
}
|
|
42936
|
+
|
|
40447
42937
|
function parseArgvFlags(argv) {
|
|
40448
42938
|
const parsedArgv = {};
|
|
40449
42939
|
const splitArgv = [];
|
|
@@ -40786,7 +43276,7 @@ class Runner {
|
|
|
40786
43276
|
dryRun: (_j = (_h = this.executionOptions) === null || _h === void 0 ? void 0 : _h.bigquery) === null || _j === void 0 ? void 0 : _j.dryRun,
|
|
40787
43277
|
reservation: ((_k = action.actionDescriptor) === null || _k === void 0 ? void 0 : _k.reservation) || ((_l = this.graph.projectConfig) === null || _l === void 0 ? void 0 : _l.defaultReservation)
|
|
40788
43278
|
}
|
|
40789
|
-
});
|
|
43279
|
+
}, action);
|
|
40790
43280
|
if (taskStatus === sqlanvil.TaskResult.ExecutionStatus.FAILED) {
|
|
40791
43281
|
actionResult.status = sqlanvil.ActionResult.ExecutionStatus.FAILED;
|
|
40792
43282
|
}
|
|
@@ -40829,8 +43319,8 @@ class Runner {
|
|
|
40829
43319
|
this.notifyListeners();
|
|
40830
43320
|
return actionResult;
|
|
40831
43321
|
}
|
|
40832
|
-
async executeTask(client, task, parentAction, options) {
|
|
40833
|
-
var _a, _b, _c, _d;
|
|
43322
|
+
async executeTask(client, task, parentAction, options, action) {
|
|
43323
|
+
var _a, _b, _c, _d, _e;
|
|
40834
43324
|
const timer = Timer.start();
|
|
40835
43325
|
const taskResult = {
|
|
40836
43326
|
status: sqlanvil.TaskResult.ExecutionStatus.RUNNING,
|
|
@@ -40842,6 +43332,25 @@ class Runner {
|
|
|
40842
43332
|
if (((_a = options.bigquery) === null || _a === void 0 ? void 0 : _a.dryRun) && task.type === "assertion") {
|
|
40843
43333
|
taskResult.status = sqlanvil.TaskResult.ExecutionStatus.SUCCESSFUL;
|
|
40844
43334
|
}
|
|
43335
|
+
else if (task.type === "export") {
|
|
43336
|
+
try {
|
|
43337
|
+
const exporter = this.executionOptions.duckdbExport || runDuckdbExport;
|
|
43338
|
+
await exporter({
|
|
43339
|
+
spec: action === null || action === void 0 ? void 0 : action.export,
|
|
43340
|
+
selectSql: task.statement,
|
|
43341
|
+
pg: this.executionOptions.warehouseConnection,
|
|
43342
|
+
storage: this.executionOptions.storageCredentials,
|
|
43343
|
+
actionName: (_b = action === null || action === void 0 ? void 0 : action.target) === null || _b === void 0 ? void 0 : _b.name
|
|
43344
|
+
});
|
|
43345
|
+
taskResult.status = sqlanvil.TaskResult.ExecutionStatus.SUCCESSFUL;
|
|
43346
|
+
}
|
|
43347
|
+
catch (e) {
|
|
43348
|
+
taskResult.status = this.cancelled
|
|
43349
|
+
? sqlanvil.TaskResult.ExecutionStatus.CANCELLED
|
|
43350
|
+
: sqlanvil.TaskResult.ExecutionStatus.FAILED;
|
|
43351
|
+
taskResult.errorMessage = `${this.graph.projectConfig.warehouse} export error: ${e.message}`;
|
|
43352
|
+
}
|
|
43353
|
+
}
|
|
40845
43354
|
else {
|
|
40846
43355
|
try {
|
|
40847
43356
|
const statement = this.executionOptions.connectionCredentials
|
|
@@ -40854,7 +43363,7 @@ class Runner {
|
|
|
40854
43363
|
}), task.type === "operation" ? 1 : options.bigquery.actionRetryLimit + 1 || 1);
|
|
40855
43364
|
taskResult.metadata = metadata;
|
|
40856
43365
|
if (task.type === "assertion") {
|
|
40857
|
-
const rowCount = (
|
|
43366
|
+
const rowCount = (_c = rows[0]) === null || _c === void 0 ? void 0 : _c[Object.keys(rows[0])[0]];
|
|
40858
43367
|
if (rowCount > 0) {
|
|
40859
43368
|
throw new Error(`Assertion failed: query returned ${rowCount} row(s).`);
|
|
40860
43369
|
}
|
|
@@ -40866,7 +43375,7 @@ class Runner {
|
|
|
40866
43375
|
? sqlanvil.TaskResult.ExecutionStatus.CANCELLED
|
|
40867
43376
|
: sqlanvil.TaskResult.ExecutionStatus.FAILED;
|
|
40868
43377
|
taskResult.errorMessage = `${this.graph.projectConfig.warehouse} error: ${e.message}`;
|
|
40869
|
-
if ((
|
|
43378
|
+
if ((_e = (_d = e.metadata) === null || _d === void 0 ? void 0 : _d.bigquery) === null || _e === void 0 ? void 0 : _e.jobId) {
|
|
40870
43379
|
taskResult.metadata = {
|
|
40871
43380
|
bigquery: {
|
|
40872
43381
|
jobId: e.metadata.bigquery.jobId
|
|
@@ -41003,6 +43512,46 @@ function normalizeRow(row) {
|
|
|
41003
43512
|
return newRow;
|
|
41004
43513
|
}
|
|
41005
43514
|
|
|
43515
|
+
function resolveEnvironment(projectDir, envName) {
|
|
43516
|
+
const settings = readConfigFromWorkflowSettings(projectDir);
|
|
43517
|
+
const environments = (settings === null || settings === void 0 ? void 0 : settings.environments) || {};
|
|
43518
|
+
const env = environments[envName];
|
|
43519
|
+
if (!env) {
|
|
43520
|
+
const available = Object.keys(environments);
|
|
43521
|
+
throw new Error(`Environment "${envName}" not found. ` +
|
|
43522
|
+
(available.length
|
|
43523
|
+
? `Available environments: ${available.join(", ")}.`
|
|
43524
|
+
: `No environments defined in workflow_settings.yaml.`));
|
|
43525
|
+
}
|
|
43526
|
+
const configOverride = {};
|
|
43527
|
+
if (env.schemaSuffix) {
|
|
43528
|
+
configOverride.schemaSuffix = env.schemaSuffix;
|
|
43529
|
+
}
|
|
43530
|
+
if (env.vars && Object.keys(env.vars).length > 0) {
|
|
43531
|
+
configOverride.vars = env.vars;
|
|
43532
|
+
}
|
|
43533
|
+
if (env.defaultDatabase) {
|
|
43534
|
+
configOverride.defaultDatabase = env.defaultDatabase;
|
|
43535
|
+
}
|
|
43536
|
+
if (env.defaultLocation) {
|
|
43537
|
+
configOverride.defaultLocation = env.defaultLocation;
|
|
43538
|
+
}
|
|
43539
|
+
return { configOverride, credentials: env.credentials || undefined };
|
|
43540
|
+
}
|
|
43541
|
+
function mergeProjectConfigOverride(envOverride, cliOverride) {
|
|
43542
|
+
const merged = Object.assign(Object.assign({}, envOverride), cliOverride);
|
|
43543
|
+
if (envOverride.vars || cliOverride.vars) {
|
|
43544
|
+
merged.vars = Object.assign(Object.assign({}, envOverride.vars), cliOverride.vars);
|
|
43545
|
+
}
|
|
43546
|
+
return merged;
|
|
43547
|
+
}
|
|
43548
|
+
function resolveCredentials(envCredentials, cliCredentials, defaultFilename) {
|
|
43549
|
+
if (cliCredentials && cliCredentials !== defaultFilename) {
|
|
43550
|
+
return cliCredentials;
|
|
43551
|
+
}
|
|
43552
|
+
return envCredentials || defaultFilename;
|
|
43553
|
+
}
|
|
43554
|
+
|
|
41006
43555
|
function parsePostgresEvalError(_query, error) {
|
|
41007
43556
|
return sqlanvil.QueryEvaluationError.create({
|
|
41008
43557
|
message: (error === null || error === void 0 ? void 0 : error.message) ? String(error.message) : String(error)
|
|
@@ -43632,6 +46181,21 @@ const actionRetryLimitName = "action-retry-limit";
|
|
|
43632
46181
|
function getCredentialsPath(projectDir, credentialsPath) {
|
|
43633
46182
|
return actuallyResolve(projectDir, credentialsPath);
|
|
43634
46183
|
}
|
|
46184
|
+
function projectConfigOverrideWithEnvironment(projectDir, argv) {
|
|
46185
|
+
const cliOverride = ProjectConfigOptions.constructProjectConfigOverride(argv);
|
|
46186
|
+
if (!argv[ProjectConfigOptions.environment.name]) {
|
|
46187
|
+
return cliOverride;
|
|
46188
|
+
}
|
|
46189
|
+
const { configOverride } = resolveEnvironment(projectDir, argv[ProjectConfigOptions.environment.name]);
|
|
46190
|
+
return mergeProjectConfigOverride(configOverride, cliOverride);
|
|
46191
|
+
}
|
|
46192
|
+
function credentialsPathWithEnvironment(projectDir, argv) {
|
|
46193
|
+
const envCredentials = argv[ProjectConfigOptions.environment.name]
|
|
46194
|
+
? resolveEnvironment(projectDir, argv[ProjectConfigOptions.environment.name]).credentials
|
|
46195
|
+
: undefined;
|
|
46196
|
+
const chosen = resolveCredentials(envCredentials, argv[credentialsOption.name], CREDENTIALS_FILENAME);
|
|
46197
|
+
return getCredentialsPath(projectDir, chosen);
|
|
46198
|
+
}
|
|
43635
46199
|
function runCli() {
|
|
43636
46200
|
const builtYargs = createYargsCli({
|
|
43637
46201
|
commands: [
|
|
@@ -43789,7 +46353,7 @@ function runCli() {
|
|
|
43789
46353
|
}
|
|
43790
46354
|
const compiledGraph = await compile({
|
|
43791
46355
|
projectDir,
|
|
43792
|
-
projectConfigOverride:
|
|
46356
|
+
projectConfigOverride: projectConfigOverrideWithEnvironment(projectDir, argv),
|
|
43793
46357
|
timeoutMillis: argv[timeoutOption.name] || undefined,
|
|
43794
46358
|
verbose: argv[verboseOptionName] || false
|
|
43795
46359
|
});
|
|
@@ -43870,7 +46434,7 @@ function runCli() {
|
|
|
43870
46434
|
}
|
|
43871
46435
|
const compiledGraph = await compile({
|
|
43872
46436
|
projectDir: argv[projectDirMustExistOption.name],
|
|
43873
|
-
projectConfigOverride:
|
|
46437
|
+
projectConfigOverride: projectConfigOverrideWithEnvironment(argv[projectDirMustExistOption.name], argv),
|
|
43874
46438
|
timeoutMillis: argv[timeoutOption.name] || undefined
|
|
43875
46439
|
});
|
|
43876
46440
|
if (compiledGraphHasErrors(compiledGraph)) {
|
|
@@ -43881,7 +46445,7 @@ function runCli() {
|
|
|
43881
46445
|
printSuccess("Compiled successfully.\n");
|
|
43882
46446
|
}
|
|
43883
46447
|
const warehouse = compiledGraph.projectConfig.warehouse || "bigquery";
|
|
43884
|
-
const readCredentials = read(
|
|
46448
|
+
const readCredentials = read(credentialsPathWithEnvironment(argv[projectDirMustExistOption.name], argv), warehouse);
|
|
43885
46449
|
if (!compiledGraph.tests.length) {
|
|
43886
46450
|
printError("No unit tests found.");
|
|
43887
46451
|
return 1;
|
|
@@ -43953,7 +46517,7 @@ function runCli() {
|
|
|
43953
46517
|
}
|
|
43954
46518
|
const compiledGraph = await compile({
|
|
43955
46519
|
projectDir: argv[projectDirOption.name],
|
|
43956
|
-
projectConfigOverride:
|
|
46520
|
+
projectConfigOverride: projectConfigOverrideWithEnvironment(argv[projectDirOption.name], argv),
|
|
43957
46521
|
timeoutMillis: argv[timeoutOption.name] || undefined
|
|
43958
46522
|
});
|
|
43959
46523
|
if (compiledGraphHasErrors(compiledGraph)) {
|
|
@@ -43964,7 +46528,7 @@ function runCli() {
|
|
|
43964
46528
|
printSuccess("Compiled successfully.\n");
|
|
43965
46529
|
}
|
|
43966
46530
|
const warehouse = compiledGraph.projectConfig.warehouse || "bigquery";
|
|
43967
|
-
const readCredentials = read(
|
|
46531
|
+
const readCredentials = read(credentialsPathWithEnvironment(argv[projectDirOption.name], argv), warehouse);
|
|
43968
46532
|
let dbadapter;
|
|
43969
46533
|
if (warehouse.toLowerCase() === "supabase") {
|
|
43970
46534
|
dbadapter = await SupabaseDbAdapter.create(readCredentials);
|
|
@@ -44019,8 +46583,10 @@ function runCli() {
|
|
|
44019
46583
|
print("No actions to run.\n");
|
|
44020
46584
|
return 0;
|
|
44021
46585
|
}
|
|
44022
|
-
const connectionCredentials = readConnections(
|
|
46586
|
+
const connectionCredentials = readConnections(credentialsPathWithEnvironment(argv[projectDirOption.name], argv));
|
|
44023
46587
|
assertConnectionCredentialsAvailable(executionGraph, connectionCredentials);
|
|
46588
|
+
const storageCredentials = readStorageCredentials(credentialsPathWithEnvironment(argv[projectDirOption.name], argv));
|
|
46589
|
+
const isPostgresLike = warehouse.toLowerCase() === "postgres" || warehouse.toLowerCase() === "supabase";
|
|
44024
46590
|
if (argv[dryRunOptionName]) {
|
|
44025
46591
|
print("Dry running (no changes to the warehouse will be applied)...");
|
|
44026
46592
|
}
|
|
@@ -44029,7 +46595,9 @@ function runCli() {
|
|
|
44029
46595
|
}
|
|
44030
46596
|
const runner = run(dbadapter, executionGraph, {
|
|
44031
46597
|
bigquery: bigqueryOptions,
|
|
44032
|
-
connectionCredentials
|
|
46598
|
+
connectionCredentials,
|
|
46599
|
+
warehouseConnection: isPostgresLike ? readCredentials : undefined,
|
|
46600
|
+
storageCredentials
|
|
44033
46601
|
});
|
|
44034
46602
|
process.on("SIGINT", () => {
|
|
44035
46603
|
runner.cancel();
|
|
@@ -44263,6 +46831,11 @@ ProjectConfigOptions.defaultReservation = option("default-reservation", {
|
|
|
44263
46831
|
"workflow_settings.yaml is used. If neither is set, default BigQuery behavior applies.",
|
|
44264
46832
|
type: "string"
|
|
44265
46833
|
});
|
|
46834
|
+
ProjectConfigOptions.environment = option("environment", {
|
|
46835
|
+
describe: "Named environment from workflow_settings.yaml `environments:` to load (its schemaSuffix, " +
|
|
46836
|
+
"vars, defaultDatabase/location, and credentials file). Explicit flags override the environment.",
|
|
46837
|
+
type: "string"
|
|
46838
|
+
});
|
|
44266
46839
|
ProjectConfigOptions.allYargsOptions = [
|
|
44267
46840
|
ProjectConfigOptions.defaultDatabase,
|
|
44268
46841
|
ProjectConfigOptions.defaultSchema,
|
|
@@ -44273,7 +46846,8 @@ ProjectConfigOptions.allYargsOptions = [
|
|
|
44273
46846
|
ProjectConfigOptions.schemaSuffix,
|
|
44274
46847
|
ProjectConfigOptions.tablePrefix,
|
|
44275
46848
|
ProjectConfigOptions.disableAssertions,
|
|
44276
|
-
ProjectConfigOptions.defaultReservation
|
|
46849
|
+
ProjectConfigOptions.defaultReservation,
|
|
46850
|
+
ProjectConfigOptions.environment
|
|
44277
46851
|
];
|
|
44278
46852
|
|
|
44279
46853
|
runCli();
|