@sqlanvil/core 1.5.0 → 1.7.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/bundle.d.ts +375 -1
- package/bundle.js +1 -1
- package/configs.proto +43 -0
- package/core.proto +1 -0
- package/package.json +1 -1
package/bundle.js
CHANGED
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
|
|
15
|
-
(()=>{var __webpack_modules__={127(e,t,n){"use strict";var r=n(5388),i=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),o=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");e.exports=new r("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==i.exec(e)||null!==o.exec(e))},construct:function(e){var t,n,r,a,s,l,c,u,p=0,f=null;if(null===(t=i.exec(e))&&(t=o.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,a=+t[3],!t[4])return new Date(Date.UTC(n,r,a));if(s=+t[4],l=+t[5],c=+t[6],t[7]){for(p=t[7].slice(0,3);p.length<3;)p+="0";p=+p}return t[9]&&(f=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(f=-f)),u=new Date(Date.UTC(n,r,a,s,l,c,p)),f&&u.setTime(u.getTime()-f),u},instanceOf:Date,represent:function(e){return e.toISOString()}})},361(e,t,n){"use strict";var r=t,i=n(3262),o=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function a(e,t){var n=0,r={};for(t|=0;n<e.length;)r[o[n+t]]=e[n++];return r}r.basic=a([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),r.defaults=a([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",i.emptyArray,null]),r.long=a([0,0,0,1,1],7),r.mapKey=a([0,0,0,5,5,0,0,0,1,1,0,2],2),r.packed=a([1,5,0,0,0,5,5,0,0,0,1,1,0])},390(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=n(7210),o=r(n(9553)),a=n(3165),s=["self","ref","resolve","name","when","incremental","schema","database"].map((e=>`const ${e} = ctx.${e} ? ctx.${e}.bind(ctx) : undefined;`)).join("\n"),l=["EXPECT"].map((e=>`const ${e} = ctx.${e} ? ctx.${e} : undefined;`)).join("\n");function c(e){const t=[""];return e.forEach((e=>{"string"==typeof e||e.type!==a.SyntaxTreeNodeType.SQL_STATEMENT_SEPARATOR?t[t.length-1]+=function(e){return"string"==typeof e?u.get(a.SyntaxTreeNodeType.SQL_LITERAL_STRING)(e):e.concatenate(u)}(e):t.push("")})),t}t.INVALID_YAML_ERROR_STRING="is not a valid YAML file",t.compile=function(e,n){if("sqlx"===o.fileExtension(n))return function(e,t){const{config:n,js:r,sql:i,incremental:u,preOperations:p,postOperations:f,inputs:d}=function(e){let t="",n="";e.children().filter(a.SyntaxTreeNode.isSyntaxTreeNode).filter((e=>e.type===a.SyntaxTreeNodeType.JAVASCRIPT)).forEach((e=>{const r=e.concatenate();r.startsWith("config")?t=r.slice(7):n+=r.slice(4,-1)}));const r=c(e.children().filter((e=>"string"==typeof e||[a.SyntaxTreeNodeType.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER,a.SyntaxTreeNodeType.SQL_COMMENT,a.SyntaxTreeNodeType.SQL_LITERAL_STRING,a.SyntaxTreeNodeType.SQL_LITERAL_MULTILINE_STRING,a.SyntaxTreeNodeType.SQL_STATEMENT_SEPARATOR].includes(e.type))));let i="",o=[],s=[];const l=[];return e.children().filter(a.SyntaxTreeNode.isSyntaxTreeNode).filter((e=>e.type===a.SyntaxTreeNodeType.SQL)).forEach((e=>{const t=e.children()[0],n=e.children().slice(-1)[0],r=c((1===e.children().length?new a.SyntaxTreeNode(a.SyntaxTreeNodeType.SQL,[t.slice(t.indexOf("{")+1,t.lastIndexOf("}"))]):new a.SyntaxTreeNode(a.SyntaxTreeNodeType.SQL,[t.slice(t.indexOf("{")+1),...e.children().slice(1,-1),n.slice(0,n.lastIndexOf("}"))])).children());if(t.startsWith("incremental_where")){if(r.length>1)throw new Error("'incremental_where' code blocks may only contain a single SQL statement.");i=r[0]}else if(t.startsWith("pre_operations"))o=r;else if(t.startsWith("post_operations"))s=r;else if(t.startsWith("input")){if(r.length>1)throw new Error("'input' code blocks may only contain a single SQL statement.");const e=t.slice(t.indexOf('"'),t.lastIndexOf('"')+1).split(",").map((e=>e.trim().slice(1,-1)));l.push({labelParts:e,value:r[0]})}})),{config:t,js:n,sql:r,incremental:i,preOperations:o,postOperations:s,inputs:l}}(e);return`sqlanvil.sqlxAction({\n sqlxConfig: {\n name: "${o.escapedBasename(t)}",\n type: "operations",\n ...${n||"{}"}\n },\n sqlStatementCount: ${i.length},\n sqlContextable: (ctx) => {\n ${s}\n ${l}\n ${r}\n return [${i.map((e=>`\`${e}\``))}];\n },\n incrementalWhereContextable: ${u?`(ctx) => {\n ${s}\n ${l}\n ${r}\n return \`${u}\`\n }`:"undefined"},\n preOperationsContextable: ${p.length>0?`(ctx) => {\n ${s}\n ${l}\n ${r}\n return [${p.map((e=>`\`${e}\``))}];\n }`:"undefined"},\n postOperationsContextable: ${f.length>0?`(ctx) => {\n ${s}\n ${l}\n ${r}\n return [${f.map((e=>`\`${e}\``))}];\n }`:"undefined"},\n inputContextables: [\n ${d.map((({labelParts:e,value:t})=>`{\n refName: [${e.map((e=>`"${e}"`)).join(", ")}],\n contextable: (ctx) => {\n ${r}\n return \`${t}\`;\n }\n }`)).join(",")}\n ]\n});\n`}(a.SyntaxTreeNode.create(e),n);if("yaml"===o.fileExtension(n)||"yml"===o.fileExtension(n))try{const t=i.load(e);return`exports.asJson = ${JSON.stringify(t)}`}catch(e){if(e instanceof i.YAMLException)throw new Error(`${n} ${t.INVALID_YAML_ERROR_STRING}: ${e}`);throw e}if("ipynb"===o.fileExtension(n)){let t={};try{t=JSON.parse(e)}catch(e){throw new Error(`Error parsing ${n} as JSON: ${e}`)}return`exports.asJson = ${JSON.stringify(t)}`}return"sql"===o.fileExtension(n)?`exports.query = \`${e.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\${/g,"\\${")}\`;`:e},t.extractJsBlocks=function(e){const t=[];return{sql:e.replace(/^\s*\/\*[jJ][sS]\s*[\r\n]+((?:[^*]|[\r\n]|(?:\*+(?:[^*/]|[\r\n])))*)\*+\/|^\s*\-\-[jJ][sS]\s(.*)/gm,((e,n,r)=>(n&&t.push(n),r&&t.push(r),""))).replace(/([^\\])`/g,((e,t)=>t+"\\`")).trim(),js:t.map((e=>e.trim())).join("\n")}};const u=new Map([[a.SyntaxTreeNodeType.SQL_COMMENT,e=>e.replace(/`/g,"\\`").replace(/\${/g,"\\${")],[a.SyntaxTreeNodeType.SQL_LITERAL_STRING,e=>e.replace(/\\/g,"\\\\").replace(/\`/g,"\\`")],[a.SyntaxTreeNodeType.SQL_LITERAL_MULTILINE_STRING,e=>e.replace(/\\/g,"\\\\").replace(/\`/g,"\\`")]])},420(e,t,n){"use strict";e.exports=function(e){var t=i.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),n={};e.oneofsArray.length&&t("var p={}");for(var r=0;r<e.fieldsArray.length;++r){var l=e._fieldsArray[r].resolve(),c="m"+i.safeProp(l.name);if(l.optional&&t("if(%s!=null&&m.hasOwnProperty(%j)){",c,l.name),l.map)t("if(!util.isObject(%s))",c)("return%j",o(l,"object"))("var k=Object.keys(%s)",c)("for(var i=0;i<k.length;++i){"),s(t,l,"k[i]"),a(t,l,r,c+"[k[i]]")("}");else if(l.repeated)t("if(!Array.isArray(%s))",c)("return%j",o(l,"array"))("for(var i=0;i<%s.length;++i){",c),a(t,l,r,c+"[i]")("}");else{if(l.partOf){var u=i.safeProp(l.partOf.name);1===n[l.partOf.name]&&t("if(p%s===1)",u)("return%j",l.partOf.name+": multiple values"),n[l.partOf.name]=1,t("p%s=1",u)}a(t,l,r,c)}l.optional&&t("}")}return t("return null")};var r=n(5643),i=n(3262);function o(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function a(e,t,n,i){if(t.resolvedType)if(t.resolvedType instanceof r){e("switch(%s){",i)("default:")("return%j",o(t,"enum value"));for(var a=Object.keys(t.resolvedType.values),s=0;s<a.length;++s)e("case %i:",t.resolvedType.values[a[s]]);e("break")("}")}else e("{")("var e=types[%i].verify(%s);",n,i)("if(e)")("return%j+e",t.name+".")("}");else switch(t.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.isInteger(%s))",i)("return%j",o(t,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",i,i,i,i)("return%j",o(t,"integer|Long"));break;case"float":case"double":e('if(typeof %s!=="number")',i)("return%j",o(t,"number"));break;case"bool":e('if(typeof %s!=="boolean")',i)("return%j",o(t,"boolean"));break;case"string":e("if(!util.isString(%s))",i)("return%j",o(t,"string"));break;case"bytes":e('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',i,i,i)("return%j",o(t,"buffer"))}return e}function s(e,t,n){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",n)("return%j",o(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",n)("return%j",o(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",n)("return%j",o(t,"boolean key"))}return e}},472(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(390);t.compiler=r.compile;const i=n(6899);t.jitCompiler=i.jitCompiler;const o=n(7983);t.main=o.main;const a=n(7180),s=n(2628);t.version=s.version;const l=n(5379),c=(global._DF_SESSION||(global._DF_SESSION=new a.Session),global._DF_SESSION);t.session=c;const u=[l.sqlanvil.SupportedFeatures.ARRAY_BUFFER_IPC];t.supportedFeatures=u,t.indexFileGenerator=function(){throw new Error("@sqlanvil/cli ^3.0.0 required.")}},527(e){"use strict";e.exports=p;var t=/[\s{}=;:[\],'"()<>]/g,n=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,r=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,i=/^ *[*/]+ */,o=/^\s*\*?\/*/,a=/\n/g,s=/\s/,l=/\\(.?)/g,c={0:"\0",r:"\r",n:"\n",t:"\t"};function u(e){return e.replace(l,(function(e,t){switch(t){case"\\":case"":return t;default:return c[t]||""}}))}function p(e,l){e=e.toString();var c=0,p=e.length,f=1,d=0,g={},h=[],y=null;function b(e){return Error("illegal "+e+" (line "+f+")")}function m(t){return e.charAt(t)}function v(t,n,r){var s,c={type:e.charAt(t++),lineEmpty:!1,leading:r},u=t-(l?2:3);do{if(--u<0||"\n"===(s=e.charAt(u))){c.lineEmpty=!0;break}}while(" "===s||"\t"===s);for(var p=e.substring(t,n).split(a),h=0;h<p.length;++h)p[h]=p[h].replace(l?o:i,"").trim();c.text=p.join("\n").trim(),g[f]=c,d=f}function O(t){var n=T(t),r=e.substring(t,n);return/^\s*\/\//.test(r)}function T(e){for(var t=e;t<p&&"\n"!==m(t);)t++;return t}function w(){if(h.length>0)return h.shift();if(y)return function(){var t="'"===y?r:n;t.lastIndex=c-1;var i=t.exec(e);if(!i)throw b("string");return c=t.lastIndex,j(y),y=null,u(i[1])}();var i,o,a,d,g,w=0===c;do{if(c===p)return null;for(i=!1;s.test(a=m(c));)if("\n"===a&&(w=!0,++f),++c===p)return null;if("/"===m(c)){if(++c===p)throw b("comment");if("/"===m(c))if(l){if(d=c,g=!1,O(c-1)){g=!0;do{if((c=T(c))===p)break;if(c++,!w)break}while(O(c))}else c=Math.min(p,T(c)+1);g&&(v(d,c,w),w=!0),f++,i=!0}else{for(g="/"===m(d=c+1);"\n"!==m(++c);)if(c===p)return null;++c,g&&(v(d,c-1,w),w=!0),++f,i=!0}else{if("*"!==(a=m(c)))return"/";d=c+1,g=l||"*"===m(d);do{if("\n"===a&&++f,++c===p)throw b("comment");o=a,a=m(c)}while("*"!==o||"/"!==a);++c,g&&(v(d,c-2,w),w=!0),i=!0}}}while(i);var P=c;if(t.lastIndex=0,!t.test(m(P++)))for(;P<p&&!t.test(m(P));)++P;var q=e.substring(c,c=P);return'"'!==q&&"'"!==q||(y=q),q}function j(e){h.push(e)}function P(){if(!h.length){var e=w();if(null===e)return null;j(e)}return h[0]}return Object.defineProperty({next:w,peek:P,push:j,skip:function(e,t){var n=P();if(n===e)return w(),!0;if(!t)throw b("token '"+n+"', '"+e+"' expected");return!1},cmnt:function(e){var t,n=null;return void 0===e?(t=g[f-1],delete g[f-1],t&&(l||"*"===t.type||t.lineEmpty)&&(n=t.leading?t.text:null)):(d<e&&P(),t=g[e],delete g[e],!t||t.lineEmpty||!l&&"/"!==t.type||(n=t.leading?null:t.text)),n}},"line",{get:function(){return f}})}p.unescape=u},744(e,t,n){"use strict";var r=t,i=n(5643),o=n(3262);function a(e,t,n,r){var o=!1;if(t.resolvedType)if(t.resolvedType instanceof i){e("switch(d%s){",r);for(var a=t.resolvedType.values,s=Object.keys(a),l=0;l<s.length;++l)a[s[l]]!==t.typeDefault||o||(e("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',r,r,r),t.repeated||e("break"),o=!0),e("case%j:",s[l])("case %i:",a[s[l]])("m%s=%j",r,a[s[l]])("break");e("}")}else e('if(typeof d%s!=="object")',r)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",r,n,r);else{var c=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",r,r);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",r,r);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",r,r);break;case"uint64":c=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",r,r,c)('else if(typeof d%s==="string")',r)("m%s=parseInt(d%s,10)",r,r)('else if(typeof d%s==="number")',r)("m%s=d%s",r,r)('else if(typeof d%s==="object")',r)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",r,r,r,c?"true":"");break;case"bytes":e('if(typeof d%s==="string")',r)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",r,r,r)("else if(d%s.length >= 0)",r)("m%s=d%s",r,r);break;case"string":e("m%s=String(d%s)",r,r);break;case"bool":e("m%s=Boolean(d%s)",r,r)}}return e}function s(e,t,n,r){if(t.resolvedType)t.resolvedType instanceof i?e("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",r,n,r,r,n,r,r):e("d%s=types[%i].toObject(m%s,o)",r,n,r);else{var o=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",r,r,r,r);break;case"uint64":o=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',r)("d%s=o.longs===String?String(m%s):m%s",r,r,r)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",r,r,r,r,o?"true":"",r);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",r,r,r,r,r);break;default:e("d%s=m%s",r,r)}}return e}r.fromObject=function(e){var t=e.fieldsArray,n=o.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return n("return new this.ctor");n("var m=new this.ctor");for(var r=0;r<t.length;++r){var s=t[r].resolve(),l=o.safeProp(s.name);s.map?(n("if(d%s){",l)('if(typeof d%s!=="object")',l)("throw TypeError(%j)",s.fullName+": object expected")("m%s={}",l)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",l),a(n,s,r,l+"[ks[i]]")("}")("}")):s.repeated?(n("if(d%s){",l)("if(!Array.isArray(d%s))",l)("throw TypeError(%j)",s.fullName+": array expected")("m%s=[]",l)("for(var i=0;i<d%s.length;++i){",l),a(n,s,r,l+"[i]")("}")("}")):(s.resolvedType instanceof i||n("if(d%s!=null){",l),a(n,s,r,l),s.resolvedType instanceof i||n("}"))}return n("return m")},r.toObject=function(e){var t=e.fieldsArray.slice().sort(o.compareFieldsById);if(!t.length)return o.codegen()("return {}");for(var n=o.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),r=[],a=[],l=[],c=0;c<t.length;++c)t[c].partOf||(t[c].resolve().repeated?r:t[c].map?a:l).push(t[c]);if(r.length){for(n("if(o.arrays||o.defaults){"),c=0;c<r.length;++c)n("d%s=[]",o.safeProp(r[c].name));n("}")}if(a.length){for(n("if(o.objects||o.defaults){"),c=0;c<a.length;++c)n("d%s={}",o.safeProp(a[c].name));n("}")}if(l.length){for(n("if(o.defaults){"),c=0;c<l.length;++c){var u=l[c],p=o.safeProp(u.name);if(u.resolvedType instanceof i)n("d%s=o.enums===String?%j:%j",p,u.resolvedType.valuesById[u.typeDefault],u.typeDefault);else if(u.long)n("if(util.Long){")("var n=new util.Long(%i,%i,%j)",u.typeDefault.low,u.typeDefault.high,u.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",p)("}else")("d%s=o.longs===String?%j:%i",p,u.typeDefault.toString(),u.typeDefault.toNumber());else if(u.bytes){var f="["+Array.prototype.slice.call(u.typeDefault).join(",")+"]";n("if(o.bytes===String)d%s=%j",p,String.fromCharCode.apply(String,u.typeDefault))("else{")("d%s=%s",p,f)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",p,p)("}")}else n("d%s=%j",p,u.typeDefault)}n("}")}var d=!1;for(c=0;c<t.length;++c){u=t[c];var g=e._fieldsArray.indexOf(u);p=o.safeProp(u.name),u.map?(d||(d=!0,n("var ks2")),n("if(m%s&&(ks2=Object.keys(m%s)).length){",p,p)("d%s={}",p)("for(var j=0;j<ks2.length;++j){"),s(n,u,g,p+"[ks2[j]]")("}")):u.repeated?(n("if(m%s&&m%s.length){",p,p)("d%s=[]",p)("for(var j=0;j<m%s.length;++j){",p),s(n,u,g,p+"[j]")("}")):(n("if(m%s!=null&&m.hasOwnProperty(%j)){",p,u.name),s(n,u,g,p),u.partOf&&n("if(o.oneofs)")("d%s=%j",o.safeProp(u.partOf.name),u.name)),n("}")}return n("return d")}},818(e,t,n){"use strict";e.exports=o;var r=n(3449);(o.prototype=Object.create(r.prototype)).constructor=o;var i=n(3610);function o(){r.call(this)}function a(e,t,n){e.length<40?i.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}o._configure=function(){o.alloc=i._Buffer_allocUnsafe,o.writeBytesBuffer=i.Buffer&&i.Buffer.prototype instanceof Uint8Array&&"set"===i.Buffer.prototype.set.name?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},o.prototype.bytes=function(e){i.isString(e)&&(e=i._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(o.writeBytesBuffer,t,e),this},o.prototype.string=function(e){var t=i.Buffer.byteLength(e);return this.uint32(t),t&&this._push(a,t,e),this},o._configure()},887(e,t){var n,r;void 0===(r="function"==typeof(n=function(){"use strict";var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n="boolean"==typeof(new RegExp).sticky;function r(e){return e&&"[object RegExp]"===t.call(e)}function i(e){return e&&"object"==typeof e&&!r(e)&&!Array.isArray(e)}function o(e){return"("+e+")"}function a(e){return e.length?"(?:"+e.map((function(e){return"(?:"+e+")"})).join("|")+")":"(?!)"}function s(e){if("string"==typeof e)return"(?:"+(e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+")");if(r(e)){if(e.ignoreCase)throw new Error("RegExp /i flag not allowed");if(e.global)throw new Error("RegExp /g flag is implied");if(e.sticky)throw new Error("RegExp /y flag is implied");if(e.multiline)throw new Error("RegExp /m flag is implied");return e.source}throw new Error("Not a pattern: "+e)}function l(t,n){if(i(n)||(n={match:n}),n.include)throw new Error("Matching rules cannot also include states");var o={defaultType:t,lineBreaks:!!n.error||!!n.fallback,pop:!1,next:null,push:null,error:!1,fallback:!1,value:null,type:null,shouldThrow:!1};for(var a in n)e.call(n,a)&&(o[a]=n[a]);if("string"==typeof o.type&&t!==o.type)throw new Error("Type transform cannot be a string (type '"+o.type+"' for token '"+t+"')");var s=o.match;return o.match=Array.isArray(s)?s:s?[s]:[],o.match.sort((function(e,t){return r(e)&&r(t)?0:r(t)?-1:r(e)?1:t.length-e.length})),o}function c(e){return Array.isArray(e)?function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];if(r.include)for(var i=[].concat(r.include),o=0;o<i.length;o++)t.push({include:i[o]});else{if(!r.type)throw new Error("Rule has no type: "+JSON.stringify(r));t.push(l(r.type,r))}}return t}(e):function(e){for(var t=Object.getOwnPropertyNames(e),n=[],r=0;r<t.length;r++){var o=t[r],a=e[o],s=[].concat(a);if("include"!==o){var c=[];s.forEach((function(e){i(e)?(c.length&&n.push(l(o,c)),n.push(l(o,e)),c=[]):c.push(e)})),c.length&&n.push(l(o,c))}else for(var u=0;u<s.length;u++)n.push({include:s[u]})}return n}(e)}var u=l("error",{lineBreaks:!0,shouldThrow:!0});function p(e,t){for(var i=null,l=Object.create(null),c=!0,p=null,f=[],d=[],g=0;g<e.length;g++)e[g].fallback&&(c=!1);for(g=0;g<e.length;g++){var h=e[g];if(h.include)throw new Error("Inheritance is not allowed in stateless lexers");if(h.error||h.fallback){if(i)throw!h.fallback==!i.fallback?new Error("Multiple "+(h.fallback?"fallback":"error")+" rules not allowed (for token '"+h.defaultType+"')"):new Error("fallback and error are mutually exclusive (for token '"+h.defaultType+"')");i=h}var y=h.match.slice();if(c)for(;y.length&&"string"==typeof y[0]&&1===y[0].length;)l[y.shift().charCodeAt(0)]=h;if(h.pop||h.push||h.next){if(!t)throw new Error("State-switching options are not allowed in stateless lexers (for token '"+h.defaultType+"')");if(h.fallback)throw new Error("State-switching options are not allowed on fallback tokens (for token '"+h.defaultType+"')")}if(0!==y.length){c=!1,f.push(h);for(var b=0;b<y.length;b++){var m=y[b];if(r(m))if(null===p)p=m.unicode;else if(p!==m.unicode&&!1===h.fallback)throw new Error("If one rule is /u then all must be")}var v=a(y.map(s)),O=new RegExp(v);if(O.test(""))throw new Error("RegExp matches empty string: "+O);if(new RegExp("|"+v).exec("").length-1>0)throw new Error("RegExp has capture groups: "+O+"\nUse (?: … ) instead");if(!h.lineBreaks&&O.test("\n"))throw new Error("Rule should declare lineBreaks: "+O);d.push(o(v))}}var T=i&&i.fallback,w=n&&!T?"ym":"gm",j=n||T?"":"|";return!0===p&&(w+="u"),{regexp:new RegExp(a(d)+j,w),groups:f,fast:l,error:i||u}}function f(e,t,n){var r=e&&(e.push||e.next);if(r&&!n[r])throw new Error("Missing state '"+r+"' (in token '"+e.defaultType+"' of state '"+t+"')");if(e&&e.pop&&1!=+e.pop)throw new Error("pop must be 1 (in token '"+e.defaultType+"' of state '"+t+"')")}var d=function(e,t){this.startState=t,this.states=e,this.buffer="",this.stack=[],this.reset()};d.prototype.reset=function(e,t){return this.buffer=e||"",this.index=0,this.line=t?t.line:1,this.col=t?t.col:1,this.queuedToken=t?t.queuedToken:null,this.queuedThrow=t?t.queuedThrow:null,this.setState(t?t.state:this.startState),this.stack=t&&t.stack?t.stack.slice():[],this},d.prototype.save=function(){return{line:this.line,col:this.col,state:this.state,stack:this.stack.slice(),queuedToken:this.queuedToken,queuedThrow:this.queuedThrow}},d.prototype.setState=function(e){if(e&&this.state!==e){this.state=e;var t=this.states[e];this.groups=t.groups,this.error=t.error,this.re=t.regexp,this.fast=t.fast}},d.prototype.popState=function(){this.setState(this.stack.pop())},d.prototype.pushState=function(e){this.stack.push(this.state),this.setState(e)};var g=n?function(e,t){return e.exec(t)}:function(e,t){var n=e.exec(t);return 0===n[0].length?null:n};function h(){return this.value}if(d.prototype._getGroup=function(e){for(var t=this.groups.length,n=0;n<t;n++)if(void 0!==e[n+1])return this.groups[n];throw new Error("Cannot find token type for matched text")},d.prototype.next=function(){var e=this.index;if(this.queuedGroup){var t=this._token(this.queuedGroup,this.queuedText,e);return this.queuedGroup=null,this.queuedText="",t}var n=this.buffer;if(e!==n.length){if(a=this.fast[n.charCodeAt(e)])return this._token(a,n.charAt(e),e);var r=this.re;r.lastIndex=e;var i=g(r,n),o=this.error;if(null==i)return this._token(o,n.slice(e,n.length),e);var a=this._getGroup(i),s=i[0];return o.fallback&&i.index!==e?(this.queuedGroup=a,this.queuedText=s,this._token(o,n.slice(e,i.index),e)):this._token(a,s,e)}},d.prototype._token=function(e,t,n){var r=0;if(e.lineBreaks){var i=/\n/g,o=1;if("\n"===t)r=1;else for(;i.exec(t);)r++,o=i.lastIndex}var a={type:"function"==typeof e.type&&e.type(t)||e.defaultType,value:"function"==typeof e.value?e.value(t):t,text:t,toString:h,offset:n,lineBreaks:r,line:this.line,col:this.col},s=t.length;if(this.index+=s,this.line+=r,0!==r?this.col=s-o+1:this.col+=s,e.shouldThrow)throw new Error(this.formatError(a,"invalid syntax"));return e.pop?this.popState():e.push?this.pushState(e.push):e.next&&this.setState(e.next),a},"undefined"!=typeof Symbol&&Symbol.iterator){var y=function(e){this.lexer=e};y.prototype.next=function(){var e=this.lexer.next();return{value:e,done:!e}},y.prototype[Symbol.iterator]=function(){return this},d.prototype[Symbol.iterator]=function(){return new y(this)}}return d.prototype.formatError=function(e,t){if(null==e){var n=this.buffer.slice(this.index);e={text:n,offset:this.index,lineBreaks:-1===n.indexOf("\n")?0:1,line:this.line,col:this.col}}var r=Math.max(0,e.offset-e.col+1),i=e.lineBreaks?e.text.indexOf("\n"):e.text.length,o=this.buffer.substring(r,e.offset+i);return t+=" at line "+e.line+" col "+e.col+":\n\n",(t+=" "+o+"\n")+" "+Array(e.col).join(" ")+"^"},d.prototype.clone=function(){return new d(this.states,this.state)},d.prototype.has=function(e){return!0},{compile:function(e){var t=p(c(e));return new d({start:t},"start")},states:function(e,t){var n=e.$all?c(e.$all):[];delete e.$all;var r=Object.getOwnPropertyNames(e);t||(t=r[0]);for(var i=Object.create(null),o=0;o<r.length;o++)i[v=r[o]]=c(e[v]).concat(n);for(o=0;o<r.length;o++)for(var a=i[v=r[o]],s=Object.create(null),l=0;l<a.length;l++){var u=a[l];if(u.include){var g=[l,1];if(u.include!==v&&!s[u.include]){s[u.include]=!0;var h=i[u.include];if(!h)throw new Error("Cannot include nonexistent state '"+u.include+"' (in state '"+v+"')");for(var y=0;y<h.length;y++){var b=h[y];-1===a.indexOf(b)&&g.push(b)}}a.splice.apply(a,g),l--}}var m=Object.create(null);for(o=0;o<r.length;o++){var v;m[v=r[o]]=p(i[v],!0)}for(o=0;o<r.length;o++){var O=r[o],T=m[O],w=T.groups;for(l=0;l<w.length;l++)f(w[l],O,m);var j=Object.getOwnPropertyNames(T.fast);for(l=0;l<j.length;l++)f(T.fast[j[l]],O,m)}return new d(m,t)},error:Object.freeze({error:!0}),fallback:Object.freeze({fallback:!0}),keywords:function(e){for(var t=Object.create(null),n=Object.create(null),r=Object.getOwnPropertyNames(e),i=0;i<r.length;i++){var o=r[i],a=e[o];(Array.isArray(a)?a:[a]).forEach((function(e){if((n[e.length]=n[e.length]||[]).push(e),"string"!=typeof e)throw new Error("keyword must be string (in keyword '"+o+"')");t[e]=o}))}function s(e){return JSON.stringify(e)}var l="";for(var c in l+="switch (value.length) {\n",n){var u=n[c];l+="case "+c+":\n",l+="switch (value) {\n",u.forEach((function(e){var n=t[e];l+="case "+s(e)+": return "+s(n)+"\n"})),l+="}\n"}return l+="}\n",Function("value",l)}}})?n.apply(t,[]):n)||(e.exports=r)},1080(e,t,n){"use strict";e.exports=function(e){for(var t,n=o.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),s=e.fieldsArray.slice().sort(o.compareFieldsById),l=0;l<s.length;++l){var c=s[l].resolve(),u=e._fieldsArray.indexOf(c),p=c.resolvedType instanceof r?"int32":c.type,f=i.basic[p];t="m"+o.safeProp(c.name),c.map?(n("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",t,c.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",t)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(c.id<<3|2)>>>0,8|i.mapKey[c.keyType],c.keyType),void 0===f?n("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",u,t):n(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|f,p,t),n("}")("}")):c.repeated?(n("if(%s!=null&&%s.length){",t,t),c.packed&&void 0!==i.packed[p]?n("w.uint32(%i).fork()",(c.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",p,t)("w.ldelim()"):(n("for(var i=0;i<%s.length;++i)",t),void 0===f?a(n,c,u,t+"[i]"):n("w.uint32(%i).%s(%s[i])",(c.id<<3|f)>>>0,p,t)),n("}")):(c.optional&&n("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,c.name),void 0===f?a(n,c,u,t):n("w.uint32(%i).%s(%s)",(c.id<<3|f)>>>0,p,t))}return n("return w")};var r=n(5643),i=n(361),o=n(3262);function a(e,t,n,r){return t.delimited?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",n,r,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",n,r,(t.id<<3|2)>>>0)}},1231(e){"use strict";function t(e,t){var n="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+="\n\n"+e.mark.snippet),r+" "+n):r}function n(e,n){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=n,this.message=t(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n.prototype.toString=function(e){return this.name+": "+t(this,e)},e.exports=n},1287(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CompilationSql=class{constructor(e,t){this.project=e,this.sqlanvilCoreVersion=t}get warehouse(){return(this.project.warehouse||"bigquery").toLowerCase()}resolveTarget(e){const t=e.database||this.project.defaultDatabase,n=e.schema||this.project.defaultSchema,r=e.name;return"postgres"===this.warehouse||"supabase"===this.warehouse?t?`"${t}"."${n}"."${r}"`:`"${n}"."${r}"`:"mysql"===this.warehouse?`\`${n}\`.\`${r}\``:t?`\`${t}.${n}.${r}\``:`\`${n}.${r}\``}sqlString(e){return"postgres"===this.warehouse||"supabase"===this.warehouse?`'${e.replace(/'/g,"''")}'`:`'${e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}'`}indexAssertion(e,t){const n=t.map((e=>"postgres"===this.warehouse||"supabase"===this.warehouse?`"${e.replace(/"/g,'""')}"`:"mysql"===this.warehouse?`\`${e.replace(/`/g,"``")}\``:e)).join(", ");return`\nSELECT\n *\nFROM (\n SELECT\n ${n},\n COUNT(1) AS index_row_count\n FROM ${e}\n GROUP BY ${n}\n ) AS data\nWHERE index_row_count > 1\n`}rowConditionsAssertion(e,t){return t.map((t=>`\nSELECT\n ${this.sqlString(t)} AS failing_row_condition,\n *\nFROM ${e}\nWHERE NOT (${t})\n`)).join("UNION ALL")}}},1299(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=n(8512),o=n(5436),a=n(2008),s=n(8995),l=n(8545),c=r(n(9553)),u=n(2545),p=n(5379);class f extends o.ActionBuilder{constructor(e,t,n){var r,i,o,a,s,l;if(super(e),this.dependOnDependencyAssertions=!1,this.contextablePreOps=[],this.contextablePostOps=[],this.proto=p.sqlanvil.Table.create({type:"incremental",enumType:p.sqlanvil.TableType.INCREMENTAL,disabled:!1,tags:[]}),this.uniqueKeyAssertions=[],this.session=e,this.configPath=n,this.unverifiedConfig=Object.assign({},t),!t)return;const f=this.verifyConfig(t);f.name||(f.name=c.basename(f.filename));const d=u.actionConfigToCompiledGraphTarget(f);return this.proto.target=this.applySessionToTarget(d,e.projectConfig,f.filename,{validateTarget:!0}),this.proto.canonicalTarget=this.applySessionToTarget(d,e.canonicalProjectConfig),n&&(f.filename=u.resolveActionsConfigFilename(f.filename,n),this.query(u.nativeRequire(f.filename).query)),f.filename&&(this.proto.fileName=f.filename),f.dependOnDependencyAssertions&&this.setDependOnDependencyAssertions(f.dependOnDependencyAssertions),f.dependencyTargets&&this.dependencies(f.dependencyTargets.map((e=>u.configTargetToCompiledGraphTarget(p.sqlanvil.ActionConfig.Target.create(e))))),void 0!==f.hermetic&&this.hermetic(f.hermetic),f.disabled&&this.disabled(),f.tags&&this.tags(f.tags),f.description&&this.description(f.description),f.metadata&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.metadata=f.metadata),(null===(r=f.columns)||void 0===r?void 0:r.length)&&this.columns(f.columns.map((e=>p.sqlanvil.ActionConfig.ColumnDescriptor.create(e)))),f.project&&this.database(f.project),f.dataset&&this.schema(f.dataset),f.assertions&&this.assertions(p.sqlanvil.ActionConfig.TableAssertionsConfig.create(f.assertions)),f.uniqueKey&&this.uniqueKey(f.uniqueKey),this.protected(f.protected),f.preOperations&&this.preOps(f.preOperations),f.postOperations&&this.postOps(f.postOperations),this.bigquery(Object.assign({partitionBy:f.partitionBy,clusterBy:f.clusterBy,updatePartitionFilter:f.updatePartitionFilter,labels:f.labels,partitionExpirationDays:f.partitionExpirationDays,requirePartitionFilter:f.requirePartitionFilter,additionalOptions:f.additionalOptions},f.iceberg?{connection:u.getConnectionForIcebergTable(f.iceberg.connection,null===(i=e.projectConfig.defaultIcebergConfig)||void 0===i?void 0:i.connection),fileFormat:u.getFileFormatValueForIcebergTable(null===(o=f.iceberg.fileFormat)||void 0===o?void 0:o.toString()),tableFormat:p.sqlanvil.TableFormat.ICEBERG,storageUri:u.getStorageUriForIcebergTable(u.getEffectiveBucketName(null===(a=e.projectConfig.defaultIcebergConfig)||void 0===a?void 0:a.bucketName,f.iceberg.bucketName),u.getEffectiveTableFolderRoot(null===(s=e.projectConfig.defaultIcebergConfig)||void 0===s?void 0:s.tableFolderRoot,f.iceberg.tableFolderRoot),u.getEffectiveTableFolderSubpath(this.proto.target.schema,this.proto.target.name,null===(l=e.projectConfig.defaultIcebergConfig)||void 0===l?void 0:l.tableFolderSubpath,f.iceberg.tableFolderSubpath))}:{})),f.postgres&&this.postgres(f.postgres),f.supabase&&this.supabase(f.supabase),this.proto.onSchemaChange=this.mapOnSchemaChange(f.onSchemaChange),f.reservation&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.reservation=f.reservation),this}type(e){let t;switch(e){case"table":t=new a.Table(this.session,Object.assign(Object.assign({},this.unverifiedConfig),{type:"table"}),this.configPath);break;case"incremental":return this;case"view":t=new s.View(this.session,Object.assign(Object.assign({},this.unverifiedConfig),{type:"view"}),this.configPath);break;default:throw new Error(`Unexpected table type: ${e}`)}const n=this.session.actions.indexOf(this);if(-1===n)throw Error("Expected pre-existing action, but none found. Please report this to the sqlanvil team.");this.session.actions[n]=t}query(e){return this.contextableQuery=e,this}where(e){return this.contextableWhere=e,this}jitCode(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.compilationMode=p.sqlanvil.ActionCompilationMode.ACTION_COMPILATION_MODE_JIT,this.contextableJitCode=e,this}preOps(e){return this.contextablePreOps.push(e),this}postOps(e){return this.contextablePostOps.push(e),this}disabled(e=!0){var t;return this.proto.disabled=e,this.uniqueKeyAssertions.forEach((t=>t.disabled(e))),null===(t=this.rowConditionsAssertion)||void 0===t||t.disabled(e),this}protected(e){return this.proto.protected=null==e||e,this}uniqueKey(e){this.proto.uniqueKey=e}bigquery(e){e.labels&&Object.keys(e.labels).length>0&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.bigqueryLabels=e.labels);const t=o.LegacyConfigConverter.legacyConvertBigQueryOptions(e);return Object.values(t).length>0&&(this.proto.bigquery=p.sqlanvil.BigQueryOptions.create(t)),this}postgres(e){return this.proto.postgres=p.sqlanvil.PostgresOptions.create(e),this}supabase(e){return this.proto.supabase=p.sqlanvil.SupabaseOptions.create(e),this}dependencies(e){return(Array.isArray(e)?e:[e]).forEach((e=>this.proto.dependencyTargets.push(u.checkAssertionsForDependency(this,e)))),this}hermetic(e){this.proto.hermeticity=e?p.sqlanvil.ActionHermeticity.HERMETIC:p.sqlanvil.ActionHermeticity.NON_HERMETIC}tags(e){var t;return("string"==typeof e?[e]:e).forEach((e=>{this.proto.tags.push(e)})),this.uniqueKeyAssertions.forEach((t=>t.tags(e))),null===(t=this.rowConditionsAssertion)||void 0===t||t.tags(e),this}description(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.description=e,this}columns(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.columns=l.ColumnDescriptors.mapConfigProtoToCompilationProto(e),this}database(e){return this.proto.target=this.applySessionToTarget(p.sqlanvil.Target.create(Object.assign(Object.assign({},this.proto.target),{database:e})),this.session.projectConfig,this.proto.fileName,{validateTarget:!0}),this}schema(e){return this.proto.target=this.applySessionToTarget(p.sqlanvil.Target.create(Object.assign(Object.assign({},this.proto.target),{schema:e})),this.session.projectConfig,this.proto.fileName,{validateTarget:!0}),this}assertions(e){const t=this.generateInlineAssertions(e,this.proto);return this.uniqueKeyAssertions=t.uniqueKeyAssertions,this.rowConditionsAssertion=t.rowConditionsAssertion,this}setDependOnDependencyAssertions(e){return this.dependOnDependencyAssertions=e,this}getFileName(){return this.proto.fileName}getTarget(){return p.sqlanvil.Target.create(this.proto.target)}compile(){var e,t;return this.contextableJitCode?this.compileJit():this.compileAot(),(null===(e=this.proto.bigquery)||void 0===e?void 0:e.connection)&&u.validateConnectionFormat(this.proto.bigquery.connection),(null===(t=this.proto.bigquery)||void 0===t?void 0:t.storageUri)&&u.validateStorageUriFormat(this.proto.bigquery.storageUri),i.verifyObjectMatchesProto(p.sqlanvil.Table,this.proto,i.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM)}compileJit(){u.validateNoMixedCompilationMode(this.session,this.getFileName(),this.contextableQuery,this.contextableWhere,this.contextablePostOps,this.contextablePreOps),this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.jitCode=this.contextableJitCode.toString()}compileAot(){const e=new d(this),t=new d(this,!0);this.proto.query=e.apply(this.contextableQuery),this.proto.incrementalQuery=t.apply(this.contextableQuery),this.proto.incrementalPreOps=this.contextifyOps(this.contextablePreOps,t),this.proto.incrementalPostOps=this.contextifyOps(this.contextablePostOps,t),this.contextableWhere&&(this.proto.where=e.apply(this.contextableWhere)),this.proto.preOps=this.contextifyOps(this.contextablePreOps,e).filter((e=>!!e.trim())),this.proto.postOps=this.contextifyOps(this.contextablePostOps,e).filter((e=>!!e.trim())),u.validateQueryString(this.session,this.proto.query,this.proto.fileName),u.validateQueryString(this.session,this.proto.incrementalQuery,this.proto.fileName)}contextifyOps(e,t){let n=[];return e.forEach((e=>{const r=t.apply(e);n=n.concat("string"==typeof r?[r]:r)})),n}verifyConfig(e){if(e.type&&(delete e.type,e.dependencies&&(e.dependencyTargets=e.dependencies.map((e=>u.resolvableAsActionConfigTarget(e))),delete e.dependencies),e.database&&(e.project=e.database,delete e.database),e.schema&&(e.dataset=e.schema,delete e.schema),e.fileName&&(e.filename=e.fileName,delete e.fileName),e.columns&&(e.columns=l.ColumnDescriptors.mapLegacyObjectToConfigProto(e.columns)),e=o.LegacyConfigConverter.insertLegacyInlineAssertionsToConfigProto(e),(e=o.LegacyConfigConverter.insertLegacyBigQueryOptionsToConfigProto(e)).bigquery&&u.checkExcessProperties((e=>{throw e}),e.bigquery,u.strictKeysOf()(["partitionBy","clusterBy","updatePartitionFilter","labels","partitionExpirationDays","requirePartitionFilter","additionalOptions","iceberg"]),"BigQuery table config")),e.iceberg&&e.iceberg.fileFormat&&"PARQUET"!==e.iceberg.fileFormat.toUpperCase())throw new ReferenceError(`Unexpected file format; only "PARQUET" is allowed, got "${e.iceberg.fileFormat}".`);const t=i.verifyObjectMatchesProto(p.sqlanvil.ActionConfig.IncrementalTableConfig,e,i.VerifyProtoErrorBehaviour.SHOW_DOCS_LINK);return t.additionalOptions&&o.checkConfigAdditionalOptionsOverlap(t,this.session),t}mapOnSchemaChange(e){if(!e)return p.sqlanvil.OnSchemaChange.IGNORE;if("number"==typeof e)switch(e){case p.sqlanvil.ActionConfig.OnSchemaChange.IGNORE:return p.sqlanvil.OnSchemaChange.IGNORE;case p.sqlanvil.ActionConfig.OnSchemaChange.FAIL:return p.sqlanvil.OnSchemaChange.FAIL;case p.sqlanvil.ActionConfig.OnSchemaChange.EXTEND:return p.sqlanvil.OnSchemaChange.EXTEND;case p.sqlanvil.ActionConfig.OnSchemaChange.SYNCHRONIZE:return p.sqlanvil.OnSchemaChange.SYNCHRONIZE;default:throw new Error(`OnSchemaChange value "${e}" is not supported`)}switch(e.toString().toUpperCase()){case"IGNORE":return p.sqlanvil.OnSchemaChange.IGNORE;case"FAIL":return p.sqlanvil.OnSchemaChange.FAIL;case"EXTEND":return p.sqlanvil.OnSchemaChange.EXTEND;case"SYNCHRONIZE":return p.sqlanvil.OnSchemaChange.SYNCHRONIZE;default:throw new Error(`OnSchemaChange value "${e}" is not supported`)}}}t.IncrementalTable=f;class d{constructor(e,t=!1){this.incrementalTable=e,this.isIncremental=t}self(){return this.resolve(this.incrementalTable.getTarget())}name(){return this.incrementalTable.session.finalizeName(this.incrementalTable.getTarget().name)}ref(e,...t){return e=u.toResolvable(e,t),u.resolvableAsTarget(e)?(this.incrementalTable.dependencies(e),this.resolve(e)):(this.incrementalTable.session.compileError(new Error("Action name is not specified")),"")}resolve(e,...t){return this.incrementalTable.session.resolve(e,...t)}schema(){return this.incrementalTable.session.finalizeSchema(this.incrementalTable.getTarget().schema)}database(){return this.incrementalTable.getTarget().database?this.incrementalTable.session.finalizeDatabase(this.incrementalTable.getTarget().database):(this.incrementalTable.session.compileError(new Error("Warehouse does not support multiple databases")),"")}where(e){return this.incrementalTable.where(e),""}when(e,t,n=""){return e?t:n}incremental(){return!!this.isIncremental}preOps(e){return this.incrementalTable.preOps(e),""}postOps(e){return this.incrementalTable.postOps(e),""}disabled(){return this.incrementalTable.disabled(),""}bigquery(e){return this.incrementalTable.bigquery(e),""}dependencies(e){return this.incrementalTable.dependencies(e),""}apply(e){return"function"==typeof e?e(this):e}tags(e){return this.incrementalTable.tags(e),""}}t.IncrementalTableContext=d},1344(e,t,n){"use strict";e.exports=c;var r=n(7209);((c.prototype=Object.create(r.prototype)).constructor=c).className="Field";var i,o=n(5643),a=n(361),s=n(3262),l=/^required|optional|repeated$/;function c(e,t,n,i,o,c,u){if(s.isObject(i)?(u=o,c=i,i=o=void 0):s.isObject(o)&&(u=c,c=o,o=void 0),r.call(this,e,c),!s.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!s.isString(n))throw TypeError("type must be a string");if(void 0!==i&&!l.test(i=i.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==o&&!s.isString(o))throw TypeError("extend must be a string");"proto3_optional"===i&&(i="optional"),this.rule=i&&"optional"!==i?i:void 0,this.type=n,this.id=t,this.extend=o||void 0,this.repeated="repeated"===i,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!s.Long&&void 0!==a.long[n],this.bytes="bytes"===n,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.comment=u}c.fromJSON=function(e,t){var n=new c(e,t.id,t.type,t.rule,t.extend,t.options,t.comment);return t.edition&&(n._edition=t.edition),n._defaultEdition="proto3",n},Object.defineProperty(c.prototype,"required",{get:function(){return"LEGACY_REQUIRED"===this._features.field_presence}}),Object.defineProperty(c.prototype,"optional",{get:function(){return!this.required}}),Object.defineProperty(c.prototype,"delimited",{get:function(){return this.resolvedType instanceof i&&"DELIMITED"===this._features.message_encoding}}),Object.defineProperty(c.prototype,"packed",{get:function(){return"PACKED"===this._features.repeated_field_encoding}}),Object.defineProperty(c.prototype,"hasPresence",{get:function(){return!this.repeated&&!this.map&&(this.partOf||this.declaringField||this.extensionField||"IMPLICIT"!==this._features.field_presence)}}),c.prototype.setOption=function(e,t,n){return r.prototype.setOption.call(this,e,t,n)},c.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return s.toObject(["edition",this._editionToJSON(),"rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},c.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=a.defaults[this.type])?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof i?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof o&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof o||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=s.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"==typeof this.typeDefault){var e;s.base64.test(this.typeDefault)?s.base64.decode(this.typeDefault,e=s.newBuffer(s.base64.length(this.typeDefault)),0):s.utf8.write(this.typeDefault,e=s.newBuffer(s.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=s.emptyObject:this.repeated?this.defaultValue=s.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof i&&(this.parent.ctor.prototype[this.name]=this.defaultValue),r.prototype.resolve.call(this)},c.prototype._inferLegacyProtoFeatures=function(e){if("proto2"!==e&&"proto3"!==e)return{};var t={};if("required"===this.rule&&(t.field_presence="LEGACY_REQUIRED"),this.parent&&void 0===a.defaults[this.type]){var n=this.parent.get(this.type.split(".").pop());n&&n instanceof i&&n.group&&(t.message_encoding="DELIMITED")}return!0===this.getOption("packed")?t.repeated_field_encoding="PACKED":!1===this.getOption("packed")&&(t.repeated_field_encoding="EXPANDED"),t},c.prototype._resolveFeatures=function(e){return r.prototype._resolveFeatures.call(this,this._edition||e)},c.d=function(e,t,n,r){return"function"==typeof t?t=s.decorateType(t).name:t&&"object"==typeof t&&(t=s.decorateEnum(t).name),function(i,o){s.decorateType(i.constructor).add(new c(o,e,t,n,{default:r}))}},c._configure=function(e){i=e}},1447(e,t){"use strict";var n=t;n.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)(n=e.charCodeAt(r))<128?t+=1:n<2048?t+=2:55296==(64512&n)&&56320==(64512&e.charCodeAt(r+1))?(++r,t+=4):t+=3;return t},n.read=function(e,t,n){if(n-t<1)return"";for(var r,i=null,o=[],a=0;t<n;)(r=e[t++])<128?o[a++]=r:r>191&&r<224?o[a++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[a++]=55296+(r>>10),o[a++]=56320+(1023&r)):o[a++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),a=0);return i?(a&&i.push(String.fromCharCode.apply(String,o.slice(0,a))),i.join("")):String.fromCharCode.apply(String,o.slice(0,a))},n.write=function(e,t,n){for(var r,i,o=n,a=0;a<e.length;++a)(r=e.charCodeAt(a))<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(i=e.charCodeAt(a+1)))?(r=65536+((1023&r)<<10)+(1023&i),++a,t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=63&r|128);return n-o}},1457(e,t,n){"use strict";e.exports=a;var r=n(7209);((a.prototype=Object.create(r.prototype)).constructor=a).className="OneOf";var i=n(1344),o=n(3262);function a(e,t,n,i){if(Array.isArray(t)||(n=t,t=void 0),r.call(this,e,n),void 0!==t&&!Array.isArray(t))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=i}function s(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}a.fromJSON=function(e,t){return new a(e,t.oneof,t.options,t.comment)},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},a.prototype.add=function(e){if(!(e instanceof i))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,s(this),this},a.prototype.remove=function(e){if(!(e instanceof i))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),(t=this.oneof.indexOf(e.name))>-1&&this.oneof.splice(t,1),e.partOf=null,this},a.prototype.onAdd=function(e){r.prototype.onAdd.call(this,e);for(var t=0;t<this.oneof.length;++t){var n=e.get(this.oneof[t]);n&&!n.partOf&&(n.partOf=this,this.fieldsArray.push(n))}s(this)},a.prototype.onRemove=function(e){for(var t,n=0;n<this.fieldsArray.length;++n)(t=this.fieldsArray[n]).parent&&t.parent.remove(t);r.prototype.onRemove.call(this,e)},Object.defineProperty(a.prototype,"isProto3Optional",{get:function(){if(null==this.fieldsArray||1!==this.fieldsArray.length)return!1;var e=this.fieldsArray[0];return null!=e.options&&!0===e.options.proto3_optional}}),a.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,n){o.decorateType(t.constructor).add(new a(n,e)),Object.defineProperty(t,n,{get:o.oneOfGetter(e),set:o.oneOfSetter(e)})}}},1461(e,t,n){"use strict";var r=n(8433),i=n(5388),o=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),a=/^[-+]?[0-9]+e/;e.exports=new i("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!o.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||r.isNegativeZero(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(r.isNegativeZero(e))return"-0.0";return n=e.toString(10),a.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"})},1769(e,t,n){"use strict";e.exports=n(6184)},1851(e,t,n){"use strict";var r=n(5388);e.exports=new r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}})},2008(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=n(8512),o=n(5436),a=n(1299),s=n(8995),l=n(8545),c=r(n(9553)),u=n(2545),p=n(5379);class f extends o.ActionBuilder{constructor(e,t,n){var r,i,o,a,s,l;if(super(e),this.dependOnDependencyAssertions=!1,this.contextablePreOps=[],this.contextablePostOps=[],this.proto=p.sqlanvil.Table.create({type:"table",enumType:p.sqlanvil.TableType.TABLE,disabled:!1,tags:[]}),this.uniqueKeyAssertions=[],this.session=e,this.configPath=n,this.unverifiedConfig=Object.assign({},t),!t)return;const f=this.verifyConfig(t);f.name||(f.name=c.basename(f.filename));const d=u.actionConfigToCompiledGraphTarget(f);return this.proto.target=this.applySessionToTarget(d,e.projectConfig,f.filename,{validateTarget:!0}),this.proto.canonicalTarget=this.applySessionToTarget(d,e.canonicalProjectConfig),n&&(f.filename=u.resolveActionsConfigFilename(f.filename,n),this.query(u.nativeRequire(f.filename).query)),f.filename&&(this.proto.fileName=f.filename),f.dependOnDependencyAssertions&&this.setDependOnDependencyAssertions(f.dependOnDependencyAssertions),f.dependencyTargets&&this.dependencies(f.dependencyTargets),void 0!==f.hermetic&&this.hermetic(f.hermetic),f.disabled&&this.disabled(),f.tags&&this.tags(f.tags),f.description&&this.description(f.description),f.metadata&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.metadata=f.metadata),(null===(r=f.columns)||void 0===r?void 0:r.length)&&this.columns(f.columns.map((e=>p.sqlanvil.ActionConfig.ColumnDescriptor.create(e)))),f.assertions&&this.assertions(p.sqlanvil.ActionConfig.TableAssertionsConfig.create(f.assertions)),f.preOperations&&this.preOps(f.preOperations),f.postOperations&&this.postOps(f.postOperations),this.bigquery(Object.assign({partitionBy:f.partitionBy,clusterBy:f.clusterBy,labels:f.labels,partitionExpirationDays:f.partitionExpirationDays,requirePartitionFilter:f.requirePartitionFilter,additionalOptions:f.additionalOptions},f.iceberg?{connection:u.getConnectionForIcebergTable(f.iceberg.connection,null===(i=e.projectConfig.defaultIcebergConfig)||void 0===i?void 0:i.connection),fileFormat:u.getFileFormatValueForIcebergTable(null===(o=f.iceberg.fileFormat)||void 0===o?void 0:o.toString()),tableFormat:p.sqlanvil.TableFormat.ICEBERG,storageUri:u.getStorageUriForIcebergTable(u.getEffectiveBucketName(null===(a=e.projectConfig.defaultIcebergConfig)||void 0===a?void 0:a.bucketName,f.iceberg.bucketName),u.getEffectiveTableFolderRoot(null===(s=e.projectConfig.defaultIcebergConfig)||void 0===s?void 0:s.tableFolderRoot,f.iceberg.tableFolderRoot),u.getEffectiveTableFolderSubpath(this.proto.target.schema,this.proto.target.name,null===(l=e.projectConfig.defaultIcebergConfig)||void 0===l?void 0:l.tableFolderSubpath,f.iceberg.tableFolderSubpath))}:{})),f.postgres&&this.postgres(f.postgres),f.supabase&&this.supabase(f.supabase),f.reservation&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.reservation=f.reservation),this}type(e){let t;switch(e){case"table":return this;case"incremental":t=new a.IncrementalTable(this.session,Object.assign(Object.assign({},this.unverifiedConfig),{type:"incremental"}),this.configPath);break;case"view":t=new s.View(this.session,Object.assign(Object.assign({},this.unverifiedConfig),{type:"view"}),this.configPath);break;default:throw new Error(`Unexpected table type: ${e}`)}const n=this.session.actions.indexOf(this);if(-1===n)throw Error("Expected pre-existing action, but none found. Please report this to the sqlanvil team.");this.session.actions[n]=t}query(e){return this.contextableQuery=e,this}where(e){return this.contextableWhere=e,this}jitCode(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.compilationMode=p.sqlanvil.ActionCompilationMode.ACTION_COMPILATION_MODE_JIT,this.contextableJitCode=e,this}preOps(e){return this.contextablePreOps.push(e),this}postOps(e){return this.contextablePostOps.push(e),this}disabled(e=!0){var t;return this.proto.disabled=e,this.uniqueKeyAssertions.forEach((t=>t.disabled(e))),null===(t=this.rowConditionsAssertion)||void 0===t||t.disabled(e),this}bigquery(e){e.labels&&Object.keys(e.labels).length>0&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.bigqueryLabels=e.labels);const t=o.LegacyConfigConverter.legacyConvertBigQueryOptions(e);return Object.values(t).length>0&&(this.proto.bigquery=p.sqlanvil.BigQueryOptions.create(t)),this}postgres(e){return this.proto.postgres=p.sqlanvil.PostgresOptions.create(e),this}supabase(e){return this.proto.supabase=p.sqlanvil.SupabaseOptions.create(e),this}dependencies(e){return(Array.isArray(e)?e:[e]).forEach((e=>{const t=u.checkAssertionsForDependency(this,e);t&&this.proto.dependencyTargets.push(t)})),this}hermetic(e){this.proto.hermeticity=e?p.sqlanvil.ActionHermeticity.HERMETIC:p.sqlanvil.ActionHermeticity.NON_HERMETIC}tags(e){var t;return("string"==typeof e?[e]:e).forEach((e=>{this.proto.tags.push(e)})),this.uniqueKeyAssertions.forEach((t=>t.tags(e))),null===(t=this.rowConditionsAssertion)||void 0===t||t.tags(e),this}description(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.description=e,this}columns(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.columns=l.ColumnDescriptors.mapConfigProtoToCompilationProto(e),this}database(e){return this.proto.target=this.applySessionToTarget(p.sqlanvil.Target.create(Object.assign(Object.assign({},this.proto.target),{database:e})),this.session.projectConfig,this.proto.fileName,{validateTarget:!0}),this}schema(e){return this.proto.target=this.applySessionToTarget(p.sqlanvil.Target.create(Object.assign(Object.assign({},this.proto.target),{schema:e})),this.session.projectConfig,this.proto.fileName,{validateTarget:!0}),this}assertions(e){const t=this.generateInlineAssertions(e,this.proto);return this.uniqueKeyAssertions=t.uniqueKeyAssertions,this.rowConditionsAssertion=t.rowConditionsAssertion,this}setDependOnDependencyAssertions(e){return this.dependOnDependencyAssertions=e,this}getFileName(){return this.proto.fileName}getTarget(){return p.sqlanvil.Target.create(this.proto.target)}compile(){var e,t;return this.contextableJitCode?this.compileJit():this.compileAot(),(null===(e=this.proto.bigquery)||void 0===e?void 0:e.connection)&&u.validateConnectionFormat(this.proto.bigquery.connection),(null===(t=this.proto.bigquery)||void 0===t?void 0:t.storageUri)&&u.validateStorageUriFormat(this.proto.bigquery.storageUri),i.verifyObjectMatchesProto(p.sqlanvil.Table,this.proto,i.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM)}compileJit(){u.validateNoMixedCompilationMode(this.session,this.getFileName(),this.contextableQuery,this.contextableWhere,this.contextablePostOps,this.contextablePreOps),this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.jitCode=this.contextableJitCode.toString()}compileAot(){const e=new d(this),t=new d(this,!0);this.proto.query=e.apply(this.contextableQuery),this.proto.enumType===p.sqlanvil.TableType.INCREMENTAL&&(this.proto.incrementalQuery=t.apply(this.contextableQuery),this.proto.incrementalPreOps=this.contextifyOps(this.contextablePreOps,t),this.proto.incrementalPostOps=this.contextifyOps(this.contextablePostOps,t)),this.contextableWhere&&(this.proto.where=e.apply(this.contextableWhere)),this.proto.preOps=this.contextifyOps(this.contextablePreOps,e).filter((e=>!!e.trim())),this.proto.postOps=this.contextifyOps(this.contextablePostOps,e).filter((e=>!!e.trim())),u.validateQueryString(this.session,this.proto.query,this.proto.fileName),u.validateQueryString(this.session,this.proto.incrementalQuery,this.proto.fileName)}contextifyOps(e,t){let n=[];return e.forEach((e=>{const r=t.apply(e);n=n.concat("string"==typeof r?[r]:r)})),n}verifyConfig(e){if(e.type){if("table"!==e.type)throw ReferenceError(`Unexpected type for Table; want "table", got ${e.type}`);if(delete e.type,e.dependencies&&(e.dependencyTargets=e.dependencies.map((e=>u.resolvableAsActionConfigTarget(e))),delete e.dependencies),e.database&&(e.project=e.database,delete e.database),e.schema&&(e.dataset=e.schema,delete e.schema),e.fileName&&(e.filename=e.fileName,delete e.fileName),e.columns&&(e.columns=l.ColumnDescriptors.mapLegacyObjectToConfigProto(e.columns)),e=o.LegacyConfigConverter.insertLegacyInlineAssertionsToConfigProto(e),(e=o.LegacyConfigConverter.insertLegacyBigQueryOptionsToConfigProto(e)).bigquery&&u.checkExcessProperties((e=>{throw e}),e.bigquery,u.strictKeysOf()(["partitionBy","clusterBy","updatePartitionFilter","labels","partitionExpirationDays","requirePartitionFilter","additionalOptions","iceberg"]),"BigQuery table config"),e.iceberg&&e.iceberg.fileFormat&&"PARQUET"!==e.iceberg.fileFormat.toUpperCase())throw new ReferenceError(`Unexpected file format; only "PARQUET" is allowed, got "${e.iceberg.fileFormat}".`)}const t=i.verifyObjectMatchesProto(p.sqlanvil.ActionConfig.TableConfig,e,i.VerifyProtoErrorBehaviour.SHOW_DOCS_LINK);return t.partitionBy||!t.partitionExpirationDays&&!t.requirePartitionFilter||this.session.compileError("requirePartitionFilter/partitionExpirationDays are not valid for non partitioned BigQuery tables",t.filename,p.sqlanvil.Target.create({database:t.project,schema:t.dataset,name:t.name})),t.additionalOptions&&o.checkConfigAdditionalOptionsOverlap(t,this.session),t}}t.Table=f;class d{constructor(e,t=!1){this.table=e,this.isIncremental=t}self(){return this.resolve(this.table.getTarget())}name(){return this.table.session.finalizeName(this.table.getTarget().name)}ref(e,...t){return e=u.toResolvable(e,t),u.resolvableAsTarget(e)?(this.table.dependencies(e),this.resolve(e)):(this.table.session.compileError(new Error("Action name is not specified")),"")}resolve(e,...t){return this.table.session.resolve(e,...t)}schema(){return this.table.session.finalizeSchema(this.table.getTarget().schema)}database(){return this.table.getTarget().database?this.table.session.finalizeDatabase(this.table.getTarget().database):(this.table.session.compileError(new Error("Warehouse does not support multiple databases")),"")}type(e){return this.table.type(e),""}where(e){return this.table.where(e),""}when(e,t,n=""){return e?t:n}incremental(){return!!this.isIncremental}preOps(e){return this.table.preOps(e),""}postOps(e){return this.table.postOps(e),""}disabled(){return this.table.disabled(),""}bigquery(e){return this.table.bigquery(e),""}dependencies(e){return this.table.dependencies(e),""}apply(e){return"function"==typeof e?e(this):e}tags(e){return this.table.tags(e),""}}t.TableContext=d},2119(e,t,n){"use strict";var r=n(1231),i=n(5388);function o(e,t){var n=[];return e[t].forEach((function(e){var t=n.length;n.forEach((function(n,r){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=r)})),n[t]=e})),n}function a(e){return this.extend(e)}a.prototype.extend=function(e){var t=[],n=[];if(e instanceof i)n.push(e);else if(Array.isArray(e))n=n.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new r("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit))}t.forEach((function(e){if(!(e instanceof i))throw new r("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new r("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(e.multi)throw new r("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),n.forEach((function(e){if(!(e instanceof i))throw new r("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var s=Object.create(a.prototype);return s.implicit=(this.implicit||[]).concat(t),s.explicit=(this.explicit||[]).concat(n),s.compiledImplicit=o(s,"implicit"),s.compiledExplicit=o(s,"explicit"),s.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function r(e){e.multi?(n.multi[e.kind].push(e),n.multi.fallback.push(e)):n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(r);return n}(s.compiledImplicit,s.compiledExplicit),s},e.exports=a},2239(e,t,n){"use strict";e.exports=i;var r=n(3610);function i(e,t){this.lo=e>>>0,this.hi=t>>>0}var o=i.zero=new i(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var a=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(e){if(0===e)return o;var t=e<0;t&&(e=-e);var n=e>>>0,r=(e-n)/4294967296>>>0;return t&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new i(n,r)},i.from=function(e){if("number"==typeof e)return i.fromNumber(e);if(r.isString(e)){if(!r.Long)return i.fromNumber(parseInt(e,10));e=r.Long.fromString(e)}return e.low||e.high?new i(e.low>>>0,e.high>>>0):o},i.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+4294967296*n)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(e){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var s=String.prototype.charCodeAt;i.fromHash=function(e){return e===a?o:new i((s.call(e,0)|s.call(e,1)<<8|s.call(e,2)<<16|s.call(e,3)<<24)>>>0,(s.call(e,4)|s.call(e,5)<<8|s.call(e,6)<<16|s.call(e,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},i.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},i.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}},2369(e,t,n){"use strict";var r=n(5388);e.exports=new r("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})},2545(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=n(3788),o=r(n(9553)),a=n(5379);t.nativeRequire=require,t.matchPatterns=function(e,t){const n=[];return e.forEach((e=>{if(e.includes("."))t.includes(e)&&n.push(e);else{const r=t.filter((t=>e===t.split(".").slice(-1)[0]));if(0===r.length)return;if(r.length>1)throw new Error(p(e,r));n.push(r[0])}})),n},t.getCallerFile=function(e){let t;const n=function(){const e=Error.stackTraceLimit,t=Error.prepareStackTrace;try{return Error.stackTraceLimit=Number.POSITIVE_INFINITY,Error.prepareStackTrace=(e,t)=>t,(new Error).stack}finally{Error.stackTraceLimit=e,Error.prepareStackTrace=t}}();for(;n.length;){const r=n.shift().getFileName();if(r&&r.includes(e)&&!r.includes("node_modules")&&(t=r,r.includes(`definitions${o.separator}`)||r.includes(`models${o.separator}`)))break}if(!t){if(!global.__sqlanvil_current_file)throw new Error("Unable to find valid caller file; please report this issue.");t=global.__sqlanvil_current_file}return o.relativePath(t,e)},t.graphHasErrors=function(e){var t;return(null===(t=e.graphErrors)||void 0===t?void 0:t.compilationErrors.length)>0};const s="Invalid input. Accepted inputs include: a single object containing an (optional) 'database', (optional) 'schema', and 'name', or 1-3 inputs consisting of an (optional) database, (optional) schema, and 'name'.";function l(e){return!e.some((e=>"string"!=typeof e))&&e.length>0&&e.length<=3}function c(e){if("string"==typeof e)return a.sqlanvil.Target.create({name:e});const t=e;return t instanceof a.sqlanvil.ActionConfig.Target||void 0!==t.dataset||void 0!==t.project?a.sqlanvil.Target.create({name:t.name,schema:t.dataset,database:t.project,includeDependentAssertions:t.includeDependentAssertions}):a.sqlanvil.Target.create(e)}function u(e){return"string"==typeof e?e:JSON.stringify(e)}function p(e,t){const n="string"==typeof t[0]?t:t.map((e=>`${e.getTarget().schema}.${e.getTarget().name}`));return`Ambiguous Action name: ${u(e)}. Did you mean one of: ${n.join(", ")}.`}function f(e,t){switch(e){case"table":return a.sqlanvil.TableType.TABLE;case"incremental":return a.sqlanvil.TableType.INCREMENTAL;case"view":return a.sqlanvil.TableType.VIEW;default:if(t)throw new Error(`Unexpected table type: ${e}`);return a.sqlanvil.TableType.UNKNOWN_TYPE}}function d(e){return a.sqlanvil.TableType[e].toLowerCase()}t.toResolvable=function(e,t=[]){if(Array.isArray(e)&&t.length>0)throw new Error(s);if(0===t.length&&!Array.isArray(e))return e;const n=Array.isArray(e)?e.reverse():[e,...t].reverse();if(!l(n))throw new Error(s);const[r,i,o]=n;return{database:o,schema:i,name:r}},t.resolvableAsTarget=c,t.resolvableAsActionConfigTarget=function(e){if("string"==typeof e){const t=e.split(".").reverse();if(!l(t))throw new Error(s);const[n,r,i]=t;return{name:n,dataset:r,project:i}}return e},t.stringifyResolvable=u,t.ambiguousActionNameMsg=p,t.target=function(e,t,n,r){return a.sqlanvil.Target.create({name:t,schema:n||e.defaultSchema||void 0,database:r||e.defaultDatabase||void 0})},t.strictKeysOf=function(){return e=>e},t.checkExcessProperties=function(e,t,n,r){const i=Object.keys(t).filter((e=>!n.includes(e)));i.length>0&&e(new Error(`Unexpected property "${i[0]}"${r?` in ${r}`:""}. Supported properties are: ${JSON.stringify(n)}`))},t.validateQueryString=function(e,t,n){";"===(null==t?void 0:t.trim().slice(-1))&&e.compileError(new Error("Semi-colons are not allowed at the end of SQL statements."),n)},t.validateNoMixedCompilationMode=function(e,t,n,r,i,o){let a=[];i.forEach((e=>{a=a.concat("object"==typeof e?e:[e])}));let s=[];o.forEach((e=>{s=s.concat("object"==typeof e?e:[e])}));const l=[];if(n&&l.push("query"),r&&l.push("where"),a.length&&l.push("postOps"),s.length&&l.push("preOps"),l.length){const n=new Error(`Cannot mix AoT and JiT compilation in action. The following AoT properties were found: ${l.join(", ")}`);throw e.compileError(n,t),n}},t.validateConnectionFormat=function(e){const t=/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+$/.test(e)||/^projects\/[^/]+\/locations\/[^/]+\/connections\/[^/]+$/.test(e);if("DEFAULT"!==e&&!t)throw new Error("The connection must be in the format `{project}.{location}.{connection_id}` or `projects/{project}/locations/{location}/connections/{connection_id}`, or be set to `DEFAULT`.")},t.validateStorageUriFormat=function(e){if(!/^gs:\/\/([^/]+)\/(.+)$/.test(e))throw new Error("The storage URI must be in the format `gs://{bucket_name}/{path_to_data}`.")},t.getFileFormatValueForIcebergTable=function(e){if(!e)return a.sqlanvil.FileFormat.PARQUET;if("PARQUET"===e.toUpperCase())return a.sqlanvil.FileFormat.PARQUET;throw new Error(`File format ${e} is not supported.`)},t.getConnectionForIcebergTable=function(e,t){return e||t||"DEFAULT"},t.getStorageUriForIcebergTable=function(e,t,n){return`gs://${e}/${t}/${n}`},t.getEffectiveBucketName=function(e,t){if(t)return t;if(e)return e;throw new Error("When defining an Iceberg table, bucket name must be defined in workflow_settings.yaml or the config block.")},t.getEffectiveTableFolderRoot=function(e,t){return t||e||"_sqlanvil"},t.getEffectiveTableFolderSubpath=function(e,t,n,r){return r||n||`${e}/${t}`},t.tableTypeStringToEnum=f,t.tableTypeEnumToString=d,t.setOrValidateTableEnumType=function(e){let t=null;if(""!==e.type&&void 0!==e.type&&(t=f(e.type,!0)),e.enumType===a.sqlanvil.TableType.UNKNOWN_TYPE||void 0===e.enumType)e.enumType=t;else if(null!==t&&e.enumType!==t)throw new Error(`Table str type "${e.type}" and enumType "${d(e.enumType)}" are not equivalent.`)},t.extractActionDetailsFromFileName=function(e){const t=o.basename(e);return{fileExtension:o.fileExtension(e),fileNameAsTargetName:t}},t.configTargetToCompiledGraphTarget=function(e){const t={name:e.name};return e.project&&(t.database=e.project),e.dataset&&(t.schema=e.dataset),e.hasOwnProperty("includeDependentAssertions")&&(t.includeDependentAssertions=e.includeDependentAssertions),a.sqlanvil.Target.create(t)},t.actionConfigToCompiledGraphTarget=function(e){const t=a.sqlanvil.Target.create({name:e.name});return"project"in e&&void 0!==e.project&&(t.database=e.project),"location"in e&&void 0!==e.location&&(t.schema=e.location),"dataset"in e&&void 0!==e.dataset&&(t.schema=e.dataset),t},t.resolveActionsConfigFilename=function(e,t){return o.normalize(o.join(o.dirName(t),e))},t.checkAssertionsForDependency=function(e,t){const n=c(t);n.hasOwnProperty("includeDependentAssertions")||e instanceof i.DataPreparation||(n.includeDependentAssertions=e.dependOnDependencyAssertions);const r=e.session.compilationSql().resolveTarget(n);if(!e.includeAssertionsForDependency.has(r)||e.includeAssertionsForDependency.get(r)===n.includeDependentAssertions)return e.includeAssertionsForDependency.set(r,n.includeDependentAssertions),n;e.session.compileError(`Conflicting "includeDependentAssertions" properties are not allowed. Dependency ${n.name} has different values set for this property.`,e.getFileName(),e.getTarget())},t.ResolvableMap=class{constructor(e){if(this.byName=new Map,this.bySchemaAndName=new Map,this.byDatabaseAndName=new Map,this.byDatabaseSchemaAndName=new Map,e)for(const{actionTarget:t,value:n}of e)this.set(t,n)}set(e,t){if(this.setByNameLevel(this.byName,e.name,t),e.schema&&this.setBySchemaLevel(this.bySchemaAndName,e,t),e.database){this.byDatabaseAndName.has(e.database)||this.byDatabaseAndName.set(e.database,new Map);const n=this.byDatabaseAndName.get(e.database);if(this.setByNameLevel(n,e.name,t),e.schema){this.byDatabaseSchemaAndName.has(e.database)||this.byDatabaseSchemaAndName.set(e.database,new Map);const n=this.byDatabaseSchemaAndName.get(e.database);this.setBySchemaLevel(n,e,t)}}}find(e){var t,n,r,i;return e.database?e.schema?(null===(n=null===(t=this.byDatabaseSchemaAndName.get(e.database))||void 0===t?void 0:t.get(e.schema))||void 0===n?void 0:n.get(e.name))||[]:(null===(r=this.byDatabaseAndName.get(e.database))||void 0===r?void 0:r.get(e.name))||[]:e.schema?(null===(i=this.bySchemaAndName.get(e.schema))||void 0===i?void 0:i.get(e.name))||[]:this.byName.get(e.name)||[]}setByNameLevel(e,t,n){e.has(t)||e.set(t,[]),e.get(t).push(n)}setBySchemaLevel(e,t,n){e.has(t.schema)||e.set(t.schema,new Map);const r=e.get(t.schema);this.setByNameLevel(r,t.name,n)}}},2549(e,t,n){"use strict";e.exports=n(9100)},2551(e,t,n){"use strict";e.exports=i;var r=n(3610);function i(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n){var r=t[n];"__proto__"!==r&&(this[r]=e[r])}}i.create=function(e){return this.$type.create(e)},i.encode=function(e,t){return this.$type.encode(e,t)},i.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},i.decode=function(e){return this.$type.decode(e)},i.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},i.verify=function(e){return this.$type.verify(e)},i.fromObject=function(e){return this.$type.fromObject(e)},i.toObject=function(e,t){return this.$type.toObject(e,t)},i.prototype.toJSON=function(){return this.$type.toObject(this,r.toJSONOptions)}},2628(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version="1.5.0",t.dataformVersion="3.0.59"},2795(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=n(8512),o=n(5436),a=r(n(9553)),s=n(2545),l=n(5379);class c extends o.ActionBuilder{constructor(e,t,n){super(e),this.dependOnDependencyAssertions=!1,this.proto=l.sqlanvil.Notebook.create();const r=this.verifyConfig(t);r.name||(r.name=a.basename(r.filename));const i=s.actionConfigToCompiledGraphTarget(r);r.filename=s.resolveActionsConfigFilename(r.filename,n),this.session=e,this.proto.target=this.applySessionToTarget(i,e.projectConfig,r.filename,{validateTarget:!0}),this.proto.canonicalTarget=this.applySessionToTarget(i,e.canonicalProjectConfig),this.proto.tags=r.tags,this.dependOnDependencyAssertions=r.dependOnDependencyAssertions,r.dependencyTargets&&this.dependencies(r.dependencyTargets.map((e=>s.configTargetToCompiledGraphTarget(l.sqlanvil.ActionConfig.Target.create(e))))),this.proto.fileName=r.filename,r.disabled&&(this.proto.disabled=r.disabled);const o=s.nativeRequire(r.filename).asJson;this.proto.notebookContents=JSON.stringify(function(e,t){if(!("cells"in e))throw new Error(`Notebook at ${t} is invalid: cells field not present`);return"metadata"in e&&(e.metadata={}),e.cells.forEach((e=>{"outputs"in e&&(e.outputs=[]),"execution_count"in e&&(e.execution_count=null),"metadata"in e&&(e.metadata={})})),e}(o,r.filename))}ipynb(e){return this.proto.notebookContents=JSON.stringify(e),this}dependencies(e){return(Array.isArray(e)?e:[e]).forEach((e=>{const t=s.checkAssertionsForDependency(this,e);t&&this.proto.dependencyTargets.push(t)})),this}getFileName(){return this.proto.fileName}getTarget(){return l.sqlanvil.Target.create(this.proto.target)}compile(){return i.verifyObjectMatchesProto(l.sqlanvil.Notebook,this.proto,i.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM)}verifyConfig(e){return i.verifyObjectMatchesProto(l.sqlanvil.ActionConfig.NotebookConfig,e,i.VerifyProtoErrorBehaviour.SHOW_DOCS_LINK)}}t.Notebook=c},3158(e,t,n){"use strict";e.exports=o;var r=n(6237);(o.prototype=Object.create(r.prototype)).constructor=o;var i=n(3610);function o(e){r.call(this,e)}o._configure=function(){i.Buffer&&(o.prototype._slice=i.Buffer.prototype.slice)},o.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},o._configure()},3162(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3913);t.targetStringifier=new r.JSONObjectStringifier,t.targetAsReadableString=function(e){const t=[e.name,e.schema];return e.database&&t.push(e.database),t.reverse().join(".")}},3165(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(887)),o="sql",a="jsBlock",s="jsTemplateString",l="innerSqlBlock",c="innerSingleQuote",u="innerDoubleQuote",p="innerTripleSingleQuote",f="innerTripleDoubleQuote",d={START_CONFIG:o+"_startConfig",START_JS:o+"_startJs",START_INCREMENTAL:o+"_startIncremental",START_PRE_OPERATIONS:o+"_startPreOperations",START_POST_OPERATIONS:o+"_startPostOperations",START_INPUT:o+"_startInput",STATEMENT_SEPERATOR:o+"_statementSeparator",SINGLE_LINE_COMMENT:o+"_singleLineComment",MULTI_LINE_COMMENT:o+"_multiLineComment",START_JS_PLACEHOLDER:o+"_startJsPlaceholder",BACKTICK:o+"_backtick",START_QUOTE_SINGLE:o+"_startQuoteSingle",START_QUOTE_DOUBLE:o+"_startQuoteDouble",START_TRIPLE_QUOTE_SINGLE:o+"_startTripleQuoteSingle",START_TRIPLE_QUOTE_DOUBLE:o+"_startTripleQuoteDouble",CAPTURE_EVERYTHING_ELSE:o+"_captureEverythingElse"},g={SINGLE_LINE_COMMENT:a+"_singleLineComment",MULTI_LINE_COMMENT:a+"_multiLineComment",SINGLE_QUOTE_STRING:a+"_singleQuoteString",DOUBLE_QUOTE_STRING:a+"_doubleQuoteString",START_JS_TEMPLATE_STRING:a+"_startJsTemplateString",START_JS_BLOCK:a+"_startJsBlock",CLOSE_BLOCK:a+"_closeBlock",CAPTURE_EVERYTHING_ELSE:a+"_captureEverythingElse"},h={ESCAPED_BACKSLASH:s+"_escapedBackslash",ESCAPED_DOLLAR_BRACE:s+"_escapedDollarBrace",START_JS_BLOCK:s+"_startJsBlock",CLOSE_STRING:s+"_closeString",CAPTURE_EVERYTHING_ELSE:s+"_captureEverythingElse"},y={STATEMENT_SEPERATOR:l+"_statementSeparator",SINGLE_LINE_COMMENT:l+"_singleLineComment",MULTI_LINE_COMMENT:l+"_multiLineComment",START_JS_PLACEHOLDER:l+"_startJsPlaceholder",CLOSE_BLOCK:l+"_closeBlock",BACKTICK:l+"_backtick",START_QUOTE_SINGLE:l+"_startQuoteSingle",START_QUOTE_DOUBLE:l+"_startQuoteDouble",START_TRIPLE_QUOTE_SINGLE:l+"_startTripleQuoteSingle",START_TRIPLE_QUOTE_DOUBLE:l+"_startTripleQuoteDouble",CAPTURE_EVERYTHING_ELSE:l+"_captureEverythingElse"},b={ESCAPED_BACKSLASH:c+"_escapedBackslash",ESCAPED_QUOTE:c+"_escapedQuoteSingle",START_JS_PLACEHOLDER:c+"_startJsPlaceholder",CLOSE_QUOTE:c+"_closeQuoteSingle",CAPTURE_EVERYTHING_ELSE:c+"_captureEverythingElse"},m={ESCAPED_BACKSLASH:u+"_escapedBackslash",ESCAPED_QUOTE:u+"_escapedQuoteDouble",START_JS_PLACEHOLDER:u+"_startJsPlaceholder",CLOSE_QUOTE:u+"_closeQuoteDouble",CAPTURE_EVERYTHING_ELSE:u+"_captureEverythingElse"},v={ESCAPED_BACKSLASH:p+"_escapedBackslash",START_JS_PLACEHOLDER:p+"_startJsPlaceholder",CLOSE_QUOTE:p+"_closeTripleQuoteSingle",CAPTURE_EVERYTHING_ELSE:p+"_captureEverythingElse"},O={ESCAPED_BACKSLASH:f+"_escapedBackslash",START_JS_PLACEHOLDER:f+"_startJsPlaceholder",CLOSE_QUOTE:f+"_closeTripleQuoteDouble",CAPTURE_EVERYTHING_ELSE:f+"_captureEverythingElse"},T=i.states(function(){const e={};e[d.START_CONFIG]={match:"config {",push:a},e[d.START_JS]={match:"js {",push:a},e[d.START_INCREMENTAL]={match:"incremental_where {",push:l},e[d.START_PRE_OPERATIONS]={match:"pre_operations {",push:l},e[d.START_POST_OPERATIONS]={match:"post_operations {",push:l},e[d.START_INPUT]={match:/input "[a-zA-Z0-9_-]+"(?:,\s*"[a-zA-Z0-9_-]+")* {/,push:l},e[d.STATEMENT_SEPERATOR]=/[^\S\r\n]*---[^\S\r\n]*$/,e[d.SINGLE_LINE_COMMENT]=/--.*?$/,e[d.MULTI_LINE_COMMENT]=/\/\*[\s\S]*?\*\//,e[d.START_JS_PLACEHOLDER]={match:"${",push:a},e[d.BACKTICK]="`",e[d.START_TRIPLE_QUOTE_SINGLE]={match:"'''",push:p},e[d.START_TRIPLE_QUOTE_DOUBLE]={match:'"""',push:f},e[d.START_QUOTE_SINGLE]={match:"'",push:c},e[d.START_QUOTE_DOUBLE]={match:'"',push:u},e[d.CAPTURE_EVERYTHING_ELSE]={match:/[\s\S]+?/,lineBreaks:!0};const t={};t[g.SINGLE_LINE_COMMENT]=/\/\/.*?$/,t[g.MULTI_LINE_COMMENT]=/\/\*[\s\S]*?\*\//,t[g.SINGLE_QUOTE_STRING]=/'(?:\\['\\]|[^\n'\\])*'/,t[g.DOUBLE_QUOTE_STRING]=/"(?:\\["\\]|[^\n"\\])*"/,t[g.START_JS_TEMPLATE_STRING]={match:"`",push:s},t[g.START_JS_BLOCK]={match:"{",push:a},t[g.CLOSE_BLOCK]={match:"}",pop:1},t[g.CAPTURE_EVERYTHING_ELSE]={match:/[\s\S]+?/,lineBreaks:!0};const n={};n[h.ESCAPED_BACKSLASH]=/\\\\/,n[h.ESCAPED_DOLLAR_BRACE]=/\\\${`/,n[h.START_JS_BLOCK]={match:"${",push:a},n[h.CLOSE_STRING]={match:"`",pop:1},n[h.CAPTURE_EVERYTHING_ELSE]={match:/[\s\S]+?/,lineBreaks:!0};const r={};r[y.STATEMENT_SEPERATOR]=/[^\S\r\n]*---[^\S\r\n]*$/,r[y.SINGLE_LINE_COMMENT]=/--.*?$/,r[y.MULTI_LINE_COMMENT]=/\/\*[\s\S]*?\*\//,r[y.START_JS_PLACEHOLDER]={match:"${",push:a},r[y.CLOSE_BLOCK]={match:"}",pop:1},r[y.BACKTICK]="`",r[y.START_TRIPLE_QUOTE_SINGLE]={match:"'''",push:p},r[y.START_TRIPLE_QUOTE_DOUBLE]={match:'"""',push:f},r[y.START_QUOTE_SINGLE]={match:"'",push:c},r[y.START_QUOTE_DOUBLE]={match:'"',push:u},r[y.CAPTURE_EVERYTHING_ELSE]={match:/[\s\S]+?/,lineBreaks:!0};const i={};i[b.ESCAPED_BACKSLASH]="\\\\",i[b.ESCAPED_QUOTE]="\\'",i[b.START_JS_PLACEHOLDER]={match:"${",push:a},i[b.CLOSE_QUOTE]={match:"'",pop:1},i[b.CAPTURE_EVERYTHING_ELSE]={match:/[\s\S]+?/,lineBreaks:!0};const T={};T[m.ESCAPED_BACKSLASH]="\\\\",T[m.ESCAPED_QUOTE]={match:'\\"'},i[m.START_JS_PLACEHOLDER]={match:"${",push:a},T[m.CLOSE_QUOTE]={match:'"',pop:1},T[m.CAPTURE_EVERYTHING_ELSE]={match:/[\s\S]+?/,lineBreaks:!0};const w={};w[v.ESCAPED_BACKSLASH]="\\\\",w[v.START_JS_PLACEHOLDER]={match:"${",push:a},w[v.CLOSE_QUOTE]={match:"'''",pop:1},w[v.CAPTURE_EVERYTHING_ELSE]={match:/[\s\S]+?/,lineBreaks:!0};const j={};j[O.ESCAPED_BACKSLASH]="\\\\",j[O.START_JS_PLACEHOLDER]={match:"${",push:a},j[O.CLOSE_QUOTE]={match:'"""',pop:1},j[O.CAPTURE_EVERYTHING_ELSE]={match:/[\s\S]+?/,lineBreaks:!0};const P={};return P[o]=e,P[a]=t,P[s]=n,P[l]=r,P[c]=i,P[u]=T,P[p]=w,P[f]=j,P}());var w;!function(e){e[e.JAVASCRIPT=0]="JAVASCRIPT",e[e.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER=1]="JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER",e[e.SQL=2]="SQL",e[e.SQL_COMMENT=3]="SQL_COMMENT",e[e.SQL_LITERAL_STRING=4]="SQL_LITERAL_STRING",e[e.SQL_LITERAL_MULTILINE_STRING=5]="SQL_LITERAL_MULTILINE_STRING",e[e.SQL_STATEMENT_SEPARATOR=6]="SQL_STATEMENT_SEPARATOR"}(w=t.SyntaxTreeNodeType||(t.SyntaxTreeNodeType={}));const j=new Map([[d.START_CONFIG,w.JAVASCRIPT],[d.START_INCREMENTAL,w.SQL],[d.START_INPUT,w.SQL],[d.START_JS,w.JAVASCRIPT],[d.START_JS_PLACEHOLDER,w.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER],[d.START_POST_OPERATIONS,w.SQL],[d.START_PRE_OPERATIONS,w.SQL],[d.START_QUOTE_SINGLE,w.SQL_LITERAL_STRING],[d.START_QUOTE_DOUBLE,w.SQL_LITERAL_STRING],[d.START_TRIPLE_QUOTE_SINGLE,w.SQL_LITERAL_MULTILINE_STRING],[d.START_TRIPLE_QUOTE_DOUBLE,w.SQL_LITERAL_MULTILINE_STRING],[g.START_JS_BLOCK,w.JAVASCRIPT],[h.START_JS_BLOCK,w.JAVASCRIPT],[y.START_JS_PLACEHOLDER,w.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER],[y.START_QUOTE_SINGLE,w.SQL_LITERAL_STRING],[y.START_QUOTE_DOUBLE,w.SQL_LITERAL_STRING],[y.START_TRIPLE_QUOTE_SINGLE,w.SQL_LITERAL_MULTILINE_STRING],[y.START_TRIPLE_QUOTE_DOUBLE,w.SQL_LITERAL_MULTILINE_STRING],[b.START_JS_PLACEHOLDER,w.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER],[m.START_JS_PLACEHOLDER,w.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER],[v.START_JS_PLACEHOLDER,w.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER],[O.START_JS_PLACEHOLDER,w.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER]]),P=new Set([g.CLOSE_BLOCK,y.CLOSE_BLOCK,b.CLOSE_QUOTE,m.CLOSE_QUOTE,v.CLOSE_QUOTE,O.CLOSE_QUOTE]),q=new Map([[d.MULTI_LINE_COMMENT,w.SQL_COMMENT],[d.SINGLE_LINE_COMMENT,w.SQL_COMMENT],[d.STATEMENT_SEPERATOR,w.SQL_STATEMENT_SEPARATOR],[y.MULTI_LINE_COMMENT,w.SQL_COMMENT],[y.SINGLE_LINE_COMMENT,w.SQL_COMMENT],[y.STATEMENT_SEPERATOR,w.SQL_STATEMENT_SEPARATOR]]);class A{constructor(e,t=[]){this.type=e,this.allChildren=t}static create(e){const t=new A(w.SQL);let n=t;const r=[n];T.reset(e);for(const e of T){if(!e.type)throw new Error("Undefined token type encountered.");if(j.has(e.type)){const t=j.get(e.type);if(t===w.SQL&&n.type!==w.SQL)throw new Error("SQL syntax tree nodes may only be children of other SQL nodes.");const i=new A(t,[e.value]);r.push(i),n.push(i),n=i}else P.has(e.type)?(n.push(e.value),r.pop(),n=r[r.length-1]):q.has(e.type)?n.push(new A(q.get(e.type)).push(e.value)):n.push(e.value)}return t}static isSyntaxTreeNode(e){return"string"!=typeof e}children(){return this.allChildren.slice()}concatenate(e){const t=(null==e?void 0:e.has(this.type))?e.get(this.type):e=>e;return this.allChildren.map((e=>"string"==typeof e?t(e):e.concatenate())).join("")}push(e){return this.allChildren.length>0&&"string"==typeof e&&"string"==typeof this.allChildren[this.allChildren.length-1]?(this.allChildren[this.allChildren.length-1]=this.allChildren[this.allChildren.length-1]+e,this):(this.allChildren.push(e),this)}equals(e){return this.type===e.type&&(this.allChildren.length===e.children().length&&!this.allChildren.some(((t,n)=>{return!(typeof(r=t)==typeof(i=e.children()[n])&&("string"==typeof r||"string"==typeof i?r===i:r.equals(i)));var r,i})))}}t.SyntaxTreeNode=A},3262(e,t,n){"use strict";var r,i,o=e.exports=n(3610),a=n(4529);o.codegen=n(8561),o.fetch=n(5212),o.path=n(9207),o.fs=o.inquire("fs"),o.toArray=function(e){if(e){for(var t=Object.keys(e),n=new Array(t.length),r=0;r<t.length;)n[r]=e[t[r++]];return n}return[]},o.toObject=function(e){for(var t={},n=0;n<e.length;){var r=e[n++],i=e[n++];void 0!==i&&(t[r]=i)}return t};var s=/\\/g,l=/"/g;o.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},o.safeProp=function(e){return!/^[$\w_]+$/.test(e)||o.isReserved(e)?'["'+e.replace(s,"\\\\").replace(l,'\\"')+'"]':"."+e},o.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var c=/_([a-z])/g;o.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(c,(function(e,t){return t.toUpperCase()}))},o.compareFieldsById=function(e,t){return e.id-t.id},o.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(o.decorateRoot.remove(e.$type),e.$type.name=t,o.decorateRoot.add(e.$type)),e.$type;r||(r=n(7882));var i=new r(t||e.name);return o.decorateRoot.add(i),i.ctor=e,Object.defineProperty(e,"$type",{value:i,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:i,enumerable:!1}),i};var u=0;o.decorateEnum=function(e){if(e.$type)return e.$type;i||(i=n(5643));var t=new i("Enum"+u++,e);return o.decorateRoot.add(t),Object.defineProperty(e,"$type",{value:t,enumerable:!1}),t},o.setProperty=function(e,t,n,r){if("object"!=typeof e)throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return function e(t,n,i){var o=n.shift();if("__proto__"===o||"prototype"===o)return t;if(n.length>0)t[o]=e(t[o]||{},n,i);else{var a=t[o];if(a&&r)return t;a&&(i=[].concat(a).concat(i)),t[o]=i}return t}(e,t=t.split("."),n)},Object.defineProperty(o,"decorateRoot",{get:function(){return a.decorated||(a.decorated=new(n(5330)))}})},3314(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Structs=class{static toObject(e){if(!e||!e.fields)return;const t={};for(const[n,r]of Object.entries(e.fields))t[n]=this.fromValue(r);return t}static fromObject(e){const t={};for(const[n,r]of Object.entries(e))t[n]=this.toValue(r);return{fields:t}}static fromValue(e){return null!==e.nullValue&&void 0!==e.nullValue?null:null!==e.numberValue&&void 0!==e.numberValue?e.numberValue:null!==e.stringValue&&void 0!==e.stringValue?e.stringValue:null!==e.boolValue&&void 0!==e.boolValue?e.boolValue:null!==e.structValue&&void 0!==e.structValue?this.toObject(e.structValue):null!==e.listValue&&void 0!==e.listValue?(e.listValue.values||[]).map((e=>this.fromValue(e))):void 0}static toValue(e){return"number"==typeof e?{numberValue:e}:"string"==typeof e?{stringValue:e}:"boolean"==typeof e?{boolValue:e}:null==e?{nullValue:0}:Array.isArray(e)?{listValue:{values:e.map((e=>this.toValue(e)))}}:"object"==typeof e?{structValue:this.fromObject(e)}:{nullValue:0}}}},3449(e,t,n){"use strict";e.exports=p;var r,i=n(3610),o=i.LongBits,a=i.base64,s=i.utf8;function l(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function c(){}function u(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function p(){this.len=0,this.head=new l(c,0,0),this.tail=this.head,this.states=null}var f=function(){return i.Buffer?function(){return(p.create=function(){return new r})()}:function(){return new p}};function d(e,t,n){t[n]=255&e}function g(e,t){this.len=e,this.next=void 0,this.val=t}function h(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function y(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}p.create=f(),p.alloc=function(e){return new i.Array(e)},i.Array!==Array&&(p.alloc=i.pool(p.alloc,i.Array.prototype.subarray)),p.prototype._push=function(e,t,n){return this.tail=this.tail.next=new l(e,t,n),this.len+=t,this},g.prototype=Object.create(l.prototype),g.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},p.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new g((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},p.prototype.int32=function(e){return e<0?this._push(h,10,o.fromNumber(e)):this.uint32(e)},p.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},p.prototype.uint64=function(e){var t=o.from(e);return this._push(h,t.length(),t)},p.prototype.int64=p.prototype.uint64,p.prototype.sint64=function(e){var t=o.from(e).zzEncode();return this._push(h,t.length(),t)},p.prototype.bool=function(e){return this._push(d,1,e?1:0)},p.prototype.fixed32=function(e){return this._push(y,4,e>>>0)},p.prototype.sfixed32=p.prototype.fixed32,p.prototype.fixed64=function(e){var t=o.from(e);return this._push(y,4,t.lo)._push(y,4,t.hi)},p.prototype.sfixed64=p.prototype.fixed64,p.prototype.float=function(e){return this._push(i.float.writeFloatLE,4,e)},p.prototype.double=function(e){return this._push(i.float.writeDoubleLE,8,e)};var b=i.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};p.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(d,1,0);if(i.isString(e)){var n=p.alloc(t=a.length(e));a.decode(e,n,0),e=n}return this.uint32(t)._push(b,t,e)},p.prototype.string=function(e){var t=s.length(e);return t?this.uint32(t)._push(s.write,t,e):this._push(d,1,0)},p.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new l(c,0,0),this.len=0,this},p.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new l(c,0,0),this.len=0),this},p.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},p.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},p._configure=function(e){r=e,p.create=f(),r._configure()}},3560(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8512),i=n(8771),o=n(5379);class a extends i.ActionBuilder{constructor(e,t){super(e),this.proto=o.sqlanvil.Operation.create(),this.session=e,this.config=t;const n=this.applySessionToTarget(o.sqlanvil.Target.create({name:t.table}),e.projectConfig),r=o.sqlanvil.Target.create({name:`${t.table}_policy_${t.name}`});this.proto.target=this.applySessionToTarget(r,e.projectConfig,t.filename,{validateTarget:!0}),this.proto.canonicalTarget=this.applySessionToTarget(r,e.canonicalProjectConfig),this.proto.fileName=t.filename||"",this.proto.dependencyTargets.push(n)}getFileName(){return this.proto.fileName}getTarget(){return o.sqlanvil.Target.create(this.proto.target)}compile(){const e=this.finalizeTarget(o.sqlanvil.Target.create({name:this.config.table})),t=this.session.compilationSql().resolveTarget(e),n=`"${this.config.name}"`,i=[`alter table ${t} enable row level security`,`drop policy if exists ${n} on ${t}`,`create policy ${n} on ${t} for ${this.config.command?this.config.command.toUpperCase():"ALL"} to ${this.config.roles&&this.config.roles.length>0?this.config.roles.join(", "):"PUBLIC"}${this.config.using?` USING (${this.config.using})`:""}${this.config.withCheck?` WITH CHECK (${this.config.withCheck})`:""}`];return this.proto.queries=i,r.verifyObjectMatchesProto(o.sqlanvil.Operation,this.proto,r.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM)}}t.RlsPolicy=a},3610(e,t,n){"use strict";var r=t;function i(e,t,n){for(var r=Object.keys(t),i=0;i<r.length;++i)void 0!==e[r[i]]&&n||(e[r[i]]=t[r[i]]);return e}function o(e){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&i(this,n)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}r.asPromise=n(8045),r.base64=n(8839),r.EventEmitter=n(4358),r.float=n(9410),r.inquire=n(4153),r.utf8=n(1447),r.pool=n(9390),r.LongBits=n(2239),r.isNode=Boolean("undefined"!=typeof global&&global&&global.process&&global.process.versions&&global.process.versions.node),r.global=r.isNode&&global||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},r.isString=function(e){return"string"==typeof e||e instanceof String},r.isObject=function(e){return e&&"object"==typeof e},r.isset=r.isSet=function(e,t){var n=e[t];return!(null==n||!e.hasOwnProperty(t))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"==typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){var n=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(n.lo,n.hi,t):n.toNumber(Boolean(t))},r.merge=i,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=o,r.ProtocolError=o("ProtocolError"),r.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},r.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var e=r.Buffer;e?(r._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},r._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):r._Buffer_from=r._Buffer_allocUnsafe=null}},3788(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=n(7210),o=n(8512),a=n(5436),s=r(n(9553)),l=n(2545),c=n(5379);class u extends a.ActionBuilder{constructor(e,t,n){if(super(e),this.proto=c.sqlanvil.DataPreparation.create(),this.session=e,t.name)t.name.endsWith(".dp")&&t.filename.endsWith(".dp.sqlx")&&(t.name=t.name.slice(0,-3));else{const e=s.filename(t.filename);if(e.toLowerCase().endsWith(".dp.yaml")||e.toLowerCase().endsWith(".dp.sqlx"))t.name=e.slice(0,-8);else{if(!e.toLowerCase().endsWith(".yaml")&&!e.toLowerCase().endsWith(".sqlx"))throw new Error("Only YAML and SQLX files are supported");t.name=e.slice(0,-5)}}const r=s.fileExtension(t.filename);"yaml"===r?this.configureYaml(e,t,n):"sqlx"===r&&this.configureSqlx(e,t)}config(e){return e.database&&this.database(e.database),e.project&&this.database(e.project),e.schema&&this.schema(e.schema),e.dataset&&this.schema(e.dataset),this}query(e){return this.contextableQuery=e,this}dependencies(e){return(Array.isArray(e)?e:[e]).forEach((e=>this.proto.dependencyTargets.push(l.checkAssertionsForDependency(this,e)))),this}getFileName(){return this.proto.fileName}getTarget(){return c.sqlanvil.Target.create(this.proto.target)}compile(){if(null!=this.contextableQuery){const e=new p(this);this.proto.query=e.apply(this.contextableQuery).trim(),l.validateQueryString(this.session,this.proto.query,this.proto.fileName)}return o.verifyObjectMatchesProto(c.sqlanvil.DataPreparation,this.proto,o.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM)}database(e){return this.proto.target=this.applySessionToTarget(c.sqlanvil.Target.create(Object.assign(Object.assign({},this.proto.target),{database:e})),this.session.projectConfig,this.proto.fileName,{validateTarget:!0}),this}schema(e){return this.proto.target=this.applySessionToTarget(c.sqlanvil.Target.create(Object.assign(Object.assign({},this.proto.target),{schema:e})),this.session.projectConfig,this.proto.fileName,{validateTarget:!0}),this}configureYamlWithoutTargets(e,t,n){const r=c.sqlanvil.Target.create({name:n.name});this.proto.target=this.finalizeTarget(this.applySessionToTarget(r,t.projectConfig,n.filename,{validateTarget:!0})),this.proto.targets=[this.proto.target],this.proto.canonicalTarget=this.applySessionToTarget(r,t.canonicalProjectConfig),this.proto.canonicalTargets=[this.proto.canonicalTarget];const o=this.applySessionToDataPreparationContents(e);this.proto.dataPreparationYaml=i.dump(o)}configureYamlWithTargets(e,t,n,r){const o=e.map((e=>this.applySessionToTarget(e,n.projectConfig,r.filename,{validateTarget:!0})));this.proto.targets=o.map((e=>this.finalizeTarget(e))),this.proto.canonicalTargets=e.map((e=>this.applySessionToTarget(e,n.canonicalProjectConfig)));const a=this.applySessionToDataPreparationContents(t);this.proto.dataPreparationYaml=i.dump(a),this.proto.target=o[0],this.proto.canonicalTarget=this.proto.canonicalTargets[0]}applySessionToDataPreparationContents(e){var t;if(!e)return e;const n=null===(t=e.configuration)||void 0===t?void 0:t.errorTable;return n&&(e.configuration.errorTable=this.applySessionToTableReference(n)),e.nodes&&e.nodes.forEach(((t,n)=>{var r,i;const o=null===(r=t.source)||void 0===r?void 0:r.table;o&&(e.nodes[n].source.table=this.applySessionToTableReference(o));const a=null===(i=t.destination)||void 0===i?void 0:i.table;a&&(e.nodes[n].destination.table=this.applySessionToTableReference(a))})),e}applySessionToTableReference(e){const t={database:e.project,schema:e.dataset,name:e.table},n=this.applySessionToTarget(c.sqlanvil.Target.create(t),this.session.projectConfig);let r={table:this.session.finalizeName(n.name)};return n.schema&&(r=Object.assign({dataset:this.session.finalizeSchema(n.schema)},r)),n.database&&(r=Object.assign({project:this.session.finalizeDatabase(n.database)},r)),r}getTargets(e){const t=[];return e&&e.nodes&&e.nodes.forEach((e=>{var n;const r=null===(n=e.destination)||void 0===n?void 0:n.table;if(r){const e={database:r.project,schema:r.dataset,name:r.table};t.push(c.sqlanvil.Target.create(e))}})),t}configureYaml(e,t,n){t.filename=l.resolveActionsConfigFilename(t.filename,n);const r=l.nativeRequire(t.filename).asJson,i=this.getTargets(r);i.length>0?this.configureYamlWithTargets(i,r,e,t):this.configureYamlWithoutTargets(r,e,t),this.proto.tags=t.tags,t.dependencyTargets&&this.dependencies(t.dependencyTargets.map((e=>l.configTargetToCompiledGraphTarget(c.sqlanvil.ActionConfig.Target.create(e))))),this.proto.fileName=t.filename,t.disabled&&(this.proto.disabled=t.disabled)}configureSqlx(e,t){var n,r,i;const o=[];if(o.push(l.actionConfigToCompiledGraphTarget(t)),null!=t.errorTable){const e=c.sqlanvil.ActionConfig.DataPreparationConfig.ErrorTableConfig.create(t.errorTable),n=l.actionConfigToCompiledGraphTarget(e);this.proto.errorTableRetentionDays=e.retentionDays,o.push(n)}this.proto.load=this.mapLoadMode(null===(n=t.loadMode)||void 0===n?void 0:n.mode,null===(r=t.loadMode)||void 0===r?void 0:r.incrementalColumn,null===(i=t.loadMode)||void 0===i?void 0:i.uniqueKey),this.proto.targets=o.map((n=>this.applySessionToTarget(n,e.projectConfig,t.filename,{validateTarget:!0}))).map((e=>this.finalizeTarget(e))),this.proto.target=this.proto.targets[0],this.proto.targets.length>1&&(this.proto.errorTable=this.proto.targets[1]),this.proto.canonicalTargets=o.map((t=>this.applySessionToTarget(t,e.canonicalProjectConfig))),this.proto.canonicalTarget=this.proto.canonicalTargets[0],t.dependencyTargets&&this.dependencies(t.dependencyTargets.map((e=>l.configTargetToCompiledGraphTarget(c.sqlanvil.ActionConfig.Target.create(e))))),this.proto.tags=t.tags,this.proto.fileName=t.filename,t.disabled&&(this.proto.disabled=t.disabled),this.query(l.nativeRequire(t.filename).query)}mapLoadMode(e,t,n){if(!e)return c.sqlanvil.LoadConfiguration.create({replace:{}});switch(e.toString().toUpperCase()){case"REPLACE_TABLE":return c.sqlanvil.LoadConfiguration.create({replace:{}});case"APPEND":return c.sqlanvil.LoadConfiguration.create({append:{}});case"MAXIMUM":return c.sqlanvil.LoadConfiguration.create({maximum:{columnName:this.validateLoadModeColumnName(t)}});case"UNIQUE":return c.sqlanvil.LoadConfiguration.create({unique:{columnName:this.validateLoadModeColumnName(t)}});case"MERGE":return c.sqlanvil.LoadConfiguration.create({merge:{uniqueKey:this.validateUniqueKey(n)}});default:throw new Error(`LoadMode value "${e}" is not supported`)}}validateLoadModeColumnName(e){if(!e||""===e)throw new Error("columnName is required for MAXIMUM and UNIQUE load modes.");return e}validateUniqueKey(e){if(!e||e.length<1)throw new Error("uniqueKey is required for MERGE load mode.");return e}}t.DataPreparation=u;class p{constructor(e,t=!1){this.dataPreparation=e,this.isIncremental=t,this.EXPECT=" /* @@VALIDATION */ WHERE "}config(e){return this.dataPreparation.config(e),""}self(){return this.resolve(this.dataPreparation.getTarget())}name(){return this.dataPreparation.session.finalizeName(this.dataPreparation.getTarget().name)}ref(e,...t){return e=l.toResolvable(e,t),l.resolvableAsTarget(e)?(this.dataPreparation.dependencies(e),this.resolve(e)):(this.dataPreparation.session.compileError(new Error("Action name is not specified")),"")}resolve(e,...t){return this.dataPreparation.session.resolve(e,...t)}schema(){return this.dataPreparation.session.finalizeSchema(this.dataPreparation.getTarget().schema)}database(){return this.dataPreparation.getTarget().database?this.dataPreparation.session.finalizeDatabase(this.dataPreparation.getTarget().database):(this.dataPreparation.session.compileError(new Error("Warehouse does not support multiple databases")),"")}when(e,t,n=""){return e?t:n}incremental(){return!!this.isIncremental}dependencies(e){return this.dataPreparation.dependencies(e),""}apply(e){return"function"==typeof e?e(this):e}}t.DataPreparationContext=p},3913(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JSONObjectStringifier=class{stringify(e){return JSON.stringify(Object.keys(e).sort().reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:e[n]})),{}))}parse(e){return JSON.parse(e)}}},4098(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8512),i=n(5436),o=n(1299),a=n(2008),s=n(8995),l=n(3162),c=n(2545),u=n(5379),p=c.strictKeysOf()(["type","dataset","name","filename","tags"]);class f extends i.ActionBuilder{constructor(e,t){super(e),this.contextableInputs=new Map,this.proto=u.sqlanvil.Test.create(),this.session=e,t&&this.config(t)}config(e){if(c.checkExcessProperties((e=>this.session.compileError(e)),e,p,"test config"),e.name&&(this.proto.name=e.name),e.dataset){this.testTarget=u.sqlanvil.Target.create(this.applySessionToTarget(c.resolvableAsTarget(c.toResolvable(e.dataset)),this.session.projectConfig));const t=u.sqlanvil.Target.create(this.applySessionToTarget(c.resolvableAsTarget(c.toResolvable(e.dataset)),this.session.canonicalProjectConfig));this.proto.target=h(this.testTarget,this.proto.name),this.proto.canonicalTarget=h(t,this.proto.name)}return e.filename&&(this.proto.fileName=e.filename),e.tags&&(this.proto.tags=e.tags),this}dataset(e){return this.config({dataset:e}),this}input(e,t){return this.contextableInputs.set(l.targetStringifier.stringify(c.resolvableAsTarget(c.toResolvable(e))),t),this}expect(e){return this.contextableQuery=e,this}getFileName(){return this.proto.fileName}getTarget(){return u.sqlanvil.Target.create(this.proto.target)}getTestTarget(){return u.sqlanvil.Target.create(this.testTarget)}setFilename(e){this.proto.fileName=e}compile(){const e=new d(this);if(!this.testTarget)return this.session.compileError(new Error("Tests must operate upon a specified dataset."),this.proto.fileName),this.proto;{const t=this.session.indexedActions.find(this.testTarget);if(t.length>1)return this.session.compileError(new Error(c.ambiguousActionNameMsg(this.testTarget,t)),this.proto.fileName),this.proto;const n=t.length>0?t[0]:void 0;if(!n||!(n instanceof a.Table||n instanceof s.View||n instanceof o.IncrementalTable))return this.session.compileError(new Error(`Dataset ${c.stringifyResolvable(this.testTarget)} could not be found.`),this.proto.fileName),this.proto;{const t=new g(e);this.proto.testQuery=t.apply(n.contextableQuery)}}return this.proto.expectedOutputQuery=e.apply(this.contextableQuery),this.proto.testQuery.trim()||this.session.compileError(new Error("Test query is empty."),this.proto.fileName),this.proto.expectedOutputQuery.trim()||this.session.compileError(new Error("Expected query is empty."),this.proto.fileName),r.verifyObjectMatchesProto(u.sqlanvil.Test,this.proto,r.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM)}}t.Test=f;class d{constructor(e){this.test=e}apply(e){return"function"==typeof e?e(this):e}}t.TestContext=d;class g{constructor(e){this.testContext=e}ref(e,...t){return this.resolve(e,...t)}resolve(e,...t){const n=c.resolvableAsTarget(c.toResolvable(e,t));return this.testContext.test.contextableInputs.has(l.targetStringifier.stringify(n))?`(${this.testContext.apply(this.testContext.test.contextableInputs.get(l.targetStringifier.stringify(n)))})`:(this.testContext.test.session.compileError(new Error(`Input for dataset "${JSON.stringify(n)}" has not been provided. Provided inputs: ${Array.from(this.testContext.test.contextableInputs.keys()).map((e=>JSON.stringify(e)))}`)),"")}apply(e){return"function"==typeof e?e(this):e}config(e){return""}self(){return""}name(){return""}type(e){return""}schema(){return""}database(){return""}where(e){return""}when(e,t,n=""){return e?t:n}incremental(){return!1}preOps(e){return""}postOps(e){return""}disabled(){return""}dependencies(e){return""}tags(e){return""}}function h(e,t){return u.sqlanvil.Target.create({database:e.database,schema:e.schema,name:t})}},4153(module){"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},4358(e){"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var n=this._listeners[e],r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this}},4394(e,t,n){"use strict";var r=t;function i(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=n(3449),r.BufferWriter=n(818),r.Reader=n(6237),r.BufferReader=n(3158),r.util=n(3610),r.rpc=n(5047),r.roots=n(4529),r.configure=i,i()},4466(e,t,n){"use strict";var r=n(8433),i=n(5388);function o(e){return 48<=e&&e<=55}function a(e){return 48<=e&&e<=57}e.exports=new i("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=e.length,i=0,s=!1;if(!r)return!1;if("-"!==(t=e[i])&&"+"!==t||(t=e[++i]),"0"===t){if(i+1===r)return!0;if("b"===(t=e[++i])){for(i++;i<r;i++)if("_"!==(t=e[i])){if("0"!==t&&"1"!==t)return!1;s=!0}return s&&"_"!==t}if("x"===t){for(i++;i<r;i++)if("_"!==(t=e[i])){if(!(48<=(n=e.charCodeAt(i))&&n<=57||65<=n&&n<=70||97<=n&&n<=102))return!1;s=!0}return s&&"_"!==t}if("o"===t){for(i++;i<r;i++)if("_"!==(t=e[i])){if(!o(e.charCodeAt(i)))return!1;s=!0}return s&&"_"!==t}}if("_"===t)return!1;for(;i<r;i++)if("_"!==(t=e[i])){if(!a(e.charCodeAt(i)))return!1;s=!0}return!(!s||"_"===t)},construct:function(e){var t,n=e,r=1;if(-1!==n.indexOf("_")&&(n=n.replace(/_/g,"")),"-"!==(t=n[0])&&"+"!==t||("-"===t&&(r=-1),t=(n=n.slice(1))[0]),"0"===n)return 0;if("0"===t){if("b"===n[1])return r*parseInt(n.slice(2),2);if("x"===n[1])return r*parseInt(n.slice(2),16);if("o"===n[1])return r*parseInt(n.slice(2),8)}return r*parseInt(n,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!r.isNegativeZero(e)},represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},4529(e){"use strict";e.exports={}},4565(e,t,n){"use strict";e.exports=n(4394)},4781(e,t,n){"use strict";var r=n(8433),i=n(1231),o=n(5489),a=Object.prototype.toString,s=Object.prototype.hasOwnProperty,l=65279,c={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},u=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],p=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function f(e){var t,n,o;if(t=e.toString(16).toUpperCase(),e<=255)n="x",o=2;else if(e<=65535)n="u",o=4;else{if(!(e<=4294967295))throw new i("code point within a string may not be greater than 0xFFFFFFFF");n="U",o=8}return"\\"+n+r.repeat("0",o-t.length)+t}function d(e){this.schema=e.schema||o,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=r.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=function(e,t){var n,r,i,o,a,l,c;if(null===t)return{};for(n={},i=0,o=(r=Object.keys(t)).length;i<o;i+=1)a=r[i],l=String(t[a]),"!!"===a.slice(0,2)&&(a="tag:yaml.org,2002:"+a.slice(2)),(c=e.compiledTypeMap.fallback[a])&&s.call(c.styleAliases,l)&&(l=c.styleAliases[l]),n[a]=l;return n}(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType='"'===e.quotingType?2:1,this.forceQuotes=e.forceQuotes||!1,this.replacer="function"==typeof e.replacer?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function g(e,t){for(var n,i=r.repeat(" ",t),o=0,a=-1,s="",l=e.length;o<l;)-1===(a=e.indexOf("\n",o))?(n=e.slice(o),o=l):(n=e.slice(o,a+1),o=a+1),n.length&&"\n"!==n&&(s+=i),s+=n;return s}function h(e,t){return"\n"+r.repeat(" ",e.indent*t)}function y(e){return 32===e||9===e}function b(e){return 32<=e&&e<=126||161<=e&&e<=55295&&8232!==e&&8233!==e||57344<=e&&e<=65533&&e!==l||65536<=e&&e<=1114111}function m(e){return b(e)&&e!==l&&13!==e&&10!==e}function v(e,t,n){var r=m(e),i=r&&!y(e);return(n?r:r&&44!==e&&91!==e&&93!==e&&123!==e&&125!==e)&&35!==e&&!(58===t&&!i)||m(t)&&!y(t)&&35===e||58===t&&i}function O(e,t){var n,r=e.charCodeAt(t);return r>=55296&&r<=56319&&t+1<e.length&&(n=e.charCodeAt(t+1))>=56320&&n<=57343?1024*(r-55296)+n-56320+65536:r}function T(e){return/^\n* /.test(e)}function w(e,t,n,r,o){e.dump=function(){if(0===t.length)return 2===e.quotingType?'""':"''";if(!e.noCompatMode&&(-1!==u.indexOf(t)||p.test(t)))return 2===e.quotingType?'"'+t+'"':"'"+t+"'";var a=e.indent*Math.max(1,n),s=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-a),d=r||e.flowLevel>-1&&n>=e.flowLevel;switch(function(e,t,n,r,i,o,a,s){var c,u,p=0,f=null,d=!1,g=!1,h=-1!==r,m=-1,w=b(u=O(e,0))&&u!==l&&!y(u)&&45!==u&&63!==u&&58!==u&&44!==u&&91!==u&&93!==u&&123!==u&&125!==u&&35!==u&&38!==u&&42!==u&&33!==u&&124!==u&&61!==u&&62!==u&&39!==u&&34!==u&&37!==u&&64!==u&&96!==u&&function(e){return!y(e)&&58!==e}(O(e,e.length-1));if(t||a)for(c=0;c<e.length;p>=65536?c+=2:c++){if(!b(p=O(e,c)))return 5;w=w&&v(p,f,s),f=p}else{for(c=0;c<e.length;p>=65536?c+=2:c++){if(10===(p=O(e,c)))d=!0,h&&(g=g||c-m-1>r&&" "!==e[m+1],m=c);else if(!b(p))return 5;w=w&&v(p,f,s),f=p}g=g||h&&c-m-1>r&&" "!==e[m+1]}return d||g?n>9&&T(e)?5:a?2===o?5:2:g?4:3:!w||a||i(e)?2===o?5:2:1}(t,d,e.indent,s,(function(t){return function(e,t){var n,r;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(e.implicitTypes[n].resolve(t))return!0;return!1}(e,t)}),e.quotingType,e.forceQuotes&&!r,o)){case 1:return t;case 2:return"'"+t.replace(/'/g,"''")+"'";case 3:return"|"+j(t,e.indent)+P(g(t,a));case 4:return">"+j(t,e.indent)+P(g(function(e,t){for(var n,r,i,o=/(\n+)([^\n]*)/g,a=(i=-1!==(i=e.indexOf("\n"))?i:e.length,o.lastIndex=i,q(e.slice(0,i),t)),s="\n"===e[0]||" "===e[0];r=o.exec(e);){var l=r[1],c=r[2];n=" "===c[0],a+=l+(s||n||""===c?"":"\n")+q(c,t),s=n}return a}(t,s),a));case 5:return'"'+function(e){for(var t,n="",r=0,i=0;i<e.length;r>=65536?i+=2:i++)r=O(e,i),!(t=c[r])&&b(r)?(n+=e[i],r>=65536&&(n+=e[i+1])):n+=t||f(r);return n}(t)+'"';default:throw new i("impossible error: invalid scalar style")}}()}function j(e,t){var n=T(e)?String(t):"",r="\n"===e[e.length-1];return n+(!r||"\n"!==e[e.length-2]&&"\n"!==e?r?"":"-":"+")+"\n"}function P(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function q(e,t){if(""===e||" "===e[0])return e;for(var n,r,i=/ [^ ]/g,o=0,a=0,s=0,l="";n=i.exec(e);)(s=n.index)-o>t&&(r=a>o?a:s,l+="\n"+e.slice(o,r),o=r+1),a=s;return l+="\n",e.length-o>t&&a>o?l+=e.slice(o,a)+"\n"+e.slice(a+1):l+=e.slice(o),l.slice(1)}function A(e,t,n,r){var i,o,a,s="",l=e.tag;for(i=0,o=n.length;i<o;i+=1)a=n[i],e.replacer&&(a=e.replacer.call(n,String(i),a)),(S(e,t+1,a,!0,!0,!1,!0)||void 0===a&&S(e,t+1,null,!0,!0,!1,!0))&&(r&&""===s||(s+=h(e,t)),e.dump&&10===e.dump.charCodeAt(0)?s+="-":s+="- ",s+=e.dump);e.tag=l,e.dump=s||"[]"}function C(e,t,n){var r,o,l,c,u,p;for(l=0,c=(o=n?e.explicitTypes:e.implicitTypes).length;l<c;l+=1)if(((u=o[l]).instanceOf||u.predicate)&&(!u.instanceOf||"object"==typeof t&&t instanceof u.instanceOf)&&(!u.predicate||u.predicate(t))){if(n?u.multi&&u.representName?e.tag=u.representName(t):e.tag=u.tag:e.tag="?",u.represent){if(p=e.styleMap[u.tag]||u.defaultStyle,"[object Function]"===a.call(u.represent))r=u.represent(t,p);else{if(!s.call(u.represent,p))throw new i("!<"+u.tag+'> tag resolver accepts not "'+p+'" style');r=u.represent[p](t,p)}e.dump=r}return!0}return!1}function S(e,t,n,r,o,s,l){e.tag=null,e.dump=n,C(e,n,!1)||C(e,n,!0);var c,u=a.call(e.dump),p=r;r&&(r=e.flowLevel<0||e.flowLevel>t);var f,d,g="[object Object]"===u||"[object Array]"===u;if(g&&(d=-1!==(f=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||d||2!==e.indent&&t>0)&&(o=!1),d&&e.usedDuplicates[f])e.dump="*ref_"+f;else{if(g&&d&&!e.usedDuplicates[f]&&(e.usedDuplicates[f]=!0),"[object Object]"===u)r&&0!==Object.keys(e.dump).length?(function(e,t,n,r){var o,a,s,l,c,u,p="",f=e.tag,d=Object.keys(n);if(!0===e.sortKeys)d.sort();else if("function"==typeof e.sortKeys)d.sort(e.sortKeys);else if(e.sortKeys)throw new i("sortKeys must be a boolean or a function");for(o=0,a=d.length;o<a;o+=1)u="",r&&""===p||(u+=h(e,t)),l=n[s=d[o]],e.replacer&&(l=e.replacer.call(n,s,l)),S(e,t+1,s,!0,!0,!0)&&((c=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024)&&(e.dump&&10===e.dump.charCodeAt(0)?u+="?":u+="? "),u+=e.dump,c&&(u+=h(e,t)),S(e,t+1,l,!0,c)&&(e.dump&&10===e.dump.charCodeAt(0)?u+=":":u+=": ",p+=u+=e.dump));e.tag=f,e.dump=p||"{}"}(e,t,e.dump,o),d&&(e.dump="&ref_"+f+e.dump)):(function(e,t,n){var r,i,o,a,s,l="",c=e.tag,u=Object.keys(n);for(r=0,i=u.length;r<i;r+=1)s="",""!==l&&(s+=", "),e.condenseFlow&&(s+='"'),a=n[o=u[r]],e.replacer&&(a=e.replacer.call(n,o,a)),S(e,t,o,!1,!1)&&(e.dump.length>1024&&(s+="? "),s+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),S(e,t,a,!1,!1)&&(l+=s+=e.dump));e.tag=c,e.dump="{"+l+"}"}(e,t,e.dump),d&&(e.dump="&ref_"+f+" "+e.dump));else if("[object Array]"===u)r&&0!==e.dump.length?(e.noArrayIndent&&!l&&t>0?A(e,t-1,e.dump,o):A(e,t,e.dump,o),d&&(e.dump="&ref_"+f+e.dump)):(function(e,t,n){var r,i,o,a="",s=e.tag;for(r=0,i=n.length;r<i;r+=1)o=n[r],e.replacer&&(o=e.replacer.call(n,String(r),o)),(S(e,t,o,!1,!1)||void 0===o&&S(e,t,null,!1,!1))&&(""!==a&&(a+=","+(e.condenseFlow?"":" ")),a+=e.dump);e.tag=s,e.dump="["+a+"]"}(e,t,e.dump),d&&(e.dump="&ref_"+f+" "+e.dump));else{if("[object String]"!==u){if("[object Undefined]"===u)return!1;if(e.skipInvalid)return!1;throw new i("unacceptable kind of an object to dump "+u)}"?"!==e.tag&&w(e,e.dump,t,s,p)}null!==e.tag&&"?"!==e.tag&&(c=encodeURI("!"===e.tag[0]?e.tag.slice(1):e.tag).replace(/!/g,"%21"),c="!"===e.tag[0]?"!"+c:"tag:yaml.org,2002:"===c.slice(0,18)?"!!"+c.slice(18):"!<"+c+">",e.dump=c+" "+e.dump)}return!0}function x(e,t){var n,r,i=[],o=[];for(k(e,i,o),n=0,r=o.length;n<r;n+=1)t.duplicates.push(i[o[n]]);t.usedDuplicates=new Array(r)}function k(e,t,n){var r,i,o;if(null!==e&&"object"==typeof e)if(-1!==(i=t.indexOf(e)))-1===n.indexOf(i)&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,o=e.length;i<o;i+=1)k(e[i],t,n);else for(i=0,o=(r=Object.keys(e)).length;i<o;i+=1)k(e[r[i]],t,n)}e.exports.dump=function(e,t){var n=new d(t=t||{});n.noRefs||x(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},"",r)),S(n,0,r,!0,!0)?n.dump+"\n":""}},4863(e,t,n){"use strict";e.exports=P,P.filename=null,P.defaults={keepCase:!1};var r=n(527),i=n(5330),o=n(7882),a=n(1344),s=n(8252),l=n(1457),c=n(5643),u=n(9687),p=n(8811),f=n(7209),d=n(361),g=n(3262),h=/^[1-9][0-9]*$/,y=/^-?[1-9][0-9]*$/,b=/^0[x][0-9a-fA-F]+$/,m=/^-?0[x][0-9a-fA-F]+$/,v=/^0[0-7]+$/,O=/^-?0[0-7]+$/,T=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,w=/^[a-zA-Z_][a-zA-Z_0-9]*$/,j=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;function P(e,t,n){t instanceof i||(n=t,t=new i),n||(n=P.defaults);var q,A,C,S,x=n.preferTrailingComment||!1,k=r(e,n.alternateCommentMode||!1),E=k.next,N=k.push,D=k.peek,R=k.skip,_=k.cmnt,I=!0,L="proto2",M=t,B=[],F={},U=n.keepCase?function(e){return e}:g.camelCase;function J(e,t,n){var r=P.filename;return n||(P.filename=null),Error("illegal "+(t||"token")+" '"+e+"' ("+(r?r+", ":"")+"line "+k.line+")")}function V(){var e,t=[];do{if('"'!==(e=E())&&"'"!==e)throw J(e);t.push(E()),R(e),e=D()}while('"'===e||"'"===e);return t.join("")}function K(e){var t=E();switch(t){case"'":case'"':return N(t),V();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return function(e){var t=1;switch("-"===e.charAt(0)&&(t=-1,e=e.substring(1)),e){case"inf":case"INF":case"Inf":return t*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(h.test(e))return t*parseInt(e,10);if(b.test(e))return t*parseInt(e,16);if(v.test(e))return t*parseInt(e,8);if(T.test(e))return t*parseFloat(e);throw J(e,"number",!0)}(t)}catch(n){if(e&&j.test(t))return t;throw J(t,"value")}}function G(e,t){var n,r;do{if(!t||'"'!==(n=D())&&"'"!==n)try{e.push([r=Q(E()),R("to",!0)?Q(E()):r])}catch(r){if(!(t&&j.test(n)&&L>=2023))throw r;e.push(n)}else{var i=V();if(e.push(i),L>=2023)throw J(i,"id")}}while(R(",",!0));var o={options:void 0,setOption:function(e,t){void 0===this.options&&(this.options={}),this.options[e]=t}};Z(o,(function(e){if("option"!==e)throw J(e);ne(o,e),R(";")}),(function(){oe(o)}))}function Q(e,t){switch(e){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!t&&"-"===e.charAt(0))throw J(e,"id");if(y.test(e))return parseInt(e,10);if(m.test(e))return parseInt(e,16);if(O.test(e))return parseInt(e,8);throw J(e,"id")}function $(){if(void 0!==q)throw J("package");if(q=E(),!j.test(q))throw J(q,"name");M=M.define(q),R(";")}function W(){var e,t=D();switch(t){case"weak":e=C||(C=[]),E();break;case"public":E();default:e=A||(A=[])}t=V(),R(";"),e.push(t)}function H(){if(R("="),(L=V())<2023)throw J(L,"syntax");R(";")}function z(){if(R("="),L=V(),!["2023"].includes(L))throw J(L,"edition");R(";")}function Y(e,t){switch(t){case"option":return ne(e,t),R(";"),!0;case"message":return X(e,t),!0;case"enum":return te(e,t),!0;case"service":return function(e,t){if(!w.test(t=E()))throw J(t,"service name");var n=new u(t);Z(n,(function(e){if(!Y(n,e)){if("rpc"!==e)throw J(e);!function(e,t){var n=_(),r=t;if(!w.test(t=E()))throw J(t,"name");var i,o,a,s,l=t;if(R("("),R("stream",!0)&&(o=!0),!j.test(t=E()))throw J(t);if(i=t,R(")"),R("returns"),R("("),R("stream",!0)&&(s=!0),!j.test(t=E()))throw J(t);a=t,R(")");var c=new p(l,r,i,a,o,s);c.comment=n,Z(c,(function(e){if("option"!==e)throw J(e);ne(c,e),R(";")})),e.add(c)}(n,e)}})),e.add(n),e===M&&B.push(n)}(e,t),!0;case"extend":return function(e,t){if(!j.test(t=E()))throw J(t,"reference");var n=t;Z(null,(function(t){switch(t){case"required":case"repeated":ee(e,t,n);break;case"optional":ee(e,"proto3"===L?"proto3_optional":"optional",n);break;default:if("proto2"===L||!j.test(t))throw J(t);N(t),ee(e,"optional",n)}}))}(e,t),!0}return!1}function Z(e,t,n){var r=k.line;if(e&&("string"!=typeof e.comment&&(e.comment=_()),e.filename=P.filename),R("{",!0)){for(var i;"}"!==(i=E());)t(i);R(";",!0)}else n&&n(),R(";"),e&&("string"!=typeof e.comment||x)&&(e.comment=_(r)||e.comment)}function X(e,t){if(!w.test(t=E()))throw J(t,"type name");var n=new o(t);Z(n,(function(e){if(!Y(n,e))switch(e){case"map":!function(e){R("<");var t=E();if(void 0===d.mapKey[t])throw J(t,"type");R(",");var n=E();if(!j.test(n))throw J(n,"type");R(">");var r=E();if(!w.test(r))throw J(r,"name");R("=");var i=new s(U(r),Q(E()),t,n);Z(i,(function(e){if("option"!==e)throw J(e);ne(i,e),R(";")}),(function(){oe(i)})),e.add(i)}(n);break;case"required":if("proto2"!==L)throw J(e);case"repeated":ee(n,e);break;case"optional":if("proto3"===L)ee(n,"proto3_optional");else{if("proto2"!==L)throw J(e);ee(n,"optional")}break;case"oneof":!function(e,t){if(!w.test(t=E()))throw J(t,"name");var n=new l(U(t));Z(n,(function(e){"option"===e?(ne(n,e),R(";")):(N(e),ee(n,"optional"))})),e.add(n)}(n,e);break;case"extensions":G(n.extensions||(n.extensions=[]));break;case"reserved":G(n.reserved||(n.reserved=[]),!0);break;default:if("proto2"===L||!j.test(e))throw J(e);N(e),ee(n,"optional")}})),e.add(n),e===M&&B.push(n)}function ee(e,t,n){var r=E();if("group"!==r){for(;r.endsWith(".")||D().startsWith(".");)r+=E();if(!j.test(r))throw J(r,"type");var i=E();if(!w.test(i))throw J(i,"name");i=U(i),R("=");var s=new a(i,Q(E()),r,t,n);if(Z(s,(function(e){if("option"!==e)throw J(e);ne(s,e),R(";")}),(function(){oe(s)})),"proto3_optional"===t){var c=new l("_"+i);s.setOption("proto3_optional",!0),c.add(s),e.add(c)}else e.add(s);e===M&&B.push(s)}else!function(e,t){if(L>=2023)throw J("group");var n=E();if(!w.test(n))throw J(n,"name");var r=g.lcFirst(n);n===r&&(n=g.ucFirst(n)),R("=");var i=Q(E()),s=new o(n);s.group=!0;var l=new a(r,i,n,t);l.filename=P.filename,Z(s,(function(e){switch(e){case"option":ne(s,e),R(";");break;case"required":case"repeated":ee(s,e);break;case"optional":ee(s,"proto3"===L?"proto3_optional":"optional");break;case"message":X(s,e);break;case"enum":te(s,e);break;case"reserved":G(s.reserved||(s.reserved=[]),!0);break;default:throw J(e)}})),e.add(s).add(l)}(e,t)}function te(e,t){if(!w.test(t=E()))throw J(t,"name");var n=new c(t);Z(n,(function(e){switch(e){case"option":ne(n,e),R(";");break;case"reserved":G(n.reserved||(n.reserved=[]),!0),void 0===n.reserved&&(n.reserved=[]);break;default:!function(e,t){if(!w.test(t))throw J(t,"name");R("=");var n=Q(E(),!0),r={options:void 0,getOption:function(e){return this.options[e]},setOption:function(e,t){f.prototype.setOption.call(r,e,t)},setParsedOption:function(){}};Z(r,(function(e){if("option"!==e)throw J(e);ne(r,e),R(";")}),(function(){oe(r)})),e.add(t,n,r.comment,r.parsedOptions||r.options)}(n,e)}})),e.add(n),e===M&&B.push(n)}function ne(e,t){var n,r,i=!0;for("option"===t&&(t=E());"="!==t;){if("("===t){var o=E();R(")"),t="("+o+")"}if(i){if(i=!1,t.includes(".")&&!t.includes("(")){var a=t.split(".");n=a[0]+".",t=a[1];continue}n=t}else r=r?r+=t:t;t=E()}var s=re(e,r?n.concat(r):n);r=r&&"."===r[0]?r.slice(1):r,function(e,t,n,r){e.setParsedOption&&e.setParsedOption(t,n,r)}(e,n=n&&"."===n[n.length-1]?n.slice(0,-1):n,s,r)}function re(e,t){if(R("{",!0)){for(var n={};!R("}",!0);){if(!w.test(S=E()))throw J(S,"name");if(null===S)throw J(S,"end of input");var r,i=S;if(R(":",!0),"{"===D())r=re(e,t+"."+S);else if("["===D()){var o;if(r=[],R("[",!0)){do{o=K(!0),r.push(o)}while(R(",",!0));R("]"),void 0!==o&&ie(e,t+"."+S,o)}}else r=K(!0),ie(e,t+"."+S,r);var a=n[i];a&&(r=[].concat(a).concat(r)),n[i]=r,R(",",!0),R(";",!0)}return n}var s=K(!0);return ie(e,t,s),s}function ie(e,t,n){M===e&&/^features\./.test(t)?F[t]=n:e.setOption&&e.setOption(t,n)}function oe(e){if(R("[",!0)){do{ne(e,"option")}while(R(",",!0));R("]")}return e}for(;null!==(S=E());)switch(S){case"package":if(!I)throw J(S);$();break;case"import":if(!I)throw J(S);W();break;case"syntax":if(!I)throw J(S);H();break;case"edition":if(!I)throw J(S);z();break;case"option":ne(M,S),R(";",!0);break;default:if(Y(M,S)){I=!1;continue}throw J(S)}return B.forEach((e=>{e._edition=L,Object.keys(F).forEach((t=>{void 0===e.getOption(t)&&e.setOption(t,F[t],!0)}))})),P.filename=null,{package:q,imports:A,weakImports:C,root:t}}},5047(e,t,n){"use strict";t.Service=n(7595)},5095(e){"use strict";e.exports=r;var t,n=/\/|\./;function r(e,t){n.test(e)||(e="google/protobuf/"+e+".proto",t={nested:{google:{nested:{protobuf:{nested:t}}}}}),r[e]=t}r("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}),r("duration",{Duration:t={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}),r("timestamp",{Timestamp:t}),r("empty",{Empty:{fields:{}}}),r("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}}),r("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}}),r("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}}),r.get=function(e){return r[e]||null}},5212(e,t,n){"use strict";e.exports=o;var r=n(8045),i=n(4153)("fs");function o(e,t,n){return"function"==typeof t?(n=t,t={}):t||(t={}),n?!t.xhr&&i&&i.readFile?i.readFile(e,(function(r,i){return r&&"undefined"!=typeof XMLHttpRequest?o.xhr(e,t,n):r?n(r):n(null,t.binary?i:i.toString("utf8"))})):o.xhr(e,t,n):r(o,this,e,t)}o.xhr=function(e,t,n){var r=new XMLHttpRequest;r.onreadystatechange=function(){if(4===r.readyState){if(0!==r.status&&200!==r.status)return n(Error("status "+r.status));if(t.binary){var e=r.response;if(!e){e=[];for(var i=0;i<r.responseText.length;++i)e.push(255&r.responseText.charCodeAt(i))}return n(null,"undefined"!=typeof Uint8Array?new Uint8Array(e):e)}return n(null,r.responseText)}},t.binary&&("overrideMimeType"in r&&r.overrideMimeType("text/plain; charset=x-user-defined"),r.responseType="arraybuffer"),r.open("GET",e),r.send()}},5325(e,t,n){"use strict";var r=e.exports=n(4394);r.build="light",r.load=function(e,t,n){return"function"==typeof t?(n=t,t=new r.Root):t||(t=new r.Root),t.load(e,n)},r.loadSync=function(e,t){return t||(t=new r.Root),t.loadSync(e)},r.encoder=n(1080),r.decoder=n(7728),r.verifier=n(420),r.converter=n(744),r.ReflectionObject=n(7209),r.Namespace=n(8923),r.Root=n(5330),r.Enum=n(5643),r.Type=n(7882),r.Field=n(1344),r.OneOf=n(1457),r.MapField=n(8252),r.Service=n(9687),r.Method=n(8811),r.Message=n(2551),r.wrappers=n(6434),r.types=n(361),r.util=n(3262),r.ReflectionObject._configure(r.Root),r.Namespace._configure(r.Type,r.Service,r.Enum),r.Root._configure(r.Type),r.Field._configure(r.Type)},5330(e,t,n){"use strict";e.exports=p;var r=n(8923);((p.prototype=Object.create(r.prototype)).constructor=p).className="Root";var i,o,a,s=n(1344),l=n(5643),c=n(1457),u=n(3262);function p(e){r.call(this,"",e),this.deferred=[],this.files=[],this._edition="proto2",this._fullyQualifiedObjects={}}function f(){}p.fromJSON=function(e,t){return t||(t=new p),e.options&&t.setOptions(e.options),t.addJSON(e.nested).resolveAll()},p.prototype.resolvePath=u.path.resolve,p.prototype.fetch=u.fetch,p.prototype.load=function e(t,n,r){"function"==typeof n&&(r=n,n=void 0);var i=this;if(!r)return u.asPromise(e,i,t,n);var s=r===f;function l(e,t){if(r){if(s)throw e;t&&t.resolveAll();var n=r;r=null,n(e,t)}}function c(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var n=e.substring(t);if(n in a)return n}return null}function p(e,t){try{if(u.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),u.isString(t)){o.filename=e;var r,a=o(t,i,n),p=0;if(a.imports)for(;p<a.imports.length;++p)(r=c(a.imports[p])||i.resolvePath(e,a.imports[p]))&&d(r);if(a.weakImports)for(p=0;p<a.weakImports.length;++p)(r=c(a.weakImports[p])||i.resolvePath(e,a.weakImports[p]))&&d(r,!0)}else i.setOptions(t.options).addJSON(t.nested)}catch(e){l(e)}s||g||l(null,i)}function d(e,t){if(e=c(e)||e,!(i.files.indexOf(e)>-1))if(i.files.push(e),e in a)s?p(e,a[e]):(++g,setTimeout((function(){--g,p(e,a[e])})));else if(s){var n;try{n=u.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||l(e))}p(e,n)}else++g,i.fetch(e,(function(n,o){--g,r&&(n?t?g||l(null,i):l(n):p(e,o))}))}var g=0;u.isString(t)&&(t=[t]);for(var h,y=0;y<t.length;++y)(h=i.resolvePath("",t[y]))&&d(h);return s?(i.resolveAll(),i):(g||l(null,i),i)},p.prototype.loadSync=function(e,t){if(!u.isNode)throw Error("not supported");return this.load(e,t,f)},p.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map((function(e){return"'extend "+e.extend+"' in "+e.parent.fullName})).join(", "));return r.prototype.resolveAll.call(this)};var d=/^[A-Z]/;function g(e,t){var n=t.parent.lookup(t.extend);if(n){var r=new s(t.fullName,t.id,t.type,t.rule,void 0,t.options);return n.get(r.name)||(r.declaringField=t,t.extensionField=r,n.add(r)),!0}return!1}p.prototype._handleAdd=function(e){if(e instanceof s)void 0===e.extend||e.extensionField||g(0,e)||this.deferred.push(e);else if(e instanceof l)d.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof c)){if(e instanceof i)for(var t=0;t<this.deferred.length;)g(0,this.deferred[t])?this.deferred.splice(t,1):++t;for(var n=0;n<e.nestedArray.length;++n)this._handleAdd(e._nestedArray[n]);d.test(e.name)&&(e.parent[e.name]=e)}(e instanceof i||e instanceof l||e instanceof s)&&(this._fullyQualifiedObjects[e.fullName]=e)},p.prototype._handleRemove=function(e){if(e instanceof s){if(void 0!==e.extend)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}}else if(e instanceof l)d.test(e.name)&&delete e.parent[e.name];else if(e instanceof r){for(var n=0;n<e.nestedArray.length;++n)this._handleRemove(e._nestedArray[n]);d.test(e.name)&&delete e.parent[e.name]}delete this._fullyQualifiedObjects[e.fullName]},p._configure=function(e,t,n){i=e,o=t,a=n}},5379(e,t,n){var r,i,o;i=[n(4565)],void 0===(o="function"==typeof(r=function(e){"use strict";var t,n,r,i=e.Reader,o=e.Writer,a=e.util,s=e.roots.default||(e.roots.default={});return s.sqlanvil=((r={}).WorkflowSettings=function(){function t(e){if(this.vars={},this.connections={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.sqlanvilCoreVersion="",t.prototype.defaultProject="",t.prototype.defaultDataset="",t.prototype.defaultLocation="",t.prototype.defaultAssertionDataset="",t.prototype.vars=a.emptyObject,t.prototype.projectSuffix="",t.prototype.datasetSuffix="",t.prototype.namePrefix="",t.prototype.defaultNotebookRuntimeOptions=null,t.prototype.builtinAssertionNamePrefix="",t.prototype.defaultIcebergConfig=null,t.prototype.disableAssertions=!1,t.prototype.defaultReservation="",t.prototype.extension=null,t.prototype.includeTestsInCompiledGraph=!1,t.prototype.warehouse="",t.prototype.connections=a.emptyObject,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.sqlanvilCoreVersion&&Object.hasOwnProperty.call(e,"sqlanvilCoreVersion")&&t.uint32(10).string(e.sqlanvilCoreVersion),null!=e.defaultProject&&Object.hasOwnProperty.call(e,"defaultProject")&&t.uint32(18).string(e.defaultProject),null!=e.defaultDataset&&Object.hasOwnProperty.call(e,"defaultDataset")&&t.uint32(26).string(e.defaultDataset),null!=e.defaultLocation&&Object.hasOwnProperty.call(e,"defaultLocation")&&t.uint32(34).string(e.defaultLocation),null!=e.defaultAssertionDataset&&Object.hasOwnProperty.call(e,"defaultAssertionDataset")&&t.uint32(42).string(e.defaultAssertionDataset),null!=e.vars&&Object.hasOwnProperty.call(e,"vars"))for(var n=Object.keys(e.vars),r=0;r<n.length;++r)t.uint32(50).fork().uint32(10).string(n[r]).uint32(18).string(e.vars[n[r]]).ldelim();if(null!=e.projectSuffix&&Object.hasOwnProperty.call(e,"projectSuffix")&&t.uint32(58).string(e.projectSuffix),null!=e.datasetSuffix&&Object.hasOwnProperty.call(e,"datasetSuffix")&&t.uint32(66).string(e.datasetSuffix),null!=e.namePrefix&&Object.hasOwnProperty.call(e,"namePrefix")&&t.uint32(74).string(e.namePrefix),null!=e.defaultNotebookRuntimeOptions&&Object.hasOwnProperty.call(e,"defaultNotebookRuntimeOptions")&&s.sqlanvil.NotebookRuntimeOptionsConfig.encode(e.defaultNotebookRuntimeOptions,t.uint32(82).fork()).ldelim(),null!=e.builtinAssertionNamePrefix&&Object.hasOwnProperty.call(e,"builtinAssertionNamePrefix")&&t.uint32(90).string(e.builtinAssertionNamePrefix),null!=e.defaultIcebergConfig&&Object.hasOwnProperty.call(e,"defaultIcebergConfig")&&s.sqlanvil.DefaultIcebergConfig.encode(e.defaultIcebergConfig,t.uint32(98).fork()).ldelim(),null!=e.disableAssertions&&Object.hasOwnProperty.call(e,"disableAssertions")&&t.uint32(104).bool(e.disableAssertions),null!=e.defaultReservation&&Object.hasOwnProperty.call(e,"defaultReservation")&&t.uint32(114).string(e.defaultReservation),null!=e.extension&&Object.hasOwnProperty.call(e,"extension")&&s.sqlanvil.Extension.encode(e.extension,t.uint32(122).fork()).ldelim(),null!=e.includeTestsInCompiledGraph&&Object.hasOwnProperty.call(e,"includeTestsInCompiledGraph")&&t.uint32(128).bool(e.includeTestsInCompiledGraph),null!=e.warehouse&&Object.hasOwnProperty.call(e,"warehouse")&&t.uint32(138).string(e.warehouse),null!=e.connections&&Object.hasOwnProperty.call(e,"connections"))for(n=Object.keys(e.connections),r=0;r<n.length;++r)t.uint32(146).fork().uint32(10).string(n[r]),s.sqlanvil.ConnectionConfig.encode(e.connections[n[r]],t.uint32(18).fork()).ldelim().ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r,o,l=void 0===t?e.len:e.pos+t,c=new s.sqlanvil.WorkflowSettings;e.pos<l;){var u=e.uint32();if(u===n)break;switch(u>>>3){case 1:c.sqlanvilCoreVersion=e.string();break;case 2:c.defaultProject=e.string();break;case 3:c.defaultDataset=e.string();break;case 4:c.defaultLocation=e.string();break;case 5:c.defaultAssertionDataset=e.string();break;case 6:c.vars===a.emptyObject&&(c.vars={});var p=e.uint32()+e.pos;for(r="",o="";e.pos<p;)switch((f=e.uint32())>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}c.vars[r]=o;break;case 7:c.projectSuffix=e.string();break;case 8:c.datasetSuffix=e.string();break;case 9:c.namePrefix=e.string();break;case 10:c.defaultNotebookRuntimeOptions=s.sqlanvil.NotebookRuntimeOptionsConfig.decode(e,e.uint32());break;case 11:c.builtinAssertionNamePrefix=e.string();break;case 12:c.defaultIcebergConfig=s.sqlanvil.DefaultIcebergConfig.decode(e,e.uint32());break;case 13:c.disableAssertions=e.bool();break;case 14:c.defaultReservation=e.string();break;case 15:c.extension=s.sqlanvil.Extension.decode(e,e.uint32());break;case 16:c.includeTestsInCompiledGraph=e.bool();break;case 17:c.warehouse=e.string();break;case 18:for(c.connections===a.emptyObject&&(c.connections={}),p=e.uint32()+e.pos,r="",o=null;e.pos<p;){var f;switch((f=e.uint32())>>>3){case 1:r=e.string();break;case 2:o=s.sqlanvil.ConnectionConfig.decode(e,e.uint32());break;default:e.skipType(7&f)}}c.connections[r]=o;break;default:e.skipType(7&u)}}return c},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.sqlanvilCoreVersion&&e.hasOwnProperty("sqlanvilCoreVersion")&&!a.isString(e.sqlanvilCoreVersion))return"sqlanvilCoreVersion: string expected";if(null!=e.defaultProject&&e.hasOwnProperty("defaultProject")&&!a.isString(e.defaultProject))return"defaultProject: string expected";if(null!=e.defaultDataset&&e.hasOwnProperty("defaultDataset")&&!a.isString(e.defaultDataset))return"defaultDataset: string expected";if(null!=e.defaultLocation&&e.hasOwnProperty("defaultLocation")&&!a.isString(e.defaultLocation))return"defaultLocation: string expected";if(null!=e.defaultAssertionDataset&&e.hasOwnProperty("defaultAssertionDataset")&&!a.isString(e.defaultAssertionDataset))return"defaultAssertionDataset: string expected";if(null!=e.vars&&e.hasOwnProperty("vars")){if(!a.isObject(e.vars))return"vars: object expected";for(var t=Object.keys(e.vars),n=0;n<t.length;++n)if(!a.isString(e.vars[t[n]]))return"vars: string{k:string} expected"}if(null!=e.projectSuffix&&e.hasOwnProperty("projectSuffix")&&!a.isString(e.projectSuffix))return"projectSuffix: string expected";if(null!=e.datasetSuffix&&e.hasOwnProperty("datasetSuffix")&&!a.isString(e.datasetSuffix))return"datasetSuffix: string expected";if(null!=e.namePrefix&&e.hasOwnProperty("namePrefix")&&!a.isString(e.namePrefix))return"namePrefix: string expected";if(null!=e.defaultNotebookRuntimeOptions&&e.hasOwnProperty("defaultNotebookRuntimeOptions")&&(r=s.sqlanvil.NotebookRuntimeOptionsConfig.verify(e.defaultNotebookRuntimeOptions)))return"defaultNotebookRuntimeOptions."+r;if(null!=e.builtinAssertionNamePrefix&&e.hasOwnProperty("builtinAssertionNamePrefix")&&!a.isString(e.builtinAssertionNamePrefix))return"builtinAssertionNamePrefix: string expected";if(null!=e.defaultIcebergConfig&&e.hasOwnProperty("defaultIcebergConfig")&&(r=s.sqlanvil.DefaultIcebergConfig.verify(e.defaultIcebergConfig)))return"defaultIcebergConfig."+r;if(null!=e.disableAssertions&&e.hasOwnProperty("disableAssertions")&&"boolean"!=typeof e.disableAssertions)return"disableAssertions: boolean expected";if(null!=e.defaultReservation&&e.hasOwnProperty("defaultReservation")&&!a.isString(e.defaultReservation))return"defaultReservation: string expected";if(null!=e.extension&&e.hasOwnProperty("extension")&&(r=s.sqlanvil.Extension.verify(e.extension)))return"extension."+r;if(null!=e.includeTestsInCompiledGraph&&e.hasOwnProperty("includeTestsInCompiledGraph")&&"boolean"!=typeof e.includeTestsInCompiledGraph)return"includeTestsInCompiledGraph: boolean expected";if(null!=e.warehouse&&e.hasOwnProperty("warehouse")&&!a.isString(e.warehouse))return"warehouse: string expected";if(null!=e.connections&&e.hasOwnProperty("connections")){if(!a.isObject(e.connections))return"connections: object expected";for(t=Object.keys(e.connections),n=0;n<t.length;++n){var r;if(r=s.sqlanvil.ConnectionConfig.verify(e.connections[t[n]]))return"connections."+r}}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.WorkflowSettings)return e;var t=new s.sqlanvil.WorkflowSettings;if(null!=e.sqlanvilCoreVersion&&(t.sqlanvilCoreVersion=String(e.sqlanvilCoreVersion)),null!=e.defaultProject&&(t.defaultProject=String(e.defaultProject)),null!=e.defaultDataset&&(t.defaultDataset=String(e.defaultDataset)),null!=e.defaultLocation&&(t.defaultLocation=String(e.defaultLocation)),null!=e.defaultAssertionDataset&&(t.defaultAssertionDataset=String(e.defaultAssertionDataset)),e.vars){if("object"!=typeof e.vars)throw TypeError(".sqlanvil.WorkflowSettings.vars: object expected");t.vars={};for(var n=Object.keys(e.vars),r=0;r<n.length;++r)t.vars[n[r]]=String(e.vars[n[r]])}if(null!=e.projectSuffix&&(t.projectSuffix=String(e.projectSuffix)),null!=e.datasetSuffix&&(t.datasetSuffix=String(e.datasetSuffix)),null!=e.namePrefix&&(t.namePrefix=String(e.namePrefix)),null!=e.defaultNotebookRuntimeOptions){if("object"!=typeof e.defaultNotebookRuntimeOptions)throw TypeError(".sqlanvil.WorkflowSettings.defaultNotebookRuntimeOptions: object expected");t.defaultNotebookRuntimeOptions=s.sqlanvil.NotebookRuntimeOptionsConfig.fromObject(e.defaultNotebookRuntimeOptions)}if(null!=e.builtinAssertionNamePrefix&&(t.builtinAssertionNamePrefix=String(e.builtinAssertionNamePrefix)),null!=e.defaultIcebergConfig){if("object"!=typeof e.defaultIcebergConfig)throw TypeError(".sqlanvil.WorkflowSettings.defaultIcebergConfig: object expected");t.defaultIcebergConfig=s.sqlanvil.DefaultIcebergConfig.fromObject(e.defaultIcebergConfig)}if(null!=e.disableAssertions&&(t.disableAssertions=Boolean(e.disableAssertions)),null!=e.defaultReservation&&(t.defaultReservation=String(e.defaultReservation)),null!=e.extension){if("object"!=typeof e.extension)throw TypeError(".sqlanvil.WorkflowSettings.extension: object expected");t.extension=s.sqlanvil.Extension.fromObject(e.extension)}if(null!=e.includeTestsInCompiledGraph&&(t.includeTestsInCompiledGraph=Boolean(e.includeTestsInCompiledGraph)),null!=e.warehouse&&(t.warehouse=String(e.warehouse)),e.connections){if("object"!=typeof e.connections)throw TypeError(".sqlanvil.WorkflowSettings.connections: object expected");for(t.connections={},n=Object.keys(e.connections),r=0;r<n.length;++r){if("object"!=typeof e.connections[n[r]])throw TypeError(".sqlanvil.WorkflowSettings.connections: object expected");t.connections[n[r]]=s.sqlanvil.ConnectionConfig.fromObject(e.connections[n[r]])}}return t},t.toObject=function(e,t){t||(t={});var n,r={};if((t.objects||t.defaults)&&(r.vars={},r.connections={}),t.defaults&&(r.sqlanvilCoreVersion="",r.defaultProject="",r.defaultDataset="",r.defaultLocation="",r.defaultAssertionDataset="",r.projectSuffix="",r.datasetSuffix="",r.namePrefix="",r.defaultNotebookRuntimeOptions=null,r.builtinAssertionNamePrefix="",r.defaultIcebergConfig=null,r.disableAssertions=!1,r.defaultReservation="",r.extension=null,r.includeTestsInCompiledGraph=!1,r.warehouse=""),null!=e.sqlanvilCoreVersion&&e.hasOwnProperty("sqlanvilCoreVersion")&&(r.sqlanvilCoreVersion=e.sqlanvilCoreVersion),null!=e.defaultProject&&e.hasOwnProperty("defaultProject")&&(r.defaultProject=e.defaultProject),null!=e.defaultDataset&&e.hasOwnProperty("defaultDataset")&&(r.defaultDataset=e.defaultDataset),null!=e.defaultLocation&&e.hasOwnProperty("defaultLocation")&&(r.defaultLocation=e.defaultLocation),null!=e.defaultAssertionDataset&&e.hasOwnProperty("defaultAssertionDataset")&&(r.defaultAssertionDataset=e.defaultAssertionDataset),e.vars&&(n=Object.keys(e.vars)).length){r.vars={};for(var i=0;i<n.length;++i)r.vars[n[i]]=e.vars[n[i]]}if(null!=e.projectSuffix&&e.hasOwnProperty("projectSuffix")&&(r.projectSuffix=e.projectSuffix),null!=e.datasetSuffix&&e.hasOwnProperty("datasetSuffix")&&(r.datasetSuffix=e.datasetSuffix),null!=e.namePrefix&&e.hasOwnProperty("namePrefix")&&(r.namePrefix=e.namePrefix),null!=e.defaultNotebookRuntimeOptions&&e.hasOwnProperty("defaultNotebookRuntimeOptions")&&(r.defaultNotebookRuntimeOptions=s.sqlanvil.NotebookRuntimeOptionsConfig.toObject(e.defaultNotebookRuntimeOptions,t)),null!=e.builtinAssertionNamePrefix&&e.hasOwnProperty("builtinAssertionNamePrefix")&&(r.builtinAssertionNamePrefix=e.builtinAssertionNamePrefix),null!=e.defaultIcebergConfig&&e.hasOwnProperty("defaultIcebergConfig")&&(r.defaultIcebergConfig=s.sqlanvil.DefaultIcebergConfig.toObject(e.defaultIcebergConfig,t)),null!=e.disableAssertions&&e.hasOwnProperty("disableAssertions")&&(r.disableAssertions=e.disableAssertions),null!=e.defaultReservation&&e.hasOwnProperty("defaultReservation")&&(r.defaultReservation=e.defaultReservation),null!=e.extension&&e.hasOwnProperty("extension")&&(r.extension=s.sqlanvil.Extension.toObject(e.extension,t)),null!=e.includeTestsInCompiledGraph&&e.hasOwnProperty("includeTestsInCompiledGraph")&&(r.includeTestsInCompiledGraph=e.includeTestsInCompiledGraph),null!=e.warehouse&&e.hasOwnProperty("warehouse")&&(r.warehouse=e.warehouse),e.connections&&(n=Object.keys(e.connections)).length)for(r.connections={},i=0;i<n.length;++i)r.connections[n[i]]=s.sqlanvil.ConnectionConfig.toObject(e.connections[n[i]],t);return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.WorkflowSettings"},t}(),r.ConnectionConfig=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.platform="",t.prototype.project="",t.prototype.dataset="",t.prototype.saKeyId="",t.prototype.host="",t.prototype.port=0,t.prototype.database="",t.prototype.defaultSchema="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.platform&&Object.hasOwnProperty.call(e,"platform")&&t.uint32(10).string(e.platform),null!=e.project&&Object.hasOwnProperty.call(e,"project")&&t.uint32(18).string(e.project),null!=e.dataset&&Object.hasOwnProperty.call(e,"dataset")&&t.uint32(26).string(e.dataset),null!=e.saKeyId&&Object.hasOwnProperty.call(e,"saKeyId")&&t.uint32(34).string(e.saKeyId),null!=e.host&&Object.hasOwnProperty.call(e,"host")&&t.uint32(42).string(e.host),null!=e.port&&Object.hasOwnProperty.call(e,"port")&&t.uint32(48).uint32(e.port),null!=e.database&&Object.hasOwnProperty.call(e,"database")&&t.uint32(58).string(e.database),null!=e.defaultSchema&&Object.hasOwnProperty.call(e,"defaultSchema")&&t.uint32(66).string(e.defaultSchema),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ConnectionConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.platform=e.string();break;case 2:o.project=e.string();break;case 3:o.dataset=e.string();break;case 4:o.saKeyId=e.string();break;case 5:o.host=e.string();break;case 6:o.port=e.uint32();break;case 7:o.database=e.string();break;case 8:o.defaultSchema=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.platform&&e.hasOwnProperty("platform")&&!a.isString(e.platform)?"platform: string expected":null!=e.project&&e.hasOwnProperty("project")&&!a.isString(e.project)?"project: string expected":null!=e.dataset&&e.hasOwnProperty("dataset")&&!a.isString(e.dataset)?"dataset: string expected":null!=e.saKeyId&&e.hasOwnProperty("saKeyId")&&!a.isString(e.saKeyId)?"saKeyId: string expected":null!=e.host&&e.hasOwnProperty("host")&&!a.isString(e.host)?"host: string expected":null!=e.port&&e.hasOwnProperty("port")&&!a.isInteger(e.port)?"port: integer expected":null!=e.database&&e.hasOwnProperty("database")&&!a.isString(e.database)?"database: string expected":null!=e.defaultSchema&&e.hasOwnProperty("defaultSchema")&&!a.isString(e.defaultSchema)?"defaultSchema: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ConnectionConfig)return e;var t=new s.sqlanvil.ConnectionConfig;return null!=e.platform&&(t.platform=String(e.platform)),null!=e.project&&(t.project=String(e.project)),null!=e.dataset&&(t.dataset=String(e.dataset)),null!=e.saKeyId&&(t.saKeyId=String(e.saKeyId)),null!=e.host&&(t.host=String(e.host)),null!=e.port&&(t.port=e.port>>>0),null!=e.database&&(t.database=String(e.database)),null!=e.defaultSchema&&(t.defaultSchema=String(e.defaultSchema)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.platform="",n.project="",n.dataset="",n.saKeyId="",n.host="",n.port=0,n.database="",n.defaultSchema=""),null!=e.platform&&e.hasOwnProperty("platform")&&(n.platform=e.platform),null!=e.project&&e.hasOwnProperty("project")&&(n.project=e.project),null!=e.dataset&&e.hasOwnProperty("dataset")&&(n.dataset=e.dataset),null!=e.saKeyId&&e.hasOwnProperty("saKeyId")&&(n.saKeyId=e.saKeyId),null!=e.host&&e.hasOwnProperty("host")&&(n.host=e.host),null!=e.port&&e.hasOwnProperty("port")&&(n.port=e.port),null!=e.database&&e.hasOwnProperty("database")&&(n.database=e.database),null!=e.defaultSchema&&e.hasOwnProperty("defaultSchema")&&(n.defaultSchema=e.defaultSchema),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ConnectionConfig"},t}(),r.DefaultIcebergConfig=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.bucketName="",t.prototype.tableFolderRoot="",t.prototype.tableFolderSubpath="",t.prototype.connection="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.bucketName&&Object.hasOwnProperty.call(e,"bucketName")&&t.uint32(10).string(e.bucketName),null!=e.tableFolderRoot&&Object.hasOwnProperty.call(e,"tableFolderRoot")&&t.uint32(18).string(e.tableFolderRoot),null!=e.tableFolderSubpath&&Object.hasOwnProperty.call(e,"tableFolderSubpath")&&t.uint32(26).string(e.tableFolderSubpath),null!=e.connection&&Object.hasOwnProperty.call(e,"connection")&&t.uint32(34).string(e.connection),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.DefaultIcebergConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.bucketName=e.string();break;case 2:o.tableFolderRoot=e.string();break;case 3:o.tableFolderSubpath=e.string();break;case 4:o.connection=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.bucketName&&e.hasOwnProperty("bucketName")&&!a.isString(e.bucketName)?"bucketName: string expected":null!=e.tableFolderRoot&&e.hasOwnProperty("tableFolderRoot")&&!a.isString(e.tableFolderRoot)?"tableFolderRoot: string expected":null!=e.tableFolderSubpath&&e.hasOwnProperty("tableFolderSubpath")&&!a.isString(e.tableFolderSubpath)?"tableFolderSubpath: string expected":null!=e.connection&&e.hasOwnProperty("connection")&&!a.isString(e.connection)?"connection: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.DefaultIcebergConfig)return e;var t=new s.sqlanvil.DefaultIcebergConfig;return null!=e.bucketName&&(t.bucketName=String(e.bucketName)),null!=e.tableFolderRoot&&(t.tableFolderRoot=String(e.tableFolderRoot)),null!=e.tableFolderSubpath&&(t.tableFolderSubpath=String(e.tableFolderSubpath)),null!=e.connection&&(t.connection=String(e.connection)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.bucketName="",n.tableFolderRoot="",n.tableFolderSubpath="",n.connection=""),null!=e.bucketName&&e.hasOwnProperty("bucketName")&&(n.bucketName=e.bucketName),null!=e.tableFolderRoot&&e.hasOwnProperty("tableFolderRoot")&&(n.tableFolderRoot=e.tableFolderRoot),null!=e.tableFolderSubpath&&e.hasOwnProperty("tableFolderSubpath")&&(n.tableFolderSubpath=e.tableFolderSubpath),null!=e.connection&&e.hasOwnProperty("connection")&&(n.connection=e.connection),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.DefaultIcebergConfig"},t}(),r.ActionConfigs=function(){function t(e){if(this.actions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.actions=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.actions&&e.actions.length)for(var n=0;n<e.actions.length;++n)s.sqlanvil.ActionConfig.encode(e.actions[n],t.uint32(10).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionConfigs;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?(o.actions&&o.actions.length||(o.actions=[]),o.actions.push(s.sqlanvil.ActionConfig.decode(e,e.uint32()))):e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.actions&&e.hasOwnProperty("actions")){if(!Array.isArray(e.actions))return"actions: array expected";for(var t=0;t<e.actions.length;++t){var n=s.sqlanvil.ActionConfig.verify(e.actions[t]);if(n)return"actions."+n}}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfigs)return e;var t=new s.sqlanvil.ActionConfigs;if(e.actions){if(!Array.isArray(e.actions))throw TypeError(".sqlanvil.ActionConfigs.actions: array expected");t.actions=[];for(var n=0;n<e.actions.length;++n){if("object"!=typeof e.actions[n])throw TypeError(".sqlanvil.ActionConfigs.actions: object expected");t.actions[n]=s.sqlanvil.ActionConfig.fromObject(e.actions[n])}}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.actions=[]),e.actions&&e.actions.length){n.actions=[];for(var r=0;r<e.actions.length;++r)n.actions[r]=s.sqlanvil.ActionConfig.toObject(e.actions[r],t)}return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfigs"},t}(),r.ActionConfig=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var n,r,l;return t.prototype.table=null,t.prototype.view=null,t.prototype.incrementalTable=null,t.prototype.assertion=null,t.prototype.operation=null,t.prototype.declaration=null,t.prototype.notebook=null,t.prototype.dataPreparation=null,t.prototype.rlsPolicy=null,t.prototype.realtimePublication=null,t.prototype.foreignWrapper=null,t.prototype.vectorIndex=null,Object.defineProperty(t.prototype,"action",{get:a.oneOfGetter(n=["table","view","incrementalTable","assertion","operation","declaration","notebook","dataPreparation","rlsPolicy","realtimePublication","foreignWrapper","vectorIndex"]),set:a.oneOfSetter(n)}),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.table&&Object.hasOwnProperty.call(e,"table")&&s.sqlanvil.ActionConfig.TableConfig.encode(e.table,t.uint32(10).fork()).ldelim(),null!=e.view&&Object.hasOwnProperty.call(e,"view")&&s.sqlanvil.ActionConfig.ViewConfig.encode(e.view,t.uint32(18).fork()).ldelim(),null!=e.incrementalTable&&Object.hasOwnProperty.call(e,"incrementalTable")&&s.sqlanvil.ActionConfig.IncrementalTableConfig.encode(e.incrementalTable,t.uint32(26).fork()).ldelim(),null!=e.assertion&&Object.hasOwnProperty.call(e,"assertion")&&s.sqlanvil.ActionConfig.AssertionConfig.encode(e.assertion,t.uint32(34).fork()).ldelim(),null!=e.operation&&Object.hasOwnProperty.call(e,"operation")&&s.sqlanvil.ActionConfig.OperationConfig.encode(e.operation,t.uint32(42).fork()).ldelim(),null!=e.declaration&&Object.hasOwnProperty.call(e,"declaration")&&s.sqlanvil.ActionConfig.DeclarationConfig.encode(e.declaration,t.uint32(50).fork()).ldelim(),null!=e.notebook&&Object.hasOwnProperty.call(e,"notebook")&&s.sqlanvil.ActionConfig.NotebookConfig.encode(e.notebook,t.uint32(58).fork()).ldelim(),null!=e.dataPreparation&&Object.hasOwnProperty.call(e,"dataPreparation")&&s.sqlanvil.ActionConfig.DataPreparationConfig.encode(e.dataPreparation,t.uint32(66).fork()).ldelim(),null!=e.rlsPolicy&&Object.hasOwnProperty.call(e,"rlsPolicy")&&s.sqlanvil.ActionConfig.RlsPolicyConfig.encode(e.rlsPolicy,t.uint32(74).fork()).ldelim(),null!=e.realtimePublication&&Object.hasOwnProperty.call(e,"realtimePublication")&&s.sqlanvil.ActionConfig.RealtimePublicationConfig.encode(e.realtimePublication,t.uint32(82).fork()).ldelim(),null!=e.foreignWrapper&&Object.hasOwnProperty.call(e,"foreignWrapper")&&s.sqlanvil.ActionConfig.ForeignWrapperConfig.encode(e.foreignWrapper,t.uint32(90).fork()).ldelim(),null!=e.vectorIndex&&Object.hasOwnProperty.call(e,"vectorIndex")&&s.sqlanvil.ActionConfig.VectorIndexConfig.encode(e.vectorIndex,t.uint32(98).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.table=s.sqlanvil.ActionConfig.TableConfig.decode(e,e.uint32());break;case 2:o.view=s.sqlanvil.ActionConfig.ViewConfig.decode(e,e.uint32());break;case 3:o.incrementalTable=s.sqlanvil.ActionConfig.IncrementalTableConfig.decode(e,e.uint32());break;case 4:o.assertion=s.sqlanvil.ActionConfig.AssertionConfig.decode(e,e.uint32());break;case 5:o.operation=s.sqlanvil.ActionConfig.OperationConfig.decode(e,e.uint32());break;case 6:o.declaration=s.sqlanvil.ActionConfig.DeclarationConfig.decode(e,e.uint32());break;case 7:o.notebook=s.sqlanvil.ActionConfig.NotebookConfig.decode(e,e.uint32());break;case 8:o.dataPreparation=s.sqlanvil.ActionConfig.DataPreparationConfig.decode(e,e.uint32());break;case 9:o.rlsPolicy=s.sqlanvil.ActionConfig.RlsPolicyConfig.decode(e,e.uint32());break;case 10:o.realtimePublication=s.sqlanvil.ActionConfig.RealtimePublicationConfig.decode(e,e.uint32());break;case 11:o.foreignWrapper=s.sqlanvil.ActionConfig.ForeignWrapperConfig.decode(e,e.uint32());break;case 12:o.vectorIndex=s.sqlanvil.ActionConfig.VectorIndexConfig.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.table&&e.hasOwnProperty("table")&&(t.action=1,n=s.sqlanvil.ActionConfig.TableConfig.verify(e.table)))return"table."+n;if(null!=e.view&&e.hasOwnProperty("view")){if(1===t.action)return"action: multiple values";if(t.action=1,n=s.sqlanvil.ActionConfig.ViewConfig.verify(e.view))return"view."+n}if(null!=e.incrementalTable&&e.hasOwnProperty("incrementalTable")){if(1===t.action)return"action: multiple values";if(t.action=1,n=s.sqlanvil.ActionConfig.IncrementalTableConfig.verify(e.incrementalTable))return"incrementalTable."+n}if(null!=e.assertion&&e.hasOwnProperty("assertion")){if(1===t.action)return"action: multiple values";if(t.action=1,n=s.sqlanvil.ActionConfig.AssertionConfig.verify(e.assertion))return"assertion."+n}if(null!=e.operation&&e.hasOwnProperty("operation")){if(1===t.action)return"action: multiple values";if(t.action=1,n=s.sqlanvil.ActionConfig.OperationConfig.verify(e.operation))return"operation."+n}if(null!=e.declaration&&e.hasOwnProperty("declaration")){if(1===t.action)return"action: multiple values";if(t.action=1,n=s.sqlanvil.ActionConfig.DeclarationConfig.verify(e.declaration))return"declaration."+n}if(null!=e.notebook&&e.hasOwnProperty("notebook")){if(1===t.action)return"action: multiple values";if(t.action=1,n=s.sqlanvil.ActionConfig.NotebookConfig.verify(e.notebook))return"notebook."+n}if(null!=e.dataPreparation&&e.hasOwnProperty("dataPreparation")){if(1===t.action)return"action: multiple values";if(t.action=1,n=s.sqlanvil.ActionConfig.DataPreparationConfig.verify(e.dataPreparation))return"dataPreparation."+n}if(null!=e.rlsPolicy&&e.hasOwnProperty("rlsPolicy")){if(1===t.action)return"action: multiple values";if(t.action=1,n=s.sqlanvil.ActionConfig.RlsPolicyConfig.verify(e.rlsPolicy))return"rlsPolicy."+n}if(null!=e.realtimePublication&&e.hasOwnProperty("realtimePublication")){if(1===t.action)return"action: multiple values";if(t.action=1,n=s.sqlanvil.ActionConfig.RealtimePublicationConfig.verify(e.realtimePublication))return"realtimePublication."+n}if(null!=e.foreignWrapper&&e.hasOwnProperty("foreignWrapper")){if(1===t.action)return"action: multiple values";if(t.action=1,n=s.sqlanvil.ActionConfig.ForeignWrapperConfig.verify(e.foreignWrapper))return"foreignWrapper."+n}if(null!=e.vectorIndex&&e.hasOwnProperty("vectorIndex")){if(1===t.action)return"action: multiple values";var n;if(t.action=1,n=s.sqlanvil.ActionConfig.VectorIndexConfig.verify(e.vectorIndex))return"vectorIndex."+n}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig)return e;var t=new s.sqlanvil.ActionConfig;if(null!=e.table){if("object"!=typeof e.table)throw TypeError(".sqlanvil.ActionConfig.table: object expected");t.table=s.sqlanvil.ActionConfig.TableConfig.fromObject(e.table)}if(null!=e.view){if("object"!=typeof e.view)throw TypeError(".sqlanvil.ActionConfig.view: object expected");t.view=s.sqlanvil.ActionConfig.ViewConfig.fromObject(e.view)}if(null!=e.incrementalTable){if("object"!=typeof e.incrementalTable)throw TypeError(".sqlanvil.ActionConfig.incrementalTable: object expected");t.incrementalTable=s.sqlanvil.ActionConfig.IncrementalTableConfig.fromObject(e.incrementalTable)}if(null!=e.assertion){if("object"!=typeof e.assertion)throw TypeError(".sqlanvil.ActionConfig.assertion: object expected");t.assertion=s.sqlanvil.ActionConfig.AssertionConfig.fromObject(e.assertion)}if(null!=e.operation){if("object"!=typeof e.operation)throw TypeError(".sqlanvil.ActionConfig.operation: object expected");t.operation=s.sqlanvil.ActionConfig.OperationConfig.fromObject(e.operation)}if(null!=e.declaration){if("object"!=typeof e.declaration)throw TypeError(".sqlanvil.ActionConfig.declaration: object expected");t.declaration=s.sqlanvil.ActionConfig.DeclarationConfig.fromObject(e.declaration)}if(null!=e.notebook){if("object"!=typeof e.notebook)throw TypeError(".sqlanvil.ActionConfig.notebook: object expected");t.notebook=s.sqlanvil.ActionConfig.NotebookConfig.fromObject(e.notebook)}if(null!=e.dataPreparation){if("object"!=typeof e.dataPreparation)throw TypeError(".sqlanvil.ActionConfig.dataPreparation: object expected");t.dataPreparation=s.sqlanvil.ActionConfig.DataPreparationConfig.fromObject(e.dataPreparation)}if(null!=e.rlsPolicy){if("object"!=typeof e.rlsPolicy)throw TypeError(".sqlanvil.ActionConfig.rlsPolicy: object expected");t.rlsPolicy=s.sqlanvil.ActionConfig.RlsPolicyConfig.fromObject(e.rlsPolicy)}if(null!=e.realtimePublication){if("object"!=typeof e.realtimePublication)throw TypeError(".sqlanvil.ActionConfig.realtimePublication: object expected");t.realtimePublication=s.sqlanvil.ActionConfig.RealtimePublicationConfig.fromObject(e.realtimePublication)}if(null!=e.foreignWrapper){if("object"!=typeof e.foreignWrapper)throw TypeError(".sqlanvil.ActionConfig.foreignWrapper: object expected");t.foreignWrapper=s.sqlanvil.ActionConfig.ForeignWrapperConfig.fromObject(e.foreignWrapper)}if(null!=e.vectorIndex){if("object"!=typeof e.vectorIndex)throw TypeError(".sqlanvil.ActionConfig.vectorIndex: object expected");t.vectorIndex=s.sqlanvil.ActionConfig.VectorIndexConfig.fromObject(e.vectorIndex)}return t},t.toObject=function(e,t){t||(t={});var n={};return null!=e.table&&e.hasOwnProperty("table")&&(n.table=s.sqlanvil.ActionConfig.TableConfig.toObject(e.table,t),t.oneofs&&(n.action="table")),null!=e.view&&e.hasOwnProperty("view")&&(n.view=s.sqlanvil.ActionConfig.ViewConfig.toObject(e.view,t),t.oneofs&&(n.action="view")),null!=e.incrementalTable&&e.hasOwnProperty("incrementalTable")&&(n.incrementalTable=s.sqlanvil.ActionConfig.IncrementalTableConfig.toObject(e.incrementalTable,t),t.oneofs&&(n.action="incrementalTable")),null!=e.assertion&&e.hasOwnProperty("assertion")&&(n.assertion=s.sqlanvil.ActionConfig.AssertionConfig.toObject(e.assertion,t),t.oneofs&&(n.action="assertion")),null!=e.operation&&e.hasOwnProperty("operation")&&(n.operation=s.sqlanvil.ActionConfig.OperationConfig.toObject(e.operation,t),t.oneofs&&(n.action="operation")),null!=e.declaration&&e.hasOwnProperty("declaration")&&(n.declaration=s.sqlanvil.ActionConfig.DeclarationConfig.toObject(e.declaration,t),t.oneofs&&(n.action="declaration")),null!=e.notebook&&e.hasOwnProperty("notebook")&&(n.notebook=s.sqlanvil.ActionConfig.NotebookConfig.toObject(e.notebook,t),t.oneofs&&(n.action="notebook")),null!=e.dataPreparation&&e.hasOwnProperty("dataPreparation")&&(n.dataPreparation=s.sqlanvil.ActionConfig.DataPreparationConfig.toObject(e.dataPreparation,t),t.oneofs&&(n.action="dataPreparation")),null!=e.rlsPolicy&&e.hasOwnProperty("rlsPolicy")&&(n.rlsPolicy=s.sqlanvil.ActionConfig.RlsPolicyConfig.toObject(e.rlsPolicy,t),t.oneofs&&(n.action="rlsPolicy")),null!=e.realtimePublication&&e.hasOwnProperty("realtimePublication")&&(n.realtimePublication=s.sqlanvil.ActionConfig.RealtimePublicationConfig.toObject(e.realtimePublication,t),t.oneofs&&(n.action="realtimePublication")),null!=e.foreignWrapper&&e.hasOwnProperty("foreignWrapper")&&(n.foreignWrapper=s.sqlanvil.ActionConfig.ForeignWrapperConfig.toObject(e.foreignWrapper,t),t.oneofs&&(n.action="foreignWrapper")),null!=e.vectorIndex&&e.hasOwnProperty("vectorIndex")&&(n.vectorIndex=s.sqlanvil.ActionConfig.VectorIndexConfig.toObject(e.vectorIndex,t),t.oneofs&&(n.action="vectorIndex")),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig"},t.Target=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.project="",t.prototype.dataset="",t.prototype.name="",t.prototype.includeDependentAssertions=!1,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.project&&Object.hasOwnProperty.call(e,"project")&&t.uint32(10).string(e.project),null!=e.dataset&&Object.hasOwnProperty.call(e,"dataset")&&t.uint32(18).string(e.dataset),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(34).string(e.name),null!=e.includeDependentAssertions&&Object.hasOwnProperty.call(e,"includeDependentAssertions")&&t.uint32(40).bool(e.includeDependentAssertions),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionConfig.Target;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.project=e.string();break;case 2:o.dataset=e.string();break;case 4:o.name=e.string();break;case 5:o.includeDependentAssertions=e.bool();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.project&&e.hasOwnProperty("project")&&!a.isString(e.project)?"project: string expected":null!=e.dataset&&e.hasOwnProperty("dataset")&&!a.isString(e.dataset)?"dataset: string expected":null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name)?"name: string expected":null!=e.includeDependentAssertions&&e.hasOwnProperty("includeDependentAssertions")&&"boolean"!=typeof e.includeDependentAssertions?"includeDependentAssertions: boolean expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.Target)return e;var t=new s.sqlanvil.ActionConfig.Target;return null!=e.project&&(t.project=String(e.project)),null!=e.dataset&&(t.dataset=String(e.dataset)),null!=e.name&&(t.name=String(e.name)),null!=e.includeDependentAssertions&&(t.includeDependentAssertions=Boolean(e.includeDependentAssertions)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.project="",n.dataset="",n.name="",n.includeDependentAssertions=!1),null!=e.project&&e.hasOwnProperty("project")&&(n.project=e.project),null!=e.dataset&&e.hasOwnProperty("dataset")&&(n.dataset=e.dataset),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.includeDependentAssertions&&e.hasOwnProperty("includeDependentAssertions")&&(n.includeDependentAssertions=e.includeDependentAssertions),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.Target"},t}(),t.ColumnDescriptor=function(){function t(e){if(this.path=[],this.bigqueryPolicyTags=[],this.tags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.path=a.emptyArray,t.prototype.description="",t.prototype.bigqueryPolicyTags=a.emptyArray,t.prototype.tags=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.path&&e.path.length)for(var n=0;n<e.path.length;++n)t.uint32(10).string(e.path[n]);if(null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(18).string(e.description),null!=e.bigqueryPolicyTags&&e.bigqueryPolicyTags.length)for(n=0;n<e.bigqueryPolicyTags.length;++n)t.uint32(26).string(e.bigqueryPolicyTags[n]);if(null!=e.tags&&e.tags.length)for(n=0;n<e.tags.length;++n)t.uint32(34).string(e.tags[n]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionConfig.ColumnDescriptor;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.path&&o.path.length||(o.path=[]),o.path.push(e.string());break;case 2:o.description=e.string();break;case 3:o.bigqueryPolicyTags&&o.bigqueryPolicyTags.length||(o.bigqueryPolicyTags=[]),o.bigqueryPolicyTags.push(e.string());break;case 4:o.tags&&o.tags.length||(o.tags=[]),o.tags.push(e.string());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.path&&e.hasOwnProperty("path")){if(!Array.isArray(e.path))return"path: array expected";for(var t=0;t<e.path.length;++t)if(!a.isString(e.path[t]))return"path: string[] expected"}if(null!=e.description&&e.hasOwnProperty("description")&&!a.isString(e.description))return"description: string expected";if(null!=e.bigqueryPolicyTags&&e.hasOwnProperty("bigqueryPolicyTags")){if(!Array.isArray(e.bigqueryPolicyTags))return"bigqueryPolicyTags: array expected";for(t=0;t<e.bigqueryPolicyTags.length;++t)if(!a.isString(e.bigqueryPolicyTags[t]))return"bigqueryPolicyTags: string[] expected"}if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!a.isString(e.tags[t]))return"tags: string[] expected"}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.ColumnDescriptor)return e;var t=new s.sqlanvil.ActionConfig.ColumnDescriptor;if(e.path){if(!Array.isArray(e.path))throw TypeError(".sqlanvil.ActionConfig.ColumnDescriptor.path: array expected");t.path=[];for(var n=0;n<e.path.length;++n)t.path[n]=String(e.path[n])}if(null!=e.description&&(t.description=String(e.description)),e.bigqueryPolicyTags){if(!Array.isArray(e.bigqueryPolicyTags))throw TypeError(".sqlanvil.ActionConfig.ColumnDescriptor.bigqueryPolicyTags: array expected");for(t.bigqueryPolicyTags=[],n=0;n<e.bigqueryPolicyTags.length;++n)t.bigqueryPolicyTags[n]=String(e.bigqueryPolicyTags[n])}if(e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.ColumnDescriptor.tags: array expected");for(t.tags=[],n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.path=[],n.bigqueryPolicyTags=[],n.tags=[]),t.defaults&&(n.description=""),e.path&&e.path.length){n.path=[];for(var r=0;r<e.path.length;++r)n.path[r]=e.path[r]}if(null!=e.description&&e.hasOwnProperty("description")&&(n.description=e.description),e.bigqueryPolicyTags&&e.bigqueryPolicyTags.length)for(n.bigqueryPolicyTags=[],r=0;r<e.bigqueryPolicyTags.length;++r)n.bigqueryPolicyTags[r]=e.bigqueryPolicyTags[r];if(e.tags&&e.tags.length)for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=e.tags[r];return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.ColumnDescriptor"},t}(),t.TableAssertionsConfig=function(){function t(e){if(this.uniqueKey=[],this.uniqueKeys=[],this.nonNull=[],this.rowConditions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.uniqueKey=a.emptyArray,t.prototype.uniqueKeys=a.emptyArray,t.prototype.nonNull=a.emptyArray,t.prototype.rowConditions=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.uniqueKey&&e.uniqueKey.length)for(var n=0;n<e.uniqueKey.length;++n)t.uint32(10).string(e.uniqueKey[n]);if(null!=e.uniqueKeys&&e.uniqueKeys.length)for(n=0;n<e.uniqueKeys.length;++n)s.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey.encode(e.uniqueKeys[n],t.uint32(18).fork()).ldelim();if(null!=e.nonNull&&e.nonNull.length)for(n=0;n<e.nonNull.length;++n)t.uint32(26).string(e.nonNull[n]);if(null!=e.rowConditions&&e.rowConditions.length)for(n=0;n<e.rowConditions.length;++n)t.uint32(34).string(e.rowConditions[n]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionConfig.TableAssertionsConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.uniqueKey&&o.uniqueKey.length||(o.uniqueKey=[]),o.uniqueKey.push(e.string());break;case 2:o.uniqueKeys&&o.uniqueKeys.length||(o.uniqueKeys=[]),o.uniqueKeys.push(s.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey.decode(e,e.uint32()));break;case 3:o.nonNull&&o.nonNull.length||(o.nonNull=[]),o.nonNull.push(e.string());break;case 4:o.rowConditions&&o.rowConditions.length||(o.rowConditions=[]),o.rowConditions.push(e.string());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.uniqueKey&&e.hasOwnProperty("uniqueKey")){if(!Array.isArray(e.uniqueKey))return"uniqueKey: array expected";for(var t=0;t<e.uniqueKey.length;++t)if(!a.isString(e.uniqueKey[t]))return"uniqueKey: string[] expected"}if(null!=e.uniqueKeys&&e.hasOwnProperty("uniqueKeys")){if(!Array.isArray(e.uniqueKeys))return"uniqueKeys: array expected";for(t=0;t<e.uniqueKeys.length;++t){var n=s.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey.verify(e.uniqueKeys[t]);if(n)return"uniqueKeys."+n}}if(null!=e.nonNull&&e.hasOwnProperty("nonNull")){if(!Array.isArray(e.nonNull))return"nonNull: array expected";for(t=0;t<e.nonNull.length;++t)if(!a.isString(e.nonNull[t]))return"nonNull: string[] expected"}if(null!=e.rowConditions&&e.hasOwnProperty("rowConditions")){if(!Array.isArray(e.rowConditions))return"rowConditions: array expected";for(t=0;t<e.rowConditions.length;++t)if(!a.isString(e.rowConditions[t]))return"rowConditions: string[] expected"}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.TableAssertionsConfig)return e;var t=new s.sqlanvil.ActionConfig.TableAssertionsConfig;if(e.uniqueKey){if(!Array.isArray(e.uniqueKey))throw TypeError(".sqlanvil.ActionConfig.TableAssertionsConfig.uniqueKey: array expected");t.uniqueKey=[];for(var n=0;n<e.uniqueKey.length;++n)t.uniqueKey[n]=String(e.uniqueKey[n])}if(e.uniqueKeys){if(!Array.isArray(e.uniqueKeys))throw TypeError(".sqlanvil.ActionConfig.TableAssertionsConfig.uniqueKeys: array expected");for(t.uniqueKeys=[],n=0;n<e.uniqueKeys.length;++n){if("object"!=typeof e.uniqueKeys[n])throw TypeError(".sqlanvil.ActionConfig.TableAssertionsConfig.uniqueKeys: object expected");t.uniqueKeys[n]=s.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey.fromObject(e.uniqueKeys[n])}}if(e.nonNull){if(!Array.isArray(e.nonNull))throw TypeError(".sqlanvil.ActionConfig.TableAssertionsConfig.nonNull: array expected");for(t.nonNull=[],n=0;n<e.nonNull.length;++n)t.nonNull[n]=String(e.nonNull[n])}if(e.rowConditions){if(!Array.isArray(e.rowConditions))throw TypeError(".sqlanvil.ActionConfig.TableAssertionsConfig.rowConditions: array expected");for(t.rowConditions=[],n=0;n<e.rowConditions.length;++n)t.rowConditions[n]=String(e.rowConditions[n])}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.uniqueKey=[],n.uniqueKeys=[],n.nonNull=[],n.rowConditions=[]),e.uniqueKey&&e.uniqueKey.length){n.uniqueKey=[];for(var r=0;r<e.uniqueKey.length;++r)n.uniqueKey[r]=e.uniqueKey[r]}if(e.uniqueKeys&&e.uniqueKeys.length)for(n.uniqueKeys=[],r=0;r<e.uniqueKeys.length;++r)n.uniqueKeys[r]=s.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey.toObject(e.uniqueKeys[r],t);if(e.nonNull&&e.nonNull.length)for(n.nonNull=[],r=0;r<e.nonNull.length;++r)n.nonNull[r]=e.nonNull[r];if(e.rowConditions&&e.rowConditions.length)for(n.rowConditions=[],r=0;r<e.rowConditions.length;++r)n.rowConditions[r]=e.rowConditions[r];return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.TableAssertionsConfig"},t.UniqueKey=function(){function t(e){if(this.uniqueKey=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.uniqueKey=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.uniqueKey&&e.uniqueKey.length)for(var n=0;n<e.uniqueKey.length;++n)t.uint32(10).string(e.uniqueKey[n]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?(o.uniqueKey&&o.uniqueKey.length||(o.uniqueKey=[]),o.uniqueKey.push(e.string())):e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.uniqueKey&&e.hasOwnProperty("uniqueKey")){if(!Array.isArray(e.uniqueKey))return"uniqueKey: array expected";for(var t=0;t<e.uniqueKey.length;++t)if(!a.isString(e.uniqueKey[t]))return"uniqueKey: string[] expected"}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey)return e;var t=new s.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey;if(e.uniqueKey){if(!Array.isArray(e.uniqueKey))throw TypeError(".sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey.uniqueKey: array expected");t.uniqueKey=[];for(var n=0;n<e.uniqueKey.length;++n)t.uniqueKey[n]=String(e.uniqueKey[n])}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.uniqueKey=[]),e.uniqueKey&&e.uniqueKey.length){n.uniqueKey=[];for(var r=0;r<e.uniqueKey.length;++r)n.uniqueKey[r]=e.uniqueKey[r]}return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey"},t}(),t}(),t.IcebergTableConfig=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var n,r;return t.prototype.fileFormat=0,t.prototype.connection="",t.prototype.bucketName="",t.prototype.tableFolderRoot="",t.prototype.tableFolderSubpath="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.fileFormat&&Object.hasOwnProperty.call(e,"fileFormat")&&t.uint32(8).int32(e.fileFormat),null!=e.connection&&Object.hasOwnProperty.call(e,"connection")&&t.uint32(18).string(e.connection),null!=e.bucketName&&Object.hasOwnProperty.call(e,"bucketName")&&t.uint32(26).string(e.bucketName),null!=e.tableFolderRoot&&Object.hasOwnProperty.call(e,"tableFolderRoot")&&t.uint32(34).string(e.tableFolderRoot),null!=e.tableFolderSubpath&&Object.hasOwnProperty.call(e,"tableFolderSubpath")&&t.uint32(42).string(e.tableFolderSubpath),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionConfig.IcebergTableConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.fileFormat=e.int32();break;case 2:o.connection=e.string();break;case 3:o.bucketName=e.string();break;case 4:o.tableFolderRoot=e.string();break;case 5:o.tableFolderSubpath=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.fileFormat&&e.hasOwnProperty("fileFormat"))switch(e.fileFormat){default:return"fileFormat: enum value expected";case 0:case 1:}return null!=e.connection&&e.hasOwnProperty("connection")&&!a.isString(e.connection)?"connection: string expected":null!=e.bucketName&&e.hasOwnProperty("bucketName")&&!a.isString(e.bucketName)?"bucketName: string expected":null!=e.tableFolderRoot&&e.hasOwnProperty("tableFolderRoot")&&!a.isString(e.tableFolderRoot)?"tableFolderRoot: string expected":null!=e.tableFolderSubpath&&e.hasOwnProperty("tableFolderSubpath")&&!a.isString(e.tableFolderSubpath)?"tableFolderSubpath: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.IcebergTableConfig)return e;var t=new s.sqlanvil.ActionConfig.IcebergTableConfig;switch(e.fileFormat){default:if("number"==typeof e.fileFormat){t.fileFormat=e.fileFormat;break}break;case"FILE_FORMAT_UNSPECIFIED":case 0:t.fileFormat=0;break;case"PARQUET":case 1:t.fileFormat=1}return null!=e.connection&&(t.connection=String(e.connection)),null!=e.bucketName&&(t.bucketName=String(e.bucketName)),null!=e.tableFolderRoot&&(t.tableFolderRoot=String(e.tableFolderRoot)),null!=e.tableFolderSubpath&&(t.tableFolderSubpath=String(e.tableFolderSubpath)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.fileFormat=t.enums===String?"FILE_FORMAT_UNSPECIFIED":0,n.connection="",n.bucketName="",n.tableFolderRoot="",n.tableFolderSubpath=""),null!=e.fileFormat&&e.hasOwnProperty("fileFormat")&&(n.fileFormat=t.enums===String?void 0===s.sqlanvil.ActionConfig.IcebergTableConfig.FileFormat[e.fileFormat]?e.fileFormat:s.sqlanvil.ActionConfig.IcebergTableConfig.FileFormat[e.fileFormat]:e.fileFormat),null!=e.connection&&e.hasOwnProperty("connection")&&(n.connection=e.connection),null!=e.bucketName&&e.hasOwnProperty("bucketName")&&(n.bucketName=e.bucketName),null!=e.tableFolderRoot&&e.hasOwnProperty("tableFolderRoot")&&(n.tableFolderRoot=e.tableFolderRoot),null!=e.tableFolderSubpath&&e.hasOwnProperty("tableFolderSubpath")&&(n.tableFolderSubpath=e.tableFolderSubpath),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.IcebergTableConfig"},t.FileFormat=(n={},(r=Object.create(n))[n[0]="FILE_FORMAT_UNSPECIFIED"]=0,r[n[1]="PARQUET"]=1,r),t}(),t.TableConfig=function(){function t(e){if(this.dependencyTargets=[],this.tags=[],this.preOperations=[],this.postOperations=[],this.columns=[],this.clusterBy=[],this.labels={},this.additionalOptions={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.dataset="",t.prototype.project="",t.prototype.dependencyTargets=a.emptyArray,t.prototype.filename="",t.prototype.tags=a.emptyArray,t.prototype.disabled=!1,t.prototype.preOperations=a.emptyArray,t.prototype.postOperations=a.emptyArray,t.prototype.description="",t.prototype.columns=a.emptyArray,t.prototype.partitionBy="",t.prototype.partitionExpirationDays=0,t.prototype.requirePartitionFilter=!1,t.prototype.clusterBy=a.emptyArray,t.prototype.labels=a.emptyObject,t.prototype.additionalOptions=a.emptyObject,t.prototype.dependOnDependencyAssertions=!1,t.prototype.assertions=null,t.prototype.hermetic=!1,t.prototype.iceberg=null,t.prototype.metadata=null,t.prototype.reservation="",t.prototype.postgres=null,t.prototype.supabase=null,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.dataset&&Object.hasOwnProperty.call(e,"dataset")&&t.uint32(18).string(e.dataset),null!=e.project&&Object.hasOwnProperty.call(e,"project")&&t.uint32(26).string(e.project),null!=e.dependencyTargets&&e.dependencyTargets.length)for(var n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.ActionConfig.Target.encode(e.dependencyTargets[n],t.uint32(34).fork()).ldelim();if(null!=e.filename&&Object.hasOwnProperty.call(e,"filename")&&t.uint32(42).string(e.filename),null!=e.tags&&e.tags.length)for(n=0;n<e.tags.length;++n)t.uint32(50).string(e.tags[n]);if(null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(56).bool(e.disabled),null!=e.preOperations&&e.preOperations.length)for(n=0;n<e.preOperations.length;++n)t.uint32(66).string(e.preOperations[n]);if(null!=e.postOperations&&e.postOperations.length)for(n=0;n<e.postOperations.length;++n)t.uint32(74).string(e.postOperations[n]);if(null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(82).string(e.description),null!=e.columns&&e.columns.length)for(n=0;n<e.columns.length;++n)s.sqlanvil.ActionConfig.ColumnDescriptor.encode(e.columns[n],t.uint32(90).fork()).ldelim();if(null!=e.partitionBy&&Object.hasOwnProperty.call(e,"partitionBy")&&t.uint32(98).string(e.partitionBy),null!=e.partitionExpirationDays&&Object.hasOwnProperty.call(e,"partitionExpirationDays")&&t.uint32(104).int32(e.partitionExpirationDays),null!=e.requirePartitionFilter&&Object.hasOwnProperty.call(e,"requirePartitionFilter")&&t.uint32(112).bool(e.requirePartitionFilter),null!=e.clusterBy&&e.clusterBy.length)for(n=0;n<e.clusterBy.length;++n)t.uint32(122).string(e.clusterBy[n]);if(null!=e.labels&&Object.hasOwnProperty.call(e,"labels")){var r=Object.keys(e.labels);for(n=0;n<r.length;++n)t.uint32(130).fork().uint32(10).string(r[n]).uint32(18).string(e.labels[r[n]]).ldelim()}if(null!=e.additionalOptions&&Object.hasOwnProperty.call(e,"additionalOptions"))for(r=Object.keys(e.additionalOptions),n=0;n<r.length;++n)t.uint32(138).fork().uint32(10).string(r[n]).uint32(18).string(e.additionalOptions[r[n]]).ldelim();return null!=e.dependOnDependencyAssertions&&Object.hasOwnProperty.call(e,"dependOnDependencyAssertions")&&t.uint32(144).bool(e.dependOnDependencyAssertions),null!=e.assertions&&Object.hasOwnProperty.call(e,"assertions")&&s.sqlanvil.ActionConfig.TableAssertionsConfig.encode(e.assertions,t.uint32(154).fork()).ldelim(),null!=e.hermetic&&Object.hasOwnProperty.call(e,"hermetic")&&t.uint32(160).bool(e.hermetic),null!=e.iceberg&&Object.hasOwnProperty.call(e,"iceberg")&&s.sqlanvil.ActionConfig.IcebergTableConfig.encode(e.iceberg,t.uint32(178).fork()).ldelim(),null!=e.metadata&&Object.hasOwnProperty.call(e,"metadata")&&s.sqlanvil.ActionConfig.Metadata.encode(e.metadata,t.uint32(186).fork()).ldelim(),null!=e.reservation&&Object.hasOwnProperty.call(e,"reservation")&&t.uint32(194).string(e.reservation),null!=e.postgres&&Object.hasOwnProperty.call(e,"postgres")&&s.sqlanvil.PostgresOptions.encode(e.postgres,t.uint32(202).fork()).ldelim(),null!=e.supabase&&Object.hasOwnProperty.call(e,"supabase")&&s.sqlanvil.SupabaseOptions.encode(e.supabase,t.uint32(210).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r,o,l=void 0===t?e.len:e.pos+t,c=new s.sqlanvil.ActionConfig.TableConfig;e.pos<l;){var u=e.uint32();if(u===n)break;switch(u>>>3){case 1:c.name=e.string();break;case 2:c.dataset=e.string();break;case 3:c.project=e.string();break;case 4:c.dependencyTargets&&c.dependencyTargets.length||(c.dependencyTargets=[]),c.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32()));break;case 5:c.filename=e.string();break;case 6:c.tags&&c.tags.length||(c.tags=[]),c.tags.push(e.string());break;case 7:c.disabled=e.bool();break;case 8:c.preOperations&&c.preOperations.length||(c.preOperations=[]),c.preOperations.push(e.string());break;case 9:c.postOperations&&c.postOperations.length||(c.postOperations=[]),c.postOperations.push(e.string());break;case 10:c.description=e.string();break;case 11:c.columns&&c.columns.length||(c.columns=[]),c.columns.push(s.sqlanvil.ActionConfig.ColumnDescriptor.decode(e,e.uint32()));break;case 12:c.partitionBy=e.string();break;case 13:c.partitionExpirationDays=e.int32();break;case 14:c.requirePartitionFilter=e.bool();break;case 15:c.clusterBy&&c.clusterBy.length||(c.clusterBy=[]),c.clusterBy.push(e.string());break;case 16:c.labels===a.emptyObject&&(c.labels={});var p=e.uint32()+e.pos;for(r="",o="";e.pos<p;)switch((f=e.uint32())>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}c.labels[r]=o;break;case 17:for(c.additionalOptions===a.emptyObject&&(c.additionalOptions={}),p=e.uint32()+e.pos,r="",o="";e.pos<p;){var f;switch((f=e.uint32())>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}}c.additionalOptions[r]=o;break;case 18:c.dependOnDependencyAssertions=e.bool();break;case 19:c.assertions=s.sqlanvil.ActionConfig.TableAssertionsConfig.decode(e,e.uint32());break;case 20:c.hermetic=e.bool();break;case 22:c.iceberg=s.sqlanvil.ActionConfig.IcebergTableConfig.decode(e,e.uint32());break;case 23:c.metadata=s.sqlanvil.ActionConfig.Metadata.decode(e,e.uint32());break;case 24:c.reservation=e.string();break;case 25:c.postgres=s.sqlanvil.PostgresOptions.decode(e,e.uint32());break;case 26:c.supabase=s.sqlanvil.SupabaseOptions.decode(e,e.uint32());break;default:e.skipType(7&u)}}return c},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.dataset&&e.hasOwnProperty("dataset")&&!a.isString(e.dataset))return"dataset: string expected";if(null!=e.project&&e.hasOwnProperty("project")&&!a.isString(e.project))return"project: string expected";if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var t=0;t<e.dependencyTargets.length;++t)if(r=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[t]))return"dependencyTargets."+r}if(null!=e.filename&&e.hasOwnProperty("filename")&&!a.isString(e.filename))return"filename: string expected";if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!a.isString(e.tags[t]))return"tags: string[] expected"}if(null!=e.disabled&&e.hasOwnProperty("disabled")&&"boolean"!=typeof e.disabled)return"disabled: boolean expected";if(null!=e.preOperations&&e.hasOwnProperty("preOperations")){if(!Array.isArray(e.preOperations))return"preOperations: array expected";for(t=0;t<e.preOperations.length;++t)if(!a.isString(e.preOperations[t]))return"preOperations: string[] expected"}if(null!=e.postOperations&&e.hasOwnProperty("postOperations")){if(!Array.isArray(e.postOperations))return"postOperations: array expected";for(t=0;t<e.postOperations.length;++t)if(!a.isString(e.postOperations[t]))return"postOperations: string[] expected"}if(null!=e.description&&e.hasOwnProperty("description")&&!a.isString(e.description))return"description: string expected";if(null!=e.columns&&e.hasOwnProperty("columns")){if(!Array.isArray(e.columns))return"columns: array expected";for(t=0;t<e.columns.length;++t)if(r=s.sqlanvil.ActionConfig.ColumnDescriptor.verify(e.columns[t]))return"columns."+r}if(null!=e.partitionBy&&e.hasOwnProperty("partitionBy")&&!a.isString(e.partitionBy))return"partitionBy: string expected";if(null!=e.partitionExpirationDays&&e.hasOwnProperty("partitionExpirationDays")&&!a.isInteger(e.partitionExpirationDays))return"partitionExpirationDays: integer expected";if(null!=e.requirePartitionFilter&&e.hasOwnProperty("requirePartitionFilter")&&"boolean"!=typeof e.requirePartitionFilter)return"requirePartitionFilter: boolean expected";if(null!=e.clusterBy&&e.hasOwnProperty("clusterBy")){if(!Array.isArray(e.clusterBy))return"clusterBy: array expected";for(t=0;t<e.clusterBy.length;++t)if(!a.isString(e.clusterBy[t]))return"clusterBy: string[] expected"}if(null!=e.labels&&e.hasOwnProperty("labels")){if(!a.isObject(e.labels))return"labels: object expected";var n=Object.keys(e.labels);for(t=0;t<n.length;++t)if(!a.isString(e.labels[n[t]]))return"labels: string{k:string} expected"}if(null!=e.additionalOptions&&e.hasOwnProperty("additionalOptions")){if(!a.isObject(e.additionalOptions))return"additionalOptions: object expected";for(n=Object.keys(e.additionalOptions),t=0;t<n.length;++t)if(!a.isString(e.additionalOptions[n[t]]))return"additionalOptions: string{k:string} expected"}return null!=e.dependOnDependencyAssertions&&e.hasOwnProperty("dependOnDependencyAssertions")&&"boolean"!=typeof e.dependOnDependencyAssertions?"dependOnDependencyAssertions: boolean expected":null!=e.assertions&&e.hasOwnProperty("assertions")&&(r=s.sqlanvil.ActionConfig.TableAssertionsConfig.verify(e.assertions))?"assertions."+r:null!=e.hermetic&&e.hasOwnProperty("hermetic")&&"boolean"!=typeof e.hermetic?"hermetic: boolean expected":null!=e.iceberg&&e.hasOwnProperty("iceberg")&&(r=s.sqlanvil.ActionConfig.IcebergTableConfig.verify(e.iceberg))?"iceberg."+r:null!=e.metadata&&e.hasOwnProperty("metadata")&&(r=s.sqlanvil.ActionConfig.Metadata.verify(e.metadata))?"metadata."+r:null!=e.reservation&&e.hasOwnProperty("reservation")&&!a.isString(e.reservation)?"reservation: string expected":null!=e.postgres&&e.hasOwnProperty("postgres")&&(r=s.sqlanvil.PostgresOptions.verify(e.postgres))?"postgres."+r:null!=e.supabase&&e.hasOwnProperty("supabase")&&(r=s.sqlanvil.SupabaseOptions.verify(e.supabase))?"supabase."+r:null;var r},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.TableConfig)return e;var t=new s.sqlanvil.ActionConfig.TableConfig;if(null!=e.name&&(t.name=String(e.name)),null!=e.dataset&&(t.dataset=String(e.dataset)),null!=e.project&&(t.project=String(e.project)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.TableConfig.dependencyTargets: array expected");t.dependencyTargets=[];for(var n=0;n<e.dependencyTargets.length;++n){if("object"!=typeof e.dependencyTargets[n])throw TypeError(".sqlanvil.ActionConfig.TableConfig.dependencyTargets: object expected");t.dependencyTargets[n]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[n])}}if(null!=e.filename&&(t.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.TableConfig.tags: array expected");for(t.tags=[],n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}if(null!=e.disabled&&(t.disabled=Boolean(e.disabled)),e.preOperations){if(!Array.isArray(e.preOperations))throw TypeError(".sqlanvil.ActionConfig.TableConfig.preOperations: array expected");for(t.preOperations=[],n=0;n<e.preOperations.length;++n)t.preOperations[n]=String(e.preOperations[n])}if(e.postOperations){if(!Array.isArray(e.postOperations))throw TypeError(".sqlanvil.ActionConfig.TableConfig.postOperations: array expected");for(t.postOperations=[],n=0;n<e.postOperations.length;++n)t.postOperations[n]=String(e.postOperations[n])}if(null!=e.description&&(t.description=String(e.description)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.ActionConfig.TableConfig.columns: array expected");for(t.columns=[],n=0;n<e.columns.length;++n){if("object"!=typeof e.columns[n])throw TypeError(".sqlanvil.ActionConfig.TableConfig.columns: object expected");t.columns[n]=s.sqlanvil.ActionConfig.ColumnDescriptor.fromObject(e.columns[n])}}if(null!=e.partitionBy&&(t.partitionBy=String(e.partitionBy)),null!=e.partitionExpirationDays&&(t.partitionExpirationDays=0|e.partitionExpirationDays),null!=e.requirePartitionFilter&&(t.requirePartitionFilter=Boolean(e.requirePartitionFilter)),e.clusterBy){if(!Array.isArray(e.clusterBy))throw TypeError(".sqlanvil.ActionConfig.TableConfig.clusterBy: array expected");for(t.clusterBy=[],n=0;n<e.clusterBy.length;++n)t.clusterBy[n]=String(e.clusterBy[n])}if(e.labels){if("object"!=typeof e.labels)throw TypeError(".sqlanvil.ActionConfig.TableConfig.labels: object expected");t.labels={};var r=Object.keys(e.labels);for(n=0;n<r.length;++n)t.labels[r[n]]=String(e.labels[r[n]])}if(e.additionalOptions){if("object"!=typeof e.additionalOptions)throw TypeError(".sqlanvil.ActionConfig.TableConfig.additionalOptions: object expected");for(t.additionalOptions={},r=Object.keys(e.additionalOptions),n=0;n<r.length;++n)t.additionalOptions[r[n]]=String(e.additionalOptions[r[n]])}if(null!=e.dependOnDependencyAssertions&&(t.dependOnDependencyAssertions=Boolean(e.dependOnDependencyAssertions)),null!=e.assertions){if("object"!=typeof e.assertions)throw TypeError(".sqlanvil.ActionConfig.TableConfig.assertions: object expected");t.assertions=s.sqlanvil.ActionConfig.TableAssertionsConfig.fromObject(e.assertions)}if(null!=e.hermetic&&(t.hermetic=Boolean(e.hermetic)),null!=e.iceberg){if("object"!=typeof e.iceberg)throw TypeError(".sqlanvil.ActionConfig.TableConfig.iceberg: object expected");t.iceberg=s.sqlanvil.ActionConfig.IcebergTableConfig.fromObject(e.iceberg)}if(null!=e.metadata){if("object"!=typeof e.metadata)throw TypeError(".sqlanvil.ActionConfig.TableConfig.metadata: object expected");t.metadata=s.sqlanvil.ActionConfig.Metadata.fromObject(e.metadata)}if(null!=e.reservation&&(t.reservation=String(e.reservation)),null!=e.postgres){if("object"!=typeof e.postgres)throw TypeError(".sqlanvil.ActionConfig.TableConfig.postgres: object expected");t.postgres=s.sqlanvil.PostgresOptions.fromObject(e.postgres)}if(null!=e.supabase){if("object"!=typeof e.supabase)throw TypeError(".sqlanvil.ActionConfig.TableConfig.supabase: object expected");t.supabase=s.sqlanvil.SupabaseOptions.fromObject(e.supabase)}return t},t.toObject=function(e,t){t||(t={});var n,r={};if((t.arrays||t.defaults)&&(r.dependencyTargets=[],r.tags=[],r.preOperations=[],r.postOperations=[],r.columns=[],r.clusterBy=[]),(t.objects||t.defaults)&&(r.labels={},r.additionalOptions={}),t.defaults&&(r.name="",r.dataset="",r.project="",r.filename="",r.disabled=!1,r.description="",r.partitionBy="",r.partitionExpirationDays=0,r.requirePartitionFilter=!1,r.dependOnDependencyAssertions=!1,r.assertions=null,r.hermetic=!1,r.iceberg=null,r.metadata=null,r.reservation="",r.postgres=null,r.supabase=null),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),null!=e.dataset&&e.hasOwnProperty("dataset")&&(r.dataset=e.dataset),null!=e.project&&e.hasOwnProperty("project")&&(r.project=e.project),e.dependencyTargets&&e.dependencyTargets.length){r.dependencyTargets=[];for(var i=0;i<e.dependencyTargets.length;++i)r.dependencyTargets[i]=s.sqlanvil.ActionConfig.Target.toObject(e.dependencyTargets[i],t)}if(null!=e.filename&&e.hasOwnProperty("filename")&&(r.filename=e.filename),e.tags&&e.tags.length)for(r.tags=[],i=0;i<e.tags.length;++i)r.tags[i]=e.tags[i];if(null!=e.disabled&&e.hasOwnProperty("disabled")&&(r.disabled=e.disabled),e.preOperations&&e.preOperations.length)for(r.preOperations=[],i=0;i<e.preOperations.length;++i)r.preOperations[i]=e.preOperations[i];if(e.postOperations&&e.postOperations.length)for(r.postOperations=[],i=0;i<e.postOperations.length;++i)r.postOperations[i]=e.postOperations[i];if(null!=e.description&&e.hasOwnProperty("description")&&(r.description=e.description),e.columns&&e.columns.length)for(r.columns=[],i=0;i<e.columns.length;++i)r.columns[i]=s.sqlanvil.ActionConfig.ColumnDescriptor.toObject(e.columns[i],t);if(null!=e.partitionBy&&e.hasOwnProperty("partitionBy")&&(r.partitionBy=e.partitionBy),null!=e.partitionExpirationDays&&e.hasOwnProperty("partitionExpirationDays")&&(r.partitionExpirationDays=e.partitionExpirationDays),null!=e.requirePartitionFilter&&e.hasOwnProperty("requirePartitionFilter")&&(r.requirePartitionFilter=e.requirePartitionFilter),e.clusterBy&&e.clusterBy.length)for(r.clusterBy=[],i=0;i<e.clusterBy.length;++i)r.clusterBy[i]=e.clusterBy[i];if(e.labels&&(n=Object.keys(e.labels)).length)for(r.labels={},i=0;i<n.length;++i)r.labels[n[i]]=e.labels[n[i]];if(e.additionalOptions&&(n=Object.keys(e.additionalOptions)).length)for(r.additionalOptions={},i=0;i<n.length;++i)r.additionalOptions[n[i]]=e.additionalOptions[n[i]];return null!=e.dependOnDependencyAssertions&&e.hasOwnProperty("dependOnDependencyAssertions")&&(r.dependOnDependencyAssertions=e.dependOnDependencyAssertions),null!=e.assertions&&e.hasOwnProperty("assertions")&&(r.assertions=s.sqlanvil.ActionConfig.TableAssertionsConfig.toObject(e.assertions,t)),null!=e.hermetic&&e.hasOwnProperty("hermetic")&&(r.hermetic=e.hermetic),null!=e.iceberg&&e.hasOwnProperty("iceberg")&&(r.iceberg=s.sqlanvil.ActionConfig.IcebergTableConfig.toObject(e.iceberg,t)),null!=e.metadata&&e.hasOwnProperty("metadata")&&(r.metadata=s.sqlanvil.ActionConfig.Metadata.toObject(e.metadata,t)),null!=e.reservation&&e.hasOwnProperty("reservation")&&(r.reservation=e.reservation),null!=e.postgres&&e.hasOwnProperty("postgres")&&(r.postgres=s.sqlanvil.PostgresOptions.toObject(e.postgres,t)),null!=e.supabase&&e.hasOwnProperty("supabase")&&(r.supabase=s.sqlanvil.SupabaseOptions.toObject(e.supabase,t)),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.TableConfig"},t}(),t.Metadata=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.overview="",t.prototype.extraProperties=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.overview&&Object.hasOwnProperty.call(e,"overview")&&t.uint32(10).string(e.overview),null!=e.extraProperties&&Object.hasOwnProperty.call(e,"extraProperties")&&s.google.protobuf.Struct.encode(e.extraProperties,t.uint32(18).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionConfig.Metadata;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.overview=e.string();break;case 2:o.extraProperties=s.google.protobuf.Struct.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.overview&&e.hasOwnProperty("overview")&&!a.isString(e.overview))return"overview: string expected";if(null!=e.extraProperties&&e.hasOwnProperty("extraProperties")){var t=s.google.protobuf.Struct.verify(e.extraProperties);if(t)return"extraProperties."+t}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.Metadata)return e;var t=new s.sqlanvil.ActionConfig.Metadata;if(null!=e.overview&&(t.overview=String(e.overview)),null!=e.extraProperties){if("object"!=typeof e.extraProperties)throw TypeError(".sqlanvil.ActionConfig.Metadata.extraProperties: object expected");t.extraProperties=s.google.protobuf.Struct.fromObject(e.extraProperties)}return t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.overview="",n.extraProperties=null),null!=e.overview&&e.hasOwnProperty("overview")&&(n.overview=e.overview),null!=e.extraProperties&&e.hasOwnProperty("extraProperties")&&(n.extraProperties=s.google.protobuf.Struct.toObject(e.extraProperties,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.Metadata"},t}(),t.ViewConfig=function(){function t(e){if(this.dependencyTargets=[],this.tags=[],this.preOperations=[],this.postOperations=[],this.clusterBy=[],this.columns=[],this.labels={},this.additionalOptions={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.dataset="",t.prototype.project="",t.prototype.dependencyTargets=a.emptyArray,t.prototype.filename="",t.prototype.tags=a.emptyArray,t.prototype.disabled=!1,t.prototype.preOperations=a.emptyArray,t.prototype.postOperations=a.emptyArray,t.prototype.materialized=!1,t.prototype.partitionBy="",t.prototype.clusterBy=a.emptyArray,t.prototype.description="",t.prototype.columns=a.emptyArray,t.prototype.labels=a.emptyObject,t.prototype.additionalOptions=a.emptyObject,t.prototype.dependOnDependencyAssertions=!1,t.prototype.hermetic=!1,t.prototype.assertions=null,t.prototype.metadata=null,t.prototype.reservation="",t.prototype.postgres=null,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.dataset&&Object.hasOwnProperty.call(e,"dataset")&&t.uint32(18).string(e.dataset),null!=e.project&&Object.hasOwnProperty.call(e,"project")&&t.uint32(26).string(e.project),null!=e.dependencyTargets&&e.dependencyTargets.length)for(var n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.ActionConfig.Target.encode(e.dependencyTargets[n],t.uint32(34).fork()).ldelim();if(null!=e.filename&&Object.hasOwnProperty.call(e,"filename")&&t.uint32(42).string(e.filename),null!=e.tags&&e.tags.length)for(n=0;n<e.tags.length;++n)t.uint32(50).string(e.tags[n]);if(null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(56).bool(e.disabled),null!=e.preOperations&&e.preOperations.length)for(n=0;n<e.preOperations.length;++n)t.uint32(66).string(e.preOperations[n]);if(null!=e.postOperations&&e.postOperations.length)for(n=0;n<e.postOperations.length;++n)t.uint32(74).string(e.postOperations[n]);if(null!=e.materialized&&Object.hasOwnProperty.call(e,"materialized")&&t.uint32(80).bool(e.materialized),null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(90).string(e.description),null!=e.columns&&e.columns.length)for(n=0;n<e.columns.length;++n)s.sqlanvil.ActionConfig.ColumnDescriptor.encode(e.columns[n],t.uint32(98).fork()).ldelim();if(null!=e.labels&&Object.hasOwnProperty.call(e,"labels")){var r=Object.keys(e.labels);for(n=0;n<r.length;++n)t.uint32(106).fork().uint32(10).string(r[n]).uint32(18).string(e.labels[r[n]]).ldelim()}if(null!=e.additionalOptions&&Object.hasOwnProperty.call(e,"additionalOptions"))for(r=Object.keys(e.additionalOptions),n=0;n<r.length;++n)t.uint32(114).fork().uint32(10).string(r[n]).uint32(18).string(e.additionalOptions[r[n]]).ldelim();if(null!=e.dependOnDependencyAssertions&&Object.hasOwnProperty.call(e,"dependOnDependencyAssertions")&&t.uint32(120).bool(e.dependOnDependencyAssertions),null!=e.hermetic&&Object.hasOwnProperty.call(e,"hermetic")&&t.uint32(128).bool(e.hermetic),null!=e.assertions&&Object.hasOwnProperty.call(e,"assertions")&&s.sqlanvil.ActionConfig.TableAssertionsConfig.encode(e.assertions,t.uint32(138).fork()).ldelim(),null!=e.partitionBy&&Object.hasOwnProperty.call(e,"partitionBy")&&t.uint32(146).string(e.partitionBy),null!=e.clusterBy&&e.clusterBy.length)for(n=0;n<e.clusterBy.length;++n)t.uint32(154).string(e.clusterBy[n]);return null!=e.metadata&&Object.hasOwnProperty.call(e,"metadata")&&s.sqlanvil.ActionConfig.Metadata.encode(e.metadata,t.uint32(162).fork()).ldelim(),null!=e.reservation&&Object.hasOwnProperty.call(e,"reservation")&&t.uint32(170).string(e.reservation),null!=e.postgres&&Object.hasOwnProperty.call(e,"postgres")&&s.sqlanvil.PostgresOptions.encode(e.postgres,t.uint32(178).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r,o,l=void 0===t?e.len:e.pos+t,c=new s.sqlanvil.ActionConfig.ViewConfig;e.pos<l;){var u=e.uint32();if(u===n)break;switch(u>>>3){case 1:c.name=e.string();break;case 2:c.dataset=e.string();break;case 3:c.project=e.string();break;case 4:c.dependencyTargets&&c.dependencyTargets.length||(c.dependencyTargets=[]),c.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32()));break;case 5:c.filename=e.string();break;case 6:c.tags&&c.tags.length||(c.tags=[]),c.tags.push(e.string());break;case 7:c.disabled=e.bool();break;case 8:c.preOperations&&c.preOperations.length||(c.preOperations=[]),c.preOperations.push(e.string());break;case 9:c.postOperations&&c.postOperations.length||(c.postOperations=[]),c.postOperations.push(e.string());break;case 10:c.materialized=e.bool();break;case 18:c.partitionBy=e.string();break;case 19:c.clusterBy&&c.clusterBy.length||(c.clusterBy=[]),c.clusterBy.push(e.string());break;case 11:c.description=e.string();break;case 12:c.columns&&c.columns.length||(c.columns=[]),c.columns.push(s.sqlanvil.ActionConfig.ColumnDescriptor.decode(e,e.uint32()));break;case 13:c.labels===a.emptyObject&&(c.labels={});var p=e.uint32()+e.pos;for(r="",o="";e.pos<p;)switch((f=e.uint32())>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}c.labels[r]=o;break;case 14:for(c.additionalOptions===a.emptyObject&&(c.additionalOptions={}),p=e.uint32()+e.pos,r="",o="";e.pos<p;){var f;switch((f=e.uint32())>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}}c.additionalOptions[r]=o;break;case 15:c.dependOnDependencyAssertions=e.bool();break;case 16:c.hermetic=e.bool();break;case 17:c.assertions=s.sqlanvil.ActionConfig.TableAssertionsConfig.decode(e,e.uint32());break;case 20:c.metadata=s.sqlanvil.ActionConfig.Metadata.decode(e,e.uint32());break;case 21:c.reservation=e.string();break;case 22:c.postgres=s.sqlanvil.PostgresOptions.decode(e,e.uint32());break;default:e.skipType(7&u)}}return c},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.dataset&&e.hasOwnProperty("dataset")&&!a.isString(e.dataset))return"dataset: string expected";if(null!=e.project&&e.hasOwnProperty("project")&&!a.isString(e.project))return"project: string expected";if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var t=0;t<e.dependencyTargets.length;++t)if(r=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[t]))return"dependencyTargets."+r}if(null!=e.filename&&e.hasOwnProperty("filename")&&!a.isString(e.filename))return"filename: string expected";if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!a.isString(e.tags[t]))return"tags: string[] expected"}if(null!=e.disabled&&e.hasOwnProperty("disabled")&&"boolean"!=typeof e.disabled)return"disabled: boolean expected";if(null!=e.preOperations&&e.hasOwnProperty("preOperations")){if(!Array.isArray(e.preOperations))return"preOperations: array expected";for(t=0;t<e.preOperations.length;++t)if(!a.isString(e.preOperations[t]))return"preOperations: string[] expected"}if(null!=e.postOperations&&e.hasOwnProperty("postOperations")){if(!Array.isArray(e.postOperations))return"postOperations: array expected";for(t=0;t<e.postOperations.length;++t)if(!a.isString(e.postOperations[t]))return"postOperations: string[] expected"}if(null!=e.materialized&&e.hasOwnProperty("materialized")&&"boolean"!=typeof e.materialized)return"materialized: boolean expected";if(null!=e.partitionBy&&e.hasOwnProperty("partitionBy")&&!a.isString(e.partitionBy))return"partitionBy: string expected";if(null!=e.clusterBy&&e.hasOwnProperty("clusterBy")){if(!Array.isArray(e.clusterBy))return"clusterBy: array expected";for(t=0;t<e.clusterBy.length;++t)if(!a.isString(e.clusterBy[t]))return"clusterBy: string[] expected"}if(null!=e.description&&e.hasOwnProperty("description")&&!a.isString(e.description))return"description: string expected";if(null!=e.columns&&e.hasOwnProperty("columns")){if(!Array.isArray(e.columns))return"columns: array expected";for(t=0;t<e.columns.length;++t)if(r=s.sqlanvil.ActionConfig.ColumnDescriptor.verify(e.columns[t]))return"columns."+r}if(null!=e.labels&&e.hasOwnProperty("labels")){if(!a.isObject(e.labels))return"labels: object expected";var n=Object.keys(e.labels);for(t=0;t<n.length;++t)if(!a.isString(e.labels[n[t]]))return"labels: string{k:string} expected"}if(null!=e.additionalOptions&&e.hasOwnProperty("additionalOptions")){if(!a.isObject(e.additionalOptions))return"additionalOptions: object expected";for(n=Object.keys(e.additionalOptions),t=0;t<n.length;++t)if(!a.isString(e.additionalOptions[n[t]]))return"additionalOptions: string{k:string} expected"}return null!=e.dependOnDependencyAssertions&&e.hasOwnProperty("dependOnDependencyAssertions")&&"boolean"!=typeof e.dependOnDependencyAssertions?"dependOnDependencyAssertions: boolean expected":null!=e.hermetic&&e.hasOwnProperty("hermetic")&&"boolean"!=typeof e.hermetic?"hermetic: boolean expected":null!=e.assertions&&e.hasOwnProperty("assertions")&&(r=s.sqlanvil.ActionConfig.TableAssertionsConfig.verify(e.assertions))?"assertions."+r:null!=e.metadata&&e.hasOwnProperty("metadata")&&(r=s.sqlanvil.ActionConfig.Metadata.verify(e.metadata))?"metadata."+r:null!=e.reservation&&e.hasOwnProperty("reservation")&&!a.isString(e.reservation)?"reservation: string expected":null!=e.postgres&&e.hasOwnProperty("postgres")&&(r=s.sqlanvil.PostgresOptions.verify(e.postgres))?"postgres."+r:null;var r},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.ViewConfig)return e;var t=new s.sqlanvil.ActionConfig.ViewConfig;if(null!=e.name&&(t.name=String(e.name)),null!=e.dataset&&(t.dataset=String(e.dataset)),null!=e.project&&(t.project=String(e.project)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.ViewConfig.dependencyTargets: array expected");t.dependencyTargets=[];for(var n=0;n<e.dependencyTargets.length;++n){if("object"!=typeof e.dependencyTargets[n])throw TypeError(".sqlanvil.ActionConfig.ViewConfig.dependencyTargets: object expected");t.dependencyTargets[n]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[n])}}if(null!=e.filename&&(t.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.ViewConfig.tags: array expected");for(t.tags=[],n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}if(null!=e.disabled&&(t.disabled=Boolean(e.disabled)),e.preOperations){if(!Array.isArray(e.preOperations))throw TypeError(".sqlanvil.ActionConfig.ViewConfig.preOperations: array expected");for(t.preOperations=[],n=0;n<e.preOperations.length;++n)t.preOperations[n]=String(e.preOperations[n])}if(e.postOperations){if(!Array.isArray(e.postOperations))throw TypeError(".sqlanvil.ActionConfig.ViewConfig.postOperations: array expected");for(t.postOperations=[],n=0;n<e.postOperations.length;++n)t.postOperations[n]=String(e.postOperations[n])}if(null!=e.materialized&&(t.materialized=Boolean(e.materialized)),null!=e.partitionBy&&(t.partitionBy=String(e.partitionBy)),e.clusterBy){if(!Array.isArray(e.clusterBy))throw TypeError(".sqlanvil.ActionConfig.ViewConfig.clusterBy: array expected");for(t.clusterBy=[],n=0;n<e.clusterBy.length;++n)t.clusterBy[n]=String(e.clusterBy[n])}if(null!=e.description&&(t.description=String(e.description)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.ActionConfig.ViewConfig.columns: array expected");for(t.columns=[],n=0;n<e.columns.length;++n){if("object"!=typeof e.columns[n])throw TypeError(".sqlanvil.ActionConfig.ViewConfig.columns: object expected");t.columns[n]=s.sqlanvil.ActionConfig.ColumnDescriptor.fromObject(e.columns[n])}}if(e.labels){if("object"!=typeof e.labels)throw TypeError(".sqlanvil.ActionConfig.ViewConfig.labels: object expected");t.labels={};var r=Object.keys(e.labels);for(n=0;n<r.length;++n)t.labels[r[n]]=String(e.labels[r[n]])}if(e.additionalOptions){if("object"!=typeof e.additionalOptions)throw TypeError(".sqlanvil.ActionConfig.ViewConfig.additionalOptions: object expected");for(t.additionalOptions={},r=Object.keys(e.additionalOptions),n=0;n<r.length;++n)t.additionalOptions[r[n]]=String(e.additionalOptions[r[n]])}if(null!=e.dependOnDependencyAssertions&&(t.dependOnDependencyAssertions=Boolean(e.dependOnDependencyAssertions)),null!=e.hermetic&&(t.hermetic=Boolean(e.hermetic)),null!=e.assertions){if("object"!=typeof e.assertions)throw TypeError(".sqlanvil.ActionConfig.ViewConfig.assertions: object expected");t.assertions=s.sqlanvil.ActionConfig.TableAssertionsConfig.fromObject(e.assertions)}if(null!=e.metadata){if("object"!=typeof e.metadata)throw TypeError(".sqlanvil.ActionConfig.ViewConfig.metadata: object expected");t.metadata=s.sqlanvil.ActionConfig.Metadata.fromObject(e.metadata)}if(null!=e.reservation&&(t.reservation=String(e.reservation)),null!=e.postgres){if("object"!=typeof e.postgres)throw TypeError(".sqlanvil.ActionConfig.ViewConfig.postgres: object expected");t.postgres=s.sqlanvil.PostgresOptions.fromObject(e.postgres)}return t},t.toObject=function(e,t){t||(t={});var n,r={};if((t.arrays||t.defaults)&&(r.dependencyTargets=[],r.tags=[],r.preOperations=[],r.postOperations=[],r.columns=[],r.clusterBy=[]),(t.objects||t.defaults)&&(r.labels={},r.additionalOptions={}),t.defaults&&(r.name="",r.dataset="",r.project="",r.filename="",r.disabled=!1,r.materialized=!1,r.description="",r.dependOnDependencyAssertions=!1,r.hermetic=!1,r.assertions=null,r.partitionBy="",r.metadata=null,r.reservation="",r.postgres=null),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),null!=e.dataset&&e.hasOwnProperty("dataset")&&(r.dataset=e.dataset),null!=e.project&&e.hasOwnProperty("project")&&(r.project=e.project),e.dependencyTargets&&e.dependencyTargets.length){r.dependencyTargets=[];for(var i=0;i<e.dependencyTargets.length;++i)r.dependencyTargets[i]=s.sqlanvil.ActionConfig.Target.toObject(e.dependencyTargets[i],t)}if(null!=e.filename&&e.hasOwnProperty("filename")&&(r.filename=e.filename),e.tags&&e.tags.length)for(r.tags=[],i=0;i<e.tags.length;++i)r.tags[i]=e.tags[i];if(null!=e.disabled&&e.hasOwnProperty("disabled")&&(r.disabled=e.disabled),e.preOperations&&e.preOperations.length)for(r.preOperations=[],i=0;i<e.preOperations.length;++i)r.preOperations[i]=e.preOperations[i];if(e.postOperations&&e.postOperations.length)for(r.postOperations=[],i=0;i<e.postOperations.length;++i)r.postOperations[i]=e.postOperations[i];if(null!=e.materialized&&e.hasOwnProperty("materialized")&&(r.materialized=e.materialized),null!=e.description&&e.hasOwnProperty("description")&&(r.description=e.description),e.columns&&e.columns.length)for(r.columns=[],i=0;i<e.columns.length;++i)r.columns[i]=s.sqlanvil.ActionConfig.ColumnDescriptor.toObject(e.columns[i],t);if(e.labels&&(n=Object.keys(e.labels)).length)for(r.labels={},i=0;i<n.length;++i)r.labels[n[i]]=e.labels[n[i]];if(e.additionalOptions&&(n=Object.keys(e.additionalOptions)).length)for(r.additionalOptions={},i=0;i<n.length;++i)r.additionalOptions[n[i]]=e.additionalOptions[n[i]];if(null!=e.dependOnDependencyAssertions&&e.hasOwnProperty("dependOnDependencyAssertions")&&(r.dependOnDependencyAssertions=e.dependOnDependencyAssertions),null!=e.hermetic&&e.hasOwnProperty("hermetic")&&(r.hermetic=e.hermetic),null!=e.assertions&&e.hasOwnProperty("assertions")&&(r.assertions=s.sqlanvil.ActionConfig.TableAssertionsConfig.toObject(e.assertions,t)),null!=e.partitionBy&&e.hasOwnProperty("partitionBy")&&(r.partitionBy=e.partitionBy),e.clusterBy&&e.clusterBy.length)for(r.clusterBy=[],i=0;i<e.clusterBy.length;++i)r.clusterBy[i]=e.clusterBy[i];return null!=e.metadata&&e.hasOwnProperty("metadata")&&(r.metadata=s.sqlanvil.ActionConfig.Metadata.toObject(e.metadata,t)),null!=e.reservation&&e.hasOwnProperty("reservation")&&(r.reservation=e.reservation),null!=e.postgres&&e.hasOwnProperty("postgres")&&(r.postgres=s.sqlanvil.PostgresOptions.toObject(e.postgres,t)),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.ViewConfig"},t}(),t.OnSchemaChange=(r={},(l=Object.create(r))[r[0]="IGNORE"]=0,l[r[1]="FAIL"]=1,l[r[2]="EXTEND"]=2,l[r[3]="SYNCHRONIZE"]=3,l),t.IncrementalTableConfig=function(){function t(e){if(this.dependencyTargets=[],this.tags=[],this.preOperations=[],this.postOperations=[],this.uniqueKey=[],this.columns=[],this.clusterBy=[],this.labels={},this.additionalOptions={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.dataset="",t.prototype.project="",t.prototype.dependencyTargets=a.emptyArray,t.prototype.filename="",t.prototype.tags=a.emptyArray,t.prototype.disabled=!1,t.prototype.preOperations=a.emptyArray,t.prototype.postOperations=a.emptyArray,t.prototype.protected=!1,t.prototype.uniqueKey=a.emptyArray,t.prototype.description="",t.prototype.columns=a.emptyArray,t.prototype.partitionBy="",t.prototype.partitionExpirationDays=0,t.prototype.requirePartitionFilter=!1,t.prototype.updatePartitionFilter="",t.prototype.clusterBy=a.emptyArray,t.prototype.labels=a.emptyObject,t.prototype.additionalOptions=a.emptyObject,t.prototype.dependOnDependencyAssertions=!1,t.prototype.assertions=null,t.prototype.hermetic=!1,t.prototype.onSchemaChange=0,t.prototype.iceberg=null,t.prototype.metadata=null,t.prototype.reservation="",t.prototype.postgres=null,t.prototype.supabase=null,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.dataset&&Object.hasOwnProperty.call(e,"dataset")&&t.uint32(18).string(e.dataset),null!=e.project&&Object.hasOwnProperty.call(e,"project")&&t.uint32(26).string(e.project),null!=e.dependencyTargets&&e.dependencyTargets.length)for(var n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.ActionConfig.Target.encode(e.dependencyTargets[n],t.uint32(34).fork()).ldelim();if(null!=e.filename&&Object.hasOwnProperty.call(e,"filename")&&t.uint32(42).string(e.filename),null!=e.tags&&e.tags.length)for(n=0;n<e.tags.length;++n)t.uint32(50).string(e.tags[n]);if(null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(56).bool(e.disabled),null!=e.preOperations&&e.preOperations.length)for(n=0;n<e.preOperations.length;++n)t.uint32(66).string(e.preOperations[n]);if(null!=e.postOperations&&e.postOperations.length)for(n=0;n<e.postOperations.length;++n)t.uint32(74).string(e.postOperations[n]);if(null!=e.protected&&Object.hasOwnProperty.call(e,"protected")&&t.uint32(80).bool(e.protected),null!=e.uniqueKey&&e.uniqueKey.length)for(n=0;n<e.uniqueKey.length;++n)t.uint32(90).string(e.uniqueKey[n]);if(null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(98).string(e.description),null!=e.columns&&e.columns.length)for(n=0;n<e.columns.length;++n)s.sqlanvil.ActionConfig.ColumnDescriptor.encode(e.columns[n],t.uint32(106).fork()).ldelim();if(null!=e.partitionBy&&Object.hasOwnProperty.call(e,"partitionBy")&&t.uint32(114).string(e.partitionBy),null!=e.partitionExpirationDays&&Object.hasOwnProperty.call(e,"partitionExpirationDays")&&t.uint32(120).int32(e.partitionExpirationDays),null!=e.requirePartitionFilter&&Object.hasOwnProperty.call(e,"requirePartitionFilter")&&t.uint32(128).bool(e.requirePartitionFilter),null!=e.updatePartitionFilter&&Object.hasOwnProperty.call(e,"updatePartitionFilter")&&t.uint32(138).string(e.updatePartitionFilter),null!=e.clusterBy&&e.clusterBy.length)for(n=0;n<e.clusterBy.length;++n)t.uint32(146).string(e.clusterBy[n]);if(null!=e.labels&&Object.hasOwnProperty.call(e,"labels")){var r=Object.keys(e.labels);for(n=0;n<r.length;++n)t.uint32(154).fork().uint32(10).string(r[n]).uint32(18).string(e.labels[r[n]]).ldelim()}if(null!=e.additionalOptions&&Object.hasOwnProperty.call(e,"additionalOptions"))for(r=Object.keys(e.additionalOptions),n=0;n<r.length;++n)t.uint32(162).fork().uint32(10).string(r[n]).uint32(18).string(e.additionalOptions[r[n]]).ldelim();return null!=e.dependOnDependencyAssertions&&Object.hasOwnProperty.call(e,"dependOnDependencyAssertions")&&t.uint32(168).bool(e.dependOnDependencyAssertions),null!=e.assertions&&Object.hasOwnProperty.call(e,"assertions")&&s.sqlanvil.ActionConfig.TableAssertionsConfig.encode(e.assertions,t.uint32(178).fork()).ldelim(),null!=e.hermetic&&Object.hasOwnProperty.call(e,"hermetic")&&t.uint32(184).bool(e.hermetic),null!=e.onSchemaChange&&Object.hasOwnProperty.call(e,"onSchemaChange")&&t.uint32(192).int32(e.onSchemaChange),null!=e.iceberg&&Object.hasOwnProperty.call(e,"iceberg")&&s.sqlanvil.ActionConfig.IcebergTableConfig.encode(e.iceberg,t.uint32(202).fork()).ldelim(),null!=e.metadata&&Object.hasOwnProperty.call(e,"metadata")&&s.sqlanvil.ActionConfig.Metadata.encode(e.metadata,t.uint32(210).fork()).ldelim(),null!=e.reservation&&Object.hasOwnProperty.call(e,"reservation")&&t.uint32(218).string(e.reservation),null!=e.postgres&&Object.hasOwnProperty.call(e,"postgres")&&s.sqlanvil.PostgresOptions.encode(e.postgres,t.uint32(226).fork()).ldelim(),null!=e.supabase&&Object.hasOwnProperty.call(e,"supabase")&&s.sqlanvil.SupabaseOptions.encode(e.supabase,t.uint32(234).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r,o,l=void 0===t?e.len:e.pos+t,c=new s.sqlanvil.ActionConfig.IncrementalTableConfig;e.pos<l;){var u=e.uint32();if(u===n)break;switch(u>>>3){case 1:c.name=e.string();break;case 2:c.dataset=e.string();break;case 3:c.project=e.string();break;case 4:c.dependencyTargets&&c.dependencyTargets.length||(c.dependencyTargets=[]),c.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32()));break;case 5:c.filename=e.string();break;case 6:c.tags&&c.tags.length||(c.tags=[]),c.tags.push(e.string());break;case 7:c.disabled=e.bool();break;case 8:c.preOperations&&c.preOperations.length||(c.preOperations=[]),c.preOperations.push(e.string());break;case 9:c.postOperations&&c.postOperations.length||(c.postOperations=[]),c.postOperations.push(e.string());break;case 10:c.protected=e.bool();break;case 11:c.uniqueKey&&c.uniqueKey.length||(c.uniqueKey=[]),c.uniqueKey.push(e.string());break;case 12:c.description=e.string();break;case 13:c.columns&&c.columns.length||(c.columns=[]),c.columns.push(s.sqlanvil.ActionConfig.ColumnDescriptor.decode(e,e.uint32()));break;case 14:c.partitionBy=e.string();break;case 15:c.partitionExpirationDays=e.int32();break;case 16:c.requirePartitionFilter=e.bool();break;case 17:c.updatePartitionFilter=e.string();break;case 18:c.clusterBy&&c.clusterBy.length||(c.clusterBy=[]),c.clusterBy.push(e.string());break;case 19:c.labels===a.emptyObject&&(c.labels={});var p=e.uint32()+e.pos;for(r="",o="";e.pos<p;)switch((f=e.uint32())>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}c.labels[r]=o;break;case 20:for(c.additionalOptions===a.emptyObject&&(c.additionalOptions={}),p=e.uint32()+e.pos,r="",o="";e.pos<p;){var f;switch((f=e.uint32())>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}}c.additionalOptions[r]=o;break;case 21:c.dependOnDependencyAssertions=e.bool();break;case 22:c.assertions=s.sqlanvil.ActionConfig.TableAssertionsConfig.decode(e,e.uint32());break;case 23:c.hermetic=e.bool();break;case 24:c.onSchemaChange=e.int32();break;case 25:c.iceberg=s.sqlanvil.ActionConfig.IcebergTableConfig.decode(e,e.uint32());break;case 26:c.metadata=s.sqlanvil.ActionConfig.Metadata.decode(e,e.uint32());break;case 27:c.reservation=e.string();break;case 28:c.postgres=s.sqlanvil.PostgresOptions.decode(e,e.uint32());break;case 29:c.supabase=s.sqlanvil.SupabaseOptions.decode(e,e.uint32());break;default:e.skipType(7&u)}}return c},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.dataset&&e.hasOwnProperty("dataset")&&!a.isString(e.dataset))return"dataset: string expected";if(null!=e.project&&e.hasOwnProperty("project")&&!a.isString(e.project))return"project: string expected";if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var t=0;t<e.dependencyTargets.length;++t)if(r=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[t]))return"dependencyTargets."+r}if(null!=e.filename&&e.hasOwnProperty("filename")&&!a.isString(e.filename))return"filename: string expected";if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!a.isString(e.tags[t]))return"tags: string[] expected"}if(null!=e.disabled&&e.hasOwnProperty("disabled")&&"boolean"!=typeof e.disabled)return"disabled: boolean expected";if(null!=e.preOperations&&e.hasOwnProperty("preOperations")){if(!Array.isArray(e.preOperations))return"preOperations: array expected";for(t=0;t<e.preOperations.length;++t)if(!a.isString(e.preOperations[t]))return"preOperations: string[] expected"}if(null!=e.postOperations&&e.hasOwnProperty("postOperations")){if(!Array.isArray(e.postOperations))return"postOperations: array expected";for(t=0;t<e.postOperations.length;++t)if(!a.isString(e.postOperations[t]))return"postOperations: string[] expected"}if(null!=e.protected&&e.hasOwnProperty("protected")&&"boolean"!=typeof e.protected)return"protected: boolean expected";if(null!=e.uniqueKey&&e.hasOwnProperty("uniqueKey")){if(!Array.isArray(e.uniqueKey))return"uniqueKey: array expected";for(t=0;t<e.uniqueKey.length;++t)if(!a.isString(e.uniqueKey[t]))return"uniqueKey: string[] expected"}if(null!=e.description&&e.hasOwnProperty("description")&&!a.isString(e.description))return"description: string expected";if(null!=e.columns&&e.hasOwnProperty("columns")){if(!Array.isArray(e.columns))return"columns: array expected";for(t=0;t<e.columns.length;++t)if(r=s.sqlanvil.ActionConfig.ColumnDescriptor.verify(e.columns[t]))return"columns."+r}if(null!=e.partitionBy&&e.hasOwnProperty("partitionBy")&&!a.isString(e.partitionBy))return"partitionBy: string expected";if(null!=e.partitionExpirationDays&&e.hasOwnProperty("partitionExpirationDays")&&!a.isInteger(e.partitionExpirationDays))return"partitionExpirationDays: integer expected";if(null!=e.requirePartitionFilter&&e.hasOwnProperty("requirePartitionFilter")&&"boolean"!=typeof e.requirePartitionFilter)return"requirePartitionFilter: boolean expected";if(null!=e.updatePartitionFilter&&e.hasOwnProperty("updatePartitionFilter")&&!a.isString(e.updatePartitionFilter))return"updatePartitionFilter: string expected";if(null!=e.clusterBy&&e.hasOwnProperty("clusterBy")){if(!Array.isArray(e.clusterBy))return"clusterBy: array expected";for(t=0;t<e.clusterBy.length;++t)if(!a.isString(e.clusterBy[t]))return"clusterBy: string[] expected"}if(null!=e.labels&&e.hasOwnProperty("labels")){if(!a.isObject(e.labels))return"labels: object expected";var n=Object.keys(e.labels);for(t=0;t<n.length;++t)if(!a.isString(e.labels[n[t]]))return"labels: string{k:string} expected"}if(null!=e.additionalOptions&&e.hasOwnProperty("additionalOptions")){if(!a.isObject(e.additionalOptions))return"additionalOptions: object expected";for(n=Object.keys(e.additionalOptions),t=0;t<n.length;++t)if(!a.isString(e.additionalOptions[n[t]]))return"additionalOptions: string{k:string} expected"}if(null!=e.dependOnDependencyAssertions&&e.hasOwnProperty("dependOnDependencyAssertions")&&"boolean"!=typeof e.dependOnDependencyAssertions)return"dependOnDependencyAssertions: boolean expected";var r;if(null!=e.assertions&&e.hasOwnProperty("assertions")&&(r=s.sqlanvil.ActionConfig.TableAssertionsConfig.verify(e.assertions)))return"assertions."+r;if(null!=e.hermetic&&e.hasOwnProperty("hermetic")&&"boolean"!=typeof e.hermetic)return"hermetic: boolean expected";if(null!=e.onSchemaChange&&e.hasOwnProperty("onSchemaChange"))switch(e.onSchemaChange){default:return"onSchemaChange: enum value expected";case 0:case 1:case 2:case 3:}return null!=e.iceberg&&e.hasOwnProperty("iceberg")&&(r=s.sqlanvil.ActionConfig.IcebergTableConfig.verify(e.iceberg))?"iceberg."+r:null!=e.metadata&&e.hasOwnProperty("metadata")&&(r=s.sqlanvil.ActionConfig.Metadata.verify(e.metadata))?"metadata."+r:null!=e.reservation&&e.hasOwnProperty("reservation")&&!a.isString(e.reservation)?"reservation: string expected":null!=e.postgres&&e.hasOwnProperty("postgres")&&(r=s.sqlanvil.PostgresOptions.verify(e.postgres))?"postgres."+r:null!=e.supabase&&e.hasOwnProperty("supabase")&&(r=s.sqlanvil.SupabaseOptions.verify(e.supabase))?"supabase."+r:null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.IncrementalTableConfig)return e;var t=new s.sqlanvil.ActionConfig.IncrementalTableConfig;if(null!=e.name&&(t.name=String(e.name)),null!=e.dataset&&(t.dataset=String(e.dataset)),null!=e.project&&(t.project=String(e.project)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.dependencyTargets: array expected");t.dependencyTargets=[];for(var n=0;n<e.dependencyTargets.length;++n){if("object"!=typeof e.dependencyTargets[n])throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.dependencyTargets: object expected");t.dependencyTargets[n]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[n])}}if(null!=e.filename&&(t.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.tags: array expected");for(t.tags=[],n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}if(null!=e.disabled&&(t.disabled=Boolean(e.disabled)),e.preOperations){if(!Array.isArray(e.preOperations))throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.preOperations: array expected");for(t.preOperations=[],n=0;n<e.preOperations.length;++n)t.preOperations[n]=String(e.preOperations[n])}if(e.postOperations){if(!Array.isArray(e.postOperations))throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.postOperations: array expected");for(t.postOperations=[],n=0;n<e.postOperations.length;++n)t.postOperations[n]=String(e.postOperations[n])}if(null!=e.protected&&(t.protected=Boolean(e.protected)),e.uniqueKey){if(!Array.isArray(e.uniqueKey))throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.uniqueKey: array expected");for(t.uniqueKey=[],n=0;n<e.uniqueKey.length;++n)t.uniqueKey[n]=String(e.uniqueKey[n])}if(null!=e.description&&(t.description=String(e.description)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.columns: array expected");for(t.columns=[],n=0;n<e.columns.length;++n){if("object"!=typeof e.columns[n])throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.columns: object expected");t.columns[n]=s.sqlanvil.ActionConfig.ColumnDescriptor.fromObject(e.columns[n])}}if(null!=e.partitionBy&&(t.partitionBy=String(e.partitionBy)),null!=e.partitionExpirationDays&&(t.partitionExpirationDays=0|e.partitionExpirationDays),null!=e.requirePartitionFilter&&(t.requirePartitionFilter=Boolean(e.requirePartitionFilter)),null!=e.updatePartitionFilter&&(t.updatePartitionFilter=String(e.updatePartitionFilter)),e.clusterBy){if(!Array.isArray(e.clusterBy))throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.clusterBy: array expected");for(t.clusterBy=[],n=0;n<e.clusterBy.length;++n)t.clusterBy[n]=String(e.clusterBy[n])}if(e.labels){if("object"!=typeof e.labels)throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.labels: object expected");t.labels={};var r=Object.keys(e.labels);for(n=0;n<r.length;++n)t.labels[r[n]]=String(e.labels[r[n]])}if(e.additionalOptions){if("object"!=typeof e.additionalOptions)throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.additionalOptions: object expected");for(t.additionalOptions={},r=Object.keys(e.additionalOptions),n=0;n<r.length;++n)t.additionalOptions[r[n]]=String(e.additionalOptions[r[n]])}if(null!=e.dependOnDependencyAssertions&&(t.dependOnDependencyAssertions=Boolean(e.dependOnDependencyAssertions)),null!=e.assertions){if("object"!=typeof e.assertions)throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.assertions: object expected");t.assertions=s.sqlanvil.ActionConfig.TableAssertionsConfig.fromObject(e.assertions)}switch(null!=e.hermetic&&(t.hermetic=Boolean(e.hermetic)),e.onSchemaChange){default:if("number"==typeof e.onSchemaChange){t.onSchemaChange=e.onSchemaChange;break}break;case"IGNORE":case 0:t.onSchemaChange=0;break;case"FAIL":case 1:t.onSchemaChange=1;break;case"EXTEND":case 2:t.onSchemaChange=2;break;case"SYNCHRONIZE":case 3:t.onSchemaChange=3}if(null!=e.iceberg){if("object"!=typeof e.iceberg)throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.iceberg: object expected");t.iceberg=s.sqlanvil.ActionConfig.IcebergTableConfig.fromObject(e.iceberg)}if(null!=e.metadata){if("object"!=typeof e.metadata)throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.metadata: object expected");t.metadata=s.sqlanvil.ActionConfig.Metadata.fromObject(e.metadata)}if(null!=e.reservation&&(t.reservation=String(e.reservation)),null!=e.postgres){if("object"!=typeof e.postgres)throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.postgres: object expected");t.postgres=s.sqlanvil.PostgresOptions.fromObject(e.postgres)}if(null!=e.supabase){if("object"!=typeof e.supabase)throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.supabase: object expected");t.supabase=s.sqlanvil.SupabaseOptions.fromObject(e.supabase)}return t},t.toObject=function(e,t){t||(t={});var n,r={};if((t.arrays||t.defaults)&&(r.dependencyTargets=[],r.tags=[],r.preOperations=[],r.postOperations=[],r.uniqueKey=[],r.columns=[],r.clusterBy=[]),(t.objects||t.defaults)&&(r.labels={},r.additionalOptions={}),t.defaults&&(r.name="",r.dataset="",r.project="",r.filename="",r.disabled=!1,r.protected=!1,r.description="",r.partitionBy="",r.partitionExpirationDays=0,r.requirePartitionFilter=!1,r.updatePartitionFilter="",r.dependOnDependencyAssertions=!1,r.assertions=null,r.hermetic=!1,r.onSchemaChange=t.enums===String?"IGNORE":0,r.iceberg=null,r.metadata=null,r.reservation="",r.postgres=null,r.supabase=null),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),null!=e.dataset&&e.hasOwnProperty("dataset")&&(r.dataset=e.dataset),null!=e.project&&e.hasOwnProperty("project")&&(r.project=e.project),e.dependencyTargets&&e.dependencyTargets.length){r.dependencyTargets=[];for(var i=0;i<e.dependencyTargets.length;++i)r.dependencyTargets[i]=s.sqlanvil.ActionConfig.Target.toObject(e.dependencyTargets[i],t)}if(null!=e.filename&&e.hasOwnProperty("filename")&&(r.filename=e.filename),e.tags&&e.tags.length)for(r.tags=[],i=0;i<e.tags.length;++i)r.tags[i]=e.tags[i];if(null!=e.disabled&&e.hasOwnProperty("disabled")&&(r.disabled=e.disabled),e.preOperations&&e.preOperations.length)for(r.preOperations=[],i=0;i<e.preOperations.length;++i)r.preOperations[i]=e.preOperations[i];if(e.postOperations&&e.postOperations.length)for(r.postOperations=[],i=0;i<e.postOperations.length;++i)r.postOperations[i]=e.postOperations[i];if(null!=e.protected&&e.hasOwnProperty("protected")&&(r.protected=e.protected),e.uniqueKey&&e.uniqueKey.length)for(r.uniqueKey=[],i=0;i<e.uniqueKey.length;++i)r.uniqueKey[i]=e.uniqueKey[i];if(null!=e.description&&e.hasOwnProperty("description")&&(r.description=e.description),e.columns&&e.columns.length)for(r.columns=[],i=0;i<e.columns.length;++i)r.columns[i]=s.sqlanvil.ActionConfig.ColumnDescriptor.toObject(e.columns[i],t);if(null!=e.partitionBy&&e.hasOwnProperty("partitionBy")&&(r.partitionBy=e.partitionBy),null!=e.partitionExpirationDays&&e.hasOwnProperty("partitionExpirationDays")&&(r.partitionExpirationDays=e.partitionExpirationDays),null!=e.requirePartitionFilter&&e.hasOwnProperty("requirePartitionFilter")&&(r.requirePartitionFilter=e.requirePartitionFilter),null!=e.updatePartitionFilter&&e.hasOwnProperty("updatePartitionFilter")&&(r.updatePartitionFilter=e.updatePartitionFilter),e.clusterBy&&e.clusterBy.length)for(r.clusterBy=[],i=0;i<e.clusterBy.length;++i)r.clusterBy[i]=e.clusterBy[i];if(e.labels&&(n=Object.keys(e.labels)).length)for(r.labels={},i=0;i<n.length;++i)r.labels[n[i]]=e.labels[n[i]];if(e.additionalOptions&&(n=Object.keys(e.additionalOptions)).length)for(r.additionalOptions={},i=0;i<n.length;++i)r.additionalOptions[n[i]]=e.additionalOptions[n[i]];return null!=e.dependOnDependencyAssertions&&e.hasOwnProperty("dependOnDependencyAssertions")&&(r.dependOnDependencyAssertions=e.dependOnDependencyAssertions),null!=e.assertions&&e.hasOwnProperty("assertions")&&(r.assertions=s.sqlanvil.ActionConfig.TableAssertionsConfig.toObject(e.assertions,t)),null!=e.hermetic&&e.hasOwnProperty("hermetic")&&(r.hermetic=e.hermetic),null!=e.onSchemaChange&&e.hasOwnProperty("onSchemaChange")&&(r.onSchemaChange=t.enums===String?void 0===s.sqlanvil.ActionConfig.OnSchemaChange[e.onSchemaChange]?e.onSchemaChange:s.sqlanvil.ActionConfig.OnSchemaChange[e.onSchemaChange]:e.onSchemaChange),null!=e.iceberg&&e.hasOwnProperty("iceberg")&&(r.iceberg=s.sqlanvil.ActionConfig.IcebergTableConfig.toObject(e.iceberg,t)),null!=e.metadata&&e.hasOwnProperty("metadata")&&(r.metadata=s.sqlanvil.ActionConfig.Metadata.toObject(e.metadata,t)),null!=e.reservation&&e.hasOwnProperty("reservation")&&(r.reservation=e.reservation),null!=e.postgres&&e.hasOwnProperty("postgres")&&(r.postgres=s.sqlanvil.PostgresOptions.toObject(e.postgres,t)),null!=e.supabase&&e.hasOwnProperty("supabase")&&(r.supabase=s.sqlanvil.SupabaseOptions.toObject(e.supabase,t)),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.IncrementalTableConfig"},t}(),t.AssertionConfig=function(){function t(e){if(this.dependencyTargets=[],this.tags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.dataset="",t.prototype.project="",t.prototype.dependencyTargets=a.emptyArray,t.prototype.filename="",t.prototype.tags=a.emptyArray,t.prototype.disabled=!1,t.prototype.description="",t.prototype.hermetic=!1,t.prototype.dependOnDependencyAssertions=!1,t.prototype.reservation="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.dataset&&Object.hasOwnProperty.call(e,"dataset")&&t.uint32(18).string(e.dataset),null!=e.project&&Object.hasOwnProperty.call(e,"project")&&t.uint32(26).string(e.project),null!=e.dependencyTargets&&e.dependencyTargets.length)for(var n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.ActionConfig.Target.encode(e.dependencyTargets[n],t.uint32(34).fork()).ldelim();if(null!=e.filename&&Object.hasOwnProperty.call(e,"filename")&&t.uint32(42).string(e.filename),null!=e.tags&&e.tags.length)for(n=0;n<e.tags.length;++n)t.uint32(50).string(e.tags[n]);return null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(56).bool(e.disabled),null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(66).string(e.description),null!=e.hermetic&&Object.hasOwnProperty.call(e,"hermetic")&&t.uint32(72).bool(e.hermetic),null!=e.dependOnDependencyAssertions&&Object.hasOwnProperty.call(e,"dependOnDependencyAssertions")&&t.uint32(80).bool(e.dependOnDependencyAssertions),null!=e.reservation&&Object.hasOwnProperty.call(e,"reservation")&&t.uint32(90).string(e.reservation),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionConfig.AssertionConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.name=e.string();break;case 2:o.dataset=e.string();break;case 3:o.project=e.string();break;case 4:o.dependencyTargets&&o.dependencyTargets.length||(o.dependencyTargets=[]),o.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32()));break;case 5:o.filename=e.string();break;case 6:o.tags&&o.tags.length||(o.tags=[]),o.tags.push(e.string());break;case 7:o.disabled=e.bool();break;case 8:o.description=e.string();break;case 9:o.hermetic=e.bool();break;case 10:o.dependOnDependencyAssertions=e.bool();break;case 11:o.reservation=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.dataset&&e.hasOwnProperty("dataset")&&!a.isString(e.dataset))return"dataset: string expected";if(null!=e.project&&e.hasOwnProperty("project")&&!a.isString(e.project))return"project: string expected";if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var t=0;t<e.dependencyTargets.length;++t){var n=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[t]);if(n)return"dependencyTargets."+n}}if(null!=e.filename&&e.hasOwnProperty("filename")&&!a.isString(e.filename))return"filename: string expected";if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!a.isString(e.tags[t]))return"tags: string[] expected"}return null!=e.disabled&&e.hasOwnProperty("disabled")&&"boolean"!=typeof e.disabled?"disabled: boolean expected":null!=e.description&&e.hasOwnProperty("description")&&!a.isString(e.description)?"description: string expected":null!=e.hermetic&&e.hasOwnProperty("hermetic")&&"boolean"!=typeof e.hermetic?"hermetic: boolean expected":null!=e.dependOnDependencyAssertions&&e.hasOwnProperty("dependOnDependencyAssertions")&&"boolean"!=typeof e.dependOnDependencyAssertions?"dependOnDependencyAssertions: boolean expected":null!=e.reservation&&e.hasOwnProperty("reservation")&&!a.isString(e.reservation)?"reservation: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.AssertionConfig)return e;var t=new s.sqlanvil.ActionConfig.AssertionConfig;if(null!=e.name&&(t.name=String(e.name)),null!=e.dataset&&(t.dataset=String(e.dataset)),null!=e.project&&(t.project=String(e.project)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.AssertionConfig.dependencyTargets: array expected");t.dependencyTargets=[];for(var n=0;n<e.dependencyTargets.length;++n){if("object"!=typeof e.dependencyTargets[n])throw TypeError(".sqlanvil.ActionConfig.AssertionConfig.dependencyTargets: object expected");t.dependencyTargets[n]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[n])}}if(null!=e.filename&&(t.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.AssertionConfig.tags: array expected");for(t.tags=[],n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}return null!=e.disabled&&(t.disabled=Boolean(e.disabled)),null!=e.description&&(t.description=String(e.description)),null!=e.hermetic&&(t.hermetic=Boolean(e.hermetic)),null!=e.dependOnDependencyAssertions&&(t.dependOnDependencyAssertions=Boolean(e.dependOnDependencyAssertions)),null!=e.reservation&&(t.reservation=String(e.reservation)),t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.dependencyTargets=[],n.tags=[]),t.defaults&&(n.name="",n.dataset="",n.project="",n.filename="",n.disabled=!1,n.description="",n.hermetic=!1,n.dependOnDependencyAssertions=!1,n.reservation=""),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.dataset&&e.hasOwnProperty("dataset")&&(n.dataset=e.dataset),null!=e.project&&e.hasOwnProperty("project")&&(n.project=e.project),e.dependencyTargets&&e.dependencyTargets.length){n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r)n.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.toObject(e.dependencyTargets[r],t)}if(null!=e.filename&&e.hasOwnProperty("filename")&&(n.filename=e.filename),e.tags&&e.tags.length)for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=e.tags[r];return null!=e.disabled&&e.hasOwnProperty("disabled")&&(n.disabled=e.disabled),null!=e.description&&e.hasOwnProperty("description")&&(n.description=e.description),null!=e.hermetic&&e.hasOwnProperty("hermetic")&&(n.hermetic=e.hermetic),null!=e.dependOnDependencyAssertions&&e.hasOwnProperty("dependOnDependencyAssertions")&&(n.dependOnDependencyAssertions=e.dependOnDependencyAssertions),null!=e.reservation&&e.hasOwnProperty("reservation")&&(n.reservation=e.reservation),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.AssertionConfig"},t}(),t.OperationConfig=function(){function t(e){if(this.dependencyTargets=[],this.tags=[],this.columns=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.dataset="",t.prototype.project="",t.prototype.dependencyTargets=a.emptyArray,t.prototype.filename="",t.prototype.tags=a.emptyArray,t.prototype.disabled=!1,t.prototype.hasOutput=!1,t.prototype.description="",t.prototype.columns=a.emptyArray,t.prototype.dependOnDependencyAssertions=!1,t.prototype.hermetic=!1,t.prototype.reservation="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.dataset&&Object.hasOwnProperty.call(e,"dataset")&&t.uint32(18).string(e.dataset),null!=e.project&&Object.hasOwnProperty.call(e,"project")&&t.uint32(26).string(e.project),null!=e.dependencyTargets&&e.dependencyTargets.length)for(var n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.ActionConfig.Target.encode(e.dependencyTargets[n],t.uint32(34).fork()).ldelim();if(null!=e.filename&&Object.hasOwnProperty.call(e,"filename")&&t.uint32(42).string(e.filename),null!=e.tags&&e.tags.length)for(n=0;n<e.tags.length;++n)t.uint32(50).string(e.tags[n]);if(null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(56).bool(e.disabled),null!=e.hasOutput&&Object.hasOwnProperty.call(e,"hasOutput")&&t.uint32(64).bool(e.hasOutput),null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(74).string(e.description),null!=e.columns&&e.columns.length)for(n=0;n<e.columns.length;++n)s.sqlanvil.ActionConfig.ColumnDescriptor.encode(e.columns[n],t.uint32(82).fork()).ldelim();return null!=e.dependOnDependencyAssertions&&Object.hasOwnProperty.call(e,"dependOnDependencyAssertions")&&t.uint32(88).bool(e.dependOnDependencyAssertions),null!=e.hermetic&&Object.hasOwnProperty.call(e,"hermetic")&&t.uint32(96).bool(e.hermetic),null!=e.reservation&&Object.hasOwnProperty.call(e,"reservation")&&t.uint32(106).string(e.reservation),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionConfig.OperationConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.name=e.string();break;case 2:o.dataset=e.string();break;case 3:o.project=e.string();break;case 4:o.dependencyTargets&&o.dependencyTargets.length||(o.dependencyTargets=[]),o.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32()));break;case 5:o.filename=e.string();break;case 6:o.tags&&o.tags.length||(o.tags=[]),o.tags.push(e.string());break;case 7:o.disabled=e.bool();break;case 8:o.hasOutput=e.bool();break;case 9:o.description=e.string();break;case 10:o.columns&&o.columns.length||(o.columns=[]),o.columns.push(s.sqlanvil.ActionConfig.ColumnDescriptor.decode(e,e.uint32()));break;case 11:o.dependOnDependencyAssertions=e.bool();break;case 12:o.hermetic=e.bool();break;case 13:o.reservation=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.dataset&&e.hasOwnProperty("dataset")&&!a.isString(e.dataset))return"dataset: string expected";if(null!=e.project&&e.hasOwnProperty("project")&&!a.isString(e.project))return"project: string expected";if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var t=0;t<e.dependencyTargets.length;++t)if(n=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[t]))return"dependencyTargets."+n}if(null!=e.filename&&e.hasOwnProperty("filename")&&!a.isString(e.filename))return"filename: string expected";if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!a.isString(e.tags[t]))return"tags: string[] expected"}if(null!=e.disabled&&e.hasOwnProperty("disabled")&&"boolean"!=typeof e.disabled)return"disabled: boolean expected";if(null!=e.hasOutput&&e.hasOwnProperty("hasOutput")&&"boolean"!=typeof e.hasOutput)return"hasOutput: boolean expected";if(null!=e.description&&e.hasOwnProperty("description")&&!a.isString(e.description))return"description: string expected";if(null!=e.columns&&e.hasOwnProperty("columns")){if(!Array.isArray(e.columns))return"columns: array expected";for(t=0;t<e.columns.length;++t){var n;if(n=s.sqlanvil.ActionConfig.ColumnDescriptor.verify(e.columns[t]))return"columns."+n}}return null!=e.dependOnDependencyAssertions&&e.hasOwnProperty("dependOnDependencyAssertions")&&"boolean"!=typeof e.dependOnDependencyAssertions?"dependOnDependencyAssertions: boolean expected":null!=e.hermetic&&e.hasOwnProperty("hermetic")&&"boolean"!=typeof e.hermetic?"hermetic: boolean expected":null!=e.reservation&&e.hasOwnProperty("reservation")&&!a.isString(e.reservation)?"reservation: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.OperationConfig)return e;var t=new s.sqlanvil.ActionConfig.OperationConfig;if(null!=e.name&&(t.name=String(e.name)),null!=e.dataset&&(t.dataset=String(e.dataset)),null!=e.project&&(t.project=String(e.project)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.OperationConfig.dependencyTargets: array expected");t.dependencyTargets=[];for(var n=0;n<e.dependencyTargets.length;++n){if("object"!=typeof e.dependencyTargets[n])throw TypeError(".sqlanvil.ActionConfig.OperationConfig.dependencyTargets: object expected");t.dependencyTargets[n]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[n])}}if(null!=e.filename&&(t.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.OperationConfig.tags: array expected");for(t.tags=[],n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}if(null!=e.disabled&&(t.disabled=Boolean(e.disabled)),null!=e.hasOutput&&(t.hasOutput=Boolean(e.hasOutput)),null!=e.description&&(t.description=String(e.description)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.ActionConfig.OperationConfig.columns: array expected");for(t.columns=[],n=0;n<e.columns.length;++n){if("object"!=typeof e.columns[n])throw TypeError(".sqlanvil.ActionConfig.OperationConfig.columns: object expected");t.columns[n]=s.sqlanvil.ActionConfig.ColumnDescriptor.fromObject(e.columns[n])}}return null!=e.dependOnDependencyAssertions&&(t.dependOnDependencyAssertions=Boolean(e.dependOnDependencyAssertions)),null!=e.hermetic&&(t.hermetic=Boolean(e.hermetic)),null!=e.reservation&&(t.reservation=String(e.reservation)),t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.dependencyTargets=[],n.tags=[],n.columns=[]),t.defaults&&(n.name="",n.dataset="",n.project="",n.filename="",n.disabled=!1,n.hasOutput=!1,n.description="",n.dependOnDependencyAssertions=!1,n.hermetic=!1,n.reservation=""),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.dataset&&e.hasOwnProperty("dataset")&&(n.dataset=e.dataset),null!=e.project&&e.hasOwnProperty("project")&&(n.project=e.project),e.dependencyTargets&&e.dependencyTargets.length){n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r)n.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.toObject(e.dependencyTargets[r],t)}if(null!=e.filename&&e.hasOwnProperty("filename")&&(n.filename=e.filename),e.tags&&e.tags.length)for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=e.tags[r];if(null!=e.disabled&&e.hasOwnProperty("disabled")&&(n.disabled=e.disabled),null!=e.hasOutput&&e.hasOwnProperty("hasOutput")&&(n.hasOutput=e.hasOutput),null!=e.description&&e.hasOwnProperty("description")&&(n.description=e.description),e.columns&&e.columns.length)for(n.columns=[],r=0;r<e.columns.length;++r)n.columns[r]=s.sqlanvil.ActionConfig.ColumnDescriptor.toObject(e.columns[r],t);return null!=e.dependOnDependencyAssertions&&e.hasOwnProperty("dependOnDependencyAssertions")&&(n.dependOnDependencyAssertions=e.dependOnDependencyAssertions),null!=e.hermetic&&e.hasOwnProperty("hermetic")&&(n.hermetic=e.hermetic),null!=e.reservation&&e.hasOwnProperty("reservation")&&(n.reservation=e.reservation),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.OperationConfig"},t}(),t.DeclarationConfig=function(){function t(e){if(this.columns=[],this.tags=[],this.columnTypes={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.dataset="",t.prototype.project="",t.prototype.description="",t.prototype.columns=a.emptyArray,t.prototype.filename="",t.prototype.tags=a.emptyArray,t.prototype.connection="",t.prototype.columnTypes=a.emptyObject,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.dataset&&Object.hasOwnProperty.call(e,"dataset")&&t.uint32(18).string(e.dataset),null!=e.project&&Object.hasOwnProperty.call(e,"project")&&t.uint32(26).string(e.project),null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(34).string(e.description),null!=e.columns&&e.columns.length)for(var n=0;n<e.columns.length;++n)s.sqlanvil.ActionConfig.ColumnDescriptor.encode(e.columns[n],t.uint32(42).fork()).ldelim();if(null!=e.filename&&Object.hasOwnProperty.call(e,"filename")&&t.uint32(50).string(e.filename),null!=e.tags&&e.tags.length)for(n=0;n<e.tags.length;++n)t.uint32(58).string(e.tags[n]);if(null!=e.connection&&Object.hasOwnProperty.call(e,"connection")&&t.uint32(66).string(e.connection),null!=e.columnTypes&&Object.hasOwnProperty.call(e,"columnTypes")){var r=Object.keys(e.columnTypes);for(n=0;n<r.length;++n)t.uint32(74).fork().uint32(10).string(r[n]).uint32(18).string(e.columnTypes[r[n]]).ldelim()}return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r,o,l=void 0===t?e.len:e.pos+t,c=new s.sqlanvil.ActionConfig.DeclarationConfig;e.pos<l;){var u=e.uint32();if(u===n)break;switch(u>>>3){case 1:c.name=e.string();break;case 2:c.dataset=e.string();break;case 3:c.project=e.string();break;case 4:c.description=e.string();break;case 5:c.columns&&c.columns.length||(c.columns=[]),c.columns.push(s.sqlanvil.ActionConfig.ColumnDescriptor.decode(e,e.uint32()));break;case 6:c.filename=e.string();break;case 7:c.tags&&c.tags.length||(c.tags=[]),c.tags.push(e.string());break;case 8:c.connection=e.string();break;case 9:c.columnTypes===a.emptyObject&&(c.columnTypes={});var p=e.uint32()+e.pos;for(r="",o="";e.pos<p;){var f=e.uint32();switch(f>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}}c.columnTypes[r]=o;break;default:e.skipType(7&u)}}return c},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.dataset&&e.hasOwnProperty("dataset")&&!a.isString(e.dataset))return"dataset: string expected";if(null!=e.project&&e.hasOwnProperty("project")&&!a.isString(e.project))return"project: string expected";if(null!=e.description&&e.hasOwnProperty("description")&&!a.isString(e.description))return"description: string expected";if(null!=e.columns&&e.hasOwnProperty("columns")){if(!Array.isArray(e.columns))return"columns: array expected";for(var t=0;t<e.columns.length;++t){var n=s.sqlanvil.ActionConfig.ColumnDescriptor.verify(e.columns[t]);if(n)return"columns."+n}}if(null!=e.filename&&e.hasOwnProperty("filename")&&!a.isString(e.filename))return"filename: string expected";if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!a.isString(e.tags[t]))return"tags: string[] expected"}if(null!=e.connection&&e.hasOwnProperty("connection")&&!a.isString(e.connection))return"connection: string expected";if(null!=e.columnTypes&&e.hasOwnProperty("columnTypes")){if(!a.isObject(e.columnTypes))return"columnTypes: object expected";var r=Object.keys(e.columnTypes);for(t=0;t<r.length;++t)if(!a.isString(e.columnTypes[r[t]]))return"columnTypes: string{k:string} expected"}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.DeclarationConfig)return e;var t=new s.sqlanvil.ActionConfig.DeclarationConfig;if(null!=e.name&&(t.name=String(e.name)),null!=e.dataset&&(t.dataset=String(e.dataset)),null!=e.project&&(t.project=String(e.project)),null!=e.description&&(t.description=String(e.description)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.ActionConfig.DeclarationConfig.columns: array expected");t.columns=[];for(var n=0;n<e.columns.length;++n){if("object"!=typeof e.columns[n])throw TypeError(".sqlanvil.ActionConfig.DeclarationConfig.columns: object expected");t.columns[n]=s.sqlanvil.ActionConfig.ColumnDescriptor.fromObject(e.columns[n])}}if(null!=e.filename&&(t.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.DeclarationConfig.tags: array expected");for(t.tags=[],n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}if(null!=e.connection&&(t.connection=String(e.connection)),e.columnTypes){if("object"!=typeof e.columnTypes)throw TypeError(".sqlanvil.ActionConfig.DeclarationConfig.columnTypes: object expected");t.columnTypes={};var r=Object.keys(e.columnTypes);for(n=0;n<r.length;++n)t.columnTypes[r[n]]=String(e.columnTypes[r[n]])}return t},t.toObject=function(e,t){t||(t={});var n,r={};if((t.arrays||t.defaults)&&(r.columns=[],r.tags=[]),(t.objects||t.defaults)&&(r.columnTypes={}),t.defaults&&(r.name="",r.dataset="",r.project="",r.description="",r.filename="",r.connection=""),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),null!=e.dataset&&e.hasOwnProperty("dataset")&&(r.dataset=e.dataset),null!=e.project&&e.hasOwnProperty("project")&&(r.project=e.project),null!=e.description&&e.hasOwnProperty("description")&&(r.description=e.description),e.columns&&e.columns.length){r.columns=[];for(var i=0;i<e.columns.length;++i)r.columns[i]=s.sqlanvil.ActionConfig.ColumnDescriptor.toObject(e.columns[i],t)}if(null!=e.filename&&e.hasOwnProperty("filename")&&(r.filename=e.filename),e.tags&&e.tags.length)for(r.tags=[],i=0;i<e.tags.length;++i)r.tags[i]=e.tags[i];if(null!=e.connection&&e.hasOwnProperty("connection")&&(r.connection=e.connection),e.columnTypes&&(n=Object.keys(e.columnTypes)).length)for(r.columnTypes={},i=0;i<n.length;++i)r.columnTypes[n[i]]=e.columnTypes[n[i]];return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.DeclarationConfig"},t}(),t.NotebookConfig=function(){function t(e){if(this.dependencyTargets=[],this.tags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.location="",t.prototype.project="",t.prototype.dependencyTargets=a.emptyArray,t.prototype.filename="",t.prototype.tags=a.emptyArray,t.prototype.disabled=!1,t.prototype.description="",t.prototype.dependOnDependencyAssertions=!1,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.location&&Object.hasOwnProperty.call(e,"location")&&t.uint32(18).string(e.location),null!=e.project&&Object.hasOwnProperty.call(e,"project")&&t.uint32(26).string(e.project),null!=e.dependencyTargets&&e.dependencyTargets.length)for(var n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.ActionConfig.Target.encode(e.dependencyTargets[n],t.uint32(34).fork()).ldelim();if(null!=e.filename&&Object.hasOwnProperty.call(e,"filename")&&t.uint32(42).string(e.filename),null!=e.tags&&e.tags.length)for(n=0;n<e.tags.length;++n)t.uint32(50).string(e.tags[n]);return null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(56).bool(e.disabled),null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(66).string(e.description),null!=e.dependOnDependencyAssertions&&Object.hasOwnProperty.call(e,"dependOnDependencyAssertions")&&t.uint32(72).bool(e.dependOnDependencyAssertions),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionConfig.NotebookConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.name=e.string();break;case 2:o.location=e.string();break;case 3:o.project=e.string();break;case 4:o.dependencyTargets&&o.dependencyTargets.length||(o.dependencyTargets=[]),o.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32()));break;case 5:o.filename=e.string();break;case 6:o.tags&&o.tags.length||(o.tags=[]),o.tags.push(e.string());break;case 7:o.disabled=e.bool();break;case 8:o.description=e.string();break;case 9:o.dependOnDependencyAssertions=e.bool();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.location&&e.hasOwnProperty("location")&&!a.isString(e.location))return"location: string expected";if(null!=e.project&&e.hasOwnProperty("project")&&!a.isString(e.project))return"project: string expected";if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var t=0;t<e.dependencyTargets.length;++t){var n=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[t]);if(n)return"dependencyTargets."+n}}if(null!=e.filename&&e.hasOwnProperty("filename")&&!a.isString(e.filename))return"filename: string expected";if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!a.isString(e.tags[t]))return"tags: string[] expected"}return null!=e.disabled&&e.hasOwnProperty("disabled")&&"boolean"!=typeof e.disabled?"disabled: boolean expected":null!=e.description&&e.hasOwnProperty("description")&&!a.isString(e.description)?"description: string expected":null!=e.dependOnDependencyAssertions&&e.hasOwnProperty("dependOnDependencyAssertions")&&"boolean"!=typeof e.dependOnDependencyAssertions?"dependOnDependencyAssertions: boolean expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.NotebookConfig)return e;var t=new s.sqlanvil.ActionConfig.NotebookConfig;if(null!=e.name&&(t.name=String(e.name)),null!=e.location&&(t.location=String(e.location)),null!=e.project&&(t.project=String(e.project)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.NotebookConfig.dependencyTargets: array expected");t.dependencyTargets=[];for(var n=0;n<e.dependencyTargets.length;++n){if("object"!=typeof e.dependencyTargets[n])throw TypeError(".sqlanvil.ActionConfig.NotebookConfig.dependencyTargets: object expected");t.dependencyTargets[n]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[n])}}if(null!=e.filename&&(t.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.NotebookConfig.tags: array expected");for(t.tags=[],n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}return null!=e.disabled&&(t.disabled=Boolean(e.disabled)),null!=e.description&&(t.description=String(e.description)),null!=e.dependOnDependencyAssertions&&(t.dependOnDependencyAssertions=Boolean(e.dependOnDependencyAssertions)),t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.dependencyTargets=[],n.tags=[]),t.defaults&&(n.name="",n.location="",n.project="",n.filename="",n.disabled=!1,n.description="",n.dependOnDependencyAssertions=!1),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.location&&e.hasOwnProperty("location")&&(n.location=e.location),null!=e.project&&e.hasOwnProperty("project")&&(n.project=e.project),e.dependencyTargets&&e.dependencyTargets.length){n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r)n.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.toObject(e.dependencyTargets[r],t)}if(null!=e.filename&&e.hasOwnProperty("filename")&&(n.filename=e.filename),e.tags&&e.tags.length)for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=e.tags[r];return null!=e.disabled&&e.hasOwnProperty("disabled")&&(n.disabled=e.disabled),null!=e.description&&e.hasOwnProperty("description")&&(n.description=e.description),null!=e.dependOnDependencyAssertions&&e.hasOwnProperty("dependOnDependencyAssertions")&&(n.dependOnDependencyAssertions=e.dependOnDependencyAssertions),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.NotebookConfig"},t}(),t.DataPreparationConfig=function(){function t(e){if(this.dependencyTargets=[],this.tags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.dataset="",t.prototype.project="",t.prototype.dependencyTargets=a.emptyArray,t.prototype.filename="",t.prototype.tags=a.emptyArray,t.prototype.disabled=!1,t.prototype.description="",t.prototype.errorTable=null,t.prototype.loadMode=null,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.dependencyTargets&&e.dependencyTargets.length)for(var n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.ActionConfig.Target.encode(e.dependencyTargets[n],t.uint32(18).fork()).ldelim();if(null!=e.filename&&Object.hasOwnProperty.call(e,"filename")&&t.uint32(26).string(e.filename),null!=e.tags&&e.tags.length)for(n=0;n<e.tags.length;++n)t.uint32(34).string(e.tags[n]);return null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(56).bool(e.disabled),null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(66).string(e.description),null!=e.errorTable&&Object.hasOwnProperty.call(e,"errorTable")&&s.sqlanvil.ActionConfig.DataPreparationConfig.ErrorTableConfig.encode(e.errorTable,t.uint32(90).fork()).ldelim(),null!=e.loadMode&&Object.hasOwnProperty.call(e,"loadMode")&&s.sqlanvil.ActionConfig.LoadModeConfig.encode(e.loadMode,t.uint32(98).fork()).ldelim(),null!=e.dataset&&Object.hasOwnProperty.call(e,"dataset")&&t.uint32(106).string(e.dataset),null!=e.project&&Object.hasOwnProperty.call(e,"project")&&t.uint32(114).string(e.project),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionConfig.DataPreparationConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.name=e.string();break;case 13:o.dataset=e.string();break;case 14:o.project=e.string();break;case 2:o.dependencyTargets&&o.dependencyTargets.length||(o.dependencyTargets=[]),o.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32()));break;case 3:o.filename=e.string();break;case 4:o.tags&&o.tags.length||(o.tags=[]),o.tags.push(e.string());break;case 7:o.disabled=e.bool();break;case 8:o.description=e.string();break;case 11:o.errorTable=s.sqlanvil.ActionConfig.DataPreparationConfig.ErrorTableConfig.decode(e,e.uint32());break;case 12:o.loadMode=s.sqlanvil.ActionConfig.LoadModeConfig.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.dataset&&e.hasOwnProperty("dataset")&&!a.isString(e.dataset))return"dataset: string expected";if(null!=e.project&&e.hasOwnProperty("project")&&!a.isString(e.project))return"project: string expected";if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var t=0;t<e.dependencyTargets.length;++t)if(n=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[t]))return"dependencyTargets."+n}if(null!=e.filename&&e.hasOwnProperty("filename")&&!a.isString(e.filename))return"filename: string expected";if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!a.isString(e.tags[t]))return"tags: string[] expected"}return null!=e.disabled&&e.hasOwnProperty("disabled")&&"boolean"!=typeof e.disabled?"disabled: boolean expected":null!=e.description&&e.hasOwnProperty("description")&&!a.isString(e.description)?"description: string expected":null!=e.errorTable&&e.hasOwnProperty("errorTable")&&(n=s.sqlanvil.ActionConfig.DataPreparationConfig.ErrorTableConfig.verify(e.errorTable))?"errorTable."+n:null!=e.loadMode&&e.hasOwnProperty("loadMode")&&(n=s.sqlanvil.ActionConfig.LoadModeConfig.verify(e.loadMode))?"loadMode."+n:null;var n},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.DataPreparationConfig)return e;var t=new s.sqlanvil.ActionConfig.DataPreparationConfig;if(null!=e.name&&(t.name=String(e.name)),null!=e.dataset&&(t.dataset=String(e.dataset)),null!=e.project&&(t.project=String(e.project)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.DataPreparationConfig.dependencyTargets: array expected");t.dependencyTargets=[];for(var n=0;n<e.dependencyTargets.length;++n){if("object"!=typeof e.dependencyTargets[n])throw TypeError(".sqlanvil.ActionConfig.DataPreparationConfig.dependencyTargets: object expected");t.dependencyTargets[n]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[n])}}if(null!=e.filename&&(t.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.DataPreparationConfig.tags: array expected");for(t.tags=[],n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}if(null!=e.disabled&&(t.disabled=Boolean(e.disabled)),null!=e.description&&(t.description=String(e.description)),null!=e.errorTable){if("object"!=typeof e.errorTable)throw TypeError(".sqlanvil.ActionConfig.DataPreparationConfig.errorTable: object expected");t.errorTable=s.sqlanvil.ActionConfig.DataPreparationConfig.ErrorTableConfig.fromObject(e.errorTable)}if(null!=e.loadMode){if("object"!=typeof e.loadMode)throw TypeError(".sqlanvil.ActionConfig.DataPreparationConfig.loadMode: object expected");t.loadMode=s.sqlanvil.ActionConfig.LoadModeConfig.fromObject(e.loadMode)}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.dependencyTargets=[],n.tags=[]),t.defaults&&(n.name="",n.filename="",n.disabled=!1,n.description="",n.errorTable=null,n.loadMode=null,n.dataset="",n.project=""),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),e.dependencyTargets&&e.dependencyTargets.length){n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r)n.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.toObject(e.dependencyTargets[r],t)}if(null!=e.filename&&e.hasOwnProperty("filename")&&(n.filename=e.filename),e.tags&&e.tags.length)for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=e.tags[r];return null!=e.disabled&&e.hasOwnProperty("disabled")&&(n.disabled=e.disabled),null!=e.description&&e.hasOwnProperty("description")&&(n.description=e.description),null!=e.errorTable&&e.hasOwnProperty("errorTable")&&(n.errorTable=s.sqlanvil.ActionConfig.DataPreparationConfig.ErrorTableConfig.toObject(e.errorTable,t)),null!=e.loadMode&&e.hasOwnProperty("loadMode")&&(n.loadMode=s.sqlanvil.ActionConfig.LoadModeConfig.toObject(e.loadMode,t)),null!=e.dataset&&e.hasOwnProperty("dataset")&&(n.dataset=e.dataset),null!=e.project&&e.hasOwnProperty("project")&&(n.project=e.project),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.DataPreparationConfig"},t.ErrorTableConfig=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.dataset="",t.prototype.project="",t.prototype.retentionDays=0,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.dataset&&Object.hasOwnProperty.call(e,"dataset")&&t.uint32(18).string(e.dataset),null!=e.project&&Object.hasOwnProperty.call(e,"project")&&t.uint32(26).string(e.project),null!=e.retentionDays&&Object.hasOwnProperty.call(e,"retentionDays")&&t.uint32(32).int32(e.retentionDays),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionConfig.DataPreparationConfig.ErrorTableConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.name=e.string();break;case 2:o.dataset=e.string();break;case 3:o.project=e.string();break;case 4:o.retentionDays=e.int32();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name)?"name: string expected":null!=e.dataset&&e.hasOwnProperty("dataset")&&!a.isString(e.dataset)?"dataset: string expected":null!=e.project&&e.hasOwnProperty("project")&&!a.isString(e.project)?"project: string expected":null!=e.retentionDays&&e.hasOwnProperty("retentionDays")&&!a.isInteger(e.retentionDays)?"retentionDays: integer expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.DataPreparationConfig.ErrorTableConfig)return e;var t=new s.sqlanvil.ActionConfig.DataPreparationConfig.ErrorTableConfig;return null!=e.name&&(t.name=String(e.name)),null!=e.dataset&&(t.dataset=String(e.dataset)),null!=e.project&&(t.project=String(e.project)),null!=e.retentionDays&&(t.retentionDays=0|e.retentionDays),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.name="",n.dataset="",n.project="",n.retentionDays=0),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.dataset&&e.hasOwnProperty("dataset")&&(n.dataset=e.dataset),null!=e.project&&e.hasOwnProperty("project")&&(n.project=e.project),null!=e.retentionDays&&e.hasOwnProperty("retentionDays")&&(n.retentionDays=e.retentionDays),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.DataPreparationConfig.ErrorTableConfig"},t}(),t}(),t.RlsPolicyConfig=function(){function t(e){if(this.roles=[],this.dependencyTargets=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.table="",t.prototype.command="",t.prototype.roles=a.emptyArray,t.prototype.using="",t.prototype.withCheck="",t.prototype.filename="",t.prototype.dependencyTargets=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.table&&Object.hasOwnProperty.call(e,"table")&&t.uint32(18).string(e.table),null!=e.command&&Object.hasOwnProperty.call(e,"command")&&t.uint32(26).string(e.command),null!=e.roles&&e.roles.length)for(var n=0;n<e.roles.length;++n)t.uint32(34).string(e.roles[n]);if(null!=e.using&&Object.hasOwnProperty.call(e,"using")&&t.uint32(42).string(e.using),null!=e.withCheck&&Object.hasOwnProperty.call(e,"withCheck")&&t.uint32(50).string(e.withCheck),null!=e.filename&&Object.hasOwnProperty.call(e,"filename")&&t.uint32(58).string(e.filename),null!=e.dependencyTargets&&e.dependencyTargets.length)for(n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.ActionConfig.Target.encode(e.dependencyTargets[n],t.uint32(66).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionConfig.RlsPolicyConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.name=e.string();break;case 2:o.table=e.string();break;case 3:o.command=e.string();break;case 4:o.roles&&o.roles.length||(o.roles=[]),o.roles.push(e.string());break;case 5:o.using=e.string();break;case 6:o.withCheck=e.string();break;case 7:o.filename=e.string();break;case 8:o.dependencyTargets&&o.dependencyTargets.length||(o.dependencyTargets=[]),o.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.table&&e.hasOwnProperty("table")&&!a.isString(e.table))return"table: string expected";if(null!=e.command&&e.hasOwnProperty("command")&&!a.isString(e.command))return"command: string expected";if(null!=e.roles&&e.hasOwnProperty("roles")){if(!Array.isArray(e.roles))return"roles: array expected";for(var t=0;t<e.roles.length;++t)if(!a.isString(e.roles[t]))return"roles: string[] expected"}if(null!=e.using&&e.hasOwnProperty("using")&&!a.isString(e.using))return"using: string expected";if(null!=e.withCheck&&e.hasOwnProperty("withCheck")&&!a.isString(e.withCheck))return"withCheck: string expected";if(null!=e.filename&&e.hasOwnProperty("filename")&&!a.isString(e.filename))return"filename: string expected";if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(t=0;t<e.dependencyTargets.length;++t){var n=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[t]);if(n)return"dependencyTargets."+n}}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.RlsPolicyConfig)return e;var t=new s.sqlanvil.ActionConfig.RlsPolicyConfig;if(null!=e.name&&(t.name=String(e.name)),null!=e.table&&(t.table=String(e.table)),null!=e.command&&(t.command=String(e.command)),e.roles){if(!Array.isArray(e.roles))throw TypeError(".sqlanvil.ActionConfig.RlsPolicyConfig.roles: array expected");t.roles=[];for(var n=0;n<e.roles.length;++n)t.roles[n]=String(e.roles[n])}if(null!=e.using&&(t.using=String(e.using)),null!=e.withCheck&&(t.withCheck=String(e.withCheck)),null!=e.filename&&(t.filename=String(e.filename)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.RlsPolicyConfig.dependencyTargets: array expected");for(t.dependencyTargets=[],n=0;n<e.dependencyTargets.length;++n){if("object"!=typeof e.dependencyTargets[n])throw TypeError(".sqlanvil.ActionConfig.RlsPolicyConfig.dependencyTargets: object expected");t.dependencyTargets[n]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[n])}}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.roles=[],n.dependencyTargets=[]),t.defaults&&(n.name="",n.table="",n.command="",n.using="",n.withCheck="",n.filename=""),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.table&&e.hasOwnProperty("table")&&(n.table=e.table),null!=e.command&&e.hasOwnProperty("command")&&(n.command=e.command),e.roles&&e.roles.length){n.roles=[];for(var r=0;r<e.roles.length;++r)n.roles[r]=e.roles[r]}if(null!=e.using&&e.hasOwnProperty("using")&&(n.using=e.using),null!=e.withCheck&&e.hasOwnProperty("withCheck")&&(n.withCheck=e.withCheck),null!=e.filename&&e.hasOwnProperty("filename")&&(n.filename=e.filename),e.dependencyTargets&&e.dependencyTargets.length)for(n.dependencyTargets=[],r=0;r<e.dependencyTargets.length;++r)n.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.toObject(e.dependencyTargets[r],t);return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.RlsPolicyConfig"},t}(),t.RealtimePublicationConfig=function(){function t(e){if(this.events=[],this.dependencyTargets=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.table="",t.prototype.events=a.emptyArray,t.prototype.filename="",t.prototype.dependencyTargets=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.table&&Object.hasOwnProperty.call(e,"table")&&t.uint32(18).string(e.table),null!=e.events&&e.events.length)for(var n=0;n<e.events.length;++n)t.uint32(26).string(e.events[n]);if(null!=e.filename&&Object.hasOwnProperty.call(e,"filename")&&t.uint32(34).string(e.filename),null!=e.dependencyTargets&&e.dependencyTargets.length)for(n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.ActionConfig.Target.encode(e.dependencyTargets[n],t.uint32(42).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionConfig.RealtimePublicationConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.name=e.string();break;case 2:o.table=e.string();break;case 3:o.events&&o.events.length||(o.events=[]),o.events.push(e.string());break;case 4:o.filename=e.string();break;case 5:o.dependencyTargets&&o.dependencyTargets.length||(o.dependencyTargets=[]),o.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.table&&e.hasOwnProperty("table")&&!a.isString(e.table))return"table: string expected";if(null!=e.events&&e.hasOwnProperty("events")){if(!Array.isArray(e.events))return"events: array expected";for(var t=0;t<e.events.length;++t)if(!a.isString(e.events[t]))return"events: string[] expected"}if(null!=e.filename&&e.hasOwnProperty("filename")&&!a.isString(e.filename))return"filename: string expected";if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(t=0;t<e.dependencyTargets.length;++t){var n=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[t]);if(n)return"dependencyTargets."+n}}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.RealtimePublicationConfig)return e;var t=new s.sqlanvil.ActionConfig.RealtimePublicationConfig;if(null!=e.name&&(t.name=String(e.name)),null!=e.table&&(t.table=String(e.table)),e.events){if(!Array.isArray(e.events))throw TypeError(".sqlanvil.ActionConfig.RealtimePublicationConfig.events: array expected");t.events=[];for(var n=0;n<e.events.length;++n)t.events[n]=String(e.events[n])}if(null!=e.filename&&(t.filename=String(e.filename)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.RealtimePublicationConfig.dependencyTargets: array expected");for(t.dependencyTargets=[],n=0;n<e.dependencyTargets.length;++n){if("object"!=typeof e.dependencyTargets[n])throw TypeError(".sqlanvil.ActionConfig.RealtimePublicationConfig.dependencyTargets: object expected");t.dependencyTargets[n]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[n])}}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.events=[],n.dependencyTargets=[]),t.defaults&&(n.name="",n.table="",n.filename=""),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.table&&e.hasOwnProperty("table")&&(n.table=e.table),e.events&&e.events.length){n.events=[];for(var r=0;r<e.events.length;++r)n.events[r]=e.events[r]}if(null!=e.filename&&e.hasOwnProperty("filename")&&(n.filename=e.filename),e.dependencyTargets&&e.dependencyTargets.length)for(n.dependencyTargets=[],r=0;r<e.dependencyTargets.length;++r)n.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.toObject(e.dependencyTargets[r],t);return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.RealtimePublicationConfig"},t}(),t.ForeignWrapperConfig=function(){function t(e){if(this.options={},this.dependencyTargets=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.wrapper="",t.prototype.server="",t.prototype.options=a.emptyObject,t.prototype.filename="",t.prototype.dependencyTargets=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.wrapper&&Object.hasOwnProperty.call(e,"wrapper")&&t.uint32(18).string(e.wrapper),null!=e.server&&Object.hasOwnProperty.call(e,"server")&&t.uint32(26).string(e.server),null!=e.options&&Object.hasOwnProperty.call(e,"options"))for(var n=Object.keys(e.options),r=0;r<n.length;++r)t.uint32(34).fork().uint32(10).string(n[r]).uint32(18).string(e.options[n[r]]).ldelim();if(null!=e.filename&&Object.hasOwnProperty.call(e,"filename")&&t.uint32(42).string(e.filename),null!=e.dependencyTargets&&e.dependencyTargets.length)for(r=0;r<e.dependencyTargets.length;++r)s.sqlanvil.ActionConfig.Target.encode(e.dependencyTargets[r],t.uint32(50).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r,o,l=void 0===t?e.len:e.pos+t,c=new s.sqlanvil.ActionConfig.ForeignWrapperConfig;e.pos<l;){var u=e.uint32();if(u===n)break;switch(u>>>3){case 1:c.name=e.string();break;case 2:c.wrapper=e.string();break;case 3:c.server=e.string();break;case 4:c.options===a.emptyObject&&(c.options={});var p=e.uint32()+e.pos;for(r="",o="";e.pos<p;){var f=e.uint32();switch(f>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}}c.options[r]=o;break;case 5:c.filename=e.string();break;case 6:c.dependencyTargets&&c.dependencyTargets.length||(c.dependencyTargets=[]),c.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32()));break;default:e.skipType(7&u)}}return c},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.wrapper&&e.hasOwnProperty("wrapper")&&!a.isString(e.wrapper))return"wrapper: string expected";if(null!=e.server&&e.hasOwnProperty("server")&&!a.isString(e.server))return"server: string expected";if(null!=e.options&&e.hasOwnProperty("options")){if(!a.isObject(e.options))return"options: object expected";for(var t=Object.keys(e.options),n=0;n<t.length;++n)if(!a.isString(e.options[t[n]]))return"options: string{k:string} expected"}if(null!=e.filename&&e.hasOwnProperty("filename")&&!a.isString(e.filename))return"filename: string expected";if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(n=0;n<e.dependencyTargets.length;++n){var r=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[n]);if(r)return"dependencyTargets."+r}}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.ForeignWrapperConfig)return e;var t=new s.sqlanvil.ActionConfig.ForeignWrapperConfig;if(null!=e.name&&(t.name=String(e.name)),null!=e.wrapper&&(t.wrapper=String(e.wrapper)),null!=e.server&&(t.server=String(e.server)),e.options){if("object"!=typeof e.options)throw TypeError(".sqlanvil.ActionConfig.ForeignWrapperConfig.options: object expected");t.options={};for(var n=Object.keys(e.options),r=0;r<n.length;++r)t.options[n[r]]=String(e.options[n[r]])}if(null!=e.filename&&(t.filename=String(e.filename)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.ForeignWrapperConfig.dependencyTargets: array expected");for(t.dependencyTargets=[],r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.ActionConfig.ForeignWrapperConfig.dependencyTargets: object expected");t.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[r])}}return t},t.toObject=function(e,t){t||(t={});var n,r={};if((t.arrays||t.defaults)&&(r.dependencyTargets=[]),(t.objects||t.defaults)&&(r.options={}),t.defaults&&(r.name="",r.wrapper="",r.server="",r.filename=""),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),null!=e.wrapper&&e.hasOwnProperty("wrapper")&&(r.wrapper=e.wrapper),null!=e.server&&e.hasOwnProperty("server")&&(r.server=e.server),e.options&&(n=Object.keys(e.options)).length){r.options={};for(var i=0;i<n.length;++i)r.options[n[i]]=e.options[n[i]]}if(null!=e.filename&&e.hasOwnProperty("filename")&&(r.filename=e.filename),e.dependencyTargets&&e.dependencyTargets.length)for(r.dependencyTargets=[],i=0;i<e.dependencyTargets.length;++i)r.dependencyTargets[i]=s.sqlanvil.ActionConfig.Target.toObject(e.dependencyTargets[i],t);return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.ForeignWrapperConfig"},t}(),t.VectorIndexConfig=function(){function t(e){if(this.params={},this.dependencyTargets=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.table="",t.prototype.column="",t.prototype.dimensions=0,t.prototype.indexType="",t.prototype.params=a.emptyObject,t.prototype.filename="",t.prototype.dependencyTargets=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.table&&Object.hasOwnProperty.call(e,"table")&&t.uint32(18).string(e.table),null!=e.column&&Object.hasOwnProperty.call(e,"column")&&t.uint32(26).string(e.column),null!=e.dimensions&&Object.hasOwnProperty.call(e,"dimensions")&&t.uint32(32).uint32(e.dimensions),null!=e.indexType&&Object.hasOwnProperty.call(e,"indexType")&&t.uint32(42).string(e.indexType),null!=e.params&&Object.hasOwnProperty.call(e,"params"))for(var n=Object.keys(e.params),r=0;r<n.length;++r)t.uint32(50).fork().uint32(10).string(n[r]).uint32(18).string(e.params[n[r]]).ldelim();if(null!=e.filename&&Object.hasOwnProperty.call(e,"filename")&&t.uint32(58).string(e.filename),null!=e.dependencyTargets&&e.dependencyTargets.length)for(r=0;r<e.dependencyTargets.length;++r)s.sqlanvil.ActionConfig.Target.encode(e.dependencyTargets[r],t.uint32(66).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r,o,l=void 0===t?e.len:e.pos+t,c=new s.sqlanvil.ActionConfig.VectorIndexConfig;e.pos<l;){var u=e.uint32();if(u===n)break;switch(u>>>3){case 1:c.name=e.string();break;case 2:c.table=e.string();break;case 3:c.column=e.string();break;case 4:c.dimensions=e.uint32();break;case 5:c.indexType=e.string();break;case 6:c.params===a.emptyObject&&(c.params={});var p=e.uint32()+e.pos;for(r="",o="";e.pos<p;){var f=e.uint32();switch(f>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}}c.params[r]=o;break;case 7:c.filename=e.string();break;case 8:c.dependencyTargets&&c.dependencyTargets.length||(c.dependencyTargets=[]),c.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32()));break;default:e.skipType(7&u)}}return c},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.table&&e.hasOwnProperty("table")&&!a.isString(e.table))return"table: string expected";if(null!=e.column&&e.hasOwnProperty("column")&&!a.isString(e.column))return"column: string expected";if(null!=e.dimensions&&e.hasOwnProperty("dimensions")&&!a.isInteger(e.dimensions))return"dimensions: integer expected";if(null!=e.indexType&&e.hasOwnProperty("indexType")&&!a.isString(e.indexType))return"indexType: string expected";if(null!=e.params&&e.hasOwnProperty("params")){if(!a.isObject(e.params))return"params: object expected";for(var t=Object.keys(e.params),n=0;n<t.length;++n)if(!a.isString(e.params[t[n]]))return"params: string{k:string} expected"}if(null!=e.filename&&e.hasOwnProperty("filename")&&!a.isString(e.filename))return"filename: string expected";if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(n=0;n<e.dependencyTargets.length;++n){var r=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[n]);if(r)return"dependencyTargets."+r}}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.VectorIndexConfig)return e;var t=new s.sqlanvil.ActionConfig.VectorIndexConfig;if(null!=e.name&&(t.name=String(e.name)),null!=e.table&&(t.table=String(e.table)),null!=e.column&&(t.column=String(e.column)),null!=e.dimensions&&(t.dimensions=e.dimensions>>>0),null!=e.indexType&&(t.indexType=String(e.indexType)),e.params){if("object"!=typeof e.params)throw TypeError(".sqlanvil.ActionConfig.VectorIndexConfig.params: object expected");t.params={};for(var n=Object.keys(e.params),r=0;r<n.length;++r)t.params[n[r]]=String(e.params[n[r]])}if(null!=e.filename&&(t.filename=String(e.filename)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.VectorIndexConfig.dependencyTargets: array expected");for(t.dependencyTargets=[],r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.ActionConfig.VectorIndexConfig.dependencyTargets: object expected");t.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[r])}}return t},t.toObject=function(e,t){t||(t={});var n,r={};if((t.arrays||t.defaults)&&(r.dependencyTargets=[]),(t.objects||t.defaults)&&(r.params={}),t.defaults&&(r.name="",r.table="",r.column="",r.dimensions=0,r.indexType="",r.filename=""),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),null!=e.table&&e.hasOwnProperty("table")&&(r.table=e.table),null!=e.column&&e.hasOwnProperty("column")&&(r.column=e.column),null!=e.dimensions&&e.hasOwnProperty("dimensions")&&(r.dimensions=e.dimensions),null!=e.indexType&&e.hasOwnProperty("indexType")&&(r.indexType=e.indexType),e.params&&(n=Object.keys(e.params)).length){r.params={};for(var i=0;i<n.length;++i)r.params[n[i]]=e.params[n[i]]}if(null!=e.filename&&e.hasOwnProperty("filename")&&(r.filename=e.filename),e.dependencyTargets&&e.dependencyTargets.length)for(r.dependencyTargets=[],i=0;i<e.dependencyTargets.length;++i)r.dependencyTargets[i]=s.sqlanvil.ActionConfig.Target.toObject(e.dependencyTargets[i],t);return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.VectorIndexConfig"},t}(),t.LoadModeConfig=function(){function t(e){if(this.uniqueKey=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.mode=0,t.prototype.incrementalColumn="",t.prototype.uniqueKey=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.mode&&Object.hasOwnProperty.call(e,"mode")&&t.uint32(8).int32(e.mode),null!=e.incrementalColumn&&Object.hasOwnProperty.call(e,"incrementalColumn")&&t.uint32(18).string(e.incrementalColumn),null!=e.uniqueKey&&e.uniqueKey.length)for(var n=0;n<e.uniqueKey.length;++n)t.uint32(26).string(e.uniqueKey[n]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionConfig.LoadModeConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.mode=e.int32();break;case 2:o.incrementalColumn=e.string();break;case 3:o.uniqueKey&&o.uniqueKey.length||(o.uniqueKey=[]),o.uniqueKey.push(e.string());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.mode&&e.hasOwnProperty("mode"))switch(e.mode){default:return"mode: enum value expected";case 0:case 1:case 2:case 3:case 4:}if(null!=e.incrementalColumn&&e.hasOwnProperty("incrementalColumn")&&!a.isString(e.incrementalColumn))return"incrementalColumn: string expected";if(null!=e.uniqueKey&&e.hasOwnProperty("uniqueKey")){if(!Array.isArray(e.uniqueKey))return"uniqueKey: array expected";for(var t=0;t<e.uniqueKey.length;++t)if(!a.isString(e.uniqueKey[t]))return"uniqueKey: string[] expected"}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.LoadModeConfig)return e;var t=new s.sqlanvil.ActionConfig.LoadModeConfig;switch(e.mode){default:if("number"==typeof e.mode){t.mode=e.mode;break}break;case"REPLACE_TABLE":case 0:t.mode=0;break;case"APPEND":case 1:t.mode=1;break;case"MAXIMUM":case 2:t.mode=2;break;case"UNIQUE":case 3:t.mode=3;break;case"MERGE":case 4:t.mode=4}if(null!=e.incrementalColumn&&(t.incrementalColumn=String(e.incrementalColumn)),e.uniqueKey){if(!Array.isArray(e.uniqueKey))throw TypeError(".sqlanvil.ActionConfig.LoadModeConfig.uniqueKey: array expected");t.uniqueKey=[];for(var n=0;n<e.uniqueKey.length;++n)t.uniqueKey[n]=String(e.uniqueKey[n])}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.uniqueKey=[]),t.defaults&&(n.mode=t.enums===String?"REPLACE_TABLE":0,n.incrementalColumn=""),null!=e.mode&&e.hasOwnProperty("mode")&&(n.mode=t.enums===String?void 0===s.sqlanvil.ActionConfig.LoadMode[e.mode]?e.mode:s.sqlanvil.ActionConfig.LoadMode[e.mode]:e.mode),null!=e.incrementalColumn&&e.hasOwnProperty("incrementalColumn")&&(n.incrementalColumn=e.incrementalColumn),e.uniqueKey&&e.uniqueKey.length){n.uniqueKey=[];for(var r=0;r<e.uniqueKey.length;++r)n.uniqueKey[r]=e.uniqueKey[r]}return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.LoadModeConfig"},t}(),t.LoadMode=function(){var e={},t=Object.create(e);return t[e[0]="REPLACE_TABLE"]=0,t[e[1]="APPEND"]=1,t[e[2]="MAXIMUM"]=2,t[e[3]="UNIQUE"]=3,t[e[4]="MERGE"]=4,t}(),t}(),r.RepositorySnapshotDestinationConfig=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.repositorySnapshotUri="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.repositorySnapshotUri&&Object.hasOwnProperty.call(e,"repositorySnapshotUri")&&t.uint32(10).string(e.repositorySnapshotUri),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.RepositorySnapshotDestinationConfig;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?o.repositorySnapshotUri=e.string():e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.repositorySnapshotUri&&e.hasOwnProperty("repositorySnapshotUri")&&!a.isString(e.repositorySnapshotUri)?"repositorySnapshotUri: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.RepositorySnapshotDestinationConfig)return e;var t=new s.sqlanvil.RepositorySnapshotDestinationConfig;return null!=e.repositorySnapshotUri&&(t.repositorySnapshotUri=String(e.repositorySnapshotUri)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.repositorySnapshotUri=""),null!=e.repositorySnapshotUri&&e.hasOwnProperty("repositorySnapshotUri")&&(n.repositorySnapshotUri=e.repositorySnapshotUri),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.RepositorySnapshotDestinationConfig"},t}(),r.NotebookRuntimeOptionsConfig=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var n;return t.prototype.outputBucket=null,t.prototype.runtimeTemplateName="",t.prototype.repositorySnapshotDestination=null,Object.defineProperty(t.prototype,"outputSink",{get:a.oneOfGetter(n=["outputBucket"]),set:a.oneOfSetter(n)}),Object.defineProperty(t.prototype,"repositorySnapshotStorage",{get:a.oneOfGetter(n=["repositorySnapshotDestination"]),set:a.oneOfSetter(n)}),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.outputBucket&&Object.hasOwnProperty.call(e,"outputBucket")&&t.uint32(10).string(e.outputBucket),null!=e.runtimeTemplateName&&Object.hasOwnProperty.call(e,"runtimeTemplateName")&&t.uint32(18).string(e.runtimeTemplateName),null!=e.repositorySnapshotDestination&&Object.hasOwnProperty.call(e,"repositorySnapshotDestination")&&s.sqlanvil.RepositorySnapshotDestinationConfig.encode(e.repositorySnapshotDestination,t.uint32(26).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.NotebookRuntimeOptionsConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.outputBucket=e.string();break;case 2:o.runtimeTemplateName=e.string();break;case 3:o.repositorySnapshotDestination=s.sqlanvil.RepositorySnapshotDestinationConfig.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.outputBucket&&e.hasOwnProperty("outputBucket")&&(t.outputSink=1,!a.isString(e.outputBucket)))return"outputBucket: string expected";if(null!=e.runtimeTemplateName&&e.hasOwnProperty("runtimeTemplateName")&&!a.isString(e.runtimeTemplateName))return"runtimeTemplateName: string expected";if(null!=e.repositorySnapshotDestination&&e.hasOwnProperty("repositorySnapshotDestination")){t.repositorySnapshotStorage=1;var n=s.sqlanvil.RepositorySnapshotDestinationConfig.verify(e.repositorySnapshotDestination);if(n)return"repositorySnapshotDestination."+n}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.NotebookRuntimeOptionsConfig)return e;var t=new s.sqlanvil.NotebookRuntimeOptionsConfig;if(null!=e.outputBucket&&(t.outputBucket=String(e.outputBucket)),null!=e.runtimeTemplateName&&(t.runtimeTemplateName=String(e.runtimeTemplateName)),null!=e.repositorySnapshotDestination){if("object"!=typeof e.repositorySnapshotDestination)throw TypeError(".sqlanvil.NotebookRuntimeOptionsConfig.repositorySnapshotDestination: object expected");t.repositorySnapshotDestination=s.sqlanvil.RepositorySnapshotDestinationConfig.fromObject(e.repositorySnapshotDestination)}return t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.runtimeTemplateName=""),null!=e.outputBucket&&e.hasOwnProperty("outputBucket")&&(n.outputBucket=e.outputBucket,t.oneofs&&(n.outputSink="outputBucket")),null!=e.runtimeTemplateName&&e.hasOwnProperty("runtimeTemplateName")&&(n.runtimeTemplateName=e.runtimeTemplateName),null!=e.repositorySnapshotDestination&&e.hasOwnProperty("repositorySnapshotDestination")&&(n.repositorySnapshotDestination=s.sqlanvil.RepositorySnapshotDestinationConfig.toObject(e.repositorySnapshotDestination,t),t.oneofs&&(n.repositorySnapshotStorage="repositorySnapshotDestination")),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.NotebookRuntimeOptionsConfig"},t}(),r.PostgresOptions=function(){function t(e){if(this.indexes=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.tablespace="",t.prototype.fillfactor=0,t.prototype.unlogged=!1,t.prototype.partition=null,t.prototype.indexes=a.emptyArray,t.prototype.noData=!1,t.prototype.refreshPolicy="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.tablespace&&Object.hasOwnProperty.call(e,"tablespace")&&t.uint32(10).string(e.tablespace),null!=e.fillfactor&&Object.hasOwnProperty.call(e,"fillfactor")&&t.uint32(16).uint32(e.fillfactor),null!=e.unlogged&&Object.hasOwnProperty.call(e,"unlogged")&&t.uint32(24).bool(e.unlogged),null!=e.partition&&Object.hasOwnProperty.call(e,"partition")&&s.sqlanvil.PostgresOptions.Partition.encode(e.partition,t.uint32(34).fork()).ldelim(),null!=e.indexes&&e.indexes.length)for(var n=0;n<e.indexes.length;++n)s.sqlanvil.PostgresOptions.Index.encode(e.indexes[n],t.uint32(42).fork()).ldelim();return null!=e.noData&&Object.hasOwnProperty.call(e,"noData")&&t.uint32(48).bool(e.noData),null!=e.refreshPolicy&&Object.hasOwnProperty.call(e,"refreshPolicy")&&t.uint32(58).string(e.refreshPolicy),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.PostgresOptions;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.tablespace=e.string();break;case 2:o.fillfactor=e.uint32();break;case 3:o.unlogged=e.bool();break;case 4:o.partition=s.sqlanvil.PostgresOptions.Partition.decode(e,e.uint32());break;case 5:o.indexes&&o.indexes.length||(o.indexes=[]),o.indexes.push(s.sqlanvil.PostgresOptions.Index.decode(e,e.uint32()));break;case 6:o.noData=e.bool();break;case 7:o.refreshPolicy=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.tablespace&&e.hasOwnProperty("tablespace")&&!a.isString(e.tablespace))return"tablespace: string expected";if(null!=e.fillfactor&&e.hasOwnProperty("fillfactor")&&!a.isInteger(e.fillfactor))return"fillfactor: integer expected";if(null!=e.unlogged&&e.hasOwnProperty("unlogged")&&"boolean"!=typeof e.unlogged)return"unlogged: boolean expected";if(null!=e.partition&&e.hasOwnProperty("partition")&&(n=s.sqlanvil.PostgresOptions.Partition.verify(e.partition)))return"partition."+n;if(null!=e.indexes&&e.hasOwnProperty("indexes")){if(!Array.isArray(e.indexes))return"indexes: array expected";for(var t=0;t<e.indexes.length;++t){var n;if(n=s.sqlanvil.PostgresOptions.Index.verify(e.indexes[t]))return"indexes."+n}}return null!=e.noData&&e.hasOwnProperty("noData")&&"boolean"!=typeof e.noData?"noData: boolean expected":null!=e.refreshPolicy&&e.hasOwnProperty("refreshPolicy")&&!a.isString(e.refreshPolicy)?"refreshPolicy: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.PostgresOptions)return e;var t=new s.sqlanvil.PostgresOptions;if(null!=e.tablespace&&(t.tablespace=String(e.tablespace)),null!=e.fillfactor&&(t.fillfactor=e.fillfactor>>>0),null!=e.unlogged&&(t.unlogged=Boolean(e.unlogged)),null!=e.partition){if("object"!=typeof e.partition)throw TypeError(".sqlanvil.PostgresOptions.partition: object expected");t.partition=s.sqlanvil.PostgresOptions.Partition.fromObject(e.partition)}if(e.indexes){if(!Array.isArray(e.indexes))throw TypeError(".sqlanvil.PostgresOptions.indexes: array expected");t.indexes=[];for(var n=0;n<e.indexes.length;++n){if("object"!=typeof e.indexes[n])throw TypeError(".sqlanvil.PostgresOptions.indexes: object expected");t.indexes[n]=s.sqlanvil.PostgresOptions.Index.fromObject(e.indexes[n])}}return null!=e.noData&&(t.noData=Boolean(e.noData)),null!=e.refreshPolicy&&(t.refreshPolicy=String(e.refreshPolicy)),t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.indexes=[]),t.defaults&&(n.tablespace="",n.fillfactor=0,n.unlogged=!1,n.partition=null,n.noData=!1,n.refreshPolicy=""),null!=e.tablespace&&e.hasOwnProperty("tablespace")&&(n.tablespace=e.tablespace),null!=e.fillfactor&&e.hasOwnProperty("fillfactor")&&(n.fillfactor=e.fillfactor),null!=e.unlogged&&e.hasOwnProperty("unlogged")&&(n.unlogged=e.unlogged),null!=e.partition&&e.hasOwnProperty("partition")&&(n.partition=s.sqlanvil.PostgresOptions.Partition.toObject(e.partition,t)),e.indexes&&e.indexes.length){n.indexes=[];for(var r=0;r<e.indexes.length;++r)n.indexes[r]=s.sqlanvil.PostgresOptions.Index.toObject(e.indexes[r],t)}return null!=e.noData&&e.hasOwnProperty("noData")&&(n.noData=e.noData),null!=e.refreshPolicy&&e.hasOwnProperty("refreshPolicy")&&(n.refreshPolicy=e.refreshPolicy),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.PostgresOptions"},t.Partition=function(){function t(e){if(this.columns=[],this.partitions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var n,r;return t.prototype.kind=0,t.prototype.columns=a.emptyArray,t.prototype.partitions=a.emptyArray,t.prototype.includeDefault=!1,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.kind&&Object.hasOwnProperty.call(e,"kind")&&t.uint32(8).int32(e.kind),null!=e.columns&&e.columns.length)for(var n=0;n<e.columns.length;++n)t.uint32(18).string(e.columns[n]);if(null!=e.partitions&&e.partitions.length)for(n=0;n<e.partitions.length;++n)s.sqlanvil.PostgresOptions.Partition.Bound.encode(e.partitions[n],t.uint32(26).fork()).ldelim();return null!=e.includeDefault&&Object.hasOwnProperty.call(e,"includeDefault")&&t.uint32(32).bool(e.includeDefault),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.PostgresOptions.Partition;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.kind=e.int32();break;case 2:o.columns&&o.columns.length||(o.columns=[]),o.columns.push(e.string());break;case 3:o.partitions&&o.partitions.length||(o.partitions=[]),o.partitions.push(s.sqlanvil.PostgresOptions.Partition.Bound.decode(e,e.uint32()));break;case 4:o.includeDefault=e.bool();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.kind&&e.hasOwnProperty("kind"))switch(e.kind){default:return"kind: enum value expected";case 0:case 1:case 2:}if(null!=e.columns&&e.hasOwnProperty("columns")){if(!Array.isArray(e.columns))return"columns: array expected";for(var t=0;t<e.columns.length;++t)if(!a.isString(e.columns[t]))return"columns: string[] expected"}if(null!=e.partitions&&e.hasOwnProperty("partitions")){if(!Array.isArray(e.partitions))return"partitions: array expected";for(t=0;t<e.partitions.length;++t){var n=s.sqlanvil.PostgresOptions.Partition.Bound.verify(e.partitions[t]);if(n)return"partitions."+n}}return null!=e.includeDefault&&e.hasOwnProperty("includeDefault")&&"boolean"!=typeof e.includeDefault?"includeDefault: boolean expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.PostgresOptions.Partition)return e;var t=new s.sqlanvil.PostgresOptions.Partition;switch(e.kind){default:if("number"==typeof e.kind){t.kind=e.kind;break}break;case"RANGE":case 0:t.kind=0;break;case"LIST":case 1:t.kind=1;break;case"HASH":case 2:t.kind=2}if(e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.PostgresOptions.Partition.columns: array expected");t.columns=[];for(var n=0;n<e.columns.length;++n)t.columns[n]=String(e.columns[n])}if(e.partitions){if(!Array.isArray(e.partitions))throw TypeError(".sqlanvil.PostgresOptions.Partition.partitions: array expected");for(t.partitions=[],n=0;n<e.partitions.length;++n){if("object"!=typeof e.partitions[n])throw TypeError(".sqlanvil.PostgresOptions.Partition.partitions: object expected");t.partitions[n]=s.sqlanvil.PostgresOptions.Partition.Bound.fromObject(e.partitions[n])}}return null!=e.includeDefault&&(t.includeDefault=Boolean(e.includeDefault)),t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.columns=[],n.partitions=[]),t.defaults&&(n.kind=t.enums===String?"RANGE":0,n.includeDefault=!1),null!=e.kind&&e.hasOwnProperty("kind")&&(n.kind=t.enums===String?void 0===s.sqlanvil.PostgresOptions.Partition.Kind[e.kind]?e.kind:s.sqlanvil.PostgresOptions.Partition.Kind[e.kind]:e.kind),e.columns&&e.columns.length){n.columns=[];for(var r=0;r<e.columns.length;++r)n.columns[r]=e.columns[r]}if(e.partitions&&e.partitions.length)for(n.partitions=[],r=0;r<e.partitions.length;++r)n.partitions[r]=s.sqlanvil.PostgresOptions.Partition.Bound.toObject(e.partitions[r],t);return null!=e.includeDefault&&e.hasOwnProperty("includeDefault")&&(n.includeDefault=e.includeDefault),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.PostgresOptions.Partition"},t.Kind=(n={},(r=Object.create(n))[n[0]="RANGE"]=0,r[n[1]="LIST"]=1,r[n[2]="HASH"]=2,r),t.Bound=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.values="",t.prototype.subPartition=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.values&&Object.hasOwnProperty.call(e,"values")&&t.uint32(18).string(e.values),null!=e.subPartition&&Object.hasOwnProperty.call(e,"subPartition")&&s.sqlanvil.PostgresOptions.Partition.encode(e.subPartition,t.uint32(26).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.PostgresOptions.Partition.Bound;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.name=e.string();break;case 2:o.values=e.string();break;case 3:o.subPartition=s.sqlanvil.PostgresOptions.Partition.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.values&&e.hasOwnProperty("values")&&!a.isString(e.values))return"values: string expected";if(null!=e.subPartition&&e.hasOwnProperty("subPartition")){var t=s.sqlanvil.PostgresOptions.Partition.verify(e.subPartition);if(t)return"subPartition."+t}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.PostgresOptions.Partition.Bound)return e;var t=new s.sqlanvil.PostgresOptions.Partition.Bound;if(null!=e.name&&(t.name=String(e.name)),null!=e.values&&(t.values=String(e.values)),null!=e.subPartition){if("object"!=typeof e.subPartition)throw TypeError(".sqlanvil.PostgresOptions.Partition.Bound.subPartition: object expected");t.subPartition=s.sqlanvil.PostgresOptions.Partition.fromObject(e.subPartition)}return t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.name="",n.values="",n.subPartition=null),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.values&&e.hasOwnProperty("values")&&(n.values=e.values),null!=e.subPartition&&e.hasOwnProperty("subPartition")&&(n.subPartition=s.sqlanvil.PostgresOptions.Partition.toObject(e.subPartition,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.PostgresOptions.Partition.Bound"},t}(),t}(),t.Index=function(){function t(e){if(this.columns=[],this.include=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var n,r;return t.prototype.name="",t.prototype.columns=a.emptyArray,t.prototype.method=0,t.prototype.where="",t.prototype.unique=!1,t.prototype.include=a.emptyArray,t.prototype.opclass="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.columns&&e.columns.length)for(var n=0;n<e.columns.length;++n)t.uint32(18).string(e.columns[n]);if(null!=e.method&&Object.hasOwnProperty.call(e,"method")&&t.uint32(24).int32(e.method),null!=e.where&&Object.hasOwnProperty.call(e,"where")&&t.uint32(34).string(e.where),null!=e.unique&&Object.hasOwnProperty.call(e,"unique")&&t.uint32(40).bool(e.unique),null!=e.include&&e.include.length)for(n=0;n<e.include.length;++n)t.uint32(50).string(e.include[n]);return null!=e.opclass&&Object.hasOwnProperty.call(e,"opclass")&&t.uint32(58).string(e.opclass),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.PostgresOptions.Index;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.name=e.string();break;case 2:o.columns&&o.columns.length||(o.columns=[]),o.columns.push(e.string());break;case 3:o.method=e.int32();break;case 4:o.where=e.string();break;case 5:o.unique=e.bool();break;case 6:o.include&&o.include.length||(o.include=[]),o.include.push(e.string());break;case 7:o.opclass=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.columns&&e.hasOwnProperty("columns")){if(!Array.isArray(e.columns))return"columns: array expected";for(var t=0;t<e.columns.length;++t)if(!a.isString(e.columns[t]))return"columns: string[] expected"}if(null!=e.method&&e.hasOwnProperty("method"))switch(e.method){default:return"method: enum value expected";case 0:case 1:case 2:case 3:case 4:}if(null!=e.where&&e.hasOwnProperty("where")&&!a.isString(e.where))return"where: string expected";if(null!=e.unique&&e.hasOwnProperty("unique")&&"boolean"!=typeof e.unique)return"unique: boolean expected";if(null!=e.include&&e.hasOwnProperty("include")){if(!Array.isArray(e.include))return"include: array expected";for(t=0;t<e.include.length;++t)if(!a.isString(e.include[t]))return"include: string[] expected"}return null!=e.opclass&&e.hasOwnProperty("opclass")&&!a.isString(e.opclass)?"opclass: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.PostgresOptions.Index)return e;var t=new s.sqlanvil.PostgresOptions.Index;if(null!=e.name&&(t.name=String(e.name)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.PostgresOptions.Index.columns: array expected");t.columns=[];for(var n=0;n<e.columns.length;++n)t.columns[n]=String(e.columns[n])}switch(e.method){default:if("number"==typeof e.method){t.method=e.method;break}break;case"BTREE":case 0:t.method=0;break;case"HASH":case 1:t.method=1;break;case"GIN":case 2:t.method=2;break;case"GIST":case 3:t.method=3;break;case"BRIN":case 4:t.method=4}if(null!=e.where&&(t.where=String(e.where)),null!=e.unique&&(t.unique=Boolean(e.unique)),e.include){if(!Array.isArray(e.include))throw TypeError(".sqlanvil.PostgresOptions.Index.include: array expected");for(t.include=[],n=0;n<e.include.length;++n)t.include[n]=String(e.include[n])}return null!=e.opclass&&(t.opclass=String(e.opclass)),t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.columns=[],n.include=[]),t.defaults&&(n.name="",n.method=t.enums===String?"BTREE":0,n.where="",n.unique=!1,n.opclass=""),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),e.columns&&e.columns.length){n.columns=[];for(var r=0;r<e.columns.length;++r)n.columns[r]=e.columns[r]}if(null!=e.method&&e.hasOwnProperty("method")&&(n.method=t.enums===String?void 0===s.sqlanvil.PostgresOptions.Index.Method[e.method]?e.method:s.sqlanvil.PostgresOptions.Index.Method[e.method]:e.method),null!=e.where&&e.hasOwnProperty("where")&&(n.where=e.where),null!=e.unique&&e.hasOwnProperty("unique")&&(n.unique=e.unique),e.include&&e.include.length)for(n.include=[],r=0;r<e.include.length;++r)n.include[r]=e.include[r];return null!=e.opclass&&e.hasOwnProperty("opclass")&&(n.opclass=e.opclass),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.PostgresOptions.Index"},t.Method=(n={},(r=Object.create(n))[n[0]="BTREE"]=0,r[n[1]="HASH"]=1,r[n[2]="GIN"]=2,r[n[3]="GIST"]=3,r[n[4]="BRIN"]=4,r),t}(),t}(),r.SupabaseOptions=function(){function t(e){if(this.vectors=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.postgres=null,t.prototype.publishToRealtime=!1,t.prototype.enableRls=!1,t.prototype.ownerRole="",t.prototype.vectors=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.postgres&&Object.hasOwnProperty.call(e,"postgres")&&s.sqlanvil.PostgresOptions.encode(e.postgres,t.uint32(10).fork()).ldelim(),null!=e.publishToRealtime&&Object.hasOwnProperty.call(e,"publishToRealtime")&&t.uint32(16).bool(e.publishToRealtime),null!=e.enableRls&&Object.hasOwnProperty.call(e,"enableRls")&&t.uint32(24).bool(e.enableRls),null!=e.ownerRole&&Object.hasOwnProperty.call(e,"ownerRole")&&t.uint32(34).string(e.ownerRole),null!=e.vectors&&e.vectors.length)for(var n=0;n<e.vectors.length;++n)s.sqlanvil.SupabaseOptions.VectorConfig.encode(e.vectors[n],t.uint32(42).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.SupabaseOptions;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.postgres=s.sqlanvil.PostgresOptions.decode(e,e.uint32());break;case 2:o.publishToRealtime=e.bool();break;case 3:o.enableRls=e.bool();break;case 4:o.ownerRole=e.string();break;case 5:o.vectors&&o.vectors.length||(o.vectors=[]),o.vectors.push(s.sqlanvil.SupabaseOptions.VectorConfig.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.postgres&&e.hasOwnProperty("postgres")&&(n=s.sqlanvil.PostgresOptions.verify(e.postgres)))return"postgres."+n;if(null!=e.publishToRealtime&&e.hasOwnProperty("publishToRealtime")&&"boolean"!=typeof e.publishToRealtime)return"publishToRealtime: boolean expected";if(null!=e.enableRls&&e.hasOwnProperty("enableRls")&&"boolean"!=typeof e.enableRls)return"enableRls: boolean expected";if(null!=e.ownerRole&&e.hasOwnProperty("ownerRole")&&!a.isString(e.ownerRole))return"ownerRole: string expected";if(null!=e.vectors&&e.hasOwnProperty("vectors")){if(!Array.isArray(e.vectors))return"vectors: array expected";for(var t=0;t<e.vectors.length;++t){var n;if(n=s.sqlanvil.SupabaseOptions.VectorConfig.verify(e.vectors[t]))return"vectors."+n}}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.SupabaseOptions)return e;var t=new s.sqlanvil.SupabaseOptions;if(null!=e.postgres){if("object"!=typeof e.postgres)throw TypeError(".sqlanvil.SupabaseOptions.postgres: object expected");t.postgres=s.sqlanvil.PostgresOptions.fromObject(e.postgres)}if(null!=e.publishToRealtime&&(t.publishToRealtime=Boolean(e.publishToRealtime)),null!=e.enableRls&&(t.enableRls=Boolean(e.enableRls)),null!=e.ownerRole&&(t.ownerRole=String(e.ownerRole)),e.vectors){if(!Array.isArray(e.vectors))throw TypeError(".sqlanvil.SupabaseOptions.vectors: array expected");t.vectors=[];for(var n=0;n<e.vectors.length;++n){if("object"!=typeof e.vectors[n])throw TypeError(".sqlanvil.SupabaseOptions.vectors: object expected");t.vectors[n]=s.sqlanvil.SupabaseOptions.VectorConfig.fromObject(e.vectors[n])}}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.vectors=[]),t.defaults&&(n.postgres=null,n.publishToRealtime=!1,n.enableRls=!1,n.ownerRole=""),null!=e.postgres&&e.hasOwnProperty("postgres")&&(n.postgres=s.sqlanvil.PostgresOptions.toObject(e.postgres,t)),null!=e.publishToRealtime&&e.hasOwnProperty("publishToRealtime")&&(n.publishToRealtime=e.publishToRealtime),null!=e.enableRls&&e.hasOwnProperty("enableRls")&&(n.enableRls=e.enableRls),null!=e.ownerRole&&e.hasOwnProperty("ownerRole")&&(n.ownerRole=e.ownerRole),e.vectors&&e.vectors.length){n.vectors=[];for(var r=0;r<e.vectors.length;++r)n.vectors[r]=s.sqlanvil.SupabaseOptions.VectorConfig.toObject(e.vectors[r],t)}return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.SupabaseOptions"},t.VectorConfig=function(){function t(e){if(this.params={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var n,r;return t.prototype.column="",t.prototype.dimensions=0,t.prototype.indexType=0,t.prototype.params=a.emptyObject,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.column&&Object.hasOwnProperty.call(e,"column")&&t.uint32(10).string(e.column),null!=e.dimensions&&Object.hasOwnProperty.call(e,"dimensions")&&t.uint32(16).uint32(e.dimensions),null!=e.indexType&&Object.hasOwnProperty.call(e,"indexType")&&t.uint32(24).int32(e.indexType),null!=e.params&&Object.hasOwnProperty.call(e,"params"))for(var n=Object.keys(e.params),r=0;r<n.length;++r)t.uint32(34).fork().uint32(10).string(n[r]).uint32(18).string(e.params[n[r]]).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r,o,l=void 0===t?e.len:e.pos+t,c=new s.sqlanvil.SupabaseOptions.VectorConfig;e.pos<l;){var u=e.uint32();if(u===n)break;switch(u>>>3){case 1:c.column=e.string();break;case 2:c.dimensions=e.uint32();break;case 3:c.indexType=e.int32();break;case 4:c.params===a.emptyObject&&(c.params={});var p=e.uint32()+e.pos;for(r="",o="";e.pos<p;){var f=e.uint32();switch(f>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}}c.params[r]=o;break;default:e.skipType(7&u)}}return c},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.column&&e.hasOwnProperty("column")&&!a.isString(e.column))return"column: string expected";if(null!=e.dimensions&&e.hasOwnProperty("dimensions")&&!a.isInteger(e.dimensions))return"dimensions: integer expected";if(null!=e.indexType&&e.hasOwnProperty("indexType"))switch(e.indexType){default:return"indexType: enum value expected";case 0:case 1:}if(null!=e.params&&e.hasOwnProperty("params")){if(!a.isObject(e.params))return"params: object expected";for(var t=Object.keys(e.params),n=0;n<t.length;++n)if(!a.isString(e.params[t[n]]))return"params: string{k:string} expected"}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.SupabaseOptions.VectorConfig)return e;var t=new s.sqlanvil.SupabaseOptions.VectorConfig;switch(null!=e.column&&(t.column=String(e.column)),null!=e.dimensions&&(t.dimensions=e.dimensions>>>0),e.indexType){default:if("number"==typeof e.indexType){t.indexType=e.indexType;break}break;case"IVFFLAT":case 0:t.indexType=0;break;case"HNSW":case 1:t.indexType=1}if(e.params){if("object"!=typeof e.params)throw TypeError(".sqlanvil.SupabaseOptions.VectorConfig.params: object expected");t.params={};for(var n=Object.keys(e.params),r=0;r<n.length;++r)t.params[n[r]]=String(e.params[n[r]])}return t},t.toObject=function(e,t){t||(t={});var n,r={};if((t.objects||t.defaults)&&(r.params={}),t.defaults&&(r.column="",r.dimensions=0,r.indexType=t.enums===String?"IVFFLAT":0),null!=e.column&&e.hasOwnProperty("column")&&(r.column=e.column),null!=e.dimensions&&e.hasOwnProperty("dimensions")&&(r.dimensions=e.dimensions),null!=e.indexType&&e.hasOwnProperty("indexType")&&(r.indexType=t.enums===String?void 0===s.sqlanvil.SupabaseOptions.VectorConfig.IndexType[e.indexType]?e.indexType:s.sqlanvil.SupabaseOptions.VectorConfig.IndexType[e.indexType]:e.indexType),e.params&&(n=Object.keys(e.params)).length){r.params={};for(var i=0;i<n.length;++i)r.params[n[i]]=e.params[n[i]]}return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.SupabaseOptions.VectorConfig"},t.IndexType=(n={},(r=Object.create(n))[n[0]="IVFFLAT"]=0,r[n[1]="HNSW"]=1,r),t}(),t}(),r.BigQueryConnection=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.project="",t.prototype.location="",t.prototype.defaultDataset="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.project&&Object.hasOwnProperty.call(e,"project")&&t.uint32(10).string(e.project),null!=e.location&&Object.hasOwnProperty.call(e,"location")&&t.uint32(18).string(e.location),null!=e.defaultDataset&&Object.hasOwnProperty.call(e,"defaultDataset")&&t.uint32(26).string(e.defaultDataset),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.BigQueryConnection;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.project=e.string();break;case 2:o.location=e.string();break;case 3:o.defaultDataset=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.project&&e.hasOwnProperty("project")&&!a.isString(e.project)?"project: string expected":null!=e.location&&e.hasOwnProperty("location")&&!a.isString(e.location)?"location: string expected":null!=e.defaultDataset&&e.hasOwnProperty("defaultDataset")&&!a.isString(e.defaultDataset)?"defaultDataset: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.BigQueryConnection)return e;var t=new s.sqlanvil.BigQueryConnection;return null!=e.project&&(t.project=String(e.project)),null!=e.location&&(t.location=String(e.location)),null!=e.defaultDataset&&(t.defaultDataset=String(e.defaultDataset)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.project="",n.location="",n.defaultDataset=""),null!=e.project&&e.hasOwnProperty("project")&&(n.project=e.project),null!=e.location&&e.hasOwnProperty("location")&&(n.location=e.location),null!=e.defaultDataset&&e.hasOwnProperty("defaultDataset")&&(n.defaultDataset=e.defaultDataset),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.BigQueryConnection"},t}(),r.PostgresConnection=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.host="",t.prototype.port=0,t.prototype.database="",t.prototype.user="",t.prototype.password="",t.prototype.sslMode="",t.prototype.defaultSchema="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.host&&Object.hasOwnProperty.call(e,"host")&&t.uint32(10).string(e.host),null!=e.port&&Object.hasOwnProperty.call(e,"port")&&t.uint32(16).uint32(e.port),null!=e.database&&Object.hasOwnProperty.call(e,"database")&&t.uint32(26).string(e.database),null!=e.user&&Object.hasOwnProperty.call(e,"user")&&t.uint32(34).string(e.user),null!=e.password&&Object.hasOwnProperty.call(e,"password")&&t.uint32(42).string(e.password),null!=e.sslMode&&Object.hasOwnProperty.call(e,"sslMode")&&t.uint32(50).string(e.sslMode),null!=e.defaultSchema&&Object.hasOwnProperty.call(e,"defaultSchema")&&t.uint32(58).string(e.defaultSchema),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.PostgresConnection;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.host=e.string();break;case 2:o.port=e.uint32();break;case 3:o.database=e.string();break;case 4:o.user=e.string();break;case 5:o.password=e.string();break;case 6:o.sslMode=e.string();break;case 7:o.defaultSchema=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.host&&e.hasOwnProperty("host")&&!a.isString(e.host)?"host: string expected":null!=e.port&&e.hasOwnProperty("port")&&!a.isInteger(e.port)?"port: integer expected":null!=e.database&&e.hasOwnProperty("database")&&!a.isString(e.database)?"database: string expected":null!=e.user&&e.hasOwnProperty("user")&&!a.isString(e.user)?"user: string expected":null!=e.password&&e.hasOwnProperty("password")&&!a.isString(e.password)?"password: string expected":null!=e.sslMode&&e.hasOwnProperty("sslMode")&&!a.isString(e.sslMode)?"sslMode: string expected":null!=e.defaultSchema&&e.hasOwnProperty("defaultSchema")&&!a.isString(e.defaultSchema)?"defaultSchema: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.PostgresConnection)return e;var t=new s.sqlanvil.PostgresConnection;return null!=e.host&&(t.host=String(e.host)),null!=e.port&&(t.port=e.port>>>0),null!=e.database&&(t.database=String(e.database)),null!=e.user&&(t.user=String(e.user)),null!=e.password&&(t.password=String(e.password)),null!=e.sslMode&&(t.sslMode=String(e.sslMode)),null!=e.defaultSchema&&(t.defaultSchema=String(e.defaultSchema)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.host="",n.port=0,n.database="",n.user="",n.password="",n.sslMode="",n.defaultSchema=""),null!=e.host&&e.hasOwnProperty("host")&&(n.host=e.host),null!=e.port&&e.hasOwnProperty("port")&&(n.port=e.port),null!=e.database&&e.hasOwnProperty("database")&&(n.database=e.database),null!=e.user&&e.hasOwnProperty("user")&&(n.user=e.user),null!=e.password&&e.hasOwnProperty("password")&&(n.password=e.password),null!=e.sslMode&&e.hasOwnProperty("sslMode")&&(n.sslMode=e.sslMode),null!=e.defaultSchema&&e.hasOwnProperty("defaultSchema")&&(n.defaultSchema=e.defaultSchema),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.PostgresConnection"},t}(),r.SupabaseConnection=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.projectRef="",t.prototype.serviceRoleKey="",t.prototype.defaultSchema="",t.prototype.connectionString="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.projectRef&&Object.hasOwnProperty.call(e,"projectRef")&&t.uint32(10).string(e.projectRef),null!=e.serviceRoleKey&&Object.hasOwnProperty.call(e,"serviceRoleKey")&&t.uint32(18).string(e.serviceRoleKey),null!=e.defaultSchema&&Object.hasOwnProperty.call(e,"defaultSchema")&&t.uint32(26).string(e.defaultSchema),null!=e.connectionString&&Object.hasOwnProperty.call(e,"connectionString")&&t.uint32(34).string(e.connectionString),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.SupabaseConnection;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.projectRef=e.string();break;case 2:o.serviceRoleKey=e.string();break;case 3:o.defaultSchema=e.string();break;case 4:o.connectionString=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.projectRef&&e.hasOwnProperty("projectRef")&&!a.isString(e.projectRef)?"projectRef: string expected":null!=e.serviceRoleKey&&e.hasOwnProperty("serviceRoleKey")&&!a.isString(e.serviceRoleKey)?"serviceRoleKey: string expected":null!=e.defaultSchema&&e.hasOwnProperty("defaultSchema")&&!a.isString(e.defaultSchema)?"defaultSchema: string expected":null!=e.connectionString&&e.hasOwnProperty("connectionString")&&!a.isString(e.connectionString)?"connectionString: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.SupabaseConnection)return e;var t=new s.sqlanvil.SupabaseConnection;return null!=e.projectRef&&(t.projectRef=String(e.projectRef)),null!=e.serviceRoleKey&&(t.serviceRoleKey=String(e.serviceRoleKey)),null!=e.defaultSchema&&(t.defaultSchema=String(e.defaultSchema)),null!=e.connectionString&&(t.connectionString=String(e.connectionString)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.projectRef="",n.serviceRoleKey="",n.defaultSchema="",n.connectionString=""),null!=e.projectRef&&e.hasOwnProperty("projectRef")&&(n.projectRef=e.projectRef),null!=e.serviceRoleKey&&e.hasOwnProperty("serviceRoleKey")&&(n.serviceRoleKey=e.serviceRoleKey),null!=e.defaultSchema&&e.hasOwnProperty("defaultSchema")&&(n.defaultSchema=e.defaultSchema),null!=e.connectionString&&e.hasOwnProperty("connectionString")&&(n.connectionString=e.connectionString),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.SupabaseConnection"},t}(),r.MysqlConnection=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.host="",t.prototype.port=0,t.prototype.database="",t.prototype.user="",t.prototype.password="",t.prototype.sslMode="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.host&&Object.hasOwnProperty.call(e,"host")&&t.uint32(10).string(e.host),null!=e.port&&Object.hasOwnProperty.call(e,"port")&&t.uint32(16).uint32(e.port),null!=e.database&&Object.hasOwnProperty.call(e,"database")&&t.uint32(26).string(e.database),null!=e.user&&Object.hasOwnProperty.call(e,"user")&&t.uint32(34).string(e.user),null!=e.password&&Object.hasOwnProperty.call(e,"password")&&t.uint32(42).string(e.password),null!=e.sslMode&&Object.hasOwnProperty.call(e,"sslMode")&&t.uint32(50).string(e.sslMode),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.MysqlConnection;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.host=e.string();break;case 2:o.port=e.uint32();break;case 3:o.database=e.string();break;case 4:o.user=e.string();break;case 5:o.password=e.string();break;case 6:o.sslMode=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.host&&e.hasOwnProperty("host")&&!a.isString(e.host)?"host: string expected":null!=e.port&&e.hasOwnProperty("port")&&!a.isInteger(e.port)?"port: integer expected":null!=e.database&&e.hasOwnProperty("database")&&!a.isString(e.database)?"database: string expected":null!=e.user&&e.hasOwnProperty("user")&&!a.isString(e.user)?"user: string expected":null!=e.password&&e.hasOwnProperty("password")&&!a.isString(e.password)?"password: string expected":null!=e.sslMode&&e.hasOwnProperty("sslMode")&&!a.isString(e.sslMode)?"sslMode: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.MysqlConnection)return e;var t=new s.sqlanvil.MysqlConnection;return null!=e.host&&(t.host=String(e.host)),null!=e.port&&(t.port=e.port>>>0),null!=e.database&&(t.database=String(e.database)),null!=e.user&&(t.user=String(e.user)),null!=e.password&&(t.password=String(e.password)),null!=e.sslMode&&(t.sslMode=String(e.sslMode)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.host="",n.port=0,n.database="",n.user="",n.password="",n.sslMode=""),null!=e.host&&e.hasOwnProperty("host")&&(n.host=e.host),null!=e.port&&e.hasOwnProperty("port")&&(n.port=e.port),null!=e.database&&e.hasOwnProperty("database")&&(n.database=e.database),null!=e.user&&e.hasOwnProperty("user")&&(n.user=e.user),null!=e.password&&e.hasOwnProperty("password")&&(n.password=e.password),null!=e.sslMode&&e.hasOwnProperty("sslMode")&&(n.sslMode=e.sslMode),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.MysqlConnection"},t}(),r.WarehouseConfig=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var n;return t.prototype.bigquery=null,t.prototype.postgres=null,t.prototype.supabase=null,t.prototype.mysql=null,Object.defineProperty(t.prototype,"connection",{get:a.oneOfGetter(n=["bigquery","postgres","supabase","mysql"]),set:a.oneOfSetter(n)}),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.bigquery&&Object.hasOwnProperty.call(e,"bigquery")&&s.sqlanvil.BigQueryConnection.encode(e.bigquery,t.uint32(10).fork()).ldelim(),null!=e.postgres&&Object.hasOwnProperty.call(e,"postgres")&&s.sqlanvil.PostgresConnection.encode(e.postgres,t.uint32(18).fork()).ldelim(),null!=e.supabase&&Object.hasOwnProperty.call(e,"supabase")&&s.sqlanvil.SupabaseConnection.encode(e.supabase,t.uint32(26).fork()).ldelim(),null!=e.mysql&&Object.hasOwnProperty.call(e,"mysql")&&s.sqlanvil.MysqlConnection.encode(e.mysql,t.uint32(34).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.WarehouseConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.bigquery=s.sqlanvil.BigQueryConnection.decode(e,e.uint32());break;case 2:o.postgres=s.sqlanvil.PostgresConnection.decode(e,e.uint32());break;case 3:o.supabase=s.sqlanvil.SupabaseConnection.decode(e,e.uint32());break;case 4:o.mysql=s.sqlanvil.MysqlConnection.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.bigquery&&e.hasOwnProperty("bigquery")&&(t.connection=1,n=s.sqlanvil.BigQueryConnection.verify(e.bigquery)))return"bigquery."+n;if(null!=e.postgres&&e.hasOwnProperty("postgres")){if(1===t.connection)return"connection: multiple values";if(t.connection=1,n=s.sqlanvil.PostgresConnection.verify(e.postgres))return"postgres."+n}if(null!=e.supabase&&e.hasOwnProperty("supabase")){if(1===t.connection)return"connection: multiple values";if(t.connection=1,n=s.sqlanvil.SupabaseConnection.verify(e.supabase))return"supabase."+n}if(null!=e.mysql&&e.hasOwnProperty("mysql")){if(1===t.connection)return"connection: multiple values";var n;if(t.connection=1,n=s.sqlanvil.MysqlConnection.verify(e.mysql))return"mysql."+n}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.WarehouseConfig)return e;var t=new s.sqlanvil.WarehouseConfig;if(null!=e.bigquery){if("object"!=typeof e.bigquery)throw TypeError(".sqlanvil.WarehouseConfig.bigquery: object expected");t.bigquery=s.sqlanvil.BigQueryConnection.fromObject(e.bigquery)}if(null!=e.postgres){if("object"!=typeof e.postgres)throw TypeError(".sqlanvil.WarehouseConfig.postgres: object expected");t.postgres=s.sqlanvil.PostgresConnection.fromObject(e.postgres)}if(null!=e.supabase){if("object"!=typeof e.supabase)throw TypeError(".sqlanvil.WarehouseConfig.supabase: object expected");t.supabase=s.sqlanvil.SupabaseConnection.fromObject(e.supabase)}if(null!=e.mysql){if("object"!=typeof e.mysql)throw TypeError(".sqlanvil.WarehouseConfig.mysql: object expected");t.mysql=s.sqlanvil.MysqlConnection.fromObject(e.mysql)}return t},t.toObject=function(e,t){t||(t={});var n={};return null!=e.bigquery&&e.hasOwnProperty("bigquery")&&(n.bigquery=s.sqlanvil.BigQueryConnection.toObject(e.bigquery,t),t.oneofs&&(n.connection="bigquery")),null!=e.postgres&&e.hasOwnProperty("postgres")&&(n.postgres=s.sqlanvil.PostgresConnection.toObject(e.postgres,t),t.oneofs&&(n.connection="postgres")),null!=e.supabase&&e.hasOwnProperty("supabase")&&(n.supabase=s.sqlanvil.SupabaseConnection.toObject(e.supabase,t),t.oneofs&&(n.connection="supabase")),null!=e.mysql&&e.hasOwnProperty("mysql")&&(n.mysql=s.sqlanvil.MysqlConnection.toObject(e.mysql,t),t.oneofs&&(n.connection="mysql")),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.WarehouseConfig"},t}(),r.ExtensionCompilationMode=(t={},(n=Object.create(t))[t[0]="COMPILATION_MODE_UNSPECIFIED"]=0,n[t[1]="PROLOGUE"]=1,n[t[2]="APPLICATION_CODE"]=2,n),r.Extension=function(){function t(e){if(this.options={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.compilationMode=0,t.prototype.options=a.emptyObject,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.compilationMode&&Object.hasOwnProperty.call(e,"compilationMode")&&t.uint32(16).int32(e.compilationMode),null!=e.options&&Object.hasOwnProperty.call(e,"options"))for(var n=Object.keys(e.options),r=0;r<n.length;++r)t.uint32(26).fork().uint32(10).string(n[r]).uint32(18).string(e.options[n[r]]).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r,o,l=void 0===t?e.len:e.pos+t,c=new s.sqlanvil.Extension;e.pos<l;){var u=e.uint32();if(u===n)break;switch(u>>>3){case 1:c.name=e.string();break;case 2:c.compilationMode=e.int32();break;case 3:c.options===a.emptyObject&&(c.options={});var p=e.uint32()+e.pos;for(r="",o="";e.pos<p;){var f=e.uint32();switch(f>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}}c.options[r]=o;break;default:e.skipType(7&u)}}return c},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.compilationMode&&e.hasOwnProperty("compilationMode"))switch(e.compilationMode){default:return"compilationMode: enum value expected";case 0:case 1:case 2:}if(null!=e.options&&e.hasOwnProperty("options")){if(!a.isObject(e.options))return"options: object expected";for(var t=Object.keys(e.options),n=0;n<t.length;++n)if(!a.isString(e.options[t[n]]))return"options: string{k:string} expected"}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.Extension)return e;var t=new s.sqlanvil.Extension;switch(null!=e.name&&(t.name=String(e.name)),e.compilationMode){default:if("number"==typeof e.compilationMode){t.compilationMode=e.compilationMode;break}break;case"COMPILATION_MODE_UNSPECIFIED":case 0:t.compilationMode=0;break;case"PROLOGUE":case 1:t.compilationMode=1;break;case"APPLICATION_CODE":case 2:t.compilationMode=2}if(e.options){if("object"!=typeof e.options)throw TypeError(".sqlanvil.Extension.options: object expected");t.options={};for(var n=Object.keys(e.options),r=0;r<n.length;++r)t.options[n[r]]=String(e.options[n[r]])}return t},t.toObject=function(e,t){t||(t={});var n,r={};if((t.objects||t.defaults)&&(r.options={}),t.defaults&&(r.name="",r.compilationMode=t.enums===String?"COMPILATION_MODE_UNSPECIFIED":0),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),null!=e.compilationMode&&e.hasOwnProperty("compilationMode")&&(r.compilationMode=t.enums===String?void 0===s.sqlanvil.ExtensionCompilationMode[e.compilationMode]?e.compilationMode:s.sqlanvil.ExtensionCompilationMode[e.compilationMode]:e.compilationMode),e.options&&(n=Object.keys(e.options)).length){r.options={};for(var i=0;i<n.length;++i)r.options[n[i]]=e.options[n[i]]}return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.Extension"},t}(),r.ProjectConfig=function(){function t(e){if(this.vars={},this.connections={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.warehouse="",t.prototype.defaultDatabase="",t.prototype.defaultSchema="",t.prototype.defaultLocation="",t.prototype.assertionSchema="",t.prototype.vars=a.emptyObject,t.prototype.databaseSuffix="",t.prototype.schemaSuffix="",t.prototype.tablePrefix="",t.prototype.builtinAssertionNamePrefix="",t.prototype.defaultNotebookRuntimeOptions=null,t.prototype.defaultIcebergConfig=null,t.prototype.disableAssertions=!1,t.prototype.defaultReservation="",t.prototype.includeTestsInCompiledGraph=!1,t.prototype.connections=a.emptyObject,t.prototype.warehouseConnection="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.warehouse&&Object.hasOwnProperty.call(e,"warehouse")&&t.uint32(10).string(e.warehouse),null!=e.defaultSchema&&Object.hasOwnProperty.call(e,"defaultSchema")&&t.uint32(18).string(e.defaultSchema),null!=e.assertionSchema&&Object.hasOwnProperty.call(e,"assertionSchema")&&t.uint32(42).string(e.assertionSchema),null!=e.schemaSuffix&&Object.hasOwnProperty.call(e,"schemaSuffix")&&t.uint32(58).string(e.schemaSuffix),null!=e.defaultDatabase&&Object.hasOwnProperty.call(e,"defaultDatabase")&&t.uint32(74).string(e.defaultDatabase),null!=e.tablePrefix&&Object.hasOwnProperty.call(e,"tablePrefix")&&t.uint32(90).string(e.tablePrefix),null!=e.vars&&Object.hasOwnProperty.call(e,"vars"))for(var n=Object.keys(e.vars),r=0;r<n.length;++r)t.uint32(114).fork().uint32(10).string(n[r]).uint32(18).string(e.vars[n[r]]).ldelim();if(null!=e.databaseSuffix&&Object.hasOwnProperty.call(e,"databaseSuffix")&&t.uint32(122).string(e.databaseSuffix),null!=e.defaultLocation&&Object.hasOwnProperty.call(e,"defaultLocation")&&t.uint32(130).string(e.defaultLocation),null!=e.defaultNotebookRuntimeOptions&&Object.hasOwnProperty.call(e,"defaultNotebookRuntimeOptions")&&s.sqlanvil.NotebookRuntimeOptions.encode(e.defaultNotebookRuntimeOptions,t.uint32(138).fork()).ldelim(),null!=e.builtinAssertionNamePrefix&&Object.hasOwnProperty.call(e,"builtinAssertionNamePrefix")&&t.uint32(146).string(e.builtinAssertionNamePrefix),null!=e.defaultIcebergConfig&&Object.hasOwnProperty.call(e,"defaultIcebergConfig")&&s.sqlanvil.DefaultIcebergConfig.encode(e.defaultIcebergConfig,t.uint32(154).fork()).ldelim(),null!=e.disableAssertions&&Object.hasOwnProperty.call(e,"disableAssertions")&&t.uint32(160).bool(e.disableAssertions),null!=e.defaultReservation&&Object.hasOwnProperty.call(e,"defaultReservation")&&t.uint32(170).string(e.defaultReservation),null!=e.includeTestsInCompiledGraph&&Object.hasOwnProperty.call(e,"includeTestsInCompiledGraph")&&t.uint32(176).bool(e.includeTestsInCompiledGraph),null!=e.connections&&Object.hasOwnProperty.call(e,"connections"))for(n=Object.keys(e.connections),r=0;r<n.length;++r)t.uint32(186).fork().uint32(10).string(n[r]),s.sqlanvil.ConnectionConfig.encode(e.connections[n[r]],t.uint32(18).fork()).ldelim().ldelim();return null!=e.warehouseConnection&&Object.hasOwnProperty.call(e,"warehouseConnection")&&t.uint32(194).string(e.warehouseConnection),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r,o,l=void 0===t?e.len:e.pos+t,c=new s.sqlanvil.ProjectConfig;e.pos<l;){var u=e.uint32();if(u===n)break;switch(u>>>3){case 1:c.warehouse=e.string();break;case 9:c.defaultDatabase=e.string();break;case 2:c.defaultSchema=e.string();break;case 16:c.defaultLocation=e.string();break;case 5:c.assertionSchema=e.string();break;case 14:c.vars===a.emptyObject&&(c.vars={});var p=e.uint32()+e.pos;for(r="",o="";e.pos<p;)switch((f=e.uint32())>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}c.vars[r]=o;break;case 15:c.databaseSuffix=e.string();break;case 7:c.schemaSuffix=e.string();break;case 11:c.tablePrefix=e.string();break;case 18:c.builtinAssertionNamePrefix=e.string();break;case 17:c.defaultNotebookRuntimeOptions=s.sqlanvil.NotebookRuntimeOptions.decode(e,e.uint32());break;case 19:c.defaultIcebergConfig=s.sqlanvil.DefaultIcebergConfig.decode(e,e.uint32());break;case 20:c.disableAssertions=e.bool();break;case 21:c.defaultReservation=e.string();break;case 22:c.includeTestsInCompiledGraph=e.bool();break;case 23:for(c.connections===a.emptyObject&&(c.connections={}),p=e.uint32()+e.pos,r="",o=null;e.pos<p;){var f;switch((f=e.uint32())>>>3){case 1:r=e.string();break;case 2:o=s.sqlanvil.ConnectionConfig.decode(e,e.uint32());break;default:e.skipType(7&f)}}c.connections[r]=o;break;case 24:c.warehouseConnection=e.string();break;default:e.skipType(7&u)}}return c},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.warehouse&&e.hasOwnProperty("warehouse")&&!a.isString(e.warehouse))return"warehouse: string expected";if(null!=e.defaultDatabase&&e.hasOwnProperty("defaultDatabase")&&!a.isString(e.defaultDatabase))return"defaultDatabase: string expected";if(null!=e.defaultSchema&&e.hasOwnProperty("defaultSchema")&&!a.isString(e.defaultSchema))return"defaultSchema: string expected";if(null!=e.defaultLocation&&e.hasOwnProperty("defaultLocation")&&!a.isString(e.defaultLocation))return"defaultLocation: string expected";if(null!=e.assertionSchema&&e.hasOwnProperty("assertionSchema")&&!a.isString(e.assertionSchema))return"assertionSchema: string expected";if(null!=e.vars&&e.hasOwnProperty("vars")){if(!a.isObject(e.vars))return"vars: object expected";for(var t=Object.keys(e.vars),n=0;n<t.length;++n)if(!a.isString(e.vars[t[n]]))return"vars: string{k:string} expected"}if(null!=e.databaseSuffix&&e.hasOwnProperty("databaseSuffix")&&!a.isString(e.databaseSuffix))return"databaseSuffix: string expected";if(null!=e.schemaSuffix&&e.hasOwnProperty("schemaSuffix")&&!a.isString(e.schemaSuffix))return"schemaSuffix: string expected";if(null!=e.tablePrefix&&e.hasOwnProperty("tablePrefix")&&!a.isString(e.tablePrefix))return"tablePrefix: string expected";if(null!=e.builtinAssertionNamePrefix&&e.hasOwnProperty("builtinAssertionNamePrefix")&&!a.isString(e.builtinAssertionNamePrefix))return"builtinAssertionNamePrefix: string expected";if(null!=e.defaultNotebookRuntimeOptions&&e.hasOwnProperty("defaultNotebookRuntimeOptions")&&(r=s.sqlanvil.NotebookRuntimeOptions.verify(e.defaultNotebookRuntimeOptions)))return"defaultNotebookRuntimeOptions."+r;if(null!=e.defaultIcebergConfig&&e.hasOwnProperty("defaultIcebergConfig")&&(r=s.sqlanvil.DefaultIcebergConfig.verify(e.defaultIcebergConfig)))return"defaultIcebergConfig."+r;if(null!=e.disableAssertions&&e.hasOwnProperty("disableAssertions")&&"boolean"!=typeof e.disableAssertions)return"disableAssertions: boolean expected";if(null!=e.defaultReservation&&e.hasOwnProperty("defaultReservation")&&!a.isString(e.defaultReservation))return"defaultReservation: string expected";if(null!=e.includeTestsInCompiledGraph&&e.hasOwnProperty("includeTestsInCompiledGraph")&&"boolean"!=typeof e.includeTestsInCompiledGraph)return"includeTestsInCompiledGraph: boolean expected";if(null!=e.connections&&e.hasOwnProperty("connections")){if(!a.isObject(e.connections))return"connections: object expected";for(t=Object.keys(e.connections),n=0;n<t.length;++n){var r;if(r=s.sqlanvil.ConnectionConfig.verify(e.connections[t[n]]))return"connections."+r}}return null!=e.warehouseConnection&&e.hasOwnProperty("warehouseConnection")&&!a.isString(e.warehouseConnection)?"warehouseConnection: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ProjectConfig)return e;var t=new s.sqlanvil.ProjectConfig;if(null!=e.warehouse&&(t.warehouse=String(e.warehouse)),null!=e.defaultDatabase&&(t.defaultDatabase=String(e.defaultDatabase)),null!=e.defaultSchema&&(t.defaultSchema=String(e.defaultSchema)),null!=e.defaultLocation&&(t.defaultLocation=String(e.defaultLocation)),null!=e.assertionSchema&&(t.assertionSchema=String(e.assertionSchema)),e.vars){if("object"!=typeof e.vars)throw TypeError(".sqlanvil.ProjectConfig.vars: object expected");t.vars={};for(var n=Object.keys(e.vars),r=0;r<n.length;++r)t.vars[n[r]]=String(e.vars[n[r]])}if(null!=e.databaseSuffix&&(t.databaseSuffix=String(e.databaseSuffix)),null!=e.schemaSuffix&&(t.schemaSuffix=String(e.schemaSuffix)),null!=e.tablePrefix&&(t.tablePrefix=String(e.tablePrefix)),null!=e.builtinAssertionNamePrefix&&(t.builtinAssertionNamePrefix=String(e.builtinAssertionNamePrefix)),null!=e.defaultNotebookRuntimeOptions){if("object"!=typeof e.defaultNotebookRuntimeOptions)throw TypeError(".sqlanvil.ProjectConfig.defaultNotebookRuntimeOptions: object expected");t.defaultNotebookRuntimeOptions=s.sqlanvil.NotebookRuntimeOptions.fromObject(e.defaultNotebookRuntimeOptions)}if(null!=e.defaultIcebergConfig){if("object"!=typeof e.defaultIcebergConfig)throw TypeError(".sqlanvil.ProjectConfig.defaultIcebergConfig: object expected");t.defaultIcebergConfig=s.sqlanvil.DefaultIcebergConfig.fromObject(e.defaultIcebergConfig)}if(null!=e.disableAssertions&&(t.disableAssertions=Boolean(e.disableAssertions)),null!=e.defaultReservation&&(t.defaultReservation=String(e.defaultReservation)),null!=e.includeTestsInCompiledGraph&&(t.includeTestsInCompiledGraph=Boolean(e.includeTestsInCompiledGraph)),e.connections){if("object"!=typeof e.connections)throw TypeError(".sqlanvil.ProjectConfig.connections: object expected");for(t.connections={},n=Object.keys(e.connections),r=0;r<n.length;++r){if("object"!=typeof e.connections[n[r]])throw TypeError(".sqlanvil.ProjectConfig.connections: object expected");t.connections[n[r]]=s.sqlanvil.ConnectionConfig.fromObject(e.connections[n[r]])}}return null!=e.warehouseConnection&&(t.warehouseConnection=String(e.warehouseConnection)),t},t.toObject=function(e,t){t||(t={});var n,r={};if((t.objects||t.defaults)&&(r.vars={},r.connections={}),t.defaults&&(r.warehouse="",r.defaultSchema="",r.assertionSchema="",r.schemaSuffix="",r.defaultDatabase="",r.tablePrefix="",r.databaseSuffix="",r.defaultLocation="",r.defaultNotebookRuntimeOptions=null,r.builtinAssertionNamePrefix="",r.defaultIcebergConfig=null,r.disableAssertions=!1,r.defaultReservation="",r.includeTestsInCompiledGraph=!1,r.warehouseConnection=""),null!=e.warehouse&&e.hasOwnProperty("warehouse")&&(r.warehouse=e.warehouse),null!=e.defaultSchema&&e.hasOwnProperty("defaultSchema")&&(r.defaultSchema=e.defaultSchema),null!=e.assertionSchema&&e.hasOwnProperty("assertionSchema")&&(r.assertionSchema=e.assertionSchema),null!=e.schemaSuffix&&e.hasOwnProperty("schemaSuffix")&&(r.schemaSuffix=e.schemaSuffix),null!=e.defaultDatabase&&e.hasOwnProperty("defaultDatabase")&&(r.defaultDatabase=e.defaultDatabase),null!=e.tablePrefix&&e.hasOwnProperty("tablePrefix")&&(r.tablePrefix=e.tablePrefix),e.vars&&(n=Object.keys(e.vars)).length){r.vars={};for(var i=0;i<n.length;++i)r.vars[n[i]]=e.vars[n[i]]}if(null!=e.databaseSuffix&&e.hasOwnProperty("databaseSuffix")&&(r.databaseSuffix=e.databaseSuffix),null!=e.defaultLocation&&e.hasOwnProperty("defaultLocation")&&(r.defaultLocation=e.defaultLocation),null!=e.defaultNotebookRuntimeOptions&&e.hasOwnProperty("defaultNotebookRuntimeOptions")&&(r.defaultNotebookRuntimeOptions=s.sqlanvil.NotebookRuntimeOptions.toObject(e.defaultNotebookRuntimeOptions,t)),null!=e.builtinAssertionNamePrefix&&e.hasOwnProperty("builtinAssertionNamePrefix")&&(r.builtinAssertionNamePrefix=e.builtinAssertionNamePrefix),null!=e.defaultIcebergConfig&&e.hasOwnProperty("defaultIcebergConfig")&&(r.defaultIcebergConfig=s.sqlanvil.DefaultIcebergConfig.toObject(e.defaultIcebergConfig,t)),null!=e.disableAssertions&&e.hasOwnProperty("disableAssertions")&&(r.disableAssertions=e.disableAssertions),null!=e.defaultReservation&&e.hasOwnProperty("defaultReservation")&&(r.defaultReservation=e.defaultReservation),null!=e.includeTestsInCompiledGraph&&e.hasOwnProperty("includeTestsInCompiledGraph")&&(r.includeTestsInCompiledGraph=e.includeTestsInCompiledGraph),e.connections&&(n=Object.keys(e.connections)).length)for(r.connections={},i=0;i<n.length;++i)r.connections[n[i]]=s.sqlanvil.ConnectionConfig.toObject(e.connections[n[i]],t);return null!=e.warehouseConnection&&e.hasOwnProperty("warehouseConnection")&&(r.warehouseConnection=e.warehouseConnection),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ProjectConfig"},t}(),r.CompileConfig=function(){function t(e){if(this.filePaths=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.projectDir="",t.prototype.filePaths=a.emptyArray,t.prototype.projectConfigOverride=null,t.prototype.timeoutMillis=0,t.prototype.extension=null,t.prototype.verbose=!1,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.projectDir&&Object.hasOwnProperty.call(e,"projectDir")&&t.uint32(10).string(e.projectDir),null!=e.projectConfigOverride&&Object.hasOwnProperty.call(e,"projectConfigOverride")&&s.sqlanvil.ProjectConfig.encode(e.projectConfigOverride,t.uint32(26).fork()).ldelim(),null!=e.timeoutMillis&&Object.hasOwnProperty.call(e,"timeoutMillis")&&t.uint32(48).int32(e.timeoutMillis),null!=e.filePaths&&e.filePaths.length)for(var n=0;n<e.filePaths.length;++n)t.uint32(66).string(e.filePaths[n]);return null!=e.extension&&Object.hasOwnProperty.call(e,"extension")&&s.sqlanvil.Extension.encode(e.extension,t.uint32(82).fork()).ldelim(),null!=e.verbose&&Object.hasOwnProperty.call(e,"verbose")&&t.uint32(88).bool(e.verbose),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.CompileConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.projectDir=e.string();break;case 8:o.filePaths&&o.filePaths.length||(o.filePaths=[]),o.filePaths.push(e.string());break;case 3:o.projectConfigOverride=s.sqlanvil.ProjectConfig.decode(e,e.uint32());break;case 6:o.timeoutMillis=e.int32();break;case 10:o.extension=s.sqlanvil.Extension.decode(e,e.uint32());break;case 11:o.verbose=e.bool();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.projectDir&&e.hasOwnProperty("projectDir")&&!a.isString(e.projectDir))return"projectDir: string expected";if(null!=e.filePaths&&e.hasOwnProperty("filePaths")){if(!Array.isArray(e.filePaths))return"filePaths: array expected";for(var t=0;t<e.filePaths.length;++t)if(!a.isString(e.filePaths[t]))return"filePaths: string[] expected"}var n;return null!=e.projectConfigOverride&&e.hasOwnProperty("projectConfigOverride")&&(n=s.sqlanvil.ProjectConfig.verify(e.projectConfigOverride))?"projectConfigOverride."+n:null!=e.timeoutMillis&&e.hasOwnProperty("timeoutMillis")&&!a.isInteger(e.timeoutMillis)?"timeoutMillis: integer expected":null!=e.extension&&e.hasOwnProperty("extension")&&(n=s.sqlanvil.Extension.verify(e.extension))?"extension."+n:null!=e.verbose&&e.hasOwnProperty("verbose")&&"boolean"!=typeof e.verbose?"verbose: boolean expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.CompileConfig)return e;var t=new s.sqlanvil.CompileConfig;if(null!=e.projectDir&&(t.projectDir=String(e.projectDir)),e.filePaths){if(!Array.isArray(e.filePaths))throw TypeError(".sqlanvil.CompileConfig.filePaths: array expected");t.filePaths=[];for(var n=0;n<e.filePaths.length;++n)t.filePaths[n]=String(e.filePaths[n])}if(null!=e.projectConfigOverride){if("object"!=typeof e.projectConfigOverride)throw TypeError(".sqlanvil.CompileConfig.projectConfigOverride: object expected");t.projectConfigOverride=s.sqlanvil.ProjectConfig.fromObject(e.projectConfigOverride)}if(null!=e.timeoutMillis&&(t.timeoutMillis=0|e.timeoutMillis),null!=e.extension){if("object"!=typeof e.extension)throw TypeError(".sqlanvil.CompileConfig.extension: object expected");t.extension=s.sqlanvil.Extension.fromObject(e.extension)}return null!=e.verbose&&(t.verbose=Boolean(e.verbose)),t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.filePaths=[]),t.defaults&&(n.projectDir="",n.projectConfigOverride=null,n.timeoutMillis=0,n.extension=null,n.verbose=!1),null!=e.projectDir&&e.hasOwnProperty("projectDir")&&(n.projectDir=e.projectDir),null!=e.projectConfigOverride&&e.hasOwnProperty("projectConfigOverride")&&(n.projectConfigOverride=s.sqlanvil.ProjectConfig.toObject(e.projectConfigOverride,t)),null!=e.timeoutMillis&&e.hasOwnProperty("timeoutMillis")&&(n.timeoutMillis=e.timeoutMillis),e.filePaths&&e.filePaths.length){n.filePaths=[];for(var r=0;r<e.filePaths.length;++r)n.filePaths[r]=e.filePaths[r]}return null!=e.extension&&e.hasOwnProperty("extension")&&(n.extension=s.sqlanvil.Extension.toObject(e.extension,t)),null!=e.verbose&&e.hasOwnProperty("verbose")&&(n.verbose=e.verbose),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.CompileConfig"},t}(),r.Target=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.database="",t.prototype.schema="",t.prototype.name="",t.prototype.includeDependentAssertions=!1,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.schema&&Object.hasOwnProperty.call(e,"schema")&&t.uint32(10).string(e.schema),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(18).string(e.name),null!=e.database&&Object.hasOwnProperty.call(e,"database")&&t.uint32(26).string(e.database),null!=e.includeDependentAssertions&&Object.hasOwnProperty.call(e,"includeDependentAssertions")&&t.uint32(32).bool(e.includeDependentAssertions),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.Target;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 3:o.database=e.string();break;case 1:o.schema=e.string();break;case 2:o.name=e.string();break;case 4:o.includeDependentAssertions=e.bool();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.database&&e.hasOwnProperty("database")&&!a.isString(e.database)?"database: string expected":null!=e.schema&&e.hasOwnProperty("schema")&&!a.isString(e.schema)?"schema: string expected":null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name)?"name: string expected":null!=e.includeDependentAssertions&&e.hasOwnProperty("includeDependentAssertions")&&"boolean"!=typeof e.includeDependentAssertions?"includeDependentAssertions: boolean expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.Target)return e;var t=new s.sqlanvil.Target;return null!=e.database&&(t.database=String(e.database)),null!=e.schema&&(t.schema=String(e.schema)),null!=e.name&&(t.name=String(e.name)),null!=e.includeDependentAssertions&&(t.includeDependentAssertions=Boolean(e.includeDependentAssertions)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.schema="",n.name="",n.database="",n.includeDependentAssertions=!1),null!=e.schema&&e.hasOwnProperty("schema")&&(n.schema=e.schema),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.database&&e.hasOwnProperty("database")&&(n.database=e.database),null!=e.includeDependentAssertions&&e.hasOwnProperty("includeDependentAssertions")&&(n.includeDependentAssertions=e.includeDependentAssertions),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.Target"},t}(),r.FileFormat=function(){var e={},t=Object.create(e);return t[e[0]="FILE_FORMAT_UNSPECIFIED"]=0,t[e[1]="PARQUET"]=1,t}(),r.TableFormat=function(){var e={},t=Object.create(e);return t[e[0]="TABLE_FORMAT_UNSPECIFIED"]=0,t[e[1]="ICEBERG"]=1,t}(),r.BigQueryOptions=function(){function t(e){if(this.clusterBy=[],this.labels={},this.additionalOptions={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.partitionBy="",t.prototype.clusterBy=a.emptyArray,t.prototype.updatePartitionFilter="",t.prototype.labels=a.emptyObject,t.prototype.partitionExpirationDays=0,t.prototype.requirePartitionFilter=!1,t.prototype.additionalOptions=a.emptyObject,t.prototype.connection="",t.prototype.tableFormat=0,t.prototype.fileFormat=0,t.prototype.storageUri="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.partitionBy&&Object.hasOwnProperty.call(e,"partitionBy")&&t.uint32(10).string(e.partitionBy),null!=e.clusterBy&&e.clusterBy.length)for(var n=0;n<e.clusterBy.length;++n)t.uint32(18).string(e.clusterBy[n]);if(null!=e.updatePartitionFilter&&Object.hasOwnProperty.call(e,"updatePartitionFilter")&&t.uint32(26).string(e.updatePartitionFilter),null!=e.labels&&Object.hasOwnProperty.call(e,"labels")){var r=Object.keys(e.labels);for(n=0;n<r.length;++n)t.uint32(34).fork().uint32(10).string(r[n]).uint32(18).string(e.labels[r[n]]).ldelim()}if(null!=e.partitionExpirationDays&&Object.hasOwnProperty.call(e,"partitionExpirationDays")&&t.uint32(40).int32(e.partitionExpirationDays),null!=e.requirePartitionFilter&&Object.hasOwnProperty.call(e,"requirePartitionFilter")&&t.uint32(48).bool(e.requirePartitionFilter),null!=e.additionalOptions&&Object.hasOwnProperty.call(e,"additionalOptions"))for(r=Object.keys(e.additionalOptions),n=0;n<r.length;++n)t.uint32(58).fork().uint32(10).string(r[n]).uint32(18).string(e.additionalOptions[r[n]]).ldelim();return null!=e.connection&&Object.hasOwnProperty.call(e,"connection")&&t.uint32(66).string(e.connection),null!=e.tableFormat&&Object.hasOwnProperty.call(e,"tableFormat")&&t.uint32(72).int32(e.tableFormat),null!=e.fileFormat&&Object.hasOwnProperty.call(e,"fileFormat")&&t.uint32(80).int32(e.fileFormat),null!=e.storageUri&&Object.hasOwnProperty.call(e,"storageUri")&&t.uint32(90).string(e.storageUri),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r,o,l=void 0===t?e.len:e.pos+t,c=new s.sqlanvil.BigQueryOptions;e.pos<l;){var u=e.uint32();if(u===n)break;switch(u>>>3){case 1:c.partitionBy=e.string();break;case 2:c.clusterBy&&c.clusterBy.length||(c.clusterBy=[]),c.clusterBy.push(e.string());break;case 3:c.updatePartitionFilter=e.string();break;case 4:c.labels===a.emptyObject&&(c.labels={});var p=e.uint32()+e.pos;for(r="",o="";e.pos<p;)switch((f=e.uint32())>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}c.labels[r]=o;break;case 5:c.partitionExpirationDays=e.int32();break;case 6:c.requirePartitionFilter=e.bool();break;case 7:for(c.additionalOptions===a.emptyObject&&(c.additionalOptions={}),p=e.uint32()+e.pos,r="",o="";e.pos<p;){var f;switch((f=e.uint32())>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}}c.additionalOptions[r]=o;break;case 8:c.connection=e.string();break;case 9:c.tableFormat=e.int32();break;case 10:c.fileFormat=e.int32();break;case 11:c.storageUri=e.string();break;default:e.skipType(7&u)}}return c},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.partitionBy&&e.hasOwnProperty("partitionBy")&&!a.isString(e.partitionBy))return"partitionBy: string expected";if(null!=e.clusterBy&&e.hasOwnProperty("clusterBy")){if(!Array.isArray(e.clusterBy))return"clusterBy: array expected";for(var t=0;t<e.clusterBy.length;++t)if(!a.isString(e.clusterBy[t]))return"clusterBy: string[] expected"}if(null!=e.updatePartitionFilter&&e.hasOwnProperty("updatePartitionFilter")&&!a.isString(e.updatePartitionFilter))return"updatePartitionFilter: string expected";if(null!=e.labels&&e.hasOwnProperty("labels")){if(!a.isObject(e.labels))return"labels: object expected";var n=Object.keys(e.labels);for(t=0;t<n.length;++t)if(!a.isString(e.labels[n[t]]))return"labels: string{k:string} expected"}if(null!=e.partitionExpirationDays&&e.hasOwnProperty("partitionExpirationDays")&&!a.isInteger(e.partitionExpirationDays))return"partitionExpirationDays: integer expected";if(null!=e.requirePartitionFilter&&e.hasOwnProperty("requirePartitionFilter")&&"boolean"!=typeof e.requirePartitionFilter)return"requirePartitionFilter: boolean expected";if(null!=e.additionalOptions&&e.hasOwnProperty("additionalOptions")){if(!a.isObject(e.additionalOptions))return"additionalOptions: object expected";for(n=Object.keys(e.additionalOptions),t=0;t<n.length;++t)if(!a.isString(e.additionalOptions[n[t]]))return"additionalOptions: string{k:string} expected"}if(null!=e.connection&&e.hasOwnProperty("connection")&&!a.isString(e.connection))return"connection: string expected";if(null!=e.tableFormat&&e.hasOwnProperty("tableFormat"))switch(e.tableFormat){default:return"tableFormat: enum value expected";case 0:case 1:}if(null!=e.fileFormat&&e.hasOwnProperty("fileFormat"))switch(e.fileFormat){default:return"fileFormat: enum value expected";case 0:case 1:}return null!=e.storageUri&&e.hasOwnProperty("storageUri")&&!a.isString(e.storageUri)?"storageUri: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.BigQueryOptions)return e;var t=new s.sqlanvil.BigQueryOptions;if(null!=e.partitionBy&&(t.partitionBy=String(e.partitionBy)),e.clusterBy){if(!Array.isArray(e.clusterBy))throw TypeError(".sqlanvil.BigQueryOptions.clusterBy: array expected");t.clusterBy=[];for(var n=0;n<e.clusterBy.length;++n)t.clusterBy[n]=String(e.clusterBy[n])}if(null!=e.updatePartitionFilter&&(t.updatePartitionFilter=String(e.updatePartitionFilter)),e.labels){if("object"!=typeof e.labels)throw TypeError(".sqlanvil.BigQueryOptions.labels: object expected");t.labels={};var r=Object.keys(e.labels);for(n=0;n<r.length;++n)t.labels[r[n]]=String(e.labels[r[n]])}if(null!=e.partitionExpirationDays&&(t.partitionExpirationDays=0|e.partitionExpirationDays),null!=e.requirePartitionFilter&&(t.requirePartitionFilter=Boolean(e.requirePartitionFilter)),e.additionalOptions){if("object"!=typeof e.additionalOptions)throw TypeError(".sqlanvil.BigQueryOptions.additionalOptions: object expected");for(t.additionalOptions={},r=Object.keys(e.additionalOptions),n=0;n<r.length;++n)t.additionalOptions[r[n]]=String(e.additionalOptions[r[n]])}switch(null!=e.connection&&(t.connection=String(e.connection)),e.tableFormat){default:if("number"==typeof e.tableFormat){t.tableFormat=e.tableFormat;break}break;case"TABLE_FORMAT_UNSPECIFIED":case 0:t.tableFormat=0;break;case"ICEBERG":case 1:t.tableFormat=1}switch(e.fileFormat){default:if("number"==typeof e.fileFormat){t.fileFormat=e.fileFormat;break}break;case"FILE_FORMAT_UNSPECIFIED":case 0:t.fileFormat=0;break;case"PARQUET":case 1:t.fileFormat=1}return null!=e.storageUri&&(t.storageUri=String(e.storageUri)),t},t.toObject=function(e,t){t||(t={});var n,r={};if((t.arrays||t.defaults)&&(r.clusterBy=[]),(t.objects||t.defaults)&&(r.labels={},r.additionalOptions={}),t.defaults&&(r.partitionBy="",r.updatePartitionFilter="",r.partitionExpirationDays=0,r.requirePartitionFilter=!1,r.connection="",r.tableFormat=t.enums===String?"TABLE_FORMAT_UNSPECIFIED":0,r.fileFormat=t.enums===String?"FILE_FORMAT_UNSPECIFIED":0,r.storageUri=""),null!=e.partitionBy&&e.hasOwnProperty("partitionBy")&&(r.partitionBy=e.partitionBy),e.clusterBy&&e.clusterBy.length){r.clusterBy=[];for(var i=0;i<e.clusterBy.length;++i)r.clusterBy[i]=e.clusterBy[i]}if(null!=e.updatePartitionFilter&&e.hasOwnProperty("updatePartitionFilter")&&(r.updatePartitionFilter=e.updatePartitionFilter),e.labels&&(n=Object.keys(e.labels)).length)for(r.labels={},i=0;i<n.length;++i)r.labels[n[i]]=e.labels[n[i]];if(null!=e.partitionExpirationDays&&e.hasOwnProperty("partitionExpirationDays")&&(r.partitionExpirationDays=e.partitionExpirationDays),null!=e.requirePartitionFilter&&e.hasOwnProperty("requirePartitionFilter")&&(r.requirePartitionFilter=e.requirePartitionFilter),e.additionalOptions&&(n=Object.keys(e.additionalOptions)).length)for(r.additionalOptions={},i=0;i<n.length;++i)r.additionalOptions[n[i]]=e.additionalOptions[n[i]];return null!=e.connection&&e.hasOwnProperty("connection")&&(r.connection=e.connection),null!=e.tableFormat&&e.hasOwnProperty("tableFormat")&&(r.tableFormat=t.enums===String?void 0===s.sqlanvil.TableFormat[e.tableFormat]?e.tableFormat:s.sqlanvil.TableFormat[e.tableFormat]:e.tableFormat),null!=e.fileFormat&&e.hasOwnProperty("fileFormat")&&(r.fileFormat=t.enums===String?void 0===s.sqlanvil.FileFormat[e.fileFormat]?e.fileFormat:s.sqlanvil.FileFormat[e.fileFormat]:e.fileFormat),null!=e.storageUri&&e.hasOwnProperty("storageUri")&&(r.storageUri=e.storageUri),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.BigQueryOptions"},t}(),r.GraphErrors=function(){function t(e){if(this.compilationErrors=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.compilationErrors=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.compilationErrors&&e.compilationErrors.length)for(var n=0;n<e.compilationErrors.length;++n)s.sqlanvil.CompilationError.encode(e.compilationErrors[n],t.uint32(10).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.GraphErrors;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?(o.compilationErrors&&o.compilationErrors.length||(o.compilationErrors=[]),o.compilationErrors.push(s.sqlanvil.CompilationError.decode(e,e.uint32()))):e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.compilationErrors&&e.hasOwnProperty("compilationErrors")){if(!Array.isArray(e.compilationErrors))return"compilationErrors: array expected";for(var t=0;t<e.compilationErrors.length;++t){var n=s.sqlanvil.CompilationError.verify(e.compilationErrors[t]);if(n)return"compilationErrors."+n}}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.GraphErrors)return e;var t=new s.sqlanvil.GraphErrors;if(e.compilationErrors){if(!Array.isArray(e.compilationErrors))throw TypeError(".sqlanvil.GraphErrors.compilationErrors: array expected");t.compilationErrors=[];for(var n=0;n<e.compilationErrors.length;++n){if("object"!=typeof e.compilationErrors[n])throw TypeError(".sqlanvil.GraphErrors.compilationErrors: object expected");t.compilationErrors[n]=s.sqlanvil.CompilationError.fromObject(e.compilationErrors[n])}}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.compilationErrors=[]),e.compilationErrors&&e.compilationErrors.length){n.compilationErrors=[];for(var r=0;r<e.compilationErrors.length;++r)n.compilationErrors[r]=s.sqlanvil.CompilationError.toObject(e.compilationErrors[r],t)}return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.GraphErrors"},t}(),r.CompilationError=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.fileName="",t.prototype.actionName="",t.prototype.actionTarget=null,t.prototype.message="",t.prototype.stack="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(10).string(e.fileName),null!=e.message&&Object.hasOwnProperty.call(e,"message")&&t.uint32(18).string(e.message),null!=e.stack&&Object.hasOwnProperty.call(e,"stack")&&t.uint32(26).string(e.stack),null!=e.actionName&&Object.hasOwnProperty.call(e,"actionName")&&t.uint32(34).string(e.actionName),null!=e.actionTarget&&Object.hasOwnProperty.call(e,"actionTarget")&&s.sqlanvil.Target.encode(e.actionTarget,t.uint32(42).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.CompilationError;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.fileName=e.string();break;case 4:o.actionName=e.string();break;case 5:o.actionTarget=s.sqlanvil.Target.decode(e,e.uint32());break;case 2:o.message=e.string();break;case 3:o.stack=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.fileName&&e.hasOwnProperty("fileName")&&!a.isString(e.fileName))return"fileName: string expected";if(null!=e.actionName&&e.hasOwnProperty("actionName")&&!a.isString(e.actionName))return"actionName: string expected";if(null!=e.actionTarget&&e.hasOwnProperty("actionTarget")){var t=s.sqlanvil.Target.verify(e.actionTarget);if(t)return"actionTarget."+t}return null!=e.message&&e.hasOwnProperty("message")&&!a.isString(e.message)?"message: string expected":null!=e.stack&&e.hasOwnProperty("stack")&&!a.isString(e.stack)?"stack: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.CompilationError)return e;var t=new s.sqlanvil.CompilationError;if(null!=e.fileName&&(t.fileName=String(e.fileName)),null!=e.actionName&&(t.actionName=String(e.actionName)),null!=e.actionTarget){if("object"!=typeof e.actionTarget)throw TypeError(".sqlanvil.CompilationError.actionTarget: object expected");t.actionTarget=s.sqlanvil.Target.fromObject(e.actionTarget)}return null!=e.message&&(t.message=String(e.message)),null!=e.stack&&(t.stack=String(e.stack)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.fileName="",n.message="",n.stack="",n.actionName="",n.actionTarget=null),null!=e.fileName&&e.hasOwnProperty("fileName")&&(n.fileName=e.fileName),null!=e.message&&e.hasOwnProperty("message")&&(n.message=e.message),null!=e.stack&&e.hasOwnProperty("stack")&&(n.stack=e.stack),null!=e.actionName&&e.hasOwnProperty("actionName")&&(n.actionName=e.actionName),null!=e.actionTarget&&e.hasOwnProperty("actionTarget")&&(n.actionTarget=s.sqlanvil.Target.toObject(e.actionTarget,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.CompilationError"},t}(),r.ActionCompilationMode=function(){var e={},t=Object.create(e);return t[e[0]="ACTION_COMPILATION_MODE_UNSPECIFIED"]=0,t[e[1]="ACTION_COMPILATION_MODE_AOT"]=1,t[e[2]="ACTION_COMPILATION_MODE_JIT"]=2,t}(),r.ActionDescriptor=function(){function t(e){if(this.columns=[],this.bigqueryLabels={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.description="",t.prototype.columns=a.emptyArray,t.prototype.bigqueryLabels=a.emptyObject,t.prototype.metadata=null,t.prototype.compilationMode=0,t.prototype.reservation="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(10).string(e.description),null!=e.columns&&e.columns.length)for(var n=0;n<e.columns.length;++n)s.sqlanvil.ColumnDescriptor.encode(e.columns[n],t.uint32(18).fork()).ldelim();if(null!=e.bigqueryLabels&&Object.hasOwnProperty.call(e,"bigqueryLabels")){var r=Object.keys(e.bigqueryLabels);for(n=0;n<r.length;++n)t.uint32(26).fork().uint32(10).string(r[n]).uint32(18).string(e.bigqueryLabels[r[n]]).ldelim()}return null!=e.metadata&&Object.hasOwnProperty.call(e,"metadata")&&s.sqlanvil.Metadata.encode(e.metadata,t.uint32(34).fork()).ldelim(),null!=e.compilationMode&&Object.hasOwnProperty.call(e,"compilationMode")&&t.uint32(40).int32(e.compilationMode),null!=e.reservation&&Object.hasOwnProperty.call(e,"reservation")&&t.uint32(50).string(e.reservation),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r,o,l=void 0===t?e.len:e.pos+t,c=new s.sqlanvil.ActionDescriptor;e.pos<l;){var u=e.uint32();if(u===n)break;switch(u>>>3){case 1:c.description=e.string();break;case 2:c.columns&&c.columns.length||(c.columns=[]),c.columns.push(s.sqlanvil.ColumnDescriptor.decode(e,e.uint32()));break;case 3:c.bigqueryLabels===a.emptyObject&&(c.bigqueryLabels={});var p=e.uint32()+e.pos;for(r="",o="";e.pos<p;){var f=e.uint32();switch(f>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}}c.bigqueryLabels[r]=o;break;case 4:c.metadata=s.sqlanvil.Metadata.decode(e,e.uint32());break;case 5:c.compilationMode=e.int32();break;case 6:c.reservation=e.string();break;default:e.skipType(7&u)}}return c},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.description&&e.hasOwnProperty("description")&&!a.isString(e.description))return"description: string expected";if(null!=e.columns&&e.hasOwnProperty("columns")){if(!Array.isArray(e.columns))return"columns: array expected";for(var t=0;t<e.columns.length;++t)if(r=s.sqlanvil.ColumnDescriptor.verify(e.columns[t]))return"columns."+r}if(null!=e.bigqueryLabels&&e.hasOwnProperty("bigqueryLabels")){if(!a.isObject(e.bigqueryLabels))return"bigqueryLabels: object expected";var n=Object.keys(e.bigqueryLabels);for(t=0;t<n.length;++t)if(!a.isString(e.bigqueryLabels[n[t]]))return"bigqueryLabels: string{k:string} expected"}var r;if(null!=e.metadata&&e.hasOwnProperty("metadata")&&(r=s.sqlanvil.Metadata.verify(e.metadata)))return"metadata."+r;if(null!=e.compilationMode&&e.hasOwnProperty("compilationMode"))switch(e.compilationMode){default:return"compilationMode: enum value expected";case 0:case 1:case 2:}return null!=e.reservation&&e.hasOwnProperty("reservation")&&!a.isString(e.reservation)?"reservation: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionDescriptor)return e;var t=new s.sqlanvil.ActionDescriptor;if(null!=e.description&&(t.description=String(e.description)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.ActionDescriptor.columns: array expected");t.columns=[];for(var n=0;n<e.columns.length;++n){if("object"!=typeof e.columns[n])throw TypeError(".sqlanvil.ActionDescriptor.columns: object expected");t.columns[n]=s.sqlanvil.ColumnDescriptor.fromObject(e.columns[n])}}if(e.bigqueryLabels){if("object"!=typeof e.bigqueryLabels)throw TypeError(".sqlanvil.ActionDescriptor.bigqueryLabels: object expected");t.bigqueryLabels={};var r=Object.keys(e.bigqueryLabels);for(n=0;n<r.length;++n)t.bigqueryLabels[r[n]]=String(e.bigqueryLabels[r[n]])}if(null!=e.metadata){if("object"!=typeof e.metadata)throw TypeError(".sqlanvil.ActionDescriptor.metadata: object expected");t.metadata=s.sqlanvil.Metadata.fromObject(e.metadata)}switch(e.compilationMode){default:if("number"==typeof e.compilationMode){t.compilationMode=e.compilationMode;break}break;case"ACTION_COMPILATION_MODE_UNSPECIFIED":case 0:t.compilationMode=0;break;case"ACTION_COMPILATION_MODE_AOT":case 1:t.compilationMode=1;break;case"ACTION_COMPILATION_MODE_JIT":case 2:t.compilationMode=2}return null!=e.reservation&&(t.reservation=String(e.reservation)),t},t.toObject=function(e,t){t||(t={});var n,r={};if((t.arrays||t.defaults)&&(r.columns=[]),(t.objects||t.defaults)&&(r.bigqueryLabels={}),t.defaults&&(r.description="",r.metadata=null,r.compilationMode=t.enums===String?"ACTION_COMPILATION_MODE_UNSPECIFIED":0,r.reservation=""),null!=e.description&&e.hasOwnProperty("description")&&(r.description=e.description),e.columns&&e.columns.length){r.columns=[];for(var i=0;i<e.columns.length;++i)r.columns[i]=s.sqlanvil.ColumnDescriptor.toObject(e.columns[i],t)}if(e.bigqueryLabels&&(n=Object.keys(e.bigqueryLabels)).length)for(r.bigqueryLabels={},i=0;i<n.length;++i)r.bigqueryLabels[n[i]]=e.bigqueryLabels[n[i]];return null!=e.metadata&&e.hasOwnProperty("metadata")&&(r.metadata=s.sqlanvil.Metadata.toObject(e.metadata,t)),null!=e.compilationMode&&e.hasOwnProperty("compilationMode")&&(r.compilationMode=t.enums===String?void 0===s.sqlanvil.ActionCompilationMode[e.compilationMode]?e.compilationMode:s.sqlanvil.ActionCompilationMode[e.compilationMode]:e.compilationMode),null!=e.reservation&&e.hasOwnProperty("reservation")&&(r.reservation=e.reservation),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionDescriptor"},t}(),r.Metadata=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.overview="",t.prototype.extraProperties=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.overview&&Object.hasOwnProperty.call(e,"overview")&&t.uint32(10).string(e.overview),null!=e.extraProperties&&Object.hasOwnProperty.call(e,"extraProperties")&&s.google.protobuf.Struct.encode(e.extraProperties,t.uint32(18).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.Metadata;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.overview=e.string();break;case 2:o.extraProperties=s.google.protobuf.Struct.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.overview&&e.hasOwnProperty("overview")&&!a.isString(e.overview))return"overview: string expected";if(null!=e.extraProperties&&e.hasOwnProperty("extraProperties")){var t=s.google.protobuf.Struct.verify(e.extraProperties);if(t)return"extraProperties."+t}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.Metadata)return e;var t=new s.sqlanvil.Metadata;if(null!=e.overview&&(t.overview=String(e.overview)),null!=e.extraProperties){if("object"!=typeof e.extraProperties)throw TypeError(".sqlanvil.Metadata.extraProperties: object expected");t.extraProperties=s.google.protobuf.Struct.fromObject(e.extraProperties)}return t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.overview="",n.extraProperties=null),null!=e.overview&&e.hasOwnProperty("overview")&&(n.overview=e.overview),null!=e.extraProperties&&e.hasOwnProperty("extraProperties")&&(n.extraProperties=s.google.protobuf.Struct.toObject(e.extraProperties,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.Metadata"},t}(),r.ColumnDescriptor=function(){function t(e){if(this.path=[],this.tags=[],this.bigqueryPolicyTags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.description="",t.prototype.path=a.emptyArray,t.prototype.displayName="",t.prototype.tags=a.emptyArray,t.prototype.bigqueryPolicyTags=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(10).string(e.description),null!=e.path&&e.path.length)for(var n=0;n<e.path.length;++n)t.uint32(18).string(e.path[n]);if(null!=e.displayName&&Object.hasOwnProperty.call(e,"displayName")&&t.uint32(26).string(e.displayName),null!=e.tags&&e.tags.length)for(n=0;n<e.tags.length;++n)t.uint32(58).string(e.tags[n]);if(null!=e.bigqueryPolicyTags&&e.bigqueryPolicyTags.length)for(n=0;n<e.bigqueryPolicyTags.length;++n)t.uint32(66).string(e.bigqueryPolicyTags[n]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ColumnDescriptor;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.description=e.string();break;case 2:o.path&&o.path.length||(o.path=[]),o.path.push(e.string());break;case 3:o.displayName=e.string();break;case 7:o.tags&&o.tags.length||(o.tags=[]),o.tags.push(e.string());break;case 8:o.bigqueryPolicyTags&&o.bigqueryPolicyTags.length||(o.bigqueryPolicyTags=[]),o.bigqueryPolicyTags.push(e.string());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.description&&e.hasOwnProperty("description")&&!a.isString(e.description))return"description: string expected";if(null!=e.path&&e.hasOwnProperty("path")){if(!Array.isArray(e.path))return"path: array expected";for(var t=0;t<e.path.length;++t)if(!a.isString(e.path[t]))return"path: string[] expected"}if(null!=e.displayName&&e.hasOwnProperty("displayName")&&!a.isString(e.displayName))return"displayName: string expected";if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!a.isString(e.tags[t]))return"tags: string[] expected"}if(null!=e.bigqueryPolicyTags&&e.hasOwnProperty("bigqueryPolicyTags")){if(!Array.isArray(e.bigqueryPolicyTags))return"bigqueryPolicyTags: array expected";for(t=0;t<e.bigqueryPolicyTags.length;++t)if(!a.isString(e.bigqueryPolicyTags[t]))return"bigqueryPolicyTags: string[] expected"}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ColumnDescriptor)return e;var t=new s.sqlanvil.ColumnDescriptor;if(null!=e.description&&(t.description=String(e.description)),e.path){if(!Array.isArray(e.path))throw TypeError(".sqlanvil.ColumnDescriptor.path: array expected");t.path=[];for(var n=0;n<e.path.length;++n)t.path[n]=String(e.path[n])}if(null!=e.displayName&&(t.displayName=String(e.displayName)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ColumnDescriptor.tags: array expected");for(t.tags=[],n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}if(e.bigqueryPolicyTags){if(!Array.isArray(e.bigqueryPolicyTags))throw TypeError(".sqlanvil.ColumnDescriptor.bigqueryPolicyTags: array expected");for(t.bigqueryPolicyTags=[],n=0;n<e.bigqueryPolicyTags.length;++n)t.bigqueryPolicyTags[n]=String(e.bigqueryPolicyTags[n])}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.path=[],n.tags=[],n.bigqueryPolicyTags=[]),t.defaults&&(n.description="",n.displayName=""),null!=e.description&&e.hasOwnProperty("description")&&(n.description=e.description),e.path&&e.path.length){n.path=[];for(var r=0;r<e.path.length;++r)n.path[r]=e.path[r]}if(null!=e.displayName&&e.hasOwnProperty("displayName")&&(n.displayName=e.displayName),e.tags&&e.tags.length)for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=e.tags[r];if(e.bigqueryPolicyTags&&e.bigqueryPolicyTags.length)for(n.bigqueryPolicyTags=[],r=0;r<e.bigqueryPolicyTags.length;++r)n.bigqueryPolicyTags[r]=e.bigqueryPolicyTags[r];return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ColumnDescriptor"},t}(),r.TableType=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN_TYPE"]=0,t[e[1]="TABLE"]=1,t[e[2]="INCREMENTAL"]=2,t[e[3]="VIEW"]=3,t}(),r.OnSchemaChange=function(){var e={},t=Object.create(e);return t[e[0]="IGNORE"]=0,t[e[1]="FAIL"]=1,t[e[2]="EXTEND"]=2,t[e[3]="SYNCHRONIZE"]=3,t}(),r.Table=function(){function t(e){if(this.dependencyTargets=[],this.tags=[],this.uniqueKey=[],this.preOps=[],this.postOps=[],this.incrementalPreOps=[],this.incrementalPostOps=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.enumType=0,t.prototype.target=null,t.prototype.canonicalTarget=null,t.prototype.dependencyTargets=a.emptyArray,t.prototype.hermeticity=0,t.prototype.disabled=!1,t.prototype.type="",t.prototype.query="",t.prototype.protected=!1,t.prototype.materialized=!1,t.prototype.actionDescriptor=null,t.prototype.tags=a.emptyArray,t.prototype.where="",t.prototype.incrementalQuery="",t.prototype.uniqueKey=a.emptyArray,t.prototype.onSchemaChange=0,t.prototype.preOps=a.emptyArray,t.prototype.postOps=a.emptyArray,t.prototype.incrementalPreOps=a.emptyArray,t.prototype.incrementalPostOps=a.emptyArray,t.prototype.jitCode="",t.prototype.bigquery=null,t.prototype.postgres=null,t.prototype.supabase=null,t.prototype.fileName="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(26).string(e.type),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&s.sqlanvil.Target.encode(e.target,t.uint32(34).fork()).ldelim(),null!=e.query&&Object.hasOwnProperty.call(e,"query")&&t.uint32(42).string(e.query),null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(48).bool(e.disabled),null!=e.where&&Object.hasOwnProperty.call(e,"where")&&t.uint32(66).string(e.where),null!=e.protected&&Object.hasOwnProperty.call(e,"protected")&&t.uint32(72).bool(e.protected),null!=e.preOps&&e.preOps.length)for(var n=0;n<e.preOps.length;++n)t.uint32(106).string(e.preOps[n]);if(null!=e.postOps&&e.postOps.length)for(n=0;n<e.postOps.length;++n)t.uint32(114).string(e.postOps[n]);if(null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(146).string(e.fileName),null!=e.bigquery&&Object.hasOwnProperty.call(e,"bigquery")&&s.sqlanvil.BigQueryOptions.encode(e.bigquery,t.uint32(178).fork()).ldelim(),null!=e.tags&&e.tags.length)for(n=0;n<e.tags.length;++n)t.uint32(186).string(e.tags[n]);if(null!=e.actionDescriptor&&Object.hasOwnProperty.call(e,"actionDescriptor")&&s.sqlanvil.ActionDescriptor.encode(e.actionDescriptor,t.uint32(194).fork()).ldelim(),null!=e.incrementalQuery&&Object.hasOwnProperty.call(e,"incrementalQuery")&&t.uint32(210).string(e.incrementalQuery),null!=e.dependencyTargets&&e.dependencyTargets.length)for(n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.Target.encode(e.dependencyTargets[n],t.uint32(218).fork()).ldelim();if(null!=e.incrementalPreOps&&e.incrementalPreOps.length)for(n=0;n<e.incrementalPreOps.length;++n)t.uint32(226).string(e.incrementalPreOps[n]);if(null!=e.incrementalPostOps&&e.incrementalPostOps.length)for(n=0;n<e.incrementalPostOps.length;++n)t.uint32(234).string(e.incrementalPostOps[n]);if(null!=e.uniqueKey&&e.uniqueKey.length)for(n=0;n<e.uniqueKey.length;++n)t.uint32(242).string(e.uniqueKey[n]);return null!=e.hermeticity&&Object.hasOwnProperty.call(e,"hermeticity")&&t.uint32(248).int32(e.hermeticity),null!=e.canonicalTarget&&Object.hasOwnProperty.call(e,"canonicalTarget")&&s.sqlanvil.Target.encode(e.canonicalTarget,t.uint32(258).fork()).ldelim(),null!=e.materialized&&Object.hasOwnProperty.call(e,"materialized")&&t.uint32(280).bool(e.materialized),null!=e.enumType&&Object.hasOwnProperty.call(e,"enumType")&&t.uint32(288).int32(e.enumType),null!=e.onSchemaChange&&Object.hasOwnProperty.call(e,"onSchemaChange")&&t.uint32(296).int32(e.onSchemaChange),null!=e.jitCode&&Object.hasOwnProperty.call(e,"jitCode")&&t.uint32(306).string(e.jitCode),null!=e.postgres&&Object.hasOwnProperty.call(e,"postgres")&&s.sqlanvil.PostgresOptions.encode(e.postgres,t.uint32(314).fork()).ldelim(),null!=e.supabase&&Object.hasOwnProperty.call(e,"supabase")&&s.sqlanvil.SupabaseOptions.encode(e.supabase,t.uint32(322).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.Table;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 36:o.enumType=e.int32();break;case 4:o.target=s.sqlanvil.Target.decode(e,e.uint32());break;case 32:o.canonicalTarget=s.sqlanvil.Target.decode(e,e.uint32());break;case 27:o.dependencyTargets&&o.dependencyTargets.length||(o.dependencyTargets=[]),o.dependencyTargets.push(s.sqlanvil.Target.decode(e,e.uint32()));break;case 31:o.hermeticity=e.int32();break;case 6:o.disabled=e.bool();break;case 3:o.type=e.string();break;case 5:o.query=e.string();break;case 9:o.protected=e.bool();break;case 35:o.materialized=e.bool();break;case 24:o.actionDescriptor=s.sqlanvil.ActionDescriptor.decode(e,e.uint32());break;case 23:o.tags&&o.tags.length||(o.tags=[]),o.tags.push(e.string());break;case 8:o.where=e.string();break;case 26:o.incrementalQuery=e.string();break;case 30:o.uniqueKey&&o.uniqueKey.length||(o.uniqueKey=[]),o.uniqueKey.push(e.string());break;case 37:o.onSchemaChange=e.int32();break;case 13:o.preOps&&o.preOps.length||(o.preOps=[]),o.preOps.push(e.string());break;case 14:o.postOps&&o.postOps.length||(o.postOps=[]),o.postOps.push(e.string());break;case 28:o.incrementalPreOps&&o.incrementalPreOps.length||(o.incrementalPreOps=[]),o.incrementalPreOps.push(e.string());break;case 29:o.incrementalPostOps&&o.incrementalPostOps.length||(o.incrementalPostOps=[]),o.incrementalPostOps.push(e.string());break;case 38:o.jitCode=e.string();break;case 22:o.bigquery=s.sqlanvil.BigQueryOptions.decode(e,e.uint32());break;case 39:o.postgres=s.sqlanvil.PostgresOptions.decode(e,e.uint32());break;case 40:o.supabase=s.sqlanvil.SupabaseOptions.decode(e,e.uint32());break;case 18:o.fileName=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.enumType&&e.hasOwnProperty("enumType"))switch(e.enumType){default:return"enumType: enum value expected";case 0:case 1:case 2:case 3:}if(null!=e.target&&e.hasOwnProperty("target")&&(n=s.sqlanvil.Target.verify(e.target)))return"target."+n;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(n=s.sqlanvil.Target.verify(e.canonicalTarget)))return"canonicalTarget."+n;if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var t=0;t<e.dependencyTargets.length;++t){var n;if(n=s.sqlanvil.Target.verify(e.dependencyTargets[t]))return"dependencyTargets."+n}}if(null!=e.hermeticity&&e.hasOwnProperty("hermeticity"))switch(e.hermeticity){default:return"hermeticity: enum value expected";case 0:case 1:case 2:}if(null!=e.disabled&&e.hasOwnProperty("disabled")&&"boolean"!=typeof e.disabled)return"disabled: boolean expected";if(null!=e.type&&e.hasOwnProperty("type")&&!a.isString(e.type))return"type: string expected";if(null!=e.query&&e.hasOwnProperty("query")&&!a.isString(e.query))return"query: string expected";if(null!=e.protected&&e.hasOwnProperty("protected")&&"boolean"!=typeof e.protected)return"protected: boolean expected";if(null!=e.materialized&&e.hasOwnProperty("materialized")&&"boolean"!=typeof e.materialized)return"materialized: boolean expected";if(null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(n=s.sqlanvil.ActionDescriptor.verify(e.actionDescriptor)))return"actionDescriptor."+n;if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!a.isString(e.tags[t]))return"tags: string[] expected"}if(null!=e.where&&e.hasOwnProperty("where")&&!a.isString(e.where))return"where: string expected";if(null!=e.incrementalQuery&&e.hasOwnProperty("incrementalQuery")&&!a.isString(e.incrementalQuery))return"incrementalQuery: string expected";if(null!=e.uniqueKey&&e.hasOwnProperty("uniqueKey")){if(!Array.isArray(e.uniqueKey))return"uniqueKey: array expected";for(t=0;t<e.uniqueKey.length;++t)if(!a.isString(e.uniqueKey[t]))return"uniqueKey: string[] expected"}if(null!=e.onSchemaChange&&e.hasOwnProperty("onSchemaChange"))switch(e.onSchemaChange){default:return"onSchemaChange: enum value expected";case 0:case 1:case 2:case 3:}if(null!=e.preOps&&e.hasOwnProperty("preOps")){if(!Array.isArray(e.preOps))return"preOps: array expected";for(t=0;t<e.preOps.length;++t)if(!a.isString(e.preOps[t]))return"preOps: string[] expected"}if(null!=e.postOps&&e.hasOwnProperty("postOps")){if(!Array.isArray(e.postOps))return"postOps: array expected";for(t=0;t<e.postOps.length;++t)if(!a.isString(e.postOps[t]))return"postOps: string[] expected"}if(null!=e.incrementalPreOps&&e.hasOwnProperty("incrementalPreOps")){if(!Array.isArray(e.incrementalPreOps))return"incrementalPreOps: array expected";for(t=0;t<e.incrementalPreOps.length;++t)if(!a.isString(e.incrementalPreOps[t]))return"incrementalPreOps: string[] expected"}if(null!=e.incrementalPostOps&&e.hasOwnProperty("incrementalPostOps")){if(!Array.isArray(e.incrementalPostOps))return"incrementalPostOps: array expected";for(t=0;t<e.incrementalPostOps.length;++t)if(!a.isString(e.incrementalPostOps[t]))return"incrementalPostOps: string[] expected"}return null!=e.jitCode&&e.hasOwnProperty("jitCode")&&!a.isString(e.jitCode)?"jitCode: string expected":null!=e.bigquery&&e.hasOwnProperty("bigquery")&&(n=s.sqlanvil.BigQueryOptions.verify(e.bigquery))?"bigquery."+n:null!=e.postgres&&e.hasOwnProperty("postgres")&&(n=s.sqlanvil.PostgresOptions.verify(e.postgres))?"postgres."+n:null!=e.supabase&&e.hasOwnProperty("supabase")&&(n=s.sqlanvil.SupabaseOptions.verify(e.supabase))?"supabase."+n:null!=e.fileName&&e.hasOwnProperty("fileName")&&!a.isString(e.fileName)?"fileName: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.Table)return e;var t=new s.sqlanvil.Table;switch(e.enumType){default:if("number"==typeof e.enumType){t.enumType=e.enumType;break}break;case"UNKNOWN_TYPE":case 0:t.enumType=0;break;case"TABLE":case 1:t.enumType=1;break;case"INCREMENTAL":case 2:t.enumType=2;break;case"VIEW":case 3:t.enumType=3}if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.Table.target: object expected");t.target=s.sqlanvil.Target.fromObject(e.target)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".sqlanvil.Table.canonicalTarget: object expected");t.canonicalTarget=s.sqlanvil.Target.fromObject(e.canonicalTarget)}if(e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.Table.dependencyTargets: array expected");t.dependencyTargets=[];for(var n=0;n<e.dependencyTargets.length;++n){if("object"!=typeof e.dependencyTargets[n])throw TypeError(".sqlanvil.Table.dependencyTargets: object expected");t.dependencyTargets[n]=s.sqlanvil.Target.fromObject(e.dependencyTargets[n])}}switch(e.hermeticity){default:if("number"==typeof e.hermeticity){t.hermeticity=e.hermeticity;break}break;case"UNKNOWN":case 0:t.hermeticity=0;break;case"HERMETIC":case 1:t.hermeticity=1;break;case"NON_HERMETIC":case 2:t.hermeticity=2}if(null!=e.disabled&&(t.disabled=Boolean(e.disabled)),null!=e.type&&(t.type=String(e.type)),null!=e.query&&(t.query=String(e.query)),null!=e.protected&&(t.protected=Boolean(e.protected)),null!=e.materialized&&(t.materialized=Boolean(e.materialized)),null!=e.actionDescriptor){if("object"!=typeof e.actionDescriptor)throw TypeError(".sqlanvil.Table.actionDescriptor: object expected");t.actionDescriptor=s.sqlanvil.ActionDescriptor.fromObject(e.actionDescriptor)}if(e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.Table.tags: array expected");for(t.tags=[],n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}if(null!=e.where&&(t.where=String(e.where)),null!=e.incrementalQuery&&(t.incrementalQuery=String(e.incrementalQuery)),e.uniqueKey){if(!Array.isArray(e.uniqueKey))throw TypeError(".sqlanvil.Table.uniqueKey: array expected");for(t.uniqueKey=[],n=0;n<e.uniqueKey.length;++n)t.uniqueKey[n]=String(e.uniqueKey[n])}switch(e.onSchemaChange){default:if("number"==typeof e.onSchemaChange){t.onSchemaChange=e.onSchemaChange;break}break;case"IGNORE":case 0:t.onSchemaChange=0;break;case"FAIL":case 1:t.onSchemaChange=1;break;case"EXTEND":case 2:t.onSchemaChange=2;break;case"SYNCHRONIZE":case 3:t.onSchemaChange=3}if(e.preOps){if(!Array.isArray(e.preOps))throw TypeError(".sqlanvil.Table.preOps: array expected");for(t.preOps=[],n=0;n<e.preOps.length;++n)t.preOps[n]=String(e.preOps[n])}if(e.postOps){if(!Array.isArray(e.postOps))throw TypeError(".sqlanvil.Table.postOps: array expected");for(t.postOps=[],n=0;n<e.postOps.length;++n)t.postOps[n]=String(e.postOps[n])}if(e.incrementalPreOps){if(!Array.isArray(e.incrementalPreOps))throw TypeError(".sqlanvil.Table.incrementalPreOps: array expected");for(t.incrementalPreOps=[],n=0;n<e.incrementalPreOps.length;++n)t.incrementalPreOps[n]=String(e.incrementalPreOps[n])}if(e.incrementalPostOps){if(!Array.isArray(e.incrementalPostOps))throw TypeError(".sqlanvil.Table.incrementalPostOps: array expected");for(t.incrementalPostOps=[],n=0;n<e.incrementalPostOps.length;++n)t.incrementalPostOps[n]=String(e.incrementalPostOps[n])}if(null!=e.jitCode&&(t.jitCode=String(e.jitCode)),null!=e.bigquery){if("object"!=typeof e.bigquery)throw TypeError(".sqlanvil.Table.bigquery: object expected");t.bigquery=s.sqlanvil.BigQueryOptions.fromObject(e.bigquery)}if(null!=e.postgres){if("object"!=typeof e.postgres)throw TypeError(".sqlanvil.Table.postgres: object expected");t.postgres=s.sqlanvil.PostgresOptions.fromObject(e.postgres)}if(null!=e.supabase){if("object"!=typeof e.supabase)throw TypeError(".sqlanvil.Table.supabase: object expected");t.supabase=s.sqlanvil.SupabaseOptions.fromObject(e.supabase)}return null!=e.fileName&&(t.fileName=String(e.fileName)),t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.preOps=[],n.postOps=[],n.tags=[],n.dependencyTargets=[],n.incrementalPreOps=[],n.incrementalPostOps=[],n.uniqueKey=[]),t.defaults&&(n.type="",n.target=null,n.query="",n.disabled=!1,n.where="",n.protected=!1,n.fileName="",n.bigquery=null,n.actionDescriptor=null,n.incrementalQuery="",n.hermeticity=t.enums===String?"UNKNOWN":0,n.canonicalTarget=null,n.materialized=!1,n.enumType=t.enums===String?"UNKNOWN_TYPE":0,n.onSchemaChange=t.enums===String?"IGNORE":0,n.jitCode="",n.postgres=null,n.supabase=null),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.target&&e.hasOwnProperty("target")&&(n.target=s.sqlanvil.Target.toObject(e.target,t)),null!=e.query&&e.hasOwnProperty("query")&&(n.query=e.query),null!=e.disabled&&e.hasOwnProperty("disabled")&&(n.disabled=e.disabled),null!=e.where&&e.hasOwnProperty("where")&&(n.where=e.where),null!=e.protected&&e.hasOwnProperty("protected")&&(n.protected=e.protected),e.preOps&&e.preOps.length){n.preOps=[];for(var r=0;r<e.preOps.length;++r)n.preOps[r]=e.preOps[r]}if(e.postOps&&e.postOps.length)for(n.postOps=[],r=0;r<e.postOps.length;++r)n.postOps[r]=e.postOps[r];if(null!=e.fileName&&e.hasOwnProperty("fileName")&&(n.fileName=e.fileName),null!=e.bigquery&&e.hasOwnProperty("bigquery")&&(n.bigquery=s.sqlanvil.BigQueryOptions.toObject(e.bigquery,t)),e.tags&&e.tags.length)for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=e.tags[r];if(null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(n.actionDescriptor=s.sqlanvil.ActionDescriptor.toObject(e.actionDescriptor,t)),null!=e.incrementalQuery&&e.hasOwnProperty("incrementalQuery")&&(n.incrementalQuery=e.incrementalQuery),e.dependencyTargets&&e.dependencyTargets.length)for(n.dependencyTargets=[],r=0;r<e.dependencyTargets.length;++r)n.dependencyTargets[r]=s.sqlanvil.Target.toObject(e.dependencyTargets[r],t);if(e.incrementalPreOps&&e.incrementalPreOps.length)for(n.incrementalPreOps=[],r=0;r<e.incrementalPreOps.length;++r)n.incrementalPreOps[r]=e.incrementalPreOps[r];if(e.incrementalPostOps&&e.incrementalPostOps.length)for(n.incrementalPostOps=[],r=0;r<e.incrementalPostOps.length;++r)n.incrementalPostOps[r]=e.incrementalPostOps[r];if(e.uniqueKey&&e.uniqueKey.length)for(n.uniqueKey=[],r=0;r<e.uniqueKey.length;++r)n.uniqueKey[r]=e.uniqueKey[r];return null!=e.hermeticity&&e.hasOwnProperty("hermeticity")&&(n.hermeticity=t.enums===String?void 0===s.sqlanvil.ActionHermeticity[e.hermeticity]?e.hermeticity:s.sqlanvil.ActionHermeticity[e.hermeticity]:e.hermeticity),null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(n.canonicalTarget=s.sqlanvil.Target.toObject(e.canonicalTarget,t)),null!=e.materialized&&e.hasOwnProperty("materialized")&&(n.materialized=e.materialized),null!=e.enumType&&e.hasOwnProperty("enumType")&&(n.enumType=t.enums===String?void 0===s.sqlanvil.TableType[e.enumType]?e.enumType:s.sqlanvil.TableType[e.enumType]:e.enumType),null!=e.onSchemaChange&&e.hasOwnProperty("onSchemaChange")&&(n.onSchemaChange=t.enums===String?void 0===s.sqlanvil.OnSchemaChange[e.onSchemaChange]?e.onSchemaChange:s.sqlanvil.OnSchemaChange[e.onSchemaChange]:e.onSchemaChange),null!=e.jitCode&&e.hasOwnProperty("jitCode")&&(n.jitCode=e.jitCode),null!=e.postgres&&e.hasOwnProperty("postgres")&&(n.postgres=s.sqlanvil.PostgresOptions.toObject(e.postgres,t)),null!=e.supabase&&e.hasOwnProperty("supabase")&&(n.supabase=s.sqlanvil.SupabaseOptions.toObject(e.supabase,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.Table"},t}(),r.Operation=function(){function t(e){if(this.dependencyTargets=[],this.queries=[],this.tags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.target=null,t.prototype.canonicalTarget=null,t.prototype.dependencyTargets=a.emptyArray,t.prototype.hermeticity=0,t.prototype.disabled=!1,t.prototype.queries=a.emptyArray,t.prototype.jitCode="",t.prototype.hasOutput=!1,t.prototype.tags=a.emptyArray,t.prototype.actionDescriptor=null,t.prototype.fileName="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&s.sqlanvil.Target.encode(e.target,t.uint32(26).fork()).ldelim(),null!=e.queries&&e.queries.length)for(var n=0;n<e.queries.length;++n)t.uint32(50).string(e.queries[n]);if(null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(58).string(e.fileName),null!=e.hasOutput&&Object.hasOwnProperty.call(e,"hasOutput")&&t.uint32(64).bool(e.hasOutput),null!=e.tags&&e.tags.length)for(n=0;n<e.tags.length;++n)t.uint32(74).string(e.tags[n]);if(null!=e.actionDescriptor&&Object.hasOwnProperty.call(e,"actionDescriptor")&&s.sqlanvil.ActionDescriptor.encode(e.actionDescriptor,t.uint32(82).fork()).ldelim(),null!=e.dependencyTargets&&e.dependencyTargets.length)for(n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.Target.encode(e.dependencyTargets[n],t.uint32(90).fork()).ldelim();return null!=e.hermeticity&&Object.hasOwnProperty.call(e,"hermeticity")&&t.uint32(96).int32(e.hermeticity),null!=e.canonicalTarget&&Object.hasOwnProperty.call(e,"canonicalTarget")&&s.sqlanvil.Target.encode(e.canonicalTarget,t.uint32(106).fork()).ldelim(),null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(112).bool(e.disabled),null!=e.jitCode&&Object.hasOwnProperty.call(e,"jitCode")&&t.uint32(122).string(e.jitCode),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.Operation;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 3:o.target=s.sqlanvil.Target.decode(e,e.uint32());break;case 13:o.canonicalTarget=s.sqlanvil.Target.decode(e,e.uint32());break;case 11:o.dependencyTargets&&o.dependencyTargets.length||(o.dependencyTargets=[]),o.dependencyTargets.push(s.sqlanvil.Target.decode(e,e.uint32()));break;case 12:o.hermeticity=e.int32();break;case 14:o.disabled=e.bool();break;case 6:o.queries&&o.queries.length||(o.queries=[]),o.queries.push(e.string());break;case 15:o.jitCode=e.string();break;case 8:o.hasOutput=e.bool();break;case 9:o.tags&&o.tags.length||(o.tags=[]),o.tags.push(e.string());break;case 10:o.actionDescriptor=s.sqlanvil.ActionDescriptor.decode(e,e.uint32());break;case 7:o.fileName=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.target&&e.hasOwnProperty("target")&&(n=s.sqlanvil.Target.verify(e.target)))return"target."+n;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(n=s.sqlanvil.Target.verify(e.canonicalTarget)))return"canonicalTarget."+n;if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var t=0;t<e.dependencyTargets.length;++t){var n;if(n=s.sqlanvil.Target.verify(e.dependencyTargets[t]))return"dependencyTargets."+n}}if(null!=e.hermeticity&&e.hasOwnProperty("hermeticity"))switch(e.hermeticity){default:return"hermeticity: enum value expected";case 0:case 1:case 2:}if(null!=e.disabled&&e.hasOwnProperty("disabled")&&"boolean"!=typeof e.disabled)return"disabled: boolean expected";if(null!=e.queries&&e.hasOwnProperty("queries")){if(!Array.isArray(e.queries))return"queries: array expected";for(t=0;t<e.queries.length;++t)if(!a.isString(e.queries[t]))return"queries: string[] expected"}if(null!=e.jitCode&&e.hasOwnProperty("jitCode")&&!a.isString(e.jitCode))return"jitCode: string expected";if(null!=e.hasOutput&&e.hasOwnProperty("hasOutput")&&"boolean"!=typeof e.hasOutput)return"hasOutput: boolean expected";if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!a.isString(e.tags[t]))return"tags: string[] expected"}return null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(n=s.sqlanvil.ActionDescriptor.verify(e.actionDescriptor))?"actionDescriptor."+n:null!=e.fileName&&e.hasOwnProperty("fileName")&&!a.isString(e.fileName)?"fileName: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.Operation)return e;var t=new s.sqlanvil.Operation;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.Operation.target: object expected");t.target=s.sqlanvil.Target.fromObject(e.target)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".sqlanvil.Operation.canonicalTarget: object expected");t.canonicalTarget=s.sqlanvil.Target.fromObject(e.canonicalTarget)}if(e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.Operation.dependencyTargets: array expected");t.dependencyTargets=[];for(var n=0;n<e.dependencyTargets.length;++n){if("object"!=typeof e.dependencyTargets[n])throw TypeError(".sqlanvil.Operation.dependencyTargets: object expected");t.dependencyTargets[n]=s.sqlanvil.Target.fromObject(e.dependencyTargets[n])}}switch(e.hermeticity){default:if("number"==typeof e.hermeticity){t.hermeticity=e.hermeticity;break}break;case"UNKNOWN":case 0:t.hermeticity=0;break;case"HERMETIC":case 1:t.hermeticity=1;break;case"NON_HERMETIC":case 2:t.hermeticity=2}if(null!=e.disabled&&(t.disabled=Boolean(e.disabled)),e.queries){if(!Array.isArray(e.queries))throw TypeError(".sqlanvil.Operation.queries: array expected");for(t.queries=[],n=0;n<e.queries.length;++n)t.queries[n]=String(e.queries[n])}if(null!=e.jitCode&&(t.jitCode=String(e.jitCode)),null!=e.hasOutput&&(t.hasOutput=Boolean(e.hasOutput)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.Operation.tags: array expected");for(t.tags=[],n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}if(null!=e.actionDescriptor){if("object"!=typeof e.actionDescriptor)throw TypeError(".sqlanvil.Operation.actionDescriptor: object expected");t.actionDescriptor=s.sqlanvil.ActionDescriptor.fromObject(e.actionDescriptor)}return null!=e.fileName&&(t.fileName=String(e.fileName)),t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.queries=[],n.tags=[],n.dependencyTargets=[]),t.defaults&&(n.target=null,n.fileName="",n.hasOutput=!1,n.actionDescriptor=null,n.hermeticity=t.enums===String?"UNKNOWN":0,n.canonicalTarget=null,n.disabled=!1,n.jitCode=""),null!=e.target&&e.hasOwnProperty("target")&&(n.target=s.sqlanvil.Target.toObject(e.target,t)),e.queries&&e.queries.length){n.queries=[];for(var r=0;r<e.queries.length;++r)n.queries[r]=e.queries[r]}if(null!=e.fileName&&e.hasOwnProperty("fileName")&&(n.fileName=e.fileName),null!=e.hasOutput&&e.hasOwnProperty("hasOutput")&&(n.hasOutput=e.hasOutput),e.tags&&e.tags.length)for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=e.tags[r];if(null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(n.actionDescriptor=s.sqlanvil.ActionDescriptor.toObject(e.actionDescriptor,t)),e.dependencyTargets&&e.dependencyTargets.length)for(n.dependencyTargets=[],r=0;r<e.dependencyTargets.length;++r)n.dependencyTargets[r]=s.sqlanvil.Target.toObject(e.dependencyTargets[r],t);return null!=e.hermeticity&&e.hasOwnProperty("hermeticity")&&(n.hermeticity=t.enums===String?void 0===s.sqlanvil.ActionHermeticity[e.hermeticity]?e.hermeticity:s.sqlanvil.ActionHermeticity[e.hermeticity]:e.hermeticity),null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(n.canonicalTarget=s.sqlanvil.Target.toObject(e.canonicalTarget,t)),null!=e.disabled&&e.hasOwnProperty("disabled")&&(n.disabled=e.disabled),null!=e.jitCode&&e.hasOwnProperty("jitCode")&&(n.jitCode=e.jitCode),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.Operation"},t}(),r.Assertion=function(){function t(e){if(this.dependencyTargets=[],this.tags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.target=null,t.prototype.canonicalTarget=null,t.prototype.dependencyTargets=a.emptyArray,t.prototype.hermeticity=0,t.prototype.disabled=!1,t.prototype.query="",t.prototype.tags=a.emptyArray,t.prototype.actionDescriptor=null,t.prototype.parentAction=null,t.prototype.jitCode="",t.prototype.fileName="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.query&&Object.hasOwnProperty.call(e,"query")&&t.uint32(26).string(e.query),null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(58).string(e.fileName),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&s.sqlanvil.Target.encode(e.target,t.uint32(66).fork()).ldelim(),null!=e.tags&&e.tags.length)for(var n=0;n<e.tags.length;++n)t.uint32(74).string(e.tags[n]);if(null!=e.actionDescriptor&&Object.hasOwnProperty.call(e,"actionDescriptor")&&s.sqlanvil.ActionDescriptor.encode(e.actionDescriptor,t.uint32(82).fork()).ldelim(),null!=e.dependencyTargets&&e.dependencyTargets.length)for(n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.Target.encode(e.dependencyTargets[n],t.uint32(90).fork()).ldelim();return null!=e.hermeticity&&Object.hasOwnProperty.call(e,"hermeticity")&&t.uint32(96).int32(e.hermeticity),null!=e.canonicalTarget&&Object.hasOwnProperty.call(e,"canonicalTarget")&&s.sqlanvil.Target.encode(e.canonicalTarget,t.uint32(106).fork()).ldelim(),null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(112).bool(e.disabled),null!=e.parentAction&&Object.hasOwnProperty.call(e,"parentAction")&&s.sqlanvil.Target.encode(e.parentAction,t.uint32(122).fork()).ldelim(),null!=e.jitCode&&Object.hasOwnProperty.call(e,"jitCode")&&t.uint32(130).string(e.jitCode),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.Assertion;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 8:o.target=s.sqlanvil.Target.decode(e,e.uint32());break;case 13:o.canonicalTarget=s.sqlanvil.Target.decode(e,e.uint32());break;case 11:o.dependencyTargets&&o.dependencyTargets.length||(o.dependencyTargets=[]),o.dependencyTargets.push(s.sqlanvil.Target.decode(e,e.uint32()));break;case 12:o.hermeticity=e.int32();break;case 14:o.disabled=e.bool();break;case 3:o.query=e.string();break;case 9:o.tags&&o.tags.length||(o.tags=[]),o.tags.push(e.string());break;case 10:o.actionDescriptor=s.sqlanvil.ActionDescriptor.decode(e,e.uint32());break;case 15:o.parentAction=s.sqlanvil.Target.decode(e,e.uint32());break;case 16:o.jitCode=e.string();break;case 7:o.fileName=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.target&&e.hasOwnProperty("target")&&(n=s.sqlanvil.Target.verify(e.target)))return"target."+n;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(n=s.sqlanvil.Target.verify(e.canonicalTarget)))return"canonicalTarget."+n;if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var t=0;t<e.dependencyTargets.length;++t){var n;if(n=s.sqlanvil.Target.verify(e.dependencyTargets[t]))return"dependencyTargets."+n}}if(null!=e.hermeticity&&e.hasOwnProperty("hermeticity"))switch(e.hermeticity){default:return"hermeticity: enum value expected";case 0:case 1:case 2:}if(null!=e.disabled&&e.hasOwnProperty("disabled")&&"boolean"!=typeof e.disabled)return"disabled: boolean expected";if(null!=e.query&&e.hasOwnProperty("query")&&!a.isString(e.query))return"query: string expected";if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!a.isString(e.tags[t]))return"tags: string[] expected"}return null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(n=s.sqlanvil.ActionDescriptor.verify(e.actionDescriptor))?"actionDescriptor."+n:null!=e.parentAction&&e.hasOwnProperty("parentAction")&&(n=s.sqlanvil.Target.verify(e.parentAction))?"parentAction."+n:null!=e.jitCode&&e.hasOwnProperty("jitCode")&&!a.isString(e.jitCode)?"jitCode: string expected":null!=e.fileName&&e.hasOwnProperty("fileName")&&!a.isString(e.fileName)?"fileName: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.Assertion)return e;var t=new s.sqlanvil.Assertion;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.Assertion.target: object expected");t.target=s.sqlanvil.Target.fromObject(e.target)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".sqlanvil.Assertion.canonicalTarget: object expected");t.canonicalTarget=s.sqlanvil.Target.fromObject(e.canonicalTarget)}if(e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.Assertion.dependencyTargets: array expected");t.dependencyTargets=[];for(var n=0;n<e.dependencyTargets.length;++n){if("object"!=typeof e.dependencyTargets[n])throw TypeError(".sqlanvil.Assertion.dependencyTargets: object expected");t.dependencyTargets[n]=s.sqlanvil.Target.fromObject(e.dependencyTargets[n])}}switch(e.hermeticity){default:if("number"==typeof e.hermeticity){t.hermeticity=e.hermeticity;break}break;case"UNKNOWN":case 0:t.hermeticity=0;break;case"HERMETIC":case 1:t.hermeticity=1;break;case"NON_HERMETIC":case 2:t.hermeticity=2}if(null!=e.disabled&&(t.disabled=Boolean(e.disabled)),null!=e.query&&(t.query=String(e.query)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.Assertion.tags: array expected");for(t.tags=[],n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}if(null!=e.actionDescriptor){if("object"!=typeof e.actionDescriptor)throw TypeError(".sqlanvil.Assertion.actionDescriptor: object expected");t.actionDescriptor=s.sqlanvil.ActionDescriptor.fromObject(e.actionDescriptor)}if(null!=e.parentAction){if("object"!=typeof e.parentAction)throw TypeError(".sqlanvil.Assertion.parentAction: object expected");t.parentAction=s.sqlanvil.Target.fromObject(e.parentAction)}return null!=e.jitCode&&(t.jitCode=String(e.jitCode)),null!=e.fileName&&(t.fileName=String(e.fileName)),t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.tags=[],n.dependencyTargets=[]),t.defaults&&(n.query="",n.fileName="",n.target=null,n.actionDescriptor=null,n.hermeticity=t.enums===String?"UNKNOWN":0,n.canonicalTarget=null,n.disabled=!1,n.parentAction=null,n.jitCode=""),null!=e.query&&e.hasOwnProperty("query")&&(n.query=e.query),null!=e.fileName&&e.hasOwnProperty("fileName")&&(n.fileName=e.fileName),null!=e.target&&e.hasOwnProperty("target")&&(n.target=s.sqlanvil.Target.toObject(e.target,t)),e.tags&&e.tags.length){n.tags=[];for(var r=0;r<e.tags.length;++r)n.tags[r]=e.tags[r]}if(null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(n.actionDescriptor=s.sqlanvil.ActionDescriptor.toObject(e.actionDescriptor,t)),e.dependencyTargets&&e.dependencyTargets.length)for(n.dependencyTargets=[],r=0;r<e.dependencyTargets.length;++r)n.dependencyTargets[r]=s.sqlanvil.Target.toObject(e.dependencyTargets[r],t);return null!=e.hermeticity&&e.hasOwnProperty("hermeticity")&&(n.hermeticity=t.enums===String?void 0===s.sqlanvil.ActionHermeticity[e.hermeticity]?e.hermeticity:s.sqlanvil.ActionHermeticity[e.hermeticity]:e.hermeticity),null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(n.canonicalTarget=s.sqlanvil.Target.toObject(e.canonicalTarget,t)),null!=e.disabled&&e.hasOwnProperty("disabled")&&(n.disabled=e.disabled),null!=e.parentAction&&e.hasOwnProperty("parentAction")&&(n.parentAction=s.sqlanvil.Target.toObject(e.parentAction,t)),null!=e.jitCode&&e.hasOwnProperty("jitCode")&&(n.jitCode=e.jitCode),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.Assertion"},t}(),r.ActionHermeticity=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN"]=0,t[e[1]="HERMETIC"]=1,t[e[2]="NON_HERMETIC"]=2,t}(),r.Declaration=function(){function t(e){if(this.tags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.target=null,t.prototype.canonicalTarget=null,t.prototype.actionDescriptor=null,t.prototype.fileName="",t.prototype.tags=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&s.sqlanvil.Target.encode(e.target,t.uint32(18).fork()).ldelim(),null!=e.actionDescriptor&&Object.hasOwnProperty.call(e,"actionDescriptor")&&s.sqlanvil.ActionDescriptor.encode(e.actionDescriptor,t.uint32(26).fork()).ldelim(),null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(34).string(e.fileName),null!=e.canonicalTarget&&Object.hasOwnProperty.call(e,"canonicalTarget")&&s.sqlanvil.Target.encode(e.canonicalTarget,t.uint32(42).fork()).ldelim(),null!=e.tags&&e.tags.length)for(var n=0;n<e.tags.length;++n)t.uint32(50).string(e.tags[n]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.Declaration;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 2:o.target=s.sqlanvil.Target.decode(e,e.uint32());break;case 5:o.canonicalTarget=s.sqlanvil.Target.decode(e,e.uint32());break;case 3:o.actionDescriptor=s.sqlanvil.ActionDescriptor.decode(e,e.uint32());break;case 4:o.fileName=e.string();break;case 6:o.tags&&o.tags.length||(o.tags=[]),o.tags.push(e.string());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t;if(null!=e.target&&e.hasOwnProperty("target")&&(t=s.sqlanvil.Target.verify(e.target)))return"target."+t;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(t=s.sqlanvil.Target.verify(e.canonicalTarget)))return"canonicalTarget."+t;if(null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(t=s.sqlanvil.ActionDescriptor.verify(e.actionDescriptor)))return"actionDescriptor."+t;if(null!=e.fileName&&e.hasOwnProperty("fileName")&&!a.isString(e.fileName))return"fileName: string expected";if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(var n=0;n<e.tags.length;++n)if(!a.isString(e.tags[n]))return"tags: string[] expected"}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.Declaration)return e;var t=new s.sqlanvil.Declaration;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.Declaration.target: object expected");t.target=s.sqlanvil.Target.fromObject(e.target)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".sqlanvil.Declaration.canonicalTarget: object expected");t.canonicalTarget=s.sqlanvil.Target.fromObject(e.canonicalTarget)}if(null!=e.actionDescriptor){if("object"!=typeof e.actionDescriptor)throw TypeError(".sqlanvil.Declaration.actionDescriptor: object expected");t.actionDescriptor=s.sqlanvil.ActionDescriptor.fromObject(e.actionDescriptor)}if(null!=e.fileName&&(t.fileName=String(e.fileName)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.Declaration.tags: array expected");t.tags=[];for(var n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.tags=[]),t.defaults&&(n.target=null,n.actionDescriptor=null,n.fileName="",n.canonicalTarget=null),null!=e.target&&e.hasOwnProperty("target")&&(n.target=s.sqlanvil.Target.toObject(e.target,t)),null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(n.actionDescriptor=s.sqlanvil.ActionDescriptor.toObject(e.actionDescriptor,t)),null!=e.fileName&&e.hasOwnProperty("fileName")&&(n.fileName=e.fileName),null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(n.canonicalTarget=s.sqlanvil.Target.toObject(e.canonicalTarget,t)),e.tags&&e.tags.length){n.tags=[];for(var r=0;r<e.tags.length;++r)n.tags[r]=e.tags[r]}return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.Declaration"},t}(),r.Test=function(){function t(e){if(this.tags=[],this.dependencyTargets=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.testQuery="",t.prototype.expectedOutputQuery="",t.prototype.jitCode="",t.prototype.fileName="",t.prototype.disabled=!1,t.prototype.tags=a.emptyArray,t.prototype.target=null,t.prototype.canonicalTarget=null,t.prototype.dependencyTargets=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.testQuery&&Object.hasOwnProperty.call(e,"testQuery")&&t.uint32(18).string(e.testQuery),null!=e.expectedOutputQuery&&Object.hasOwnProperty.call(e,"expectedOutputQuery")&&t.uint32(26).string(e.expectedOutputQuery),null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(34).string(e.fileName),null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(40).bool(e.disabled),null!=e.tags&&e.tags.length)for(var n=0;n<e.tags.length;++n)t.uint32(50).string(e.tags[n]);if(null!=e.target&&Object.hasOwnProperty.call(e,"target")&&s.sqlanvil.Target.encode(e.target,t.uint32(58).fork()).ldelim(),null!=e.canonicalTarget&&Object.hasOwnProperty.call(e,"canonicalTarget")&&s.sqlanvil.Target.encode(e.canonicalTarget,t.uint32(66).fork()).ldelim(),null!=e.dependencyTargets&&e.dependencyTargets.length)for(n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.Target.encode(e.dependencyTargets[n],t.uint32(74).fork()).ldelim();return null!=e.jitCode&&Object.hasOwnProperty.call(e,"jitCode")&&t.uint32(82).string(e.jitCode),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.Test;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.name=e.string();break;case 2:o.testQuery=e.string();break;case 3:o.expectedOutputQuery=e.string();break;case 10:o.jitCode=e.string();break;case 4:o.fileName=e.string();break;case 5:o.disabled=e.bool();break;case 6:o.tags&&o.tags.length||(o.tags=[]),o.tags.push(e.string());break;case 7:o.target=s.sqlanvil.Target.decode(e,e.uint32());break;case 8:o.canonicalTarget=s.sqlanvil.Target.decode(e,e.uint32());break;case 9:o.dependencyTargets&&o.dependencyTargets.length||(o.dependencyTargets=[]),o.dependencyTargets.push(s.sqlanvil.Target.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.testQuery&&e.hasOwnProperty("testQuery")&&!a.isString(e.testQuery))return"testQuery: string expected";if(null!=e.expectedOutputQuery&&e.hasOwnProperty("expectedOutputQuery")&&!a.isString(e.expectedOutputQuery))return"expectedOutputQuery: string expected";if(null!=e.jitCode&&e.hasOwnProperty("jitCode")&&!a.isString(e.jitCode))return"jitCode: string expected";if(null!=e.fileName&&e.hasOwnProperty("fileName")&&!a.isString(e.fileName))return"fileName: string expected";if(null!=e.disabled&&e.hasOwnProperty("disabled")&&"boolean"!=typeof e.disabled)return"disabled: boolean expected";if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(var t=0;t<e.tags.length;++t)if(!a.isString(e.tags[t]))return"tags: string[] expected"}if(null!=e.target&&e.hasOwnProperty("target")&&(n=s.sqlanvil.Target.verify(e.target)))return"target."+n;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(n=s.sqlanvil.Target.verify(e.canonicalTarget)))return"canonicalTarget."+n;if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(t=0;t<e.dependencyTargets.length;++t){var n;if(n=s.sqlanvil.Target.verify(e.dependencyTargets[t]))return"dependencyTargets."+n}}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.Test)return e;var t=new s.sqlanvil.Test;if(null!=e.name&&(t.name=String(e.name)),null!=e.testQuery&&(t.testQuery=String(e.testQuery)),null!=e.expectedOutputQuery&&(t.expectedOutputQuery=String(e.expectedOutputQuery)),null!=e.jitCode&&(t.jitCode=String(e.jitCode)),null!=e.fileName&&(t.fileName=String(e.fileName)),null!=e.disabled&&(t.disabled=Boolean(e.disabled)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.Test.tags: array expected");t.tags=[];for(var n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.Test.target: object expected");t.target=s.sqlanvil.Target.fromObject(e.target)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".sqlanvil.Test.canonicalTarget: object expected");t.canonicalTarget=s.sqlanvil.Target.fromObject(e.canonicalTarget)}if(e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.Test.dependencyTargets: array expected");for(t.dependencyTargets=[],n=0;n<e.dependencyTargets.length;++n){if("object"!=typeof e.dependencyTargets[n])throw TypeError(".sqlanvil.Test.dependencyTargets: object expected");t.dependencyTargets[n]=s.sqlanvil.Target.fromObject(e.dependencyTargets[n])}}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.tags=[],n.dependencyTargets=[]),t.defaults&&(n.name="",n.testQuery="",n.expectedOutputQuery="",n.fileName="",n.disabled=!1,n.target=null,n.canonicalTarget=null,n.jitCode=""),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.testQuery&&e.hasOwnProperty("testQuery")&&(n.testQuery=e.testQuery),null!=e.expectedOutputQuery&&e.hasOwnProperty("expectedOutputQuery")&&(n.expectedOutputQuery=e.expectedOutputQuery),null!=e.fileName&&e.hasOwnProperty("fileName")&&(n.fileName=e.fileName),null!=e.disabled&&e.hasOwnProperty("disabled")&&(n.disabled=e.disabled),e.tags&&e.tags.length){n.tags=[];for(var r=0;r<e.tags.length;++r)n.tags[r]=e.tags[r]}if(null!=e.target&&e.hasOwnProperty("target")&&(n.target=s.sqlanvil.Target.toObject(e.target,t)),null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(n.canonicalTarget=s.sqlanvil.Target.toObject(e.canonicalTarget,t)),e.dependencyTargets&&e.dependencyTargets.length)for(n.dependencyTargets=[],r=0;r<e.dependencyTargets.length;++r)n.dependencyTargets[r]=s.sqlanvil.Target.toObject(e.dependencyTargets[r],t);return null!=e.jitCode&&e.hasOwnProperty("jitCode")&&(n.jitCode=e.jitCode),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.Test"},t}(),r.Notebook=function(){function t(e){if(this.tags=[],this.dependencyTargets=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.target=null,t.prototype.canonicalTarget=null,t.prototype.tags=a.emptyArray,t.prototype.dependencyTargets=a.emptyArray,t.prototype.fileName="",t.prototype.disabled=!1,t.prototype.notebookContents="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&s.sqlanvil.Target.encode(e.target,t.uint32(10).fork()).ldelim(),null!=e.canonicalTarget&&Object.hasOwnProperty.call(e,"canonicalTarget")&&s.sqlanvil.Target.encode(e.canonicalTarget,t.uint32(18).fork()).ldelim(),null!=e.tags&&e.tags.length)for(var n=0;n<e.tags.length;++n)t.uint32(26).string(e.tags[n]);if(null!=e.dependencyTargets&&e.dependencyTargets.length)for(n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.Target.encode(e.dependencyTargets[n],t.uint32(34).fork()).ldelim();return null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(42).string(e.fileName),null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(48).bool(e.disabled),null!=e.notebookContents&&Object.hasOwnProperty.call(e,"notebookContents")&&t.uint32(58).string(e.notebookContents),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.Notebook;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.target=s.sqlanvil.Target.decode(e,e.uint32());break;case 2:o.canonicalTarget=s.sqlanvil.Target.decode(e,e.uint32());break;case 3:o.tags&&o.tags.length||(o.tags=[]),o.tags.push(e.string());break;case 4:o.dependencyTargets&&o.dependencyTargets.length||(o.dependencyTargets=[]),o.dependencyTargets.push(s.sqlanvil.Target.decode(e,e.uint32()));break;case 5:o.fileName=e.string();break;case 6:o.disabled=e.bool();break;case 7:o.notebookContents=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.target&&e.hasOwnProperty("target")&&(n=s.sqlanvil.Target.verify(e.target)))return"target."+n;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(n=s.sqlanvil.Target.verify(e.canonicalTarget)))return"canonicalTarget."+n;if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(var t=0;t<e.tags.length;++t)if(!a.isString(e.tags[t]))return"tags: string[] expected"}if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(t=0;t<e.dependencyTargets.length;++t){var n;if(n=s.sqlanvil.Target.verify(e.dependencyTargets[t]))return"dependencyTargets."+n}}return null!=e.fileName&&e.hasOwnProperty("fileName")&&!a.isString(e.fileName)?"fileName: string expected":null!=e.disabled&&e.hasOwnProperty("disabled")&&"boolean"!=typeof e.disabled?"disabled: boolean expected":null!=e.notebookContents&&e.hasOwnProperty("notebookContents")&&!a.isString(e.notebookContents)?"notebookContents: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.Notebook)return e;var t=new s.sqlanvil.Notebook;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.Notebook.target: object expected");t.target=s.sqlanvil.Target.fromObject(e.target)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".sqlanvil.Notebook.canonicalTarget: object expected");t.canonicalTarget=s.sqlanvil.Target.fromObject(e.canonicalTarget)}if(e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.Notebook.tags: array expected");t.tags=[];for(var n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}if(e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.Notebook.dependencyTargets: array expected");for(t.dependencyTargets=[],n=0;n<e.dependencyTargets.length;++n){if("object"!=typeof e.dependencyTargets[n])throw TypeError(".sqlanvil.Notebook.dependencyTargets: object expected");t.dependencyTargets[n]=s.sqlanvil.Target.fromObject(e.dependencyTargets[n])}}return null!=e.fileName&&(t.fileName=String(e.fileName)),null!=e.disabled&&(t.disabled=Boolean(e.disabled)),null!=e.notebookContents&&(t.notebookContents=String(e.notebookContents)),t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.tags=[],n.dependencyTargets=[]),t.defaults&&(n.target=null,n.canonicalTarget=null,n.fileName="",n.disabled=!1,n.notebookContents=""),null!=e.target&&e.hasOwnProperty("target")&&(n.target=s.sqlanvil.Target.toObject(e.target,t)),null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(n.canonicalTarget=s.sqlanvil.Target.toObject(e.canonicalTarget,t)),e.tags&&e.tags.length){n.tags=[];for(var r=0;r<e.tags.length;++r)n.tags[r]=e.tags[r]}if(e.dependencyTargets&&e.dependencyTargets.length)for(n.dependencyTargets=[],r=0;r<e.dependencyTargets.length;++r)n.dependencyTargets[r]=s.sqlanvil.Target.toObject(e.dependencyTargets[r],t);return null!=e.fileName&&e.hasOwnProperty("fileName")&&(n.fileName=e.fileName),null!=e.disabled&&e.hasOwnProperty("disabled")&&(n.disabled=e.disabled),null!=e.notebookContents&&e.hasOwnProperty("notebookContents")&&(n.notebookContents=e.notebookContents),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.Notebook"},t}(),r.RepositorySnapshotDestination=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.repositorySnapshotUri="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.repositorySnapshotUri&&Object.hasOwnProperty.call(e,"repositorySnapshotUri")&&t.uint32(10).string(e.repositorySnapshotUri),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.RepositorySnapshotDestination;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?o.repositorySnapshotUri=e.string():e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.repositorySnapshotUri&&e.hasOwnProperty("repositorySnapshotUri")&&!a.isString(e.repositorySnapshotUri)?"repositorySnapshotUri: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.RepositorySnapshotDestination)return e;var t=new s.sqlanvil.RepositorySnapshotDestination;return null!=e.repositorySnapshotUri&&(t.repositorySnapshotUri=String(e.repositorySnapshotUri)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.repositorySnapshotUri=""),null!=e.repositorySnapshotUri&&e.hasOwnProperty("repositorySnapshotUri")&&(n.repositorySnapshotUri=e.repositorySnapshotUri),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.RepositorySnapshotDestination"},t}(),r.NotebookRuntimeOptions=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var n;return t.prototype.outputBucket=null,t.prototype.runtimeTemplateName="",t.prototype.repositorySnapshotDestination=null,Object.defineProperty(t.prototype,"outputSink",{get:a.oneOfGetter(n=["outputBucket"]),set:a.oneOfSetter(n)}),Object.defineProperty(t.prototype,"repositorySnapshotStorage",{get:a.oneOfGetter(n=["repositorySnapshotDestination"]),set:a.oneOfSetter(n)}),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.outputBucket&&Object.hasOwnProperty.call(e,"outputBucket")&&t.uint32(10).string(e.outputBucket),null!=e.runtimeTemplateName&&Object.hasOwnProperty.call(e,"runtimeTemplateName")&&t.uint32(18).string(e.runtimeTemplateName),null!=e.repositorySnapshotDestination&&Object.hasOwnProperty.call(e,"repositorySnapshotDestination")&&s.sqlanvil.RepositorySnapshotDestination.encode(e.repositorySnapshotDestination,t.uint32(26).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.NotebookRuntimeOptions;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.outputBucket=e.string();break;case 2:o.runtimeTemplateName=e.string();break;case 3:o.repositorySnapshotDestination=s.sqlanvil.RepositorySnapshotDestination.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.outputBucket&&e.hasOwnProperty("outputBucket")&&(t.outputSink=1,!a.isString(e.outputBucket)))return"outputBucket: string expected";if(null!=e.runtimeTemplateName&&e.hasOwnProperty("runtimeTemplateName")&&!a.isString(e.runtimeTemplateName))return"runtimeTemplateName: string expected";if(null!=e.repositorySnapshotDestination&&e.hasOwnProperty("repositorySnapshotDestination")){t.repositorySnapshotStorage=1;var n=s.sqlanvil.RepositorySnapshotDestination.verify(e.repositorySnapshotDestination);if(n)return"repositorySnapshotDestination."+n}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.NotebookRuntimeOptions)return e;var t=new s.sqlanvil.NotebookRuntimeOptions;if(null!=e.outputBucket&&(t.outputBucket=String(e.outputBucket)),null!=e.runtimeTemplateName&&(t.runtimeTemplateName=String(e.runtimeTemplateName)),null!=e.repositorySnapshotDestination){if("object"!=typeof e.repositorySnapshotDestination)throw TypeError(".sqlanvil.NotebookRuntimeOptions.repositorySnapshotDestination: object expected");t.repositorySnapshotDestination=s.sqlanvil.RepositorySnapshotDestination.fromObject(e.repositorySnapshotDestination)}return t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.runtimeTemplateName=""),null!=e.outputBucket&&e.hasOwnProperty("outputBucket")&&(n.outputBucket=e.outputBucket,t.oneofs&&(n.outputSink="outputBucket")),null!=e.runtimeTemplateName&&e.hasOwnProperty("runtimeTemplateName")&&(n.runtimeTemplateName=e.runtimeTemplateName),null!=e.repositorySnapshotDestination&&e.hasOwnProperty("repositorySnapshotDestination")&&(n.repositorySnapshotDestination=s.sqlanvil.RepositorySnapshotDestination.toObject(e.repositorySnapshotDestination,t),t.oneofs&&(n.repositorySnapshotStorage="repositorySnapshotDestination")),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.NotebookRuntimeOptions"},t}(),r.DataPreparation=function(){function t(e){if(this.targets=[],this.canonicalTargets=[],this.tags=[],this.dependencyTargets=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var n;return t.prototype.target=null,t.prototype.canonicalTarget=null,t.prototype.targets=a.emptyArray,t.prototype.canonicalTargets=a.emptyArray,t.prototype.tags=a.emptyArray,t.prototype.dependencyTargets=a.emptyArray,t.prototype.fileName="",t.prototype.disabled=!1,t.prototype.dataPreparationYaml=null,t.prototype.query=null,t.prototype.errorTable=null,t.prototype.errorTableRetentionDays=0,t.prototype.load=null,Object.defineProperty(t.prototype,"definition",{get:a.oneOfGetter(n=["dataPreparationYaml","query"]),set:a.oneOfSetter(n)}),t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.targets&&e.targets.length)for(var n=0;n<e.targets.length;++n)s.sqlanvil.Target.encode(e.targets[n],t.uint32(10).fork()).ldelim();if(null!=e.canonicalTargets&&e.canonicalTargets.length)for(n=0;n<e.canonicalTargets.length;++n)s.sqlanvil.Target.encode(e.canonicalTargets[n],t.uint32(18).fork()).ldelim();if(null!=e.tags&&e.tags.length)for(n=0;n<e.tags.length;++n)t.uint32(26).string(e.tags[n]);if(null!=e.dependencyTargets&&e.dependencyTargets.length)for(n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.Target.encode(e.dependencyTargets[n],t.uint32(34).fork()).ldelim();return null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(42).string(e.fileName),null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(48).bool(e.disabled),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&s.sqlanvil.Target.encode(e.target,t.uint32(66).fork()).ldelim(),null!=e.canonicalTarget&&Object.hasOwnProperty.call(e,"canonicalTarget")&&s.sqlanvil.Target.encode(e.canonicalTarget,t.uint32(74).fork()).ldelim(),null!=e.dataPreparationYaml&&Object.hasOwnProperty.call(e,"dataPreparationYaml")&&t.uint32(90).string(e.dataPreparationYaml),null!=e.errorTable&&Object.hasOwnProperty.call(e,"errorTable")&&s.sqlanvil.Target.encode(e.errorTable,t.uint32(98).fork()).ldelim(),null!=e.errorTableRetentionDays&&Object.hasOwnProperty.call(e,"errorTableRetentionDays")&&t.uint32(104).int32(e.errorTableRetentionDays),null!=e.query&&Object.hasOwnProperty.call(e,"query")&&t.uint32(122).string(e.query),null!=e.load&&Object.hasOwnProperty.call(e,"load")&&s.sqlanvil.LoadConfiguration.encode(e.load,t.uint32(130).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.DataPreparation;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 8:o.target=s.sqlanvil.Target.decode(e,e.uint32());break;case 9:o.canonicalTarget=s.sqlanvil.Target.decode(e,e.uint32());break;case 1:o.targets&&o.targets.length||(o.targets=[]),o.targets.push(s.sqlanvil.Target.decode(e,e.uint32()));break;case 2:o.canonicalTargets&&o.canonicalTargets.length||(o.canonicalTargets=[]),o.canonicalTargets.push(s.sqlanvil.Target.decode(e,e.uint32()));break;case 3:o.tags&&o.tags.length||(o.tags=[]),o.tags.push(e.string());break;case 4:o.dependencyTargets&&o.dependencyTargets.length||(o.dependencyTargets=[]),o.dependencyTargets.push(s.sqlanvil.Target.decode(e,e.uint32()));break;case 5:o.fileName=e.string();break;case 6:o.disabled=e.bool();break;case 11:o.dataPreparationYaml=e.string();break;case 15:o.query=e.string();break;case 12:o.errorTable=s.sqlanvil.Target.decode(e,e.uint32());break;case 13:o.errorTableRetentionDays=e.int32();break;case 16:o.load=s.sqlanvil.LoadConfiguration.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.target&&e.hasOwnProperty("target")&&(r=s.sqlanvil.Target.verify(e.target)))return"target."+r;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(r=s.sqlanvil.Target.verify(e.canonicalTarget)))return"canonicalTarget."+r;if(null!=e.targets&&e.hasOwnProperty("targets")){if(!Array.isArray(e.targets))return"targets: array expected";for(var n=0;n<e.targets.length;++n)if(r=s.sqlanvil.Target.verify(e.targets[n]))return"targets."+r}if(null!=e.canonicalTargets&&e.hasOwnProperty("canonicalTargets")){if(!Array.isArray(e.canonicalTargets))return"canonicalTargets: array expected";for(n=0;n<e.canonicalTargets.length;++n)if(r=s.sqlanvil.Target.verify(e.canonicalTargets[n]))return"canonicalTargets."+r}if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(n=0;n<e.tags.length;++n)if(!a.isString(e.tags[n]))return"tags: string[] expected"}if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(n=0;n<e.dependencyTargets.length;++n){var r;if(r=s.sqlanvil.Target.verify(e.dependencyTargets[n]))return"dependencyTargets."+r}}if(null!=e.fileName&&e.hasOwnProperty("fileName")&&!a.isString(e.fileName))return"fileName: string expected";if(null!=e.disabled&&e.hasOwnProperty("disabled")&&"boolean"!=typeof e.disabled)return"disabled: boolean expected";if(null!=e.dataPreparationYaml&&e.hasOwnProperty("dataPreparationYaml")&&(t.definition=1,!a.isString(e.dataPreparationYaml)))return"dataPreparationYaml: string expected";if(null!=e.query&&e.hasOwnProperty("query")){if(1===t.definition)return"definition: multiple values";if(t.definition=1,!a.isString(e.query))return"query: string expected"}return null!=e.errorTable&&e.hasOwnProperty("errorTable")&&(r=s.sqlanvil.Target.verify(e.errorTable))?"errorTable."+r:null!=e.errorTableRetentionDays&&e.hasOwnProperty("errorTableRetentionDays")&&!a.isInteger(e.errorTableRetentionDays)?"errorTableRetentionDays: integer expected":null!=e.load&&e.hasOwnProperty("load")&&(r=s.sqlanvil.LoadConfiguration.verify(e.load))?"load."+r:null},t.fromObject=function(e){if(e instanceof s.sqlanvil.DataPreparation)return e;var t=new s.sqlanvil.DataPreparation;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.DataPreparation.target: object expected");t.target=s.sqlanvil.Target.fromObject(e.target)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".sqlanvil.DataPreparation.canonicalTarget: object expected");t.canonicalTarget=s.sqlanvil.Target.fromObject(e.canonicalTarget)}if(e.targets){if(!Array.isArray(e.targets))throw TypeError(".sqlanvil.DataPreparation.targets: array expected");t.targets=[];for(var n=0;n<e.targets.length;++n){if("object"!=typeof e.targets[n])throw TypeError(".sqlanvil.DataPreparation.targets: object expected");t.targets[n]=s.sqlanvil.Target.fromObject(e.targets[n])}}if(e.canonicalTargets){if(!Array.isArray(e.canonicalTargets))throw TypeError(".sqlanvil.DataPreparation.canonicalTargets: array expected");for(t.canonicalTargets=[],n=0;n<e.canonicalTargets.length;++n){if("object"!=typeof e.canonicalTargets[n])throw TypeError(".sqlanvil.DataPreparation.canonicalTargets: object expected");t.canonicalTargets[n]=s.sqlanvil.Target.fromObject(e.canonicalTargets[n])}}if(e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.DataPreparation.tags: array expected");for(t.tags=[],n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}if(e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.DataPreparation.dependencyTargets: array expected");for(t.dependencyTargets=[],n=0;n<e.dependencyTargets.length;++n){if("object"!=typeof e.dependencyTargets[n])throw TypeError(".sqlanvil.DataPreparation.dependencyTargets: object expected");t.dependencyTargets[n]=s.sqlanvil.Target.fromObject(e.dependencyTargets[n])}}if(null!=e.fileName&&(t.fileName=String(e.fileName)),null!=e.disabled&&(t.disabled=Boolean(e.disabled)),null!=e.dataPreparationYaml&&(t.dataPreparationYaml=String(e.dataPreparationYaml)),null!=e.query&&(t.query=String(e.query)),null!=e.errorTable){if("object"!=typeof e.errorTable)throw TypeError(".sqlanvil.DataPreparation.errorTable: object expected");t.errorTable=s.sqlanvil.Target.fromObject(e.errorTable)}if(null!=e.errorTableRetentionDays&&(t.errorTableRetentionDays=0|e.errorTableRetentionDays),null!=e.load){if("object"!=typeof e.load)throw TypeError(".sqlanvil.DataPreparation.load: object expected");t.load=s.sqlanvil.LoadConfiguration.fromObject(e.load)}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.targets=[],n.canonicalTargets=[],n.tags=[],n.dependencyTargets=[]),t.defaults&&(n.fileName="",n.disabled=!1,n.target=null,n.canonicalTarget=null,n.errorTable=null,n.errorTableRetentionDays=0,n.load=null),e.targets&&e.targets.length){n.targets=[];for(var r=0;r<e.targets.length;++r)n.targets[r]=s.sqlanvil.Target.toObject(e.targets[r],t)}if(e.canonicalTargets&&e.canonicalTargets.length)for(n.canonicalTargets=[],r=0;r<e.canonicalTargets.length;++r)n.canonicalTargets[r]=s.sqlanvil.Target.toObject(e.canonicalTargets[r],t);if(e.tags&&e.tags.length)for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=e.tags[r];if(e.dependencyTargets&&e.dependencyTargets.length)for(n.dependencyTargets=[],r=0;r<e.dependencyTargets.length;++r)n.dependencyTargets[r]=s.sqlanvil.Target.toObject(e.dependencyTargets[r],t);return null!=e.fileName&&e.hasOwnProperty("fileName")&&(n.fileName=e.fileName),null!=e.disabled&&e.hasOwnProperty("disabled")&&(n.disabled=e.disabled),null!=e.target&&e.hasOwnProperty("target")&&(n.target=s.sqlanvil.Target.toObject(e.target,t)),null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(n.canonicalTarget=s.sqlanvil.Target.toObject(e.canonicalTarget,t)),null!=e.dataPreparationYaml&&e.hasOwnProperty("dataPreparationYaml")&&(n.dataPreparationYaml=e.dataPreparationYaml,t.oneofs&&(n.definition="dataPreparationYaml")),null!=e.errorTable&&e.hasOwnProperty("errorTable")&&(n.errorTable=s.sqlanvil.Target.toObject(e.errorTable,t)),null!=e.errorTableRetentionDays&&e.hasOwnProperty("errorTableRetentionDays")&&(n.errorTableRetentionDays=e.errorTableRetentionDays),null!=e.query&&e.hasOwnProperty("query")&&(n.query=e.query,t.oneofs&&(n.definition="query")),null!=e.load&&e.hasOwnProperty("load")&&(n.load=s.sqlanvil.LoadConfiguration.toObject(e.load,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.DataPreparation"},t}(),r.LoadConfiguration=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var n;return t.prototype.replace=null,t.prototype.append=null,t.prototype.maximum=null,t.prototype.unique=null,t.prototype.automatic=null,t.prototype.merge=null,Object.defineProperty(t.prototype,"mode",{get:a.oneOfGetter(n=["replace","append","maximum","unique","automatic","merge"]),set:a.oneOfSetter(n)}),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.replace&&Object.hasOwnProperty.call(e,"replace")&&s.sqlanvil.SimpleLoadMode.encode(e.replace,t.uint32(10).fork()).ldelim(),null!=e.append&&Object.hasOwnProperty.call(e,"append")&&s.sqlanvil.SimpleLoadMode.encode(e.append,t.uint32(18).fork()).ldelim(),null!=e.maximum&&Object.hasOwnProperty.call(e,"maximum")&&s.sqlanvil.IncrementalLoadMode.encode(e.maximum,t.uint32(26).fork()).ldelim(),null!=e.unique&&Object.hasOwnProperty.call(e,"unique")&&s.sqlanvil.IncrementalLoadMode.encode(e.unique,t.uint32(34).fork()).ldelim(),null!=e.automatic&&Object.hasOwnProperty.call(e,"automatic")&&s.sqlanvil.IncrementalLoadMode.encode(e.automatic,t.uint32(42).fork()).ldelim(),null!=e.merge&&Object.hasOwnProperty.call(e,"merge")&&s.sqlanvil.MergeLoadMode.encode(e.merge,t.uint32(50).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.LoadConfiguration;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.replace=s.sqlanvil.SimpleLoadMode.decode(e,e.uint32());break;case 2:o.append=s.sqlanvil.SimpleLoadMode.decode(e,e.uint32());break;case 3:o.maximum=s.sqlanvil.IncrementalLoadMode.decode(e,e.uint32());break;case 4:o.unique=s.sqlanvil.IncrementalLoadMode.decode(e,e.uint32());break;case 5:o.automatic=s.sqlanvil.IncrementalLoadMode.decode(e,e.uint32());break;case 6:o.merge=s.sqlanvil.MergeLoadMode.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.replace&&e.hasOwnProperty("replace")&&(t.mode=1,n=s.sqlanvil.SimpleLoadMode.verify(e.replace)))return"replace."+n;if(null!=e.append&&e.hasOwnProperty("append")){if(1===t.mode)return"mode: multiple values";if(t.mode=1,n=s.sqlanvil.SimpleLoadMode.verify(e.append))return"append."+n}if(null!=e.maximum&&e.hasOwnProperty("maximum")){if(1===t.mode)return"mode: multiple values";if(t.mode=1,n=s.sqlanvil.IncrementalLoadMode.verify(e.maximum))return"maximum."+n}if(null!=e.unique&&e.hasOwnProperty("unique")){if(1===t.mode)return"mode: multiple values";if(t.mode=1,n=s.sqlanvil.IncrementalLoadMode.verify(e.unique))return"unique."+n}if(null!=e.automatic&&e.hasOwnProperty("automatic")){if(1===t.mode)return"mode: multiple values";if(t.mode=1,n=s.sqlanvil.IncrementalLoadMode.verify(e.automatic))return"automatic."+n}if(null!=e.merge&&e.hasOwnProperty("merge")){if(1===t.mode)return"mode: multiple values";var n;if(t.mode=1,n=s.sqlanvil.MergeLoadMode.verify(e.merge))return"merge."+n}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.LoadConfiguration)return e;var t=new s.sqlanvil.LoadConfiguration;if(null!=e.replace){if("object"!=typeof e.replace)throw TypeError(".sqlanvil.LoadConfiguration.replace: object expected");t.replace=s.sqlanvil.SimpleLoadMode.fromObject(e.replace)}if(null!=e.append){if("object"!=typeof e.append)throw TypeError(".sqlanvil.LoadConfiguration.append: object expected");t.append=s.sqlanvil.SimpleLoadMode.fromObject(e.append)}if(null!=e.maximum){if("object"!=typeof e.maximum)throw TypeError(".sqlanvil.LoadConfiguration.maximum: object expected");t.maximum=s.sqlanvil.IncrementalLoadMode.fromObject(e.maximum)}if(null!=e.unique){if("object"!=typeof e.unique)throw TypeError(".sqlanvil.LoadConfiguration.unique: object expected");t.unique=s.sqlanvil.IncrementalLoadMode.fromObject(e.unique)}if(null!=e.automatic){if("object"!=typeof e.automatic)throw TypeError(".sqlanvil.LoadConfiguration.automatic: object expected");t.automatic=s.sqlanvil.IncrementalLoadMode.fromObject(e.automatic)}if(null!=e.merge){if("object"!=typeof e.merge)throw TypeError(".sqlanvil.LoadConfiguration.merge: object expected");t.merge=s.sqlanvil.MergeLoadMode.fromObject(e.merge)}return t},t.toObject=function(e,t){t||(t={});var n={};return null!=e.replace&&e.hasOwnProperty("replace")&&(n.replace=s.sqlanvil.SimpleLoadMode.toObject(e.replace,t),t.oneofs&&(n.mode="replace")),null!=e.append&&e.hasOwnProperty("append")&&(n.append=s.sqlanvil.SimpleLoadMode.toObject(e.append,t),t.oneofs&&(n.mode="append")),null!=e.maximum&&e.hasOwnProperty("maximum")&&(n.maximum=s.sqlanvil.IncrementalLoadMode.toObject(e.maximum,t),t.oneofs&&(n.mode="maximum")),null!=e.unique&&e.hasOwnProperty("unique")&&(n.unique=s.sqlanvil.IncrementalLoadMode.toObject(e.unique,t),t.oneofs&&(n.mode="unique")),null!=e.automatic&&e.hasOwnProperty("automatic")&&(n.automatic=s.sqlanvil.IncrementalLoadMode.toObject(e.automatic,t),t.oneofs&&(n.mode="automatic")),null!=e.merge&&e.hasOwnProperty("merge")&&(n.merge=s.sqlanvil.MergeLoadMode.toObject(e.merge,t),t.oneofs&&(n.mode="merge")),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.LoadConfiguration"},t}(),r.SimpleLoadMode=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.SimpleLoadMode;e.pos<r;){var a=e.uint32();if(a===n)break;e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null},t.fromObject=function(e){return e instanceof s.sqlanvil.SimpleLoadMode?e:new s.sqlanvil.SimpleLoadMode},t.toObject=function(){return{}},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.SimpleLoadMode"},t}(),r.IncrementalLoadMode=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.columnName="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.columnName&&Object.hasOwnProperty.call(e,"columnName")&&t.uint32(10).string(e.columnName),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.IncrementalLoadMode;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?o.columnName=e.string():e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.columnName&&e.hasOwnProperty("columnName")&&!a.isString(e.columnName)?"columnName: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.IncrementalLoadMode)return e;var t=new s.sqlanvil.IncrementalLoadMode;return null!=e.columnName&&(t.columnName=String(e.columnName)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.columnName=""),null!=e.columnName&&e.hasOwnProperty("columnName")&&(n.columnName=e.columnName),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.IncrementalLoadMode"},t}(),r.MergeLoadMode=function(){function t(e){if(this.uniqueKey=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.uniqueKey=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.uniqueKey&&e.uniqueKey.length)for(var n=0;n<e.uniqueKey.length;++n)t.uint32(10).string(e.uniqueKey[n]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.MergeLoadMode;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?(o.uniqueKey&&o.uniqueKey.length||(o.uniqueKey=[]),o.uniqueKey.push(e.string())):e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.uniqueKey&&e.hasOwnProperty("uniqueKey")){if(!Array.isArray(e.uniqueKey))return"uniqueKey: array expected";for(var t=0;t<e.uniqueKey.length;++t)if(!a.isString(e.uniqueKey[t]))return"uniqueKey: string[] expected"}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.MergeLoadMode)return e;var t=new s.sqlanvil.MergeLoadMode;if(e.uniqueKey){if(!Array.isArray(e.uniqueKey))throw TypeError(".sqlanvil.MergeLoadMode.uniqueKey: array expected");t.uniqueKey=[];for(var n=0;n<e.uniqueKey.length;++n)t.uniqueKey[n]=String(e.uniqueKey[n])}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.uniqueKey=[]),e.uniqueKey&&e.uniqueKey.length){n.uniqueKey=[];for(var r=0;r<e.uniqueKey.length;++r)n.uniqueKey[r]=e.uniqueKey[r]}return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.MergeLoadMode"},t}(),r.CompiledGraph=function(){function t(e){if(this.tables=[],this.operations=[],this.assertions=[],this.declarations=[],this.tests=[],this.notebooks=[],this.dataPreparations=[],this.targets=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.projectConfig=null,t.prototype.tables=a.emptyArray,t.prototype.operations=a.emptyArray,t.prototype.assertions=a.emptyArray,t.prototype.declarations=a.emptyArray,t.prototype.tests=a.emptyArray,t.prototype.notebooks=a.emptyArray,t.prototype.dataPreparations=a.emptyArray,t.prototype.graphErrors=null,t.prototype.sqlanvilCoreVersion="",t.prototype.targets=a.emptyArray,t.prototype.jitData=null,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.tables&&e.tables.length)for(var n=0;n<e.tables.length;++n)s.sqlanvil.Table.encode(e.tables[n],t.uint32(10).fork()).ldelim();if(null!=e.operations&&e.operations.length)for(n=0;n<e.operations.length;++n)s.sqlanvil.Operation.encode(e.operations[n],t.uint32(18).fork()).ldelim();if(null!=e.assertions&&e.assertions.length)for(n=0;n<e.assertions.length;++n)s.sqlanvil.Assertion.encode(e.assertions[n],t.uint32(26).fork()).ldelim();if(null!=e.projectConfig&&Object.hasOwnProperty.call(e,"projectConfig")&&s.sqlanvil.ProjectConfig.encode(e.projectConfig,t.uint32(34).fork()).ldelim(),null!=e.graphErrors&&Object.hasOwnProperty.call(e,"graphErrors")&&s.sqlanvil.GraphErrors.encode(e.graphErrors,t.uint32(58).fork()).ldelim(),null!=e.tests&&e.tests.length)for(n=0;n<e.tests.length;++n)s.sqlanvil.Test.encode(e.tests[n],t.uint32(66).fork()).ldelim();if(null!=e.declarations&&e.declarations.length)for(n=0;n<e.declarations.length;++n)s.sqlanvil.Declaration.encode(e.declarations[n],t.uint32(74).fork()).ldelim();if(null!=e.sqlanvilCoreVersion&&Object.hasOwnProperty.call(e,"sqlanvilCoreVersion")&&t.uint32(82).string(e.sqlanvilCoreVersion),null!=e.targets&&e.targets.length)for(n=0;n<e.targets.length;++n)s.sqlanvil.Target.encode(e.targets[n],t.uint32(90).fork()).ldelim();if(null!=e.notebooks&&e.notebooks.length)for(n=0;n<e.notebooks.length;++n)s.sqlanvil.Notebook.encode(e.notebooks[n],t.uint32(98).fork()).ldelim();if(null!=e.dataPreparations&&e.dataPreparations.length)for(n=0;n<e.dataPreparations.length;++n)s.sqlanvil.DataPreparation.encode(e.dataPreparations[n],t.uint32(106).fork()).ldelim();return null!=e.jitData&&Object.hasOwnProperty.call(e,"jitData")&&s.google.protobuf.Struct.encode(e.jitData,t.uint32(122).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.CompiledGraph;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 4:o.projectConfig=s.sqlanvil.ProjectConfig.decode(e,e.uint32());break;case 1:o.tables&&o.tables.length||(o.tables=[]),o.tables.push(s.sqlanvil.Table.decode(e,e.uint32()));break;case 2:o.operations&&o.operations.length||(o.operations=[]),o.operations.push(s.sqlanvil.Operation.decode(e,e.uint32()));break;case 3:o.assertions&&o.assertions.length||(o.assertions=[]),o.assertions.push(s.sqlanvil.Assertion.decode(e,e.uint32()));break;case 9:o.declarations&&o.declarations.length||(o.declarations=[]),o.declarations.push(s.sqlanvil.Declaration.decode(e,e.uint32()));break;case 8:o.tests&&o.tests.length||(o.tests=[]),o.tests.push(s.sqlanvil.Test.decode(e,e.uint32()));break;case 12:o.notebooks&&o.notebooks.length||(o.notebooks=[]),o.notebooks.push(s.sqlanvil.Notebook.decode(e,e.uint32()));break;case 13:o.dataPreparations&&o.dataPreparations.length||(o.dataPreparations=[]),o.dataPreparations.push(s.sqlanvil.DataPreparation.decode(e,e.uint32()));break;case 7:o.graphErrors=s.sqlanvil.GraphErrors.decode(e,e.uint32());break;case 10:o.sqlanvilCoreVersion=e.string();break;case 11:o.targets&&o.targets.length||(o.targets=[]),o.targets.push(s.sqlanvil.Target.decode(e,e.uint32()));break;case 15:o.jitData=s.google.protobuf.Struct.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.projectConfig&&e.hasOwnProperty("projectConfig")&&(n=s.sqlanvil.ProjectConfig.verify(e.projectConfig)))return"projectConfig."+n;if(null!=e.tables&&e.hasOwnProperty("tables")){if(!Array.isArray(e.tables))return"tables: array expected";for(var t=0;t<e.tables.length;++t)if(n=s.sqlanvil.Table.verify(e.tables[t]))return"tables."+n}if(null!=e.operations&&e.hasOwnProperty("operations")){if(!Array.isArray(e.operations))return"operations: array expected";for(t=0;t<e.operations.length;++t)if(n=s.sqlanvil.Operation.verify(e.operations[t]))return"operations."+n}if(null!=e.assertions&&e.hasOwnProperty("assertions")){if(!Array.isArray(e.assertions))return"assertions: array expected";for(t=0;t<e.assertions.length;++t)if(n=s.sqlanvil.Assertion.verify(e.assertions[t]))return"assertions."+n}if(null!=e.declarations&&e.hasOwnProperty("declarations")){if(!Array.isArray(e.declarations))return"declarations: array expected";for(t=0;t<e.declarations.length;++t)if(n=s.sqlanvil.Declaration.verify(e.declarations[t]))return"declarations."+n}if(null!=e.tests&&e.hasOwnProperty("tests")){if(!Array.isArray(e.tests))return"tests: array expected";for(t=0;t<e.tests.length;++t)if(n=s.sqlanvil.Test.verify(e.tests[t]))return"tests."+n}if(null!=e.notebooks&&e.hasOwnProperty("notebooks")){if(!Array.isArray(e.notebooks))return"notebooks: array expected";for(t=0;t<e.notebooks.length;++t)if(n=s.sqlanvil.Notebook.verify(e.notebooks[t]))return"notebooks."+n}if(null!=e.dataPreparations&&e.hasOwnProperty("dataPreparations")){if(!Array.isArray(e.dataPreparations))return"dataPreparations: array expected";for(t=0;t<e.dataPreparations.length;++t)if(n=s.sqlanvil.DataPreparation.verify(e.dataPreparations[t]))return"dataPreparations."+n}if(null!=e.graphErrors&&e.hasOwnProperty("graphErrors")&&(n=s.sqlanvil.GraphErrors.verify(e.graphErrors)))return"graphErrors."+n;if(null!=e.sqlanvilCoreVersion&&e.hasOwnProperty("sqlanvilCoreVersion")&&!a.isString(e.sqlanvilCoreVersion))return"sqlanvilCoreVersion: string expected";if(null!=e.targets&&e.hasOwnProperty("targets")){if(!Array.isArray(e.targets))return"targets: array expected";for(t=0;t<e.targets.length;++t){var n;if(n=s.sqlanvil.Target.verify(e.targets[t]))return"targets."+n}}return null!=e.jitData&&e.hasOwnProperty("jitData")&&(n=s.google.protobuf.Struct.verify(e.jitData))?"jitData."+n:null},t.fromObject=function(e){if(e instanceof s.sqlanvil.CompiledGraph)return e;var t=new s.sqlanvil.CompiledGraph;if(null!=e.projectConfig){if("object"!=typeof e.projectConfig)throw TypeError(".sqlanvil.CompiledGraph.projectConfig: object expected");t.projectConfig=s.sqlanvil.ProjectConfig.fromObject(e.projectConfig)}if(e.tables){if(!Array.isArray(e.tables))throw TypeError(".sqlanvil.CompiledGraph.tables: array expected");t.tables=[];for(var n=0;n<e.tables.length;++n){if("object"!=typeof e.tables[n])throw TypeError(".sqlanvil.CompiledGraph.tables: object expected");t.tables[n]=s.sqlanvil.Table.fromObject(e.tables[n])}}if(e.operations){if(!Array.isArray(e.operations))throw TypeError(".sqlanvil.CompiledGraph.operations: array expected");for(t.operations=[],n=0;n<e.operations.length;++n){if("object"!=typeof e.operations[n])throw TypeError(".sqlanvil.CompiledGraph.operations: object expected");t.operations[n]=s.sqlanvil.Operation.fromObject(e.operations[n])}}if(e.assertions){if(!Array.isArray(e.assertions))throw TypeError(".sqlanvil.CompiledGraph.assertions: array expected");for(t.assertions=[],n=0;n<e.assertions.length;++n){if("object"!=typeof e.assertions[n])throw TypeError(".sqlanvil.CompiledGraph.assertions: object expected");t.assertions[n]=s.sqlanvil.Assertion.fromObject(e.assertions[n])}}if(e.declarations){if(!Array.isArray(e.declarations))throw TypeError(".sqlanvil.CompiledGraph.declarations: array expected");for(t.declarations=[],n=0;n<e.declarations.length;++n){if("object"!=typeof e.declarations[n])throw TypeError(".sqlanvil.CompiledGraph.declarations: object expected");t.declarations[n]=s.sqlanvil.Declaration.fromObject(e.declarations[n])}}if(e.tests){if(!Array.isArray(e.tests))throw TypeError(".sqlanvil.CompiledGraph.tests: array expected");for(t.tests=[],n=0;n<e.tests.length;++n){if("object"!=typeof e.tests[n])throw TypeError(".sqlanvil.CompiledGraph.tests: object expected");t.tests[n]=s.sqlanvil.Test.fromObject(e.tests[n])}}if(e.notebooks){if(!Array.isArray(e.notebooks))throw TypeError(".sqlanvil.CompiledGraph.notebooks: array expected");for(t.notebooks=[],n=0;n<e.notebooks.length;++n){if("object"!=typeof e.notebooks[n])throw TypeError(".sqlanvil.CompiledGraph.notebooks: object expected");t.notebooks[n]=s.sqlanvil.Notebook.fromObject(e.notebooks[n])}}if(e.dataPreparations){if(!Array.isArray(e.dataPreparations))throw TypeError(".sqlanvil.CompiledGraph.dataPreparations: array expected");for(t.dataPreparations=[],n=0;n<e.dataPreparations.length;++n){if("object"!=typeof e.dataPreparations[n])throw TypeError(".sqlanvil.CompiledGraph.dataPreparations: object expected");t.dataPreparations[n]=s.sqlanvil.DataPreparation.fromObject(e.dataPreparations[n])}}if(null!=e.graphErrors){if("object"!=typeof e.graphErrors)throw TypeError(".sqlanvil.CompiledGraph.graphErrors: object expected");t.graphErrors=s.sqlanvil.GraphErrors.fromObject(e.graphErrors)}if(null!=e.sqlanvilCoreVersion&&(t.sqlanvilCoreVersion=String(e.sqlanvilCoreVersion)),e.targets){if(!Array.isArray(e.targets))throw TypeError(".sqlanvil.CompiledGraph.targets: array expected");for(t.targets=[],n=0;n<e.targets.length;++n){if("object"!=typeof e.targets[n])throw TypeError(".sqlanvil.CompiledGraph.targets: object expected");t.targets[n]=s.sqlanvil.Target.fromObject(e.targets[n])}}if(null!=e.jitData){if("object"!=typeof e.jitData)throw TypeError(".sqlanvil.CompiledGraph.jitData: object expected");t.jitData=s.google.protobuf.Struct.fromObject(e.jitData)}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.tables=[],n.operations=[],n.assertions=[],n.tests=[],n.declarations=[],n.targets=[],n.notebooks=[],n.dataPreparations=[]),t.defaults&&(n.projectConfig=null,n.graphErrors=null,n.sqlanvilCoreVersion="",n.jitData=null),e.tables&&e.tables.length){n.tables=[];for(var r=0;r<e.tables.length;++r)n.tables[r]=s.sqlanvil.Table.toObject(e.tables[r],t)}if(e.operations&&e.operations.length)for(n.operations=[],r=0;r<e.operations.length;++r)n.operations[r]=s.sqlanvil.Operation.toObject(e.operations[r],t);if(e.assertions&&e.assertions.length)for(n.assertions=[],r=0;r<e.assertions.length;++r)n.assertions[r]=s.sqlanvil.Assertion.toObject(e.assertions[r],t);if(null!=e.projectConfig&&e.hasOwnProperty("projectConfig")&&(n.projectConfig=s.sqlanvil.ProjectConfig.toObject(e.projectConfig,t)),null!=e.graphErrors&&e.hasOwnProperty("graphErrors")&&(n.graphErrors=s.sqlanvil.GraphErrors.toObject(e.graphErrors,t)),e.tests&&e.tests.length)for(n.tests=[],r=0;r<e.tests.length;++r)n.tests[r]=s.sqlanvil.Test.toObject(e.tests[r],t);if(e.declarations&&e.declarations.length)for(n.declarations=[],r=0;r<e.declarations.length;++r)n.declarations[r]=s.sqlanvil.Declaration.toObject(e.declarations[r],t);if(null!=e.sqlanvilCoreVersion&&e.hasOwnProperty("sqlanvilCoreVersion")&&(n.sqlanvilCoreVersion=e.sqlanvilCoreVersion),e.targets&&e.targets.length)for(n.targets=[],r=0;r<e.targets.length;++r)n.targets[r]=s.sqlanvil.Target.toObject(e.targets[r],t);if(e.notebooks&&e.notebooks.length)for(n.notebooks=[],r=0;r<e.notebooks.length;++r)n.notebooks[r]=s.sqlanvil.Notebook.toObject(e.notebooks[r],t);if(e.dataPreparations&&e.dataPreparations.length)for(n.dataPreparations=[],r=0;r<e.dataPreparations.length;++r)n.dataPreparations[r]=s.sqlanvil.DataPreparation.toObject(e.dataPreparations[r],t);return null!=e.jitData&&e.hasOwnProperty("jitData")&&(n.jitData=s.google.protobuf.Struct.toObject(e.jitData,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.CompiledGraph"},t}(),r.CoreExecutionRequest=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var n;return t.prototype.compile=null,Object.defineProperty(t.prototype,"request",{get:a.oneOfGetter(n=["compile"]),set:a.oneOfSetter(n)}),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.compile&&Object.hasOwnProperty.call(e,"compile")&&s.sqlanvil.CompileExecutionRequest.encode(e.compile,t.uint32(10).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.CoreExecutionRequest;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?o.compile=s.sqlanvil.CompileExecutionRequest.decode(e,e.uint32()):e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.compile&&e.hasOwnProperty("compile")){var t=s.sqlanvil.CompileExecutionRequest.verify(e.compile);if(t)return"compile."+t}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.CoreExecutionRequest)return e;var t=new s.sqlanvil.CoreExecutionRequest;if(null!=e.compile){if("object"!=typeof e.compile)throw TypeError(".sqlanvil.CoreExecutionRequest.compile: object expected");t.compile=s.sqlanvil.CompileExecutionRequest.fromObject(e.compile)}return t},t.toObject=function(e,t){t||(t={});var n={};return null!=e.compile&&e.hasOwnProperty("compile")&&(n.compile=s.sqlanvil.CompileExecutionRequest.toObject(e.compile,t),t.oneofs&&(n.request="compile")),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.CoreExecutionRequest"},t}(),r.CoreExecutionResponse=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var n;return t.prototype.compile=null,Object.defineProperty(t.prototype,"response",{get:a.oneOfGetter(n=["compile"]),set:a.oneOfSetter(n)}),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.compile&&Object.hasOwnProperty.call(e,"compile")&&s.sqlanvil.CompileExecutionResponse.encode(e.compile,t.uint32(10).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.CoreExecutionResponse;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?o.compile=s.sqlanvil.CompileExecutionResponse.decode(e,e.uint32()):e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.compile&&e.hasOwnProperty("compile")){var t=s.sqlanvil.CompileExecutionResponse.verify(e.compile);if(t)return"compile."+t}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.CoreExecutionResponse)return e;var t=new s.sqlanvil.CoreExecutionResponse;if(null!=e.compile){if("object"!=typeof e.compile)throw TypeError(".sqlanvil.CoreExecutionResponse.compile: object expected");t.compile=s.sqlanvil.CompileExecutionResponse.fromObject(e.compile)}return t},t.toObject=function(e,t){t||(t={});var n={};return null!=e.compile&&e.hasOwnProperty("compile")&&(n.compile=s.sqlanvil.CompileExecutionResponse.toObject(e.compile,t),t.oneofs&&(n.response="compile")),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.CoreExecutionResponse"},t}(),r.CompileExecutionRequest=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.compileConfig=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.compileConfig&&Object.hasOwnProperty.call(e,"compileConfig")&&s.sqlanvil.CompileConfig.encode(e.compileConfig,t.uint32(10).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.CompileExecutionRequest;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?o.compileConfig=s.sqlanvil.CompileConfig.decode(e,e.uint32()):e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.compileConfig&&e.hasOwnProperty("compileConfig")){var t=s.sqlanvil.CompileConfig.verify(e.compileConfig);if(t)return"compileConfig."+t}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.CompileExecutionRequest)return e;var t=new s.sqlanvil.CompileExecutionRequest;if(null!=e.compileConfig){if("object"!=typeof e.compileConfig)throw TypeError(".sqlanvil.CompileExecutionRequest.compileConfig: object expected");t.compileConfig=s.sqlanvil.CompileConfig.fromObject(e.compileConfig)}return t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.compileConfig=null),null!=e.compileConfig&&e.hasOwnProperty("compileConfig")&&(n.compileConfig=s.sqlanvil.CompileConfig.toObject(e.compileConfig,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.CompileExecutionRequest"},t}(),r.CompileExecutionResponse=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.compiledGraph=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.compiledGraph&&Object.hasOwnProperty.call(e,"compiledGraph")&&s.sqlanvil.CompiledGraph.encode(e.compiledGraph,t.uint32(10).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.CompileExecutionResponse;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?o.compiledGraph=s.sqlanvil.CompiledGraph.decode(e,e.uint32()):e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.compiledGraph&&e.hasOwnProperty("compiledGraph")){var t=s.sqlanvil.CompiledGraph.verify(e.compiledGraph);if(t)return"compiledGraph."+t}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.CompileExecutionResponse)return e;var t=new s.sqlanvil.CompileExecutionResponse;if(null!=e.compiledGraph){if("object"!=typeof e.compiledGraph)throw TypeError(".sqlanvil.CompileExecutionResponse.compiledGraph: object expected");t.compiledGraph=s.sqlanvil.CompiledGraph.fromObject(e.compiledGraph)}return t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.compiledGraph=null),null!=e.compiledGraph&&e.hasOwnProperty("compiledGraph")&&(n.compiledGraph=s.sqlanvil.CompiledGraph.toObject(e.compiledGraph,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.CompileExecutionResponse"},t}(),r.SupportedFeatures=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN_FEATURE"]=0,t[e[1]="ARRAY_BUFFER_IPC"]=1,t}(),r.Field=function(){function t(e){if(this.flags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var n;return t.prototype.name="",t.prototype.flags=a.emptyArray,t.prototype.primitive=null,t.prototype.struct=null,t.prototype.description="",Object.defineProperty(t.prototype,"type",{get:a.oneOfGetter(n=["primitive","struct"]),set:a.oneOfSetter(n)}),t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.struct&&Object.hasOwnProperty.call(e,"struct")&&s.sqlanvil.Fields.encode(e.struct,t.uint32(26).fork()).ldelim(),null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(42).string(e.description),null!=e.flags&&e.flags.length){t.uint32(50).fork();for(var n=0;n<e.flags.length;++n)t.int32(e.flags[n]);t.ldelim()}return null!=e.primitive&&Object.hasOwnProperty.call(e,"primitive")&&t.uint32(56).int32(e.primitive),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.Field;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.name=e.string();break;case 6:if(o.flags&&o.flags.length||(o.flags=[]),2==(7&a))for(var l=e.uint32()+e.pos;e.pos<l;)o.flags.push(e.int32());else o.flags.push(e.int32());break;case 7:o.primitive=e.int32();break;case 3:o.struct=s.sqlanvil.Fields.decode(e,e.uint32());break;case 5:o.description=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.flags&&e.hasOwnProperty("flags")){if(!Array.isArray(e.flags))return"flags: array expected";for(var n=0;n<e.flags.length;++n)switch(e.flags[n]){default:return"flags: enum value[] expected";case 0:case 1:}}if(null!=e.primitive&&e.hasOwnProperty("primitive"))switch(t.type=1,e.primitive){default:return"primitive: enum value expected";case 0:case 1:case 2:case 5:case 3:case 4:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:}if(null!=e.struct&&e.hasOwnProperty("struct")){if(1===t.type)return"type: multiple values";t.type=1;var r=s.sqlanvil.Fields.verify(e.struct);if(r)return"struct."+r}return null!=e.description&&e.hasOwnProperty("description")&&!a.isString(e.description)?"description: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.Field)return e;var t=new s.sqlanvil.Field;if(null!=e.name&&(t.name=String(e.name)),e.flags){if(!Array.isArray(e.flags))throw TypeError(".sqlanvil.Field.flags: array expected");t.flags=[];for(var n=0;n<e.flags.length;++n)switch(e.flags[n]){default:if("number"==typeof e.flags[n]){t.flags[n]=e.flags[n];break}case"UNKNOWN_FLAG":case 0:t.flags[n]=0;break;case"REPEATED":case 1:t.flags[n]=1}}switch(e.primitive){default:if("number"==typeof e.primitive){t.primitive=e.primitive;break}break;case"UNKNOWN":case 0:t.primitive=0;break;case"INTEGER":case 1:t.primitive=1;break;case"FLOAT":case 2:t.primitive=2;break;case"NUMERIC":case 5:t.primitive=5;break;case"BOOLEAN":case 3:t.primitive=3;break;case"STRING":case 4:t.primitive=4;break;case"DATE":case 6:t.primitive=6;break;case"DATETIME":case 7:t.primitive=7;break;case"TIMESTAMP":case 8:t.primitive=8;break;case"TIME":case 9:t.primitive=9;break;case"BYTES":case 10:t.primitive=10;break;case"ANY":case 11:t.primitive=11;break;case"GEOGRAPHY":case 12:t.primitive=12;break;case"BIGNUMERIC":case 13:t.primitive=13;break;case"JSON":case 14:t.primitive=14;break;case"INTERVAL":case 15:t.primitive=15}if(null!=e.struct){if("object"!=typeof e.struct)throw TypeError(".sqlanvil.Field.struct: object expected");t.struct=s.sqlanvil.Fields.fromObject(e.struct)}return null!=e.description&&(t.description=String(e.description)),t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.flags=[]),t.defaults&&(n.name="",n.description=""),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.struct&&e.hasOwnProperty("struct")&&(n.struct=s.sqlanvil.Fields.toObject(e.struct,t),t.oneofs&&(n.type="struct")),null!=e.description&&e.hasOwnProperty("description")&&(n.description=e.description),e.flags&&e.flags.length){n.flags=[];for(var r=0;r<e.flags.length;++r)n.flags[r]=t.enums===String?void 0===s.sqlanvil.Field.Flag[e.flags[r]]?e.flags[r]:s.sqlanvil.Field.Flag[e.flags[r]]:e.flags[r]}return null!=e.primitive&&e.hasOwnProperty("primitive")&&(n.primitive=t.enums===String?void 0===s.sqlanvil.Field.Primitive[e.primitive]?e.primitive:s.sqlanvil.Field.Primitive[e.primitive]:e.primitive,t.oneofs&&(n.type="primitive")),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.Field"},t.Primitive=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN"]=0,t[e[1]="INTEGER"]=1,t[e[2]="FLOAT"]=2,t[e[5]="NUMERIC"]=5,t[e[3]="BOOLEAN"]=3,t[e[4]="STRING"]=4,t[e[6]="DATE"]=6,t[e[7]="DATETIME"]=7,t[e[8]="TIMESTAMP"]=8,t[e[9]="TIME"]=9,t[e[10]="BYTES"]=10,t[e[11]="ANY"]=11,t[e[12]="GEOGRAPHY"]=12,t[e[13]="BIGNUMERIC"]=13,t[e[14]="JSON"]=14,t[e[15]="INTERVAL"]=15,t}(),t.Flag=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN_FLAG"]=0,t[e[1]="REPEATED"]=1,t}(),t}(),r.Fields=function(){function t(e){if(this.fields=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.fields=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.fields&&e.fields.length)for(var n=0;n<e.fields.length;++n)s.sqlanvil.Field.encode(e.fields[n],t.uint32(10).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.Fields;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?(o.fields&&o.fields.length||(o.fields=[]),o.fields.push(s.sqlanvil.Field.decode(e,e.uint32()))):e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.fields&&e.hasOwnProperty("fields")){if(!Array.isArray(e.fields))return"fields: array expected";for(var t=0;t<e.fields.length;++t){var n=s.sqlanvil.Field.verify(e.fields[t]);if(n)return"fields."+n}}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.Fields)return e;var t=new s.sqlanvil.Fields;if(e.fields){if(!Array.isArray(e.fields))throw TypeError(".sqlanvil.Fields.fields: array expected");t.fields=[];for(var n=0;n<e.fields.length;++n){if("object"!=typeof e.fields[n])throw TypeError(".sqlanvil.Fields.fields: object expected");t.fields[n]=s.sqlanvil.Field.fromObject(e.fields[n])}}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.fields=[]),e.fields&&e.fields.length){n.fields=[];for(var r=0;r<e.fields.length;++r)n.fields[r]=s.sqlanvil.Field.toObject(e.fields[r],t)}return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.Fields"},t}(),r.TableMetadata=function(){function t(e){if(this.fields=[],this.labels={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.target=null,t.prototype.type=0,t.prototype.fields=a.emptyArray,t.prototype.description="",t.prototype.labels=a.emptyObject,t.prototype.lastUpdatedMillis=0,t.prototype.bigquery=null,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&s.sqlanvil.Target.encode(e.target,t.uint32(10).fork()).ldelim(),null!=e.fields&&e.fields.length)for(var n=0;n<e.fields.length;++n)s.sqlanvil.Field.encode(e.fields[n],t.uint32(26).fork()).ldelim();if(null!=e.lastUpdatedMillis&&Object.hasOwnProperty.call(e,"lastUpdatedMillis")&&t.uint32(32).int64(e.lastUpdatedMillis),null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(42).string(e.description),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(48).int32(e.type),null!=e.labels&&Object.hasOwnProperty.call(e,"labels")){var r=Object.keys(e.labels);for(n=0;n<r.length;++n)t.uint32(58).fork().uint32(10).string(r[n]).uint32(18).string(e.labels[r[n]]).ldelim()}return null!=e.bigquery&&Object.hasOwnProperty.call(e,"bigquery")&&s.sqlanvil.TableMetadata.BigQuery.encode(e.bigquery,t.uint32(66).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r,o,l=void 0===t?e.len:e.pos+t,c=new s.sqlanvil.TableMetadata;e.pos<l;){var u=e.uint32();if(u===n)break;switch(u>>>3){case 1:c.target=s.sqlanvil.Target.decode(e,e.uint32());break;case 6:c.type=e.int32();break;case 3:c.fields&&c.fields.length||(c.fields=[]),c.fields.push(s.sqlanvil.Field.decode(e,e.uint32()));break;case 5:c.description=e.string();break;case 7:c.labels===a.emptyObject&&(c.labels={});var p=e.uint32()+e.pos;for(r="",o="";e.pos<p;){var f=e.uint32();switch(f>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}}c.labels[r]=o;break;case 4:c.lastUpdatedMillis=e.int64();break;case 8:c.bigquery=s.sqlanvil.TableMetadata.BigQuery.decode(e,e.uint32());break;default:e.skipType(7&u)}}return c},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.target&&e.hasOwnProperty("target")&&(n=s.sqlanvil.Target.verify(e.target)))return"target."+n;if(null!=e.type&&e.hasOwnProperty("type"))switch(e.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:}if(null!=e.fields&&e.hasOwnProperty("fields")){if(!Array.isArray(e.fields))return"fields: array expected";for(var t=0;t<e.fields.length;++t){var n;if(n=s.sqlanvil.Field.verify(e.fields[t]))return"fields."+n}}if(null!=e.description&&e.hasOwnProperty("description")&&!a.isString(e.description))return"description: string expected";if(null!=e.labels&&e.hasOwnProperty("labels")){if(!a.isObject(e.labels))return"labels: object expected";var r=Object.keys(e.labels);for(t=0;t<r.length;++t)if(!a.isString(e.labels[r[t]]))return"labels: string{k:string} expected"}return null!=e.lastUpdatedMillis&&e.hasOwnProperty("lastUpdatedMillis")&&!(a.isInteger(e.lastUpdatedMillis)||e.lastUpdatedMillis&&a.isInteger(e.lastUpdatedMillis.low)&&a.isInteger(e.lastUpdatedMillis.high))?"lastUpdatedMillis: integer|Long expected":null!=e.bigquery&&e.hasOwnProperty("bigquery")&&(n=s.sqlanvil.TableMetadata.BigQuery.verify(e.bigquery))?"bigquery."+n:null},t.fromObject=function(e){if(e instanceof s.sqlanvil.TableMetadata)return e;var t=new s.sqlanvil.TableMetadata;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.TableMetadata.target: object expected");t.target=s.sqlanvil.Target.fromObject(e.target)}switch(e.type){default:if("number"==typeof e.type){t.type=e.type;break}break;case"UNKNOWN":case 0:t.type=0;break;case"TABLE":case 1:t.type=1;break;case"VIEW":case 2:t.type=2;break;case"MATERIALIZED_VIEW":case 3:t.type=3}if(e.fields){if(!Array.isArray(e.fields))throw TypeError(".sqlanvil.TableMetadata.fields: array expected");t.fields=[];for(var n=0;n<e.fields.length;++n){if("object"!=typeof e.fields[n])throw TypeError(".sqlanvil.TableMetadata.fields: object expected");t.fields[n]=s.sqlanvil.Field.fromObject(e.fields[n])}}if(null!=e.description&&(t.description=String(e.description)),e.labels){if("object"!=typeof e.labels)throw TypeError(".sqlanvil.TableMetadata.labels: object expected");t.labels={};var r=Object.keys(e.labels);for(n=0;n<r.length;++n)t.labels[r[n]]=String(e.labels[r[n]])}if(null!=e.lastUpdatedMillis&&(a.Long?(t.lastUpdatedMillis=a.Long.fromValue(e.lastUpdatedMillis)).unsigned=!1:"string"==typeof e.lastUpdatedMillis?t.lastUpdatedMillis=parseInt(e.lastUpdatedMillis,10):"number"==typeof e.lastUpdatedMillis?t.lastUpdatedMillis=e.lastUpdatedMillis:"object"==typeof e.lastUpdatedMillis&&(t.lastUpdatedMillis=new a.LongBits(e.lastUpdatedMillis.low>>>0,e.lastUpdatedMillis.high>>>0).toNumber())),null!=e.bigquery){if("object"!=typeof e.bigquery)throw TypeError(".sqlanvil.TableMetadata.bigquery: object expected");t.bigquery=s.sqlanvil.TableMetadata.BigQuery.fromObject(e.bigquery)}return t},t.toObject=function(e,t){t||(t={});var n,r={};if((t.arrays||t.defaults)&&(r.fields=[]),(t.objects||t.defaults)&&(r.labels={}),t.defaults&&(r.target=null,r.lastUpdatedMillis=0,r.description="",r.type=t.enums===String?"UNKNOWN":0,r.bigquery=null),null!=e.target&&e.hasOwnProperty("target")&&(r.target=s.sqlanvil.Target.toObject(e.target,t)),e.fields&&e.fields.length){r.fields=[];for(var i=0;i<e.fields.length;++i)r.fields[i]=s.sqlanvil.Field.toObject(e.fields[i],t)}if(null!=e.lastUpdatedMillis&&e.hasOwnProperty("lastUpdatedMillis")&&("number"==typeof e.lastUpdatedMillis?r.lastUpdatedMillis=t.longs===String?String(e.lastUpdatedMillis):e.lastUpdatedMillis:r.lastUpdatedMillis=t.longs===String?a.Long.prototype.toString.call(e.lastUpdatedMillis):t.longs===Number?new a.LongBits(e.lastUpdatedMillis.low>>>0,e.lastUpdatedMillis.high>>>0).toNumber():e.lastUpdatedMillis),null!=e.description&&e.hasOwnProperty("description")&&(r.description=e.description),null!=e.type&&e.hasOwnProperty("type")&&(r.type=t.enums===String?void 0===s.sqlanvil.TableMetadata.Type[e.type]?e.type:s.sqlanvil.TableMetadata.Type[e.type]:e.type),e.labels&&(n=Object.keys(e.labels)).length)for(r.labels={},i=0;i<n.length;++i)r.labels[n[i]]=e.labels[n[i]];return null!=e.bigquery&&e.hasOwnProperty("bigquery")&&(r.bigquery=s.sqlanvil.TableMetadata.BigQuery.toObject(e.bigquery,t)),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.TableMetadata"},t.Type=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN"]=0,t[e[1]="TABLE"]=1,t[e[2]="VIEW"]=2,t[e[3]="MATERIALIZED_VIEW"]=3,t}(),t.BigQuery=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.hasStreamingBuffer=!1,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.hasStreamingBuffer&&Object.hasOwnProperty.call(e,"hasStreamingBuffer")&&t.uint32(8).bool(e.hasStreamingBuffer),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.TableMetadata.BigQuery;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?o.hasStreamingBuffer=e.bool():e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.hasStreamingBuffer&&e.hasOwnProperty("hasStreamingBuffer")&&"boolean"!=typeof e.hasStreamingBuffer?"hasStreamingBuffer: boolean expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.TableMetadata.BigQuery)return e;var t=new s.sqlanvil.TableMetadata.BigQuery;return null!=e.hasStreamingBuffer&&(t.hasStreamingBuffer=Boolean(e.hasStreamingBuffer)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.hasStreamingBuffer=!1),null!=e.hasStreamingBuffer&&e.hasOwnProperty("hasStreamingBuffer")&&(n.hasStreamingBuffer=e.hasStreamingBuffer),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.TableMetadata.BigQuery"},t}(),t}(),r.ExecutionMetadata=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.bigquery=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.bigquery&&Object.hasOwnProperty.call(e,"bigquery")&&s.sqlanvil.ExecutionMetadata.BigqueryMetadata.encode(e.bigquery,t.uint32(10).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ExecutionMetadata;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?o.bigquery=s.sqlanvil.ExecutionMetadata.BigqueryMetadata.decode(e,e.uint32()):e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.bigquery&&e.hasOwnProperty("bigquery")){var t=s.sqlanvil.ExecutionMetadata.BigqueryMetadata.verify(e.bigquery);if(t)return"bigquery."+t}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ExecutionMetadata)return e;var t=new s.sqlanvil.ExecutionMetadata;if(null!=e.bigquery){if("object"!=typeof e.bigquery)throw TypeError(".sqlanvil.ExecutionMetadata.bigquery: object expected");t.bigquery=s.sqlanvil.ExecutionMetadata.BigqueryMetadata.fromObject(e.bigquery)}return t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.bigquery=null),null!=e.bigquery&&e.hasOwnProperty("bigquery")&&(n.bigquery=s.sqlanvil.ExecutionMetadata.BigqueryMetadata.toObject(e.bigquery,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ExecutionMetadata"},t.BigqueryMetadata=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.jobId="",t.prototype.totalBytesProcessed=0,t.prototype.totalBytesBilled=0,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.jobId&&Object.hasOwnProperty.call(e,"jobId")&&t.uint32(10).string(e.jobId),null!=e.totalBytesProcessed&&Object.hasOwnProperty.call(e,"totalBytesProcessed")&&t.uint32(16).int64(e.totalBytesProcessed),null!=e.totalBytesBilled&&Object.hasOwnProperty.call(e,"totalBytesBilled")&&t.uint32(24).int64(e.totalBytesBilled),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ExecutionMetadata.BigqueryMetadata;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.jobId=e.string();break;case 2:o.totalBytesProcessed=e.int64();break;case 3:o.totalBytesBilled=e.int64();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.jobId&&e.hasOwnProperty("jobId")&&!a.isString(e.jobId)?"jobId: string expected":null!=e.totalBytesProcessed&&e.hasOwnProperty("totalBytesProcessed")&&!(a.isInteger(e.totalBytesProcessed)||e.totalBytesProcessed&&a.isInteger(e.totalBytesProcessed.low)&&a.isInteger(e.totalBytesProcessed.high))?"totalBytesProcessed: integer|Long expected":null!=e.totalBytesBilled&&e.hasOwnProperty("totalBytesBilled")&&!(a.isInteger(e.totalBytesBilled)||e.totalBytesBilled&&a.isInteger(e.totalBytesBilled.low)&&a.isInteger(e.totalBytesBilled.high))?"totalBytesBilled: integer|Long expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ExecutionMetadata.BigqueryMetadata)return e;var t=new s.sqlanvil.ExecutionMetadata.BigqueryMetadata;return null!=e.jobId&&(t.jobId=String(e.jobId)),null!=e.totalBytesProcessed&&(a.Long?(t.totalBytesProcessed=a.Long.fromValue(e.totalBytesProcessed)).unsigned=!1:"string"==typeof e.totalBytesProcessed?t.totalBytesProcessed=parseInt(e.totalBytesProcessed,10):"number"==typeof e.totalBytesProcessed?t.totalBytesProcessed=e.totalBytesProcessed:"object"==typeof e.totalBytesProcessed&&(t.totalBytesProcessed=new a.LongBits(e.totalBytesProcessed.low>>>0,e.totalBytesProcessed.high>>>0).toNumber())),null!=e.totalBytesBilled&&(a.Long?(t.totalBytesBilled=a.Long.fromValue(e.totalBytesBilled)).unsigned=!1:"string"==typeof e.totalBytesBilled?t.totalBytesBilled=parseInt(e.totalBytesBilled,10):"number"==typeof e.totalBytesBilled?t.totalBytesBilled=e.totalBytesBilled:"object"==typeof e.totalBytesBilled&&(t.totalBytesBilled=new a.LongBits(e.totalBytesBilled.low>>>0,e.totalBytesBilled.high>>>0).toNumber())),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.jobId="",n.totalBytesProcessed=0,n.totalBytesBilled=0),null!=e.jobId&&e.hasOwnProperty("jobId")&&(n.jobId=e.jobId),null!=e.totalBytesProcessed&&e.hasOwnProperty("totalBytesProcessed")&&("number"==typeof e.totalBytesProcessed?n.totalBytesProcessed=t.longs===String?String(e.totalBytesProcessed):e.totalBytesProcessed:n.totalBytesProcessed=t.longs===String?a.Long.prototype.toString.call(e.totalBytesProcessed):t.longs===Number?new a.LongBits(e.totalBytesProcessed.low>>>0,e.totalBytesProcessed.high>>>0).toNumber():e.totalBytesProcessed),null!=e.totalBytesBilled&&e.hasOwnProperty("totalBytesBilled")&&("number"==typeof e.totalBytesBilled?n.totalBytesBilled=t.longs===String?String(e.totalBytesBilled):e.totalBytesBilled:n.totalBytesBilled=t.longs===String?a.Long.prototype.toString.call(e.totalBytesBilled):t.longs===Number?new a.LongBits(e.totalBytesBilled.low>>>0,e.totalBytesBilled.high>>>0).toNumber():e.totalBytesBilled),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ExecutionMetadata.BigqueryMetadata"},t}(),t}(),r.QueryEvaluationError=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.message="",t.prototype.errorLocation=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.message&&Object.hasOwnProperty.call(e,"message")&&t.uint32(10).string(e.message),null!=e.errorLocation&&Object.hasOwnProperty.call(e,"errorLocation")&&s.sqlanvil.QueryEvaluationError.ErrorLocation.encode(e.errorLocation,t.uint32(18).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.QueryEvaluationError;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.message=e.string();break;case 2:o.errorLocation=s.sqlanvil.QueryEvaluationError.ErrorLocation.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.message&&e.hasOwnProperty("message")&&!a.isString(e.message))return"message: string expected";if(null!=e.errorLocation&&e.hasOwnProperty("errorLocation")){var t=s.sqlanvil.QueryEvaluationError.ErrorLocation.verify(e.errorLocation);if(t)return"errorLocation."+t}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.QueryEvaluationError)return e;var t=new s.sqlanvil.QueryEvaluationError;if(null!=e.message&&(t.message=String(e.message)),null!=e.errorLocation){if("object"!=typeof e.errorLocation)throw TypeError(".sqlanvil.QueryEvaluationError.errorLocation: object expected");t.errorLocation=s.sqlanvil.QueryEvaluationError.ErrorLocation.fromObject(e.errorLocation)}return t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.message="",n.errorLocation=null),null!=e.message&&e.hasOwnProperty("message")&&(n.message=e.message),null!=e.errorLocation&&e.hasOwnProperty("errorLocation")&&(n.errorLocation=s.sqlanvil.QueryEvaluationError.ErrorLocation.toObject(e.errorLocation,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.QueryEvaluationError"},t.ErrorLocation=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.line=0,t.prototype.column=0,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.line&&Object.hasOwnProperty.call(e,"line")&&t.uint32(8).int32(e.line),null!=e.column&&Object.hasOwnProperty.call(e,"column")&&t.uint32(16).int32(e.column),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.QueryEvaluationError.ErrorLocation;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.line=e.int32();break;case 2:o.column=e.int32();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.line&&e.hasOwnProperty("line")&&!a.isInteger(e.line)?"line: integer expected":null!=e.column&&e.hasOwnProperty("column")&&!a.isInteger(e.column)?"column: integer expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.QueryEvaluationError.ErrorLocation)return e;var t=new s.sqlanvil.QueryEvaluationError.ErrorLocation;return null!=e.line&&(t.line=0|e.line),null!=e.column&&(t.column=0|e.column),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.line=0,n.column=0),null!=e.line&&e.hasOwnProperty("line")&&(n.line=e.line),null!=e.column&&e.hasOwnProperty("column")&&(n.column=e.column),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.QueryEvaluationError.ErrorLocation"},t}(),t}(),r.QueryEvaluation=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.status=0,t.prototype.error=null,t.prototype.incremental=!1,t.prototype.query="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.status&&Object.hasOwnProperty.call(e,"status")&&t.uint32(8).int32(e.status),null!=e.error&&Object.hasOwnProperty.call(e,"error")&&s.sqlanvil.QueryEvaluationError.encode(e.error,t.uint32(18).fork()).ldelim(),null!=e.incremental&&Object.hasOwnProperty.call(e,"incremental")&&t.uint32(24).bool(e.incremental),null!=e.query&&Object.hasOwnProperty.call(e,"query")&&t.uint32(34).string(e.query),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.QueryEvaluation;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.status=e.int32();break;case 2:o.error=s.sqlanvil.QueryEvaluationError.decode(e,e.uint32());break;case 3:o.incremental=e.bool();break;case 4:o.query=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.status&&e.hasOwnProperty("status"))switch(e.status){default:return"status: enum value expected";case 0:case 1:}if(null!=e.error&&e.hasOwnProperty("error")){var t=s.sqlanvil.QueryEvaluationError.verify(e.error);if(t)return"error."+t}return null!=e.incremental&&e.hasOwnProperty("incremental")&&"boolean"!=typeof e.incremental?"incremental: boolean expected":null!=e.query&&e.hasOwnProperty("query")&&!a.isString(e.query)?"query: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.QueryEvaluation)return e;var t=new s.sqlanvil.QueryEvaluation;switch(e.status){default:if("number"==typeof e.status){t.status=e.status;break}break;case"SUCCESS":case 0:t.status=0;break;case"FAILURE":case 1:t.status=1}if(null!=e.error){if("object"!=typeof e.error)throw TypeError(".sqlanvil.QueryEvaluation.error: object expected");t.error=s.sqlanvil.QueryEvaluationError.fromObject(e.error)}return null!=e.incremental&&(t.incremental=Boolean(e.incremental)),null!=e.query&&(t.query=String(e.query)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.status=t.enums===String?"SUCCESS":0,n.error=null,n.incremental=!1,n.query=""),null!=e.status&&e.hasOwnProperty("status")&&(n.status=t.enums===String?void 0===s.sqlanvil.QueryEvaluation.QueryEvaluationStatus[e.status]?e.status:s.sqlanvil.QueryEvaluation.QueryEvaluationStatus[e.status]:e.status),null!=e.error&&e.hasOwnProperty("error")&&(n.error=s.sqlanvil.QueryEvaluationError.toObject(e.error,t)),null!=e.incremental&&e.hasOwnProperty("incremental")&&(n.incremental=e.incremental),null!=e.query&&e.hasOwnProperty("query")&&(n.query=e.query),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.QueryEvaluation"},t.QueryEvaluationStatus=function(){var e={},t=Object.create(e);return t[e[0]="SUCCESS"]=0,t[e[1]="FAILURE"]=1,t}(),t}(),r.RunConfig=function(){function t(e){if(this.actions=[],this.tags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.actions=a.emptyArray,t.prototype.tags=a.emptyArray,t.prototype.includeDependencies=!1,t.prototype.includeDependents=!1,t.prototype.fullRefresh=!1,t.prototype.timeoutMillis=0,t.prototype.disableSetMetadata=!1,t.prototype.useRunCache=!1,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.actions&&e.actions.length)for(var n=0;n<e.actions.length;++n)t.uint32(10).string(e.actions[n]);if(null!=e.fullRefresh&&Object.hasOwnProperty.call(e,"fullRefresh")&&t.uint32(16).bool(e.fullRefresh),null!=e.includeDependencies&&Object.hasOwnProperty.call(e,"includeDependencies")&&t.uint32(24).bool(e.includeDependencies),null!=e.tags&&e.tags.length)for(n=0;n<e.tags.length;++n)t.uint32(42).string(e.tags[n]);return null!=e.timeoutMillis&&Object.hasOwnProperty.call(e,"timeoutMillis")&&t.uint32(56).int32(e.timeoutMillis),null!=e.useRunCache&&Object.hasOwnProperty.call(e,"useRunCache")&&t.uint32(64).bool(e.useRunCache),null!=e.disableSetMetadata&&Object.hasOwnProperty.call(e,"disableSetMetadata")&&t.uint32(72).bool(e.disableSetMetadata),null!=e.includeDependents&&Object.hasOwnProperty.call(e,"includeDependents")&&t.uint32(88).bool(e.includeDependents),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.RunConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.actions&&o.actions.length||(o.actions=[]),o.actions.push(e.string());break;case 5:o.tags&&o.tags.length||(o.tags=[]),o.tags.push(e.string());break;case 3:o.includeDependencies=e.bool();break;case 11:o.includeDependents=e.bool();break;case 2:o.fullRefresh=e.bool();break;case 7:o.timeoutMillis=e.int32();break;case 9:o.disableSetMetadata=e.bool();break;case 8:o.useRunCache=e.bool();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.actions&&e.hasOwnProperty("actions")){if(!Array.isArray(e.actions))return"actions: array expected";for(var t=0;t<e.actions.length;++t)if(!a.isString(e.actions[t]))return"actions: string[] expected"}if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!a.isString(e.tags[t]))return"tags: string[] expected"}return null!=e.includeDependencies&&e.hasOwnProperty("includeDependencies")&&"boolean"!=typeof e.includeDependencies?"includeDependencies: boolean expected":null!=e.includeDependents&&e.hasOwnProperty("includeDependents")&&"boolean"!=typeof e.includeDependents?"includeDependents: boolean expected":null!=e.fullRefresh&&e.hasOwnProperty("fullRefresh")&&"boolean"!=typeof e.fullRefresh?"fullRefresh: boolean expected":null!=e.timeoutMillis&&e.hasOwnProperty("timeoutMillis")&&!a.isInteger(e.timeoutMillis)?"timeoutMillis: integer expected":null!=e.disableSetMetadata&&e.hasOwnProperty("disableSetMetadata")&&"boolean"!=typeof e.disableSetMetadata?"disableSetMetadata: boolean expected":null!=e.useRunCache&&e.hasOwnProperty("useRunCache")&&"boolean"!=typeof e.useRunCache?"useRunCache: boolean expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.RunConfig)return e;var t=new s.sqlanvil.RunConfig;if(e.actions){if(!Array.isArray(e.actions))throw TypeError(".sqlanvil.RunConfig.actions: array expected");t.actions=[];for(var n=0;n<e.actions.length;++n)t.actions[n]=String(e.actions[n])}if(e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.RunConfig.tags: array expected");for(t.tags=[],n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}return null!=e.includeDependencies&&(t.includeDependencies=Boolean(e.includeDependencies)),null!=e.includeDependents&&(t.includeDependents=Boolean(e.includeDependents)),null!=e.fullRefresh&&(t.fullRefresh=Boolean(e.fullRefresh)),null!=e.timeoutMillis&&(t.timeoutMillis=0|e.timeoutMillis),null!=e.disableSetMetadata&&(t.disableSetMetadata=Boolean(e.disableSetMetadata)),null!=e.useRunCache&&(t.useRunCache=Boolean(e.useRunCache)),t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.actions=[],n.tags=[]),t.defaults&&(n.fullRefresh=!1,n.includeDependencies=!1,n.timeoutMillis=0,n.useRunCache=!1,n.disableSetMetadata=!1,n.includeDependents=!1),e.actions&&e.actions.length){n.actions=[];for(var r=0;r<e.actions.length;++r)n.actions[r]=e.actions[r]}if(null!=e.fullRefresh&&e.hasOwnProperty("fullRefresh")&&(n.fullRefresh=e.fullRefresh),null!=e.includeDependencies&&e.hasOwnProperty("includeDependencies")&&(n.includeDependencies=e.includeDependencies),e.tags&&e.tags.length)for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=e.tags[r];return null!=e.timeoutMillis&&e.hasOwnProperty("timeoutMillis")&&(n.timeoutMillis=e.timeoutMillis),null!=e.useRunCache&&e.hasOwnProperty("useRunCache")&&(n.useRunCache=e.useRunCache),null!=e.disableSetMetadata&&e.hasOwnProperty("disableSetMetadata")&&(n.disableSetMetadata=e.disableSetMetadata),null!=e.includeDependents&&e.hasOwnProperty("includeDependents")&&(n.includeDependents=e.includeDependents),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.RunConfig"},t}(),r.ExecutionTask=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.type="",t.prototype.statement="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(10).string(e.type),null!=e.statement&&Object.hasOwnProperty.call(e,"statement")&&t.uint32(18).string(e.statement),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ExecutionTask;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.type=e.string();break;case 2:o.statement=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.type&&e.hasOwnProperty("type")&&!a.isString(e.type)?"type: string expected":null!=e.statement&&e.hasOwnProperty("statement")&&!a.isString(e.statement)?"statement: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ExecutionTask)return e;var t=new s.sqlanvil.ExecutionTask;return null!=e.type&&(t.type=String(e.type)),null!=e.statement&&(t.statement=String(e.statement)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.type="",n.statement=""),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.statement&&e.hasOwnProperty("statement")&&(n.statement=e.statement),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ExecutionTask"},t}(),r.ExecutionAction=function(){function t(e){if(this.dependencyTargets=[],this.tasks=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.target=null,t.prototype.fileName="",t.prototype.type="",t.prototype.tableType="",t.prototype.dependencyTargets=a.emptyArray,t.prototype.hermeticity=0,t.prototype.tasks=a.emptyArray,t.prototype.actionDescriptor=null,t.prototype.jitCode="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.tasks&&e.tasks.length)for(var n=0;n<e.tasks.length;++n)s.sqlanvil.ExecutionTask.encode(e.tasks[n],t.uint32(18).fork()).ldelim();if(null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(34).string(e.type),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&s.sqlanvil.Target.encode(e.target,t.uint32(42).fork()).ldelim(),null!=e.tableType&&Object.hasOwnProperty.call(e,"tableType")&&t.uint32(50).string(e.tableType),null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(66).string(e.fileName),null!=e.actionDescriptor&&Object.hasOwnProperty.call(e,"actionDescriptor")&&s.sqlanvil.ActionDescriptor.encode(e.actionDescriptor,t.uint32(74).fork()).ldelim(),null!=e.hermeticity&&Object.hasOwnProperty.call(e,"hermeticity")&&t.uint32(80).int32(e.hermeticity),null!=e.dependencyTargets&&e.dependencyTargets.length)for(n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.Target.encode(e.dependencyTargets[n],t.uint32(90).fork()).ldelim();return null!=e.jitCode&&Object.hasOwnProperty.call(e,"jitCode")&&t.uint32(98).string(e.jitCode),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ExecutionAction;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 5:o.target=s.sqlanvil.Target.decode(e,e.uint32());break;case 8:o.fileName=e.string();break;case 4:o.type=e.string();break;case 6:o.tableType=e.string();break;case 11:o.dependencyTargets&&o.dependencyTargets.length||(o.dependencyTargets=[]),o.dependencyTargets.push(s.sqlanvil.Target.decode(e,e.uint32()));break;case 10:o.hermeticity=e.int32();break;case 2:o.tasks&&o.tasks.length||(o.tasks=[]),o.tasks.push(s.sqlanvil.ExecutionTask.decode(e,e.uint32()));break;case 9:o.actionDescriptor=s.sqlanvil.ActionDescriptor.decode(e,e.uint32());break;case 12:o.jitCode=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.target&&e.hasOwnProperty("target")&&(n=s.sqlanvil.Target.verify(e.target)))return"target."+n;if(null!=e.fileName&&e.hasOwnProperty("fileName")&&!a.isString(e.fileName))return"fileName: string expected";if(null!=e.type&&e.hasOwnProperty("type")&&!a.isString(e.type))return"type: string expected";if(null!=e.tableType&&e.hasOwnProperty("tableType")&&!a.isString(e.tableType))return"tableType: string expected";if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var t=0;t<e.dependencyTargets.length;++t)if(n=s.sqlanvil.Target.verify(e.dependencyTargets[t]))return"dependencyTargets."+n}if(null!=e.hermeticity&&e.hasOwnProperty("hermeticity"))switch(e.hermeticity){default:return"hermeticity: enum value expected";case 0:case 1:case 2:}if(null!=e.tasks&&e.hasOwnProperty("tasks")){if(!Array.isArray(e.tasks))return"tasks: array expected";for(t=0;t<e.tasks.length;++t){var n;if(n=s.sqlanvil.ExecutionTask.verify(e.tasks[t]))return"tasks."+n}}return null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(n=s.sqlanvil.ActionDescriptor.verify(e.actionDescriptor))?"actionDescriptor."+n:null!=e.jitCode&&e.hasOwnProperty("jitCode")&&!a.isString(e.jitCode)?"jitCode: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ExecutionAction)return e;var t=new s.sqlanvil.ExecutionAction;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.ExecutionAction.target: object expected");t.target=s.sqlanvil.Target.fromObject(e.target)}if(null!=e.fileName&&(t.fileName=String(e.fileName)),null!=e.type&&(t.type=String(e.type)),null!=e.tableType&&(t.tableType=String(e.tableType)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ExecutionAction.dependencyTargets: array expected");t.dependencyTargets=[];for(var n=0;n<e.dependencyTargets.length;++n){if("object"!=typeof e.dependencyTargets[n])throw TypeError(".sqlanvil.ExecutionAction.dependencyTargets: object expected");t.dependencyTargets[n]=s.sqlanvil.Target.fromObject(e.dependencyTargets[n])}}switch(e.hermeticity){default:if("number"==typeof e.hermeticity){t.hermeticity=e.hermeticity;break}break;case"UNKNOWN":case 0:t.hermeticity=0;break;case"HERMETIC":case 1:t.hermeticity=1;break;case"NON_HERMETIC":case 2:t.hermeticity=2}if(e.tasks){if(!Array.isArray(e.tasks))throw TypeError(".sqlanvil.ExecutionAction.tasks: array expected");for(t.tasks=[],n=0;n<e.tasks.length;++n){if("object"!=typeof e.tasks[n])throw TypeError(".sqlanvil.ExecutionAction.tasks: object expected");t.tasks[n]=s.sqlanvil.ExecutionTask.fromObject(e.tasks[n])}}if(null!=e.actionDescriptor){if("object"!=typeof e.actionDescriptor)throw TypeError(".sqlanvil.ExecutionAction.actionDescriptor: object expected");t.actionDescriptor=s.sqlanvil.ActionDescriptor.fromObject(e.actionDescriptor)}return null!=e.jitCode&&(t.jitCode=String(e.jitCode)),t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.tasks=[],n.dependencyTargets=[]),t.defaults&&(n.type="",n.target=null,n.tableType="",n.fileName="",n.actionDescriptor=null,n.hermeticity=t.enums===String?"UNKNOWN":0,n.jitCode=""),e.tasks&&e.tasks.length){n.tasks=[];for(var r=0;r<e.tasks.length;++r)n.tasks[r]=s.sqlanvil.ExecutionTask.toObject(e.tasks[r],t)}if(null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.target&&e.hasOwnProperty("target")&&(n.target=s.sqlanvil.Target.toObject(e.target,t)),null!=e.tableType&&e.hasOwnProperty("tableType")&&(n.tableType=e.tableType),null!=e.fileName&&e.hasOwnProperty("fileName")&&(n.fileName=e.fileName),null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(n.actionDescriptor=s.sqlanvil.ActionDescriptor.toObject(e.actionDescriptor,t)),null!=e.hermeticity&&e.hasOwnProperty("hermeticity")&&(n.hermeticity=t.enums===String?void 0===s.sqlanvil.ActionHermeticity[e.hermeticity]?e.hermeticity:s.sqlanvil.ActionHermeticity[e.hermeticity]:e.hermeticity),e.dependencyTargets&&e.dependencyTargets.length)for(n.dependencyTargets=[],r=0;r<e.dependencyTargets.length;++r)n.dependencyTargets[r]=s.sqlanvil.Target.toObject(e.dependencyTargets[r],t);return null!=e.jitCode&&e.hasOwnProperty("jitCode")&&(n.jitCode=e.jitCode),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ExecutionAction"},t}(),r.WarehouseState=function(){function t(e){if(this.tables=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.tables=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.tables&&e.tables.length)for(var n=0;n<e.tables.length;++n)s.sqlanvil.TableMetadata.encode(e.tables[n],t.uint32(10).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.WarehouseState;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?(o.tables&&o.tables.length||(o.tables=[]),o.tables.push(s.sqlanvil.TableMetadata.decode(e,e.uint32()))):e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.tables&&e.hasOwnProperty("tables")){if(!Array.isArray(e.tables))return"tables: array expected";for(var t=0;t<e.tables.length;++t){var n=s.sqlanvil.TableMetadata.verify(e.tables[t]);if(n)return"tables."+n}}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.WarehouseState)return e;var t=new s.sqlanvil.WarehouseState;if(e.tables){if(!Array.isArray(e.tables))throw TypeError(".sqlanvil.WarehouseState.tables: array expected");t.tables=[];for(var n=0;n<e.tables.length;++n){if("object"!=typeof e.tables[n])throw TypeError(".sqlanvil.WarehouseState.tables: object expected");t.tables[n]=s.sqlanvil.TableMetadata.fromObject(e.tables[n])}}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.tables=[]),e.tables&&e.tables.length){n.tables=[];for(var r=0;r<e.tables.length;++r)n.tables[r]=s.sqlanvil.TableMetadata.toObject(e.tables[r],t)}return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.WarehouseState"},t}(),r.ExecutionGraph=function(){function t(e){if(this.declarationTargets=[],this.actions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.projectConfig=null,t.prototype.runConfig=null,t.prototype.warehouseState=null,t.prototype.declarationTargets=a.emptyArray,t.prototype.actions=a.emptyArray,t.prototype.jitData=null,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.projectConfig&&Object.hasOwnProperty.call(e,"projectConfig")&&s.sqlanvil.ProjectConfig.encode(e.projectConfig,t.uint32(10).fork()).ldelim(),null!=e.runConfig&&Object.hasOwnProperty.call(e,"runConfig")&&s.sqlanvil.RunConfig.encode(e.runConfig,t.uint32(18).fork()).ldelim(),null!=e.actions&&e.actions.length)for(var n=0;n<e.actions.length;++n)s.sqlanvil.ExecutionAction.encode(e.actions[n],t.uint32(26).fork()).ldelim();if(null!=e.warehouseState&&Object.hasOwnProperty.call(e,"warehouseState")&&s.sqlanvil.WarehouseState.encode(e.warehouseState,t.uint32(34).fork()).ldelim(),null!=e.declarationTargets&&e.declarationTargets.length)for(n=0;n<e.declarationTargets.length;++n)s.sqlanvil.Target.encode(e.declarationTargets[n],t.uint32(42).fork()).ldelim();return null!=e.jitData&&Object.hasOwnProperty.call(e,"jitData")&&s.google.protobuf.Struct.encode(e.jitData,t.uint32(58).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ExecutionGraph;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.projectConfig=s.sqlanvil.ProjectConfig.decode(e,e.uint32());break;case 2:o.runConfig=s.sqlanvil.RunConfig.decode(e,e.uint32());break;case 4:o.warehouseState=s.sqlanvil.WarehouseState.decode(e,e.uint32());break;case 5:o.declarationTargets&&o.declarationTargets.length||(o.declarationTargets=[]),o.declarationTargets.push(s.sqlanvil.Target.decode(e,e.uint32()));break;case 3:o.actions&&o.actions.length||(o.actions=[]),o.actions.push(s.sqlanvil.ExecutionAction.decode(e,e.uint32()));break;case 7:o.jitData=s.google.protobuf.Struct.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.projectConfig&&e.hasOwnProperty("projectConfig")&&(n=s.sqlanvil.ProjectConfig.verify(e.projectConfig)))return"projectConfig."+n;if(null!=e.runConfig&&e.hasOwnProperty("runConfig")&&(n=s.sqlanvil.RunConfig.verify(e.runConfig)))return"runConfig."+n;if(null!=e.warehouseState&&e.hasOwnProperty("warehouseState")&&(n=s.sqlanvil.WarehouseState.verify(e.warehouseState)))return"warehouseState."+n;if(null!=e.declarationTargets&&e.hasOwnProperty("declarationTargets")){if(!Array.isArray(e.declarationTargets))return"declarationTargets: array expected";for(var t=0;t<e.declarationTargets.length;++t)if(n=s.sqlanvil.Target.verify(e.declarationTargets[t]))return"declarationTargets."+n}if(null!=e.actions&&e.hasOwnProperty("actions")){if(!Array.isArray(e.actions))return"actions: array expected";for(t=0;t<e.actions.length;++t){var n;if(n=s.sqlanvil.ExecutionAction.verify(e.actions[t]))return"actions."+n}}return null!=e.jitData&&e.hasOwnProperty("jitData")&&(n=s.google.protobuf.Struct.verify(e.jitData))?"jitData."+n:null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ExecutionGraph)return e;var t=new s.sqlanvil.ExecutionGraph;if(null!=e.projectConfig){if("object"!=typeof e.projectConfig)throw TypeError(".sqlanvil.ExecutionGraph.projectConfig: object expected");t.projectConfig=s.sqlanvil.ProjectConfig.fromObject(e.projectConfig)}if(null!=e.runConfig){if("object"!=typeof e.runConfig)throw TypeError(".sqlanvil.ExecutionGraph.runConfig: object expected");t.runConfig=s.sqlanvil.RunConfig.fromObject(e.runConfig)}if(null!=e.warehouseState){if("object"!=typeof e.warehouseState)throw TypeError(".sqlanvil.ExecutionGraph.warehouseState: object expected");t.warehouseState=s.sqlanvil.WarehouseState.fromObject(e.warehouseState)}if(e.declarationTargets){if(!Array.isArray(e.declarationTargets))throw TypeError(".sqlanvil.ExecutionGraph.declarationTargets: array expected");t.declarationTargets=[];for(var n=0;n<e.declarationTargets.length;++n){if("object"!=typeof e.declarationTargets[n])throw TypeError(".sqlanvil.ExecutionGraph.declarationTargets: object expected");t.declarationTargets[n]=s.sqlanvil.Target.fromObject(e.declarationTargets[n])}}if(e.actions){if(!Array.isArray(e.actions))throw TypeError(".sqlanvil.ExecutionGraph.actions: array expected");for(t.actions=[],n=0;n<e.actions.length;++n){if("object"!=typeof e.actions[n])throw TypeError(".sqlanvil.ExecutionGraph.actions: object expected");t.actions[n]=s.sqlanvil.ExecutionAction.fromObject(e.actions[n])}}if(null!=e.jitData){if("object"!=typeof e.jitData)throw TypeError(".sqlanvil.ExecutionGraph.jitData: object expected");t.jitData=s.google.protobuf.Struct.fromObject(e.jitData)}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.actions=[],n.declarationTargets=[]),t.defaults&&(n.projectConfig=null,n.runConfig=null,n.warehouseState=null,n.jitData=null),null!=e.projectConfig&&e.hasOwnProperty("projectConfig")&&(n.projectConfig=s.sqlanvil.ProjectConfig.toObject(e.projectConfig,t)),null!=e.runConfig&&e.hasOwnProperty("runConfig")&&(n.runConfig=s.sqlanvil.RunConfig.toObject(e.runConfig,t)),e.actions&&e.actions.length){n.actions=[];for(var r=0;r<e.actions.length;++r)n.actions[r]=s.sqlanvil.ExecutionAction.toObject(e.actions[r],t)}if(null!=e.warehouseState&&e.hasOwnProperty("warehouseState")&&(n.warehouseState=s.sqlanvil.WarehouseState.toObject(e.warehouseState,t)),e.declarationTargets&&e.declarationTargets.length)for(n.declarationTargets=[],r=0;r<e.declarationTargets.length;++r)n.declarationTargets[r]=s.sqlanvil.Target.toObject(e.declarationTargets[r],t);return null!=e.jitData&&e.hasOwnProperty("jitData")&&(n.jitData=s.google.protobuf.Struct.toObject(e.jitData,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ExecutionGraph"},t}(),r.Timing=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.startTimeMillis=0,t.prototype.endTimeMillis=0,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.startTimeMillis&&Object.hasOwnProperty.call(e,"startTimeMillis")&&t.uint32(8).int64(e.startTimeMillis),null!=e.endTimeMillis&&Object.hasOwnProperty.call(e,"endTimeMillis")&&t.uint32(16).int64(e.endTimeMillis),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.Timing;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.startTimeMillis=e.int64();break;case 2:o.endTimeMillis=e.int64();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.startTimeMillis&&e.hasOwnProperty("startTimeMillis")&&!(a.isInteger(e.startTimeMillis)||e.startTimeMillis&&a.isInteger(e.startTimeMillis.low)&&a.isInteger(e.startTimeMillis.high))?"startTimeMillis: integer|Long expected":null!=e.endTimeMillis&&e.hasOwnProperty("endTimeMillis")&&!(a.isInteger(e.endTimeMillis)||e.endTimeMillis&&a.isInteger(e.endTimeMillis.low)&&a.isInteger(e.endTimeMillis.high))?"endTimeMillis: integer|Long expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.Timing)return e;var t=new s.sqlanvil.Timing;return null!=e.startTimeMillis&&(a.Long?(t.startTimeMillis=a.Long.fromValue(e.startTimeMillis)).unsigned=!1:"string"==typeof e.startTimeMillis?t.startTimeMillis=parseInt(e.startTimeMillis,10):"number"==typeof e.startTimeMillis?t.startTimeMillis=e.startTimeMillis:"object"==typeof e.startTimeMillis&&(t.startTimeMillis=new a.LongBits(e.startTimeMillis.low>>>0,e.startTimeMillis.high>>>0).toNumber())),null!=e.endTimeMillis&&(a.Long?(t.endTimeMillis=a.Long.fromValue(e.endTimeMillis)).unsigned=!1:"string"==typeof e.endTimeMillis?t.endTimeMillis=parseInt(e.endTimeMillis,10):"number"==typeof e.endTimeMillis?t.endTimeMillis=e.endTimeMillis:"object"==typeof e.endTimeMillis&&(t.endTimeMillis=new a.LongBits(e.endTimeMillis.low>>>0,e.endTimeMillis.high>>>0).toNumber())),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.startTimeMillis=0,n.endTimeMillis=0),null!=e.startTimeMillis&&e.hasOwnProperty("startTimeMillis")&&("number"==typeof e.startTimeMillis?n.startTimeMillis=t.longs===String?String(e.startTimeMillis):e.startTimeMillis:n.startTimeMillis=t.longs===String?a.Long.prototype.toString.call(e.startTimeMillis):t.longs===Number?new a.LongBits(e.startTimeMillis.low>>>0,e.startTimeMillis.high>>>0).toNumber():e.startTimeMillis),null!=e.endTimeMillis&&e.hasOwnProperty("endTimeMillis")&&("number"==typeof e.endTimeMillis?n.endTimeMillis=t.longs===String?String(e.endTimeMillis):e.endTimeMillis:n.endTimeMillis=t.longs===String?a.Long.prototype.toString.call(e.endTimeMillis):t.longs===Number?new a.LongBits(e.endTimeMillis.low>>>0,e.endTimeMillis.high>>>0).toNumber():e.endTimeMillis),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.Timing"},t}(),r.RunResult=function(){function t(e){if(this.actions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.status=0,t.prototype.actions=a.emptyArray,t.prototype.timing=null,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.status&&Object.hasOwnProperty.call(e,"status")&&t.uint32(8).int32(e.status),null!=e.actions&&e.actions.length)for(var n=0;n<e.actions.length;++n)s.sqlanvil.ActionResult.encode(e.actions[n],t.uint32(18).fork()).ldelim();return null!=e.timing&&Object.hasOwnProperty.call(e,"timing")&&s.sqlanvil.Timing.encode(e.timing,t.uint32(26).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.RunResult;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.status=e.int32();break;case 2:o.actions&&o.actions.length||(o.actions=[]),o.actions.push(s.sqlanvil.ActionResult.decode(e,e.uint32()));break;case 3:o.timing=s.sqlanvil.Timing.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.status&&e.hasOwnProperty("status"))switch(e.status){default:return"status: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:}if(null!=e.actions&&e.hasOwnProperty("actions")){if(!Array.isArray(e.actions))return"actions: array expected";for(var t=0;t<e.actions.length;++t)if(n=s.sqlanvil.ActionResult.verify(e.actions[t]))return"actions."+n}var n;return null!=e.timing&&e.hasOwnProperty("timing")&&(n=s.sqlanvil.Timing.verify(e.timing))?"timing."+n:null},t.fromObject=function(e){if(e instanceof s.sqlanvil.RunResult)return e;var t=new s.sqlanvil.RunResult;switch(e.status){default:if("number"==typeof e.status){t.status=e.status;break}break;case"UNKNOWN":case 0:t.status=0;break;case"RUNNING":case 1:t.status=1;break;case"SUCCESSFUL":case 2:t.status=2;break;case"FAILED":case 3:t.status=3;break;case"CANCELLED":case 4:t.status=4;break;case"TIMED_OUT":case 5:t.status=5}if(e.actions){if(!Array.isArray(e.actions))throw TypeError(".sqlanvil.RunResult.actions: array expected");t.actions=[];for(var n=0;n<e.actions.length;++n){if("object"!=typeof e.actions[n])throw TypeError(".sqlanvil.RunResult.actions: object expected");t.actions[n]=s.sqlanvil.ActionResult.fromObject(e.actions[n])}}if(null!=e.timing){if("object"!=typeof e.timing)throw TypeError(".sqlanvil.RunResult.timing: object expected");t.timing=s.sqlanvil.Timing.fromObject(e.timing)}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.actions=[]),t.defaults&&(n.status=t.enums===String?"UNKNOWN":0,n.timing=null),null!=e.status&&e.hasOwnProperty("status")&&(n.status=t.enums===String?void 0===s.sqlanvil.RunResult.ExecutionStatus[e.status]?e.status:s.sqlanvil.RunResult.ExecutionStatus[e.status]:e.status),e.actions&&e.actions.length){n.actions=[];for(var r=0;r<e.actions.length;++r)n.actions[r]=s.sqlanvil.ActionResult.toObject(e.actions[r],t)}return null!=e.timing&&e.hasOwnProperty("timing")&&(n.timing=s.sqlanvil.Timing.toObject(e.timing,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.RunResult"},t.ExecutionStatus=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN"]=0,t[e[1]="RUNNING"]=1,t[e[2]="SUCCESSFUL"]=2,t[e[3]="FAILED"]=3,t[e[4]="CANCELLED"]=4,t[e[5]="TIMED_OUT"]=5,t}(),t}(),r.ActionResult=function(){function t(e){if(this.tasks=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.target=null,t.prototype.status=0,t.prototype.tasks=a.emptyArray,t.prototype.timing=null,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.status&&Object.hasOwnProperty.call(e,"status")&&t.uint32(16).int32(e.status),null!=e.tasks&&e.tasks.length)for(var n=0;n<e.tasks.length;++n)s.sqlanvil.TaskResult.encode(e.tasks[n],t.uint32(26).fork()).ldelim();return null!=e.timing&&Object.hasOwnProperty.call(e,"timing")&&s.sqlanvil.Timing.encode(e.timing,t.uint32(34).fork()).ldelim(),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&s.sqlanvil.Target.encode(e.target,t.uint32(42).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionResult;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 5:o.target=s.sqlanvil.Target.decode(e,e.uint32());break;case 2:o.status=e.int32();break;case 3:o.tasks&&o.tasks.length||(o.tasks=[]),o.tasks.push(s.sqlanvil.TaskResult.decode(e,e.uint32()));break;case 4:o.timing=s.sqlanvil.Timing.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.target&&e.hasOwnProperty("target")&&(n=s.sqlanvil.Target.verify(e.target)))return"target."+n;if(null!=e.status&&e.hasOwnProperty("status"))switch(e.status){default:return"status: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:}if(null!=e.tasks&&e.hasOwnProperty("tasks")){if(!Array.isArray(e.tasks))return"tasks: array expected";for(var t=0;t<e.tasks.length;++t){var n;if(n=s.sqlanvil.TaskResult.verify(e.tasks[t]))return"tasks."+n}}return null!=e.timing&&e.hasOwnProperty("timing")&&(n=s.sqlanvil.Timing.verify(e.timing))?"timing."+n:null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionResult)return e;var t=new s.sqlanvil.ActionResult;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.ActionResult.target: object expected");t.target=s.sqlanvil.Target.fromObject(e.target)}switch(e.status){default:if("number"==typeof e.status){t.status=e.status;break}break;case"UNKNOWN":case 0:t.status=0;break;case"RUNNING":case 1:t.status=1;break;case"SUCCESSFUL":case 2:t.status=2;break;case"FAILED":case 3:t.status=3;break;case"SKIPPED":case 4:t.status=4;break;case"DISABLED":case 5:t.status=5;break;case"CANCELLED":case 6:t.status=6}if(e.tasks){if(!Array.isArray(e.tasks))throw TypeError(".sqlanvil.ActionResult.tasks: array expected");t.tasks=[];for(var n=0;n<e.tasks.length;++n){if("object"!=typeof e.tasks[n])throw TypeError(".sqlanvil.ActionResult.tasks: object expected");t.tasks[n]=s.sqlanvil.TaskResult.fromObject(e.tasks[n])}}if(null!=e.timing){if("object"!=typeof e.timing)throw TypeError(".sqlanvil.ActionResult.timing: object expected");t.timing=s.sqlanvil.Timing.fromObject(e.timing)}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.tasks=[]),t.defaults&&(n.status=t.enums===String?"UNKNOWN":0,n.timing=null,n.target=null),null!=e.status&&e.hasOwnProperty("status")&&(n.status=t.enums===String?void 0===s.sqlanvil.ActionResult.ExecutionStatus[e.status]?e.status:s.sqlanvil.ActionResult.ExecutionStatus[e.status]:e.status),e.tasks&&e.tasks.length){n.tasks=[];for(var r=0;r<e.tasks.length;++r)n.tasks[r]=s.sqlanvil.TaskResult.toObject(e.tasks[r],t)}return null!=e.timing&&e.hasOwnProperty("timing")&&(n.timing=s.sqlanvil.Timing.toObject(e.timing,t)),null!=e.target&&e.hasOwnProperty("target")&&(n.target=s.sqlanvil.Target.toObject(e.target,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionResult"},t.ExecutionStatus=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN"]=0,t[e[1]="RUNNING"]=1,t[e[2]="SUCCESSFUL"]=2,t[e[3]="FAILED"]=3,t[e[4]="SKIPPED"]=4,t[e[5]="DISABLED"]=5,t[e[6]="CANCELLED"]=6,t}(),t}(),r.TaskResult=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.status=0,t.prototype.errorMessage="",t.prototype.timing=null,t.prototype.metadata=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.status&&Object.hasOwnProperty.call(e,"status")&&t.uint32(8).int32(e.status),null!=e.errorMessage&&Object.hasOwnProperty.call(e,"errorMessage")&&t.uint32(18).string(e.errorMessage),null!=e.timing&&Object.hasOwnProperty.call(e,"timing")&&s.sqlanvil.Timing.encode(e.timing,t.uint32(26).fork()).ldelim(),null!=e.metadata&&Object.hasOwnProperty.call(e,"metadata")&&s.sqlanvil.ExecutionMetadata.encode(e.metadata,t.uint32(34).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.TaskResult;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.status=e.int32();break;case 2:o.errorMessage=e.string();break;case 3:o.timing=s.sqlanvil.Timing.decode(e,e.uint32());break;case 4:o.metadata=s.sqlanvil.ExecutionMetadata.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.status&&e.hasOwnProperty("status"))switch(e.status){default:return"status: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:}return null!=e.errorMessage&&e.hasOwnProperty("errorMessage")&&!a.isString(e.errorMessage)?"errorMessage: string expected":null!=e.timing&&e.hasOwnProperty("timing")&&(t=s.sqlanvil.Timing.verify(e.timing))?"timing."+t:null!=e.metadata&&e.hasOwnProperty("metadata")&&(t=s.sqlanvil.ExecutionMetadata.verify(e.metadata))?"metadata."+t:null;var t},t.fromObject=function(e){if(e instanceof s.sqlanvil.TaskResult)return e;var t=new s.sqlanvil.TaskResult;switch(e.status){default:if("number"==typeof e.status){t.status=e.status;break}break;case"UNKNOWN":case 0:t.status=0;break;case"RUNNING":case 1:t.status=1;break;case"SUCCESSFUL":case 2:t.status=2;break;case"FAILED":case 3:t.status=3;break;case"SKIPPED":case 4:t.status=4;break;case"CANCELLED":case 5:t.status=5}if(null!=e.errorMessage&&(t.errorMessage=String(e.errorMessage)),null!=e.timing){if("object"!=typeof e.timing)throw TypeError(".sqlanvil.TaskResult.timing: object expected");t.timing=s.sqlanvil.Timing.fromObject(e.timing)}if(null!=e.metadata){if("object"!=typeof e.metadata)throw TypeError(".sqlanvil.TaskResult.metadata: object expected");t.metadata=s.sqlanvil.ExecutionMetadata.fromObject(e.metadata)}return t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.status=t.enums===String?"UNKNOWN":0,n.errorMessage="",n.timing=null,n.metadata=null),null!=e.status&&e.hasOwnProperty("status")&&(n.status=t.enums===String?void 0===s.sqlanvil.TaskResult.ExecutionStatus[e.status]?e.status:s.sqlanvil.TaskResult.ExecutionStatus[e.status]:e.status),null!=e.errorMessage&&e.hasOwnProperty("errorMessage")&&(n.errorMessage=e.errorMessage),null!=e.timing&&e.hasOwnProperty("timing")&&(n.timing=s.sqlanvil.Timing.toObject(e.timing,t)),null!=e.metadata&&e.hasOwnProperty("metadata")&&(n.metadata=s.sqlanvil.ExecutionMetadata.toObject(e.metadata,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.TaskResult"},t.ExecutionStatus=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN"]=0,t[e[1]="RUNNING"]=1,t[e[2]="SUCCESSFUL"]=2,t[e[3]="FAILED"]=3,t[e[4]="SKIPPED"]=4,t[e[5]="CANCELLED"]=5,t}(),t}(),r.TestResult=function(){function t(e){if(this.messages=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.successful=!1,t.prototype.messages=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.successful&&Object.hasOwnProperty.call(e,"successful")&&t.uint32(16).bool(e.successful),null!=e.messages&&e.messages.length)for(var n=0;n<e.messages.length;++n)t.uint32(26).string(e.messages[n]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.TestResult;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.name=e.string();break;case 2:o.successful=e.bool();break;case 3:o.messages&&o.messages.length||(o.messages=[]),o.messages.push(e.string());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.successful&&e.hasOwnProperty("successful")&&"boolean"!=typeof e.successful)return"successful: boolean expected";if(null!=e.messages&&e.hasOwnProperty("messages")){if(!Array.isArray(e.messages))return"messages: array expected";for(var t=0;t<e.messages.length;++t)if(!a.isString(e.messages[t]))return"messages: string[] expected"}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.TestResult)return e;var t=new s.sqlanvil.TestResult;if(null!=e.name&&(t.name=String(e.name)),null!=e.successful&&(t.successful=Boolean(e.successful)),e.messages){if(!Array.isArray(e.messages))throw TypeError(".sqlanvil.TestResult.messages: array expected");t.messages=[];for(var n=0;n<e.messages.length;++n)t.messages[n]=String(e.messages[n])}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.messages=[]),t.defaults&&(n.name="",n.successful=!1),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.successful&&e.hasOwnProperty("successful")&&(n.successful=e.successful),e.messages&&e.messages.length){n.messages=[];for(var r=0;r<e.messages.length;++r)n.messages[r]=e.messages[r]}return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.TestResult"},t}(),r.DbAdapter=function(){function t(t,n,r){e.rpc.Service.call(this,t,n,r)}return(t.prototype=Object.create(e.rpc.Service.prototype)).constructor=t,t.create=function(e,t,n){return new this(e,t,n)},Object.defineProperty(t.prototype.execute=function e(t,n){return this.rpcCall(e,s.sqlanvil.ExecuteRequest,s.sqlanvil.ExecuteResponse,t,n)},"name",{value:"Execute"}),Object.defineProperty(t.prototype.listTables=function e(t,n){return this.rpcCall(e,s.sqlanvil.ListTablesRequest,s.sqlanvil.ListTablesResponse,t,n)},"name",{value:"ListTables"}),Object.defineProperty(t.prototype.getTable=function e(t,n){return this.rpcCall(e,s.sqlanvil.GetTableRequest,s.sqlanvil.TableMetadata,t,n)},"name",{value:"GetTable"}),Object.defineProperty(t.prototype.deleteTable=function e(t,n){return this.rpcCall(e,s.sqlanvil.DeleteTableRequest,s.google.protobuf.Empty,t,n)},"name",{value:"DeleteTable"}),t}(),r.ExecuteRequest=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.statement="",t.prototype.rowLimit=0,t.prototype.byteLimit=0,t.prototype.fetchResults=!1,t.prototype.bigQueryOptions=null,t.prototype.params=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.statement&&Object.hasOwnProperty.call(e,"statement")&&t.uint32(10).string(e.statement),null!=e.rowLimit&&Object.hasOwnProperty.call(e,"rowLimit")&&t.uint32(16).int64(e.rowLimit),null!=e.byteLimit&&Object.hasOwnProperty.call(e,"byteLimit")&&t.uint32(24).int64(e.byteLimit),null!=e.fetchResults&&Object.hasOwnProperty.call(e,"fetchResults")&&t.uint32(32).bool(e.fetchResults),null!=e.bigQueryOptions&&Object.hasOwnProperty.call(e,"bigQueryOptions")&&s.sqlanvil.BigQueryExecuteOptions.encode(e.bigQueryOptions,t.uint32(42).fork()).ldelim(),null!=e.params&&Object.hasOwnProperty.call(e,"params")&&s.google.protobuf.Struct.encode(e.params,t.uint32(50).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ExecuteRequest;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.statement=e.string();break;case 2:o.rowLimit=e.int64();break;case 3:o.byteLimit=e.int64();break;case 4:o.fetchResults=e.bool();break;case 5:o.bigQueryOptions=s.sqlanvil.BigQueryExecuteOptions.decode(e,e.uint32());break;case 6:o.params=s.google.protobuf.Struct.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.statement&&e.hasOwnProperty("statement")&&!a.isString(e.statement)?"statement: string expected":null!=e.rowLimit&&e.hasOwnProperty("rowLimit")&&!(a.isInteger(e.rowLimit)||e.rowLimit&&a.isInteger(e.rowLimit.low)&&a.isInteger(e.rowLimit.high))?"rowLimit: integer|Long expected":null!=e.byteLimit&&e.hasOwnProperty("byteLimit")&&!(a.isInteger(e.byteLimit)||e.byteLimit&&a.isInteger(e.byteLimit.low)&&a.isInteger(e.byteLimit.high))?"byteLimit: integer|Long expected":null!=e.fetchResults&&e.hasOwnProperty("fetchResults")&&"boolean"!=typeof e.fetchResults?"fetchResults: boolean expected":null!=e.bigQueryOptions&&e.hasOwnProperty("bigQueryOptions")&&(t=s.sqlanvil.BigQueryExecuteOptions.verify(e.bigQueryOptions))?"bigQueryOptions."+t:null!=e.params&&e.hasOwnProperty("params")&&(t=s.google.protobuf.Struct.verify(e.params))?"params."+t:null;var t},t.fromObject=function(e){if(e instanceof s.sqlanvil.ExecuteRequest)return e;var t=new s.sqlanvil.ExecuteRequest;if(null!=e.statement&&(t.statement=String(e.statement)),null!=e.rowLimit&&(a.Long?(t.rowLimit=a.Long.fromValue(e.rowLimit)).unsigned=!1:"string"==typeof e.rowLimit?t.rowLimit=parseInt(e.rowLimit,10):"number"==typeof e.rowLimit?t.rowLimit=e.rowLimit:"object"==typeof e.rowLimit&&(t.rowLimit=new a.LongBits(e.rowLimit.low>>>0,e.rowLimit.high>>>0).toNumber())),null!=e.byteLimit&&(a.Long?(t.byteLimit=a.Long.fromValue(e.byteLimit)).unsigned=!1:"string"==typeof e.byteLimit?t.byteLimit=parseInt(e.byteLimit,10):"number"==typeof e.byteLimit?t.byteLimit=e.byteLimit:"object"==typeof e.byteLimit&&(t.byteLimit=new a.LongBits(e.byteLimit.low>>>0,e.byteLimit.high>>>0).toNumber())),null!=e.fetchResults&&(t.fetchResults=Boolean(e.fetchResults)),null!=e.bigQueryOptions){if("object"!=typeof e.bigQueryOptions)throw TypeError(".sqlanvil.ExecuteRequest.bigQueryOptions: object expected");t.bigQueryOptions=s.sqlanvil.BigQueryExecuteOptions.fromObject(e.bigQueryOptions)}if(null!=e.params){if("object"!=typeof e.params)throw TypeError(".sqlanvil.ExecuteRequest.params: object expected");t.params=s.google.protobuf.Struct.fromObject(e.params)}return t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.statement="",n.rowLimit=0,n.byteLimit=0,n.fetchResults=!1,n.bigQueryOptions=null,n.params=null),null!=e.statement&&e.hasOwnProperty("statement")&&(n.statement=e.statement),null!=e.rowLimit&&e.hasOwnProperty("rowLimit")&&("number"==typeof e.rowLimit?n.rowLimit=t.longs===String?String(e.rowLimit):e.rowLimit:n.rowLimit=t.longs===String?a.Long.prototype.toString.call(e.rowLimit):t.longs===Number?new a.LongBits(e.rowLimit.low>>>0,e.rowLimit.high>>>0).toNumber():e.rowLimit),null!=e.byteLimit&&e.hasOwnProperty("byteLimit")&&("number"==typeof e.byteLimit?n.byteLimit=t.longs===String?String(e.byteLimit):e.byteLimit:n.byteLimit=t.longs===String?a.Long.prototype.toString.call(e.byteLimit):t.longs===Number?new a.LongBits(e.byteLimit.low>>>0,e.byteLimit.high>>>0).toNumber():e.byteLimit),null!=e.fetchResults&&e.hasOwnProperty("fetchResults")&&(n.fetchResults=e.fetchResults),null!=e.bigQueryOptions&&e.hasOwnProperty("bigQueryOptions")&&(n.bigQueryOptions=s.sqlanvil.BigQueryExecuteOptions.toObject(e.bigQueryOptions,t)),null!=e.params&&e.hasOwnProperty("params")&&(n.params=s.google.protobuf.Struct.toObject(e.params,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ExecuteRequest"},t}(),r.BigQueryExecuteOptions=function(){function t(e){if(this.labels={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.interactive=!1,t.prototype.useLegacySql=!1,t.prototype.labels=a.emptyObject,t.prototype.location="",t.prototype.jobPrefix="",t.prototype.dryRun=!1,t.prototype.reservation="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.interactive&&Object.hasOwnProperty.call(e,"interactive")&&t.uint32(8).bool(e.interactive),null!=e.useLegacySql&&Object.hasOwnProperty.call(e,"useLegacySql")&&t.uint32(16).bool(e.useLegacySql),null!=e.labels&&Object.hasOwnProperty.call(e,"labels"))for(var n=Object.keys(e.labels),r=0;r<n.length;++r)t.uint32(26).fork().uint32(10).string(n[r]).uint32(18).string(e.labels[n[r]]).ldelim();return null!=e.location&&Object.hasOwnProperty.call(e,"location")&&t.uint32(34).string(e.location),null!=e.jobPrefix&&Object.hasOwnProperty.call(e,"jobPrefix")&&t.uint32(42).string(e.jobPrefix),null!=e.dryRun&&Object.hasOwnProperty.call(e,"dryRun")&&t.uint32(48).bool(e.dryRun),null!=e.reservation&&Object.hasOwnProperty.call(e,"reservation")&&t.uint32(58).string(e.reservation),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r,o,l=void 0===t?e.len:e.pos+t,c=new s.sqlanvil.BigQueryExecuteOptions;e.pos<l;){var u=e.uint32();if(u===n)break;switch(u>>>3){case 1:c.interactive=e.bool();break;case 2:c.useLegacySql=e.bool();break;case 3:c.labels===a.emptyObject&&(c.labels={});var p=e.uint32()+e.pos;for(r="",o="";e.pos<p;){var f=e.uint32();switch(f>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}}c.labels[r]=o;break;case 4:c.location=e.string();break;case 5:c.jobPrefix=e.string();break;case 6:c.dryRun=e.bool();break;case 7:c.reservation=e.string();break;default:e.skipType(7&u)}}return c},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.interactive&&e.hasOwnProperty("interactive")&&"boolean"!=typeof e.interactive)return"interactive: boolean expected";if(null!=e.useLegacySql&&e.hasOwnProperty("useLegacySql")&&"boolean"!=typeof e.useLegacySql)return"useLegacySql: boolean expected";if(null!=e.labels&&e.hasOwnProperty("labels")){if(!a.isObject(e.labels))return"labels: object expected";for(var t=Object.keys(e.labels),n=0;n<t.length;++n)if(!a.isString(e.labels[t[n]]))return"labels: string{k:string} expected"}return null!=e.location&&e.hasOwnProperty("location")&&!a.isString(e.location)?"location: string expected":null!=e.jobPrefix&&e.hasOwnProperty("jobPrefix")&&!a.isString(e.jobPrefix)?"jobPrefix: string expected":null!=e.dryRun&&e.hasOwnProperty("dryRun")&&"boolean"!=typeof e.dryRun?"dryRun: boolean expected":null!=e.reservation&&e.hasOwnProperty("reservation")&&!a.isString(e.reservation)?"reservation: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.BigQueryExecuteOptions)return e;var t=new s.sqlanvil.BigQueryExecuteOptions;if(null!=e.interactive&&(t.interactive=Boolean(e.interactive)),null!=e.useLegacySql&&(t.useLegacySql=Boolean(e.useLegacySql)),e.labels){if("object"!=typeof e.labels)throw TypeError(".sqlanvil.BigQueryExecuteOptions.labels: object expected");t.labels={};for(var n=Object.keys(e.labels),r=0;r<n.length;++r)t.labels[n[r]]=String(e.labels[n[r]])}return null!=e.location&&(t.location=String(e.location)),null!=e.jobPrefix&&(t.jobPrefix=String(e.jobPrefix)),null!=e.dryRun&&(t.dryRun=Boolean(e.dryRun)),null!=e.reservation&&(t.reservation=String(e.reservation)),t},t.toObject=function(e,t){t||(t={});var n,r={};if((t.objects||t.defaults)&&(r.labels={}),t.defaults&&(r.interactive=!1,r.useLegacySql=!1,r.location="",r.jobPrefix="",r.dryRun=!1,r.reservation=""),null!=e.interactive&&e.hasOwnProperty("interactive")&&(r.interactive=e.interactive),null!=e.useLegacySql&&e.hasOwnProperty("useLegacySql")&&(r.useLegacySql=e.useLegacySql),e.labels&&(n=Object.keys(e.labels)).length){r.labels={};for(var i=0;i<n.length;++i)r.labels[n[i]]=e.labels[n[i]]}return null!=e.location&&e.hasOwnProperty("location")&&(r.location=e.location),null!=e.jobPrefix&&e.hasOwnProperty("jobPrefix")&&(r.jobPrefix=e.jobPrefix),null!=e.dryRun&&e.hasOwnProperty("dryRun")&&(r.dryRun=e.dryRun),null!=e.reservation&&e.hasOwnProperty("reservation")&&(r.reservation=e.reservation),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.BigQueryExecuteOptions"},t}(),r.ExecuteResponse=function(){function t(e){if(this.rows=[],this.errors=[],this.schemaFields=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.executionMetadata=null,t.prototype.rows=a.emptyArray,t.prototype.errors=a.emptyArray,t.prototype.schemaFields=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.executionMetadata&&Object.hasOwnProperty.call(e,"executionMetadata")&&s.sqlanvil.ExecutionMetadata.encode(e.executionMetadata,t.uint32(10).fork()).ldelim(),null!=e.rows&&e.rows.length)for(var n=0;n<e.rows.length;++n)s.google.protobuf.Struct.encode(e.rows[n],t.uint32(18).fork()).ldelim();if(null!=e.errors&&e.errors.length)for(n=0;n<e.errors.length;++n)t.uint32(26).string(e.errors[n]);if(null!=e.schemaFields&&e.schemaFields.length)for(n=0;n<e.schemaFields.length;++n)s.sqlanvil.Field.encode(e.schemaFields[n],t.uint32(34).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ExecuteResponse;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.executionMetadata=s.sqlanvil.ExecutionMetadata.decode(e,e.uint32());break;case 2:o.rows&&o.rows.length||(o.rows=[]),o.rows.push(s.google.protobuf.Struct.decode(e,e.uint32()));break;case 3:o.errors&&o.errors.length||(o.errors=[]),o.errors.push(e.string());break;case 4:o.schemaFields&&o.schemaFields.length||(o.schemaFields=[]),o.schemaFields.push(s.sqlanvil.Field.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.executionMetadata&&e.hasOwnProperty("executionMetadata")&&(n=s.sqlanvil.ExecutionMetadata.verify(e.executionMetadata)))return"executionMetadata."+n;if(null!=e.rows&&e.hasOwnProperty("rows")){if(!Array.isArray(e.rows))return"rows: array expected";for(var t=0;t<e.rows.length;++t)if(n=s.google.protobuf.Struct.verify(e.rows[t]))return"rows."+n}if(null!=e.errors&&e.hasOwnProperty("errors")){if(!Array.isArray(e.errors))return"errors: array expected";for(t=0;t<e.errors.length;++t)if(!a.isString(e.errors[t]))return"errors: string[] expected"}if(null!=e.schemaFields&&e.hasOwnProperty("schemaFields")){if(!Array.isArray(e.schemaFields))return"schemaFields: array expected";for(t=0;t<e.schemaFields.length;++t){var n;if(n=s.sqlanvil.Field.verify(e.schemaFields[t]))return"schemaFields."+n}}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ExecuteResponse)return e;var t=new s.sqlanvil.ExecuteResponse;if(null!=e.executionMetadata){if("object"!=typeof e.executionMetadata)throw TypeError(".sqlanvil.ExecuteResponse.executionMetadata: object expected");t.executionMetadata=s.sqlanvil.ExecutionMetadata.fromObject(e.executionMetadata)}if(e.rows){if(!Array.isArray(e.rows))throw TypeError(".sqlanvil.ExecuteResponse.rows: array expected");t.rows=[];for(var n=0;n<e.rows.length;++n){if("object"!=typeof e.rows[n])throw TypeError(".sqlanvil.ExecuteResponse.rows: object expected");t.rows[n]=s.google.protobuf.Struct.fromObject(e.rows[n])}}if(e.errors){if(!Array.isArray(e.errors))throw TypeError(".sqlanvil.ExecuteResponse.errors: array expected");for(t.errors=[],n=0;n<e.errors.length;++n)t.errors[n]=String(e.errors[n])}if(e.schemaFields){if(!Array.isArray(e.schemaFields))throw TypeError(".sqlanvil.ExecuteResponse.schemaFields: array expected");for(t.schemaFields=[],n=0;n<e.schemaFields.length;++n){if("object"!=typeof e.schemaFields[n])throw TypeError(".sqlanvil.ExecuteResponse.schemaFields: object expected");t.schemaFields[n]=s.sqlanvil.Field.fromObject(e.schemaFields[n])}}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.rows=[],n.errors=[],n.schemaFields=[]),t.defaults&&(n.executionMetadata=null),null!=e.executionMetadata&&e.hasOwnProperty("executionMetadata")&&(n.executionMetadata=s.sqlanvil.ExecutionMetadata.toObject(e.executionMetadata,t)),e.rows&&e.rows.length){n.rows=[];for(var r=0;r<e.rows.length;++r)n.rows[r]=s.google.protobuf.Struct.toObject(e.rows[r],t)}if(e.errors&&e.errors.length)for(n.errors=[],r=0;r<e.errors.length;++r)n.errors[r]=e.errors[r];if(e.schemaFields&&e.schemaFields.length)for(n.schemaFields=[],r=0;r<e.schemaFields.length;++r)n.schemaFields[r]=s.sqlanvil.Field.toObject(e.schemaFields[r],t);return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ExecuteResponse"},t}(),r.ListTablesRequest=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.database="",t.prototype.schema="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.database&&Object.hasOwnProperty.call(e,"database")&&t.uint32(10).string(e.database),null!=e.schema&&Object.hasOwnProperty.call(e,"schema")&&t.uint32(18).string(e.schema),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ListTablesRequest;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.database=e.string();break;case 2:o.schema=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.database&&e.hasOwnProperty("database")&&!a.isString(e.database)?"database: string expected":null!=e.schema&&e.hasOwnProperty("schema")&&!a.isString(e.schema)?"schema: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ListTablesRequest)return e;var t=new s.sqlanvil.ListTablesRequest;return null!=e.database&&(t.database=String(e.database)),null!=e.schema&&(t.schema=String(e.schema)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.database="",n.schema=""),null!=e.database&&e.hasOwnProperty("database")&&(n.database=e.database),null!=e.schema&&e.hasOwnProperty("schema")&&(n.schema=e.schema),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ListTablesRequest"},t}(),r.ListTablesResponse=function(){function t(e){if(this.tables=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.tables=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.tables&&e.tables.length)for(var n=0;n<e.tables.length;++n)s.sqlanvil.TableMetadata.encode(e.tables[n],t.uint32(10).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ListTablesResponse;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?(o.tables&&o.tables.length||(o.tables=[]),o.tables.push(s.sqlanvil.TableMetadata.decode(e,e.uint32()))):e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.tables&&e.hasOwnProperty("tables")){if(!Array.isArray(e.tables))return"tables: array expected";for(var t=0;t<e.tables.length;++t){var n=s.sqlanvil.TableMetadata.verify(e.tables[t]);if(n)return"tables."+n}}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ListTablesResponse)return e;var t=new s.sqlanvil.ListTablesResponse;if(e.tables){if(!Array.isArray(e.tables))throw TypeError(".sqlanvil.ListTablesResponse.tables: array expected");t.tables=[];for(var n=0;n<e.tables.length;++n){if("object"!=typeof e.tables[n])throw TypeError(".sqlanvil.ListTablesResponse.tables: object expected");t.tables[n]=s.sqlanvil.TableMetadata.fromObject(e.tables[n])}}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.tables=[]),e.tables&&e.tables.length){n.tables=[];for(var r=0;r<e.tables.length;++r)n.tables[r]=s.sqlanvil.TableMetadata.toObject(e.tables[r],t)}return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ListTablesResponse"},t}(),r.GetTableRequest=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.target=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&s.sqlanvil.Target.encode(e.target,t.uint32(10).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.GetTableRequest;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?o.target=s.sqlanvil.Target.decode(e,e.uint32()):e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.target&&e.hasOwnProperty("target")){var t=s.sqlanvil.Target.verify(e.target);if(t)return"target."+t}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.GetTableRequest)return e;var t=new s.sqlanvil.GetTableRequest;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.GetTableRequest.target: object expected");t.target=s.sqlanvil.Target.fromObject(e.target)}return t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.target=null),null!=e.target&&e.hasOwnProperty("target")&&(n.target=s.sqlanvil.Target.toObject(e.target,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.GetTableRequest"},t}(),r.DeleteTableRequest=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.target=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&s.sqlanvil.Target.encode(e.target,t.uint32(10).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.DeleteTableRequest;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?o.target=s.sqlanvil.Target.decode(e,e.uint32()):e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.target&&e.hasOwnProperty("target")){var t=s.sqlanvil.Target.verify(e.target);if(t)return"target."+t}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.DeleteTableRequest)return e;var t=new s.sqlanvil.DeleteTableRequest;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.DeleteTableRequest.target: object expected");t.target=s.sqlanvil.Target.fromObject(e.target)}return t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.target=null),null!=e.target&&e.hasOwnProperty("target")&&(n.target=s.sqlanvil.Target.toObject(e.target,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.DeleteTableRequest"},t}(),r.RunningExecutionData=function(){function t(e){if(this.runTargets=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.runTargets=a.emptyArray,t.prototype.executionId="",t.prototype.executionStartTime=null,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.runTargets&&e.runTargets.length)for(var n=0;n<e.runTargets.length;++n)s.sqlanvil.Target.encode(e.runTargets[n],t.uint32(10).fork()).ldelim();return null!=e.executionId&&Object.hasOwnProperty.call(e,"executionId")&&t.uint32(18).string(e.executionId),null!=e.executionStartTime&&Object.hasOwnProperty.call(e,"executionStartTime")&&s.google.protobuf.Timestamp.encode(e.executionStartTime,t.uint32(26).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.RunningExecutionData;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.runTargets&&o.runTargets.length||(o.runTargets=[]),o.runTargets.push(s.sqlanvil.Target.decode(e,e.uint32()));break;case 2:o.executionId=e.string();break;case 3:o.executionStartTime=s.google.protobuf.Timestamp.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.runTargets&&e.hasOwnProperty("runTargets")){if(!Array.isArray(e.runTargets))return"runTargets: array expected";for(var t=0;t<e.runTargets.length;++t)if(n=s.sqlanvil.Target.verify(e.runTargets[t]))return"runTargets."+n}return null!=e.executionId&&e.hasOwnProperty("executionId")&&!a.isString(e.executionId)?"executionId: string expected":null!=e.executionStartTime&&e.hasOwnProperty("executionStartTime")&&(n=s.google.protobuf.Timestamp.verify(e.executionStartTime))?"executionStartTime."+n:null;var n},t.fromObject=function(e){if(e instanceof s.sqlanvil.RunningExecutionData)return e;var t=new s.sqlanvil.RunningExecutionData;if(e.runTargets){if(!Array.isArray(e.runTargets))throw TypeError(".sqlanvil.RunningExecutionData.runTargets: array expected");t.runTargets=[];for(var n=0;n<e.runTargets.length;++n){if("object"!=typeof e.runTargets[n])throw TypeError(".sqlanvil.RunningExecutionData.runTargets: object expected");t.runTargets[n]=s.sqlanvil.Target.fromObject(e.runTargets[n])}}if(null!=e.executionId&&(t.executionId=String(e.executionId)),null!=e.executionStartTime){if("object"!=typeof e.executionStartTime)throw TypeError(".sqlanvil.RunningExecutionData.executionStartTime: object expected");t.executionStartTime=s.google.protobuf.Timestamp.fromObject(e.executionStartTime)}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.runTargets=[]),t.defaults&&(n.executionId="",n.executionStartTime=null),e.runTargets&&e.runTargets.length){n.runTargets=[];for(var r=0;r<e.runTargets.length;++r)n.runTargets[r]=s.sqlanvil.Target.toObject(e.runTargets[r],t)}return null!=e.executionId&&e.hasOwnProperty("executionId")&&(n.executionId=e.executionId),null!=e.executionStartTime&&e.hasOwnProperty("executionStartTime")&&(n.executionStartTime=s.google.protobuf.Timestamp.toObject(e.executionStartTime,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.RunningExecutionData"},t}(),r.JitCompilationTargetType=function(){var e={},t=Object.create(e);return t[e[0]="JIT_COMPILATION_TARGET_TYPE_UNSPECIFIED"]=0,t[e[1]="JIT_COMPILATION_TARGET_TYPE_TABLE"]=1,t[e[2]="JIT_COMPILATION_TARGET_TYPE_OPERATION"]=2,t[e[3]="JIT_COMPILATION_TARGET_TYPE_INCREMENTAL_TABLE"]=3,t[e[4]="JIT_COMPILATION_TARGET_TYPE_ASSERTION"]=4,t}(),r.JitCompilationRequest=function(){function t(e){if(this.dependencies=[],this.filePaths=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.target=null,t.prototype.dependencies=a.emptyArray,t.prototype.jitCode="",t.prototype.jitData=null,t.prototype.compilationTargetType=0,t.prototype.filePaths=a.emptyArray,t.prototype.executionData=null,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&s.sqlanvil.Target.encode(e.target,t.uint32(10).fork()).ldelim(),null!=e.dependencies&&e.dependencies.length)for(var n=0;n<e.dependencies.length;++n)s.sqlanvil.Target.encode(e.dependencies[n],t.uint32(18).fork()).ldelim();if(null!=e.jitCode&&Object.hasOwnProperty.call(e,"jitCode")&&t.uint32(26).string(e.jitCode),null!=e.jitData&&Object.hasOwnProperty.call(e,"jitData")&&s.google.protobuf.Struct.encode(e.jitData,t.uint32(34).fork()).ldelim(),null!=e.compilationTargetType&&Object.hasOwnProperty.call(e,"compilationTargetType")&&t.uint32(40).int32(e.compilationTargetType),null!=e.filePaths&&e.filePaths.length)for(n=0;n<e.filePaths.length;++n)t.uint32(50).string(e.filePaths[n]);return null!=e.executionData&&Object.hasOwnProperty.call(e,"executionData")&&s.sqlanvil.RunningExecutionData.encode(e.executionData,t.uint32(58).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.JitCompilationRequest;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.target=s.sqlanvil.Target.decode(e,e.uint32());break;case 2:o.dependencies&&o.dependencies.length||(o.dependencies=[]),o.dependencies.push(s.sqlanvil.Target.decode(e,e.uint32()));break;case 3:o.jitCode=e.string();break;case 4:o.jitData=s.google.protobuf.Struct.decode(e,e.uint32());break;case 5:o.compilationTargetType=e.int32();break;case 6:o.filePaths&&o.filePaths.length||(o.filePaths=[]),o.filePaths.push(e.string());break;case 7:o.executionData=s.sqlanvil.RunningExecutionData.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.target&&e.hasOwnProperty("target")&&(n=s.sqlanvil.Target.verify(e.target)))return"target."+n;if(null!=e.dependencies&&e.hasOwnProperty("dependencies")){if(!Array.isArray(e.dependencies))return"dependencies: array expected";for(var t=0;t<e.dependencies.length;++t){var n;if(n=s.sqlanvil.Target.verify(e.dependencies[t]))return"dependencies."+n}}if(null!=e.jitCode&&e.hasOwnProperty("jitCode")&&!a.isString(e.jitCode))return"jitCode: string expected";if(null!=e.jitData&&e.hasOwnProperty("jitData")&&(n=s.google.protobuf.Struct.verify(e.jitData)))return"jitData."+n;if(null!=e.compilationTargetType&&e.hasOwnProperty("compilationTargetType"))switch(e.compilationTargetType){default:return"compilationTargetType: enum value expected";case 0:case 1:case 2:case 3:case 4:}if(null!=e.filePaths&&e.hasOwnProperty("filePaths")){if(!Array.isArray(e.filePaths))return"filePaths: array expected";for(t=0;t<e.filePaths.length;++t)if(!a.isString(e.filePaths[t]))return"filePaths: string[] expected"}return null!=e.executionData&&e.hasOwnProperty("executionData")&&(n=s.sqlanvil.RunningExecutionData.verify(e.executionData))?"executionData."+n:null},t.fromObject=function(e){if(e instanceof s.sqlanvil.JitCompilationRequest)return e;var t=new s.sqlanvil.JitCompilationRequest;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.JitCompilationRequest.target: object expected");t.target=s.sqlanvil.Target.fromObject(e.target)}if(e.dependencies){if(!Array.isArray(e.dependencies))throw TypeError(".sqlanvil.JitCompilationRequest.dependencies: array expected");t.dependencies=[];for(var n=0;n<e.dependencies.length;++n){if("object"!=typeof e.dependencies[n])throw TypeError(".sqlanvil.JitCompilationRequest.dependencies: object expected");t.dependencies[n]=s.sqlanvil.Target.fromObject(e.dependencies[n])}}if(null!=e.jitCode&&(t.jitCode=String(e.jitCode)),null!=e.jitData){if("object"!=typeof e.jitData)throw TypeError(".sqlanvil.JitCompilationRequest.jitData: object expected");t.jitData=s.google.protobuf.Struct.fromObject(e.jitData)}switch(e.compilationTargetType){default:if("number"==typeof e.compilationTargetType){t.compilationTargetType=e.compilationTargetType;break}break;case"JIT_COMPILATION_TARGET_TYPE_UNSPECIFIED":case 0:t.compilationTargetType=0;break;case"JIT_COMPILATION_TARGET_TYPE_TABLE":case 1:t.compilationTargetType=1;break;case"JIT_COMPILATION_TARGET_TYPE_OPERATION":case 2:t.compilationTargetType=2;break;case"JIT_COMPILATION_TARGET_TYPE_INCREMENTAL_TABLE":case 3:t.compilationTargetType=3;break;case"JIT_COMPILATION_TARGET_TYPE_ASSERTION":case 4:t.compilationTargetType=4}if(e.filePaths){if(!Array.isArray(e.filePaths))throw TypeError(".sqlanvil.JitCompilationRequest.filePaths: array expected");for(t.filePaths=[],n=0;n<e.filePaths.length;++n)t.filePaths[n]=String(e.filePaths[n])}if(null!=e.executionData){if("object"!=typeof e.executionData)throw TypeError(".sqlanvil.JitCompilationRequest.executionData: object expected");t.executionData=s.sqlanvil.RunningExecutionData.fromObject(e.executionData)}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.dependencies=[],n.filePaths=[]),t.defaults&&(n.target=null,n.jitCode="",n.jitData=null,n.compilationTargetType=t.enums===String?"JIT_COMPILATION_TARGET_TYPE_UNSPECIFIED":0,n.executionData=null),null!=e.target&&e.hasOwnProperty("target")&&(n.target=s.sqlanvil.Target.toObject(e.target,t)),e.dependencies&&e.dependencies.length){n.dependencies=[];for(var r=0;r<e.dependencies.length;++r)n.dependencies[r]=s.sqlanvil.Target.toObject(e.dependencies[r],t)}if(null!=e.jitCode&&e.hasOwnProperty("jitCode")&&(n.jitCode=e.jitCode),null!=e.jitData&&e.hasOwnProperty("jitData")&&(n.jitData=s.google.protobuf.Struct.toObject(e.jitData,t)),null!=e.compilationTargetType&&e.hasOwnProperty("compilationTargetType")&&(n.compilationTargetType=t.enums===String?void 0===s.sqlanvil.JitCompilationTargetType[e.compilationTargetType]?e.compilationTargetType:s.sqlanvil.JitCompilationTargetType[e.compilationTargetType]:e.compilationTargetType),e.filePaths&&e.filePaths.length)for(n.filePaths=[],r=0;r<e.filePaths.length;++r)n.filePaths[r]=e.filePaths[r];return null!=e.executionData&&e.hasOwnProperty("executionData")&&(n.executionData=s.sqlanvil.RunningExecutionData.toObject(e.executionData,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.JitCompilationRequest"},t}(),r.JitCompilationResponse=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var n;return t.prototype.table=null,t.prototype.operation=null,t.prototype.incrementalTable=null,t.prototype.assertion=null,Object.defineProperty(t.prototype,"response",{get:a.oneOfGetter(n=["table","operation","incrementalTable","assertion"]),set:a.oneOfSetter(n)}),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.table&&Object.hasOwnProperty.call(e,"table")&&s.sqlanvil.JitTableResult.encode(e.table,t.uint32(10).fork()).ldelim(),null!=e.operation&&Object.hasOwnProperty.call(e,"operation")&&s.sqlanvil.JitOperationResult.encode(e.operation,t.uint32(18).fork()).ldelim(),null!=e.incrementalTable&&Object.hasOwnProperty.call(e,"incrementalTable")&&s.sqlanvil.JitIncrementalTableResult.encode(e.incrementalTable,t.uint32(26).fork()).ldelim(),null!=e.assertion&&Object.hasOwnProperty.call(e,"assertion")&&s.sqlanvil.JitAssertionResult.encode(e.assertion,t.uint32(34).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.JitCompilationResponse;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.table=s.sqlanvil.JitTableResult.decode(e,e.uint32());break;case 2:o.operation=s.sqlanvil.JitOperationResult.decode(e,e.uint32());break;case 3:o.incrementalTable=s.sqlanvil.JitIncrementalTableResult.decode(e,e.uint32());break;case 4:o.assertion=s.sqlanvil.JitAssertionResult.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.table&&e.hasOwnProperty("table")&&(t.response=1,n=s.sqlanvil.JitTableResult.verify(e.table)))return"table."+n;if(null!=e.operation&&e.hasOwnProperty("operation")){if(1===t.response)return"response: multiple values";if(t.response=1,n=s.sqlanvil.JitOperationResult.verify(e.operation))return"operation."+n}if(null!=e.incrementalTable&&e.hasOwnProperty("incrementalTable")){if(1===t.response)return"response: multiple values";if(t.response=1,n=s.sqlanvil.JitIncrementalTableResult.verify(e.incrementalTable))return"incrementalTable."+n}if(null!=e.assertion&&e.hasOwnProperty("assertion")){if(1===t.response)return"response: multiple values";var n;if(t.response=1,n=s.sqlanvil.JitAssertionResult.verify(e.assertion))return"assertion."+n}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.JitCompilationResponse)return e;var t=new s.sqlanvil.JitCompilationResponse;if(null!=e.table){if("object"!=typeof e.table)throw TypeError(".sqlanvil.JitCompilationResponse.table: object expected");t.table=s.sqlanvil.JitTableResult.fromObject(e.table)}if(null!=e.operation){if("object"!=typeof e.operation)throw TypeError(".sqlanvil.JitCompilationResponse.operation: object expected");t.operation=s.sqlanvil.JitOperationResult.fromObject(e.operation)}if(null!=e.incrementalTable){if("object"!=typeof e.incrementalTable)throw TypeError(".sqlanvil.JitCompilationResponse.incrementalTable: object expected");t.incrementalTable=s.sqlanvil.JitIncrementalTableResult.fromObject(e.incrementalTable)}if(null!=e.assertion){if("object"!=typeof e.assertion)throw TypeError(".sqlanvil.JitCompilationResponse.assertion: object expected");t.assertion=s.sqlanvil.JitAssertionResult.fromObject(e.assertion)}return t},t.toObject=function(e,t){t||(t={});var n={};return null!=e.table&&e.hasOwnProperty("table")&&(n.table=s.sqlanvil.JitTableResult.toObject(e.table,t),t.oneofs&&(n.response="table")),null!=e.operation&&e.hasOwnProperty("operation")&&(n.operation=s.sqlanvil.JitOperationResult.toObject(e.operation,t),t.oneofs&&(n.response="operation")),null!=e.incrementalTable&&e.hasOwnProperty("incrementalTable")&&(n.incrementalTable=s.sqlanvil.JitIncrementalTableResult.toObject(e.incrementalTable,t),t.oneofs&&(n.response="incrementalTable")),null!=e.assertion&&e.hasOwnProperty("assertion")&&(n.assertion=s.sqlanvil.JitAssertionResult.toObject(e.assertion,t),t.oneofs&&(n.response="assertion")),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.JitCompilationResponse"},t}(),r.JitTableResult=function(){function t(e){if(this.preOps=[],this.postOps=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.query="",t.prototype.preOps=a.emptyArray,t.prototype.postOps=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.query&&Object.hasOwnProperty.call(e,"query")&&t.uint32(10).string(e.query),null!=e.preOps&&e.preOps.length)for(var n=0;n<e.preOps.length;++n)t.uint32(26).string(e.preOps[n]);if(null!=e.postOps&&e.postOps.length)for(n=0;n<e.postOps.length;++n)t.uint32(34).string(e.postOps[n]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.JitTableResult;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.query=e.string();break;case 3:o.preOps&&o.preOps.length||(o.preOps=[]),o.preOps.push(e.string());break;case 4:o.postOps&&o.postOps.length||(o.postOps=[]),o.postOps.push(e.string());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.query&&e.hasOwnProperty("query")&&!a.isString(e.query))return"query: string expected";if(null!=e.preOps&&e.hasOwnProperty("preOps")){if(!Array.isArray(e.preOps))return"preOps: array expected";for(var t=0;t<e.preOps.length;++t)if(!a.isString(e.preOps[t]))return"preOps: string[] expected"}if(null!=e.postOps&&e.hasOwnProperty("postOps")){if(!Array.isArray(e.postOps))return"postOps: array expected";for(t=0;t<e.postOps.length;++t)if(!a.isString(e.postOps[t]))return"postOps: string[] expected"}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.JitTableResult)return e;var t=new s.sqlanvil.JitTableResult;if(null!=e.query&&(t.query=String(e.query)),e.preOps){if(!Array.isArray(e.preOps))throw TypeError(".sqlanvil.JitTableResult.preOps: array expected");t.preOps=[];for(var n=0;n<e.preOps.length;++n)t.preOps[n]=String(e.preOps[n])}if(e.postOps){if(!Array.isArray(e.postOps))throw TypeError(".sqlanvil.JitTableResult.postOps: array expected");for(t.postOps=[],n=0;n<e.postOps.length;++n)t.postOps[n]=String(e.postOps[n])}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.preOps=[],n.postOps=[]),t.defaults&&(n.query=""),null!=e.query&&e.hasOwnProperty("query")&&(n.query=e.query),e.preOps&&e.preOps.length){n.preOps=[];for(var r=0;r<e.preOps.length;++r)n.preOps[r]=e.preOps[r]}if(e.postOps&&e.postOps.length)for(n.postOps=[],r=0;r<e.postOps.length;++r)n.postOps[r]=e.postOps[r];return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.JitTableResult"},t}(),r.JitIncrementalTableResult=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.regular=null,t.prototype.incremental=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.regular&&Object.hasOwnProperty.call(e,"regular")&&s.sqlanvil.JitTableResult.encode(e.regular,t.uint32(10).fork()).ldelim(),null!=e.incremental&&Object.hasOwnProperty.call(e,"incremental")&&s.sqlanvil.JitTableResult.encode(e.incremental,t.uint32(18).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.JitIncrementalTableResult;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.regular=s.sqlanvil.JitTableResult.decode(e,e.uint32());break;case 2:o.incremental=s.sqlanvil.JitTableResult.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.regular&&e.hasOwnProperty("regular")&&(t=s.sqlanvil.JitTableResult.verify(e.regular))?"regular."+t:null!=e.incremental&&e.hasOwnProperty("incremental")&&(t=s.sqlanvil.JitTableResult.verify(e.incremental))?"incremental."+t:null;var t},t.fromObject=function(e){if(e instanceof s.sqlanvil.JitIncrementalTableResult)return e;var t=new s.sqlanvil.JitIncrementalTableResult;if(null!=e.regular){if("object"!=typeof e.regular)throw TypeError(".sqlanvil.JitIncrementalTableResult.regular: object expected");t.regular=s.sqlanvil.JitTableResult.fromObject(e.regular)}if(null!=e.incremental){if("object"!=typeof e.incremental)throw TypeError(".sqlanvil.JitIncrementalTableResult.incremental: object expected");t.incremental=s.sqlanvil.JitTableResult.fromObject(e.incremental)}return t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.regular=null,n.incremental=null),null!=e.regular&&e.hasOwnProperty("regular")&&(n.regular=s.sqlanvil.JitTableResult.toObject(e.regular,t)),null!=e.incremental&&e.hasOwnProperty("incremental")&&(n.incremental=s.sqlanvil.JitTableResult.toObject(e.incremental,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.JitIncrementalTableResult"},t}(),r.JitOperationResult=function(){function t(e){if(this.queries=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.queries=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.queries&&e.queries.length)for(var n=0;n<e.queries.length;++n)t.uint32(10).string(e.queries[n]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.JitOperationResult;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?(o.queries&&o.queries.length||(o.queries=[]),o.queries.push(e.string())):e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.queries&&e.hasOwnProperty("queries")){if(!Array.isArray(e.queries))return"queries: array expected";for(var t=0;t<e.queries.length;++t)if(!a.isString(e.queries[t]))return"queries: string[] expected"}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.JitOperationResult)return e;var t=new s.sqlanvil.JitOperationResult;if(e.queries){if(!Array.isArray(e.queries))throw TypeError(".sqlanvil.JitOperationResult.queries: array expected");t.queries=[];for(var n=0;n<e.queries.length;++n)t.queries[n]=String(e.queries[n])}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.queries=[]),e.queries&&e.queries.length){n.queries=[];for(var r=0;r<e.queries.length;++r)n.queries[r]=e.queries[r]}return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.JitOperationResult"},t}(),r.JitAssertionResult=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.query="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.query&&Object.hasOwnProperty.call(e,"query")&&t.uint32(10).string(e.query),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.JitAssertionResult;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?o.query=e.string():e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.query&&e.hasOwnProperty("query")&&!a.isString(e.query)?"query: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.JitAssertionResult)return e;var t=new s.sqlanvil.JitAssertionResult;return null!=e.query&&(t.query=String(e.query)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.query=""),null!=e.query&&e.hasOwnProperty("query")&&(n.query=e.query),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.JitAssertionResult"},t}(),r.BigQuery=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.projectId="",t.prototype.credentials="",t.prototype.location="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.projectId&&Object.hasOwnProperty.call(e,"projectId")&&t.uint32(10).string(e.projectId),null!=e.credentials&&Object.hasOwnProperty.call(e,"credentials")&&t.uint32(26).string(e.credentials),null!=e.location&&Object.hasOwnProperty.call(e,"location")&&t.uint32(34).string(e.location),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.BigQuery;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.projectId=e.string();break;case 3:o.credentials=e.string();break;case 4:o.location=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.projectId&&e.hasOwnProperty("projectId")&&!a.isString(e.projectId)?"projectId: string expected":null!=e.credentials&&e.hasOwnProperty("credentials")&&!a.isString(e.credentials)?"credentials: string expected":null!=e.location&&e.hasOwnProperty("location")&&!a.isString(e.location)?"location: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.BigQuery)return e;var t=new s.sqlanvil.BigQuery;return null!=e.projectId&&(t.projectId=String(e.projectId)),null!=e.credentials&&(t.credentials=String(e.credentials)),null!=e.location&&(t.location=String(e.location)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.projectId="",n.credentials="",n.location=""),null!=e.projectId&&e.hasOwnProperty("projectId")&&(n.projectId=e.projectId),null!=e.credentials&&e.hasOwnProperty("credentials")&&(n.credentials=e.credentials),null!=e.location&&e.hasOwnProperty("location")&&(n.location=e.location),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.BigQuery"},t}(),r),s.google=function(){var t,n,r,l={};return l.protobuf=((r={}).Struct=function(){function t(e){if(this.fields={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.fields=a.emptyObject,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.fields&&Object.hasOwnProperty.call(e,"fields"))for(var n=Object.keys(e.fields),r=0;r<n.length;++r)t.uint32(10).fork().uint32(10).string(n[r]),s.google.protobuf.Value.encode(e.fields[n[r]],t.uint32(18).fork()).ldelim().ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r,o,l=void 0===t?e.len:e.pos+t,c=new s.google.protobuf.Struct;e.pos<l;){var u=e.uint32();if(u===n)break;if(u>>>3==1){c.fields===a.emptyObject&&(c.fields={});var p=e.uint32()+e.pos;for(r="",o=null;e.pos<p;){var f=e.uint32();switch(f>>>3){case 1:r=e.string();break;case 2:o=s.google.protobuf.Value.decode(e,e.uint32());break;default:e.skipType(7&f)}}c.fields[r]=o}else e.skipType(7&u)}return c},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.fields&&e.hasOwnProperty("fields")){if(!a.isObject(e.fields))return"fields: object expected";for(var t=Object.keys(e.fields),n=0;n<t.length;++n){var r=s.google.protobuf.Value.verify(e.fields[t[n]]);if(r)return"fields."+r}}return null},t.fromObject=function(e){if(e instanceof s.google.protobuf.Struct)return e;var t=new s.google.protobuf.Struct;if(e.fields){if("object"!=typeof e.fields)throw TypeError(".google.protobuf.Struct.fields: object expected");t.fields={};for(var n=Object.keys(e.fields),r=0;r<n.length;++r){if("object"!=typeof e.fields[n[r]])throw TypeError(".google.protobuf.Struct.fields: object expected");t.fields[n[r]]=s.google.protobuf.Value.fromObject(e.fields[n[r]])}}return t},t.toObject=function(e,t){t||(t={});var n,r={};if((t.objects||t.defaults)&&(r.fields={}),e.fields&&(n=Object.keys(e.fields)).length){r.fields={};for(var i=0;i<n.length;++i)r.fields[n[i]]=s.google.protobuf.Value.toObject(e.fields[n[i]],t)}return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/google.protobuf.Struct"},t}(),r.Value=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var n;return t.prototype.nullValue=null,t.prototype.numberValue=null,t.prototype.stringValue=null,t.prototype.boolValue=null,t.prototype.structValue=null,t.prototype.listValue=null,Object.defineProperty(t.prototype,"kind",{get:a.oneOfGetter(n=["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]),set:a.oneOfSetter(n)}),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.nullValue&&Object.hasOwnProperty.call(e,"nullValue")&&t.uint32(8).int32(e.nullValue),null!=e.numberValue&&Object.hasOwnProperty.call(e,"numberValue")&&t.uint32(17).double(e.numberValue),null!=e.stringValue&&Object.hasOwnProperty.call(e,"stringValue")&&t.uint32(26).string(e.stringValue),null!=e.boolValue&&Object.hasOwnProperty.call(e,"boolValue")&&t.uint32(32).bool(e.boolValue),null!=e.structValue&&Object.hasOwnProperty.call(e,"structValue")&&s.google.protobuf.Struct.encode(e.structValue,t.uint32(42).fork()).ldelim(),null!=e.listValue&&Object.hasOwnProperty.call(e,"listValue")&&s.google.protobuf.ListValue.encode(e.listValue,t.uint32(50).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.google.protobuf.Value;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.nullValue=e.int32();break;case 2:o.numberValue=e.double();break;case 3:o.stringValue=e.string();break;case 4:o.boolValue=e.bool();break;case 5:o.structValue=s.google.protobuf.Struct.decode(e,e.uint32());break;case 6:o.listValue=s.google.protobuf.ListValue.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.nullValue&&e.hasOwnProperty("nullValue")&&(t.kind=1,0!==e.nullValue))return"nullValue: enum value expected";if(null!=e.numberValue&&e.hasOwnProperty("numberValue")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,"number"!=typeof e.numberValue)return"numberValue: number expected"}if(null!=e.stringValue&&e.hasOwnProperty("stringValue")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,!a.isString(e.stringValue))return"stringValue: string expected"}if(null!=e.boolValue&&e.hasOwnProperty("boolValue")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,"boolean"!=typeof e.boolValue)return"boolValue: boolean expected"}if(null!=e.structValue&&e.hasOwnProperty("structValue")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,n=s.google.protobuf.Struct.verify(e.structValue))return"structValue."+n}if(null!=e.listValue&&e.hasOwnProperty("listValue")){if(1===t.kind)return"kind: multiple values";var n;if(t.kind=1,n=s.google.protobuf.ListValue.verify(e.listValue))return"listValue."+n}return null},t.fromObject=function(e){if(e instanceof s.google.protobuf.Value)return e;var t=new s.google.protobuf.Value;switch(e.nullValue){default:if("number"==typeof e.nullValue){t.nullValue=e.nullValue;break}break;case"NULL_VALUE":case 0:t.nullValue=0}if(null!=e.numberValue&&(t.numberValue=Number(e.numberValue)),null!=e.stringValue&&(t.stringValue=String(e.stringValue)),null!=e.boolValue&&(t.boolValue=Boolean(e.boolValue)),null!=e.structValue){if("object"!=typeof e.structValue)throw TypeError(".google.protobuf.Value.structValue: object expected");t.structValue=s.google.protobuf.Struct.fromObject(e.structValue)}if(null!=e.listValue){if("object"!=typeof e.listValue)throw TypeError(".google.protobuf.Value.listValue: object expected");t.listValue=s.google.protobuf.ListValue.fromObject(e.listValue)}return t},t.toObject=function(e,t){t||(t={});var n={};return null!=e.nullValue&&e.hasOwnProperty("nullValue")&&(n.nullValue=t.enums===String?void 0===s.google.protobuf.NullValue[e.nullValue]?e.nullValue:s.google.protobuf.NullValue[e.nullValue]:e.nullValue,t.oneofs&&(n.kind="nullValue")),null!=e.numberValue&&e.hasOwnProperty("numberValue")&&(n.numberValue=t.json&&!isFinite(e.numberValue)?String(e.numberValue):e.numberValue,t.oneofs&&(n.kind="numberValue")),null!=e.stringValue&&e.hasOwnProperty("stringValue")&&(n.stringValue=e.stringValue,t.oneofs&&(n.kind="stringValue")),null!=e.boolValue&&e.hasOwnProperty("boolValue")&&(n.boolValue=e.boolValue,t.oneofs&&(n.kind="boolValue")),null!=e.structValue&&e.hasOwnProperty("structValue")&&(n.structValue=s.google.protobuf.Struct.toObject(e.structValue,t),t.oneofs&&(n.kind="structValue")),null!=e.listValue&&e.hasOwnProperty("listValue")&&(n.listValue=s.google.protobuf.ListValue.toObject(e.listValue,t),t.oneofs&&(n.kind="listValue")),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/google.protobuf.Value"},t}(),r.NullValue=(t={},(n=Object.create(t))[t[0]="NULL_VALUE"]=0,n),r.ListValue=function(){function t(e){if(this.values=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.values=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.values&&e.values.length)for(var n=0;n<e.values.length;++n)s.google.protobuf.Value.encode(e.values[n],t.uint32(10).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.google.protobuf.ListValue;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?(o.values&&o.values.length||(o.values=[]),o.values.push(s.google.protobuf.Value.decode(e,e.uint32()))):e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.values&&e.hasOwnProperty("values")){if(!Array.isArray(e.values))return"values: array expected";for(var t=0;t<e.values.length;++t){var n=s.google.protobuf.Value.verify(e.values[t]);if(n)return"values."+n}}return null},t.fromObject=function(e){if(e instanceof s.google.protobuf.ListValue)return e;var t=new s.google.protobuf.ListValue;if(e.values){if(!Array.isArray(e.values))throw TypeError(".google.protobuf.ListValue.values: array expected");t.values=[];for(var n=0;n<e.values.length;++n){if("object"!=typeof e.values[n])throw TypeError(".google.protobuf.ListValue.values: object expected");t.values[n]=s.google.protobuf.Value.fromObject(e.values[n])}}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.values=[]),e.values&&e.values.length){n.values=[];for(var r=0;r<e.values.length;++r)n.values[r]=s.google.protobuf.Value.toObject(e.values[r],t)}return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/google.protobuf.ListValue"},t}(),r.Empty=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.google.protobuf.Empty;e.pos<r;){var a=e.uint32();if(a===n)break;e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null},t.fromObject=function(e){return e instanceof s.google.protobuf.Empty?e:new s.google.protobuf.Empty},t.toObject=function(){return{}},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/google.protobuf.Empty"},t}(),r.Timestamp=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.seconds=0,t.prototype.nanos=0,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.seconds&&Object.hasOwnProperty.call(e,"seconds")&&t.uint32(8).int64(e.seconds),null!=e.nanos&&Object.hasOwnProperty.call(e,"nanos")&&t.uint32(16).int32(e.nanos),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.google.protobuf.Timestamp;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.seconds=e.int64();break;case 2:o.nanos=e.int32();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.seconds&&e.hasOwnProperty("seconds")&&!(a.isInteger(e.seconds)||e.seconds&&a.isInteger(e.seconds.low)&&a.isInteger(e.seconds.high))?"seconds: integer|Long expected":null!=e.nanos&&e.hasOwnProperty("nanos")&&!a.isInteger(e.nanos)?"nanos: integer expected":null},t.fromObject=function(e){if(e instanceof s.google.protobuf.Timestamp)return e;var t=new s.google.protobuf.Timestamp;return null!=e.seconds&&(a.Long?(t.seconds=a.Long.fromValue(e.seconds)).unsigned=!1:"string"==typeof e.seconds?t.seconds=parseInt(e.seconds,10):"number"==typeof e.seconds?t.seconds=e.seconds:"object"==typeof e.seconds&&(t.seconds=new a.LongBits(e.seconds.low>>>0,e.seconds.high>>>0).toNumber())),null!=e.nanos&&(t.nanos=0|e.nanos),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.seconds=0,n.nanos=0),null!=e.seconds&&e.hasOwnProperty("seconds")&&("number"==typeof e.seconds?n.seconds=t.longs===String?String(e.seconds):e.seconds:n.seconds=t.longs===String?a.Long.prototype.toString.call(e.seconds):t.longs===Number?new a.LongBits(e.seconds.low>>>0,e.seconds.high>>>0).toNumber():e.seconds),null!=e.nanos&&e.hasOwnProperty("nanos")&&(n.nanos=e.nanos),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/google.protobuf.Timestamp"},t}(),r),l}(),s})?r.apply(t,i):r)||(e.exports=o)},5388(e,t,n){"use strict";var r=n(1231),i=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],o=["scalar","sequence","mapping"];e.exports=function(e,t){var n,a;if(t=t||{},Object.keys(t).forEach((function(t){if(-1===i.indexOf(t))throw new r('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=(n=t.styleAliases||null,a={},null!==n&&Object.keys(n).forEach((function(e){n[e].forEach((function(t){a[String(t)]=e}))})),a),-1===o.indexOf(this.kind))throw new r('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}},5436(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5379);var i=n(3560);t.RlsPolicy=i.RlsPolicy;var o=n(8390);t.RealtimePublication=o.RealtimePublication;var a=n(7287);t.Wrapper=a.Wrapper;var s=n(6515);t.ForeignTable=s.ForeignTable;var l=n(8202);t.VectorIndex=l.VectorIndex;var c=n(8771);t.ActionBuilder=c.ActionBuilder,t.checkConfigAdditionalOptionsOverlap=function(e,t){const n=r.sqlanvil.Target.create({database:e.project,schema:e.dataset,name:e.name});e.partitionExpirationDays&&e.additionalOptions.partition_expiration_days&&t.compileError("partitionExpirationDays has been declared twice",e.filename,n),e.requirePartitionFilter&&e.additionalOptions.require_partition_filter&&t.compileError("requirePartitionFilter has been declared twice",e.filename,n)},t.TableType=["table","view","incremental"],t.LegacyConfigConverter=class{static legacyConvertBigQueryOptions(e){let t={};return Object.entries(e).forEach((([e,n])=>{Array.isArray(n)&&0===n.length||"object"==typeof n&&0===Object.entries(n).length||n&&(t=Object.assign(Object.assign({},t),{[e]:n}))})),t}static insertLegacyInlineAssertionsToConfigProto(e){var t,n,i;const o=e;return(null==o?void 0:o.assertions)&&("string"==typeof(null===(t=o.assertions)||void 0===t?void 0:t.uniqueKey)&&(o.assertions.uniqueKey=[o.assertions.uniqueKey]),(null===(i=null===(n=o.assertions.uniqueKeys)||void 0===n?void 0:n[0])||void 0===i?void 0:i.length)>0&&(o.assertions.uniqueKeys=o.assertions.uniqueKeys.map((e=>r.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey.create({uniqueKey:e})))),"string"==typeof o.assertions.nonNull&&(o.assertions.nonNull=[o.assertions.nonNull])),o}static insertLegacyBigQueryOptionsToConfigProto(e){const t=e;return(null==t?void 0:t.bigquery)?(t.bigquery.partitionBy&&(t.partitionBy=t.bigquery.partitionBy,delete t.bigquery.partitionBy),t.bigquery.clusterBy&&(t.clusterBy=t.bigquery.clusterBy,delete t.bigquery.clusterBy),t.bigquery.updatePartitionFilter&&(t.updatePartitionFilter=t.bigquery.updatePartitionFilter,delete t.bigquery.updatePartitionFilter),t.bigquery.labels&&(t.labels=t.bigquery.labels,delete t.bigquery.labels),t.bigquery.partitionExpirationDays&&(t.partitionExpirationDays=t.bigquery.partitionExpirationDays,delete t.bigquery.partitionExpirationDays),t.bigquery.requirePartitionFilter&&(t.requirePartitionFilter=t.bigquery.requirePartitionFilter,delete t.bigquery.requirePartitionFilter),t.bigquery.additionalOptions&&(t.additionalOptions=t.bigquery.additionalOptions,delete t.bigquery.additionalOptions),t.bigquery.iceberg&&(t.iceberg=t.bigquery.iceberg,delete t.bigquery.iceberg),0===Object.keys(t.bigquery).length&&delete t.bigquery,t):t}}},5489(e,t,n){"use strict";e.exports=n(1769).extend({implicit:[n(127),n(1851)],explicit:[n(9342),n(6946),n(6942),n(6663)]})},5643(e,t,n){"use strict";e.exports=a;var r=n(7209);((a.prototype=Object.create(r.prototype)).constructor=a).className="Enum";var i=n(8923),o=n(3262);function a(e,t,n,i,o,a){if(r.call(this,e,n),t&&"object"!=typeof t)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=i,this.comments=o||{},this.valuesOptions=a,this._valuesFeatures={},this.reserved=void 0,t)for(var s=Object.keys(t),l=0;l<s.length;++l)"number"==typeof t[s[l]]&&(this.valuesById[this.values[s[l]]=t[s[l]]]=s[l])}a.prototype._resolveFeatures=function(e){return e=this._edition||e,r.prototype._resolveFeatures.call(this,e),Object.keys(this.values).forEach((e=>{var t=Object.assign({},this._features);this._valuesFeatures[e]=Object.assign(t,this.valuesOptions&&this.valuesOptions[e]&&this.valuesOptions[e].features)})),this},a.fromJSON=function(e,t){var n=new a(e,t.values,t.options,t.comment,t.comments);return n.reserved=t.reserved,t.edition&&(n._edition=t.edition),n._defaultEdition="proto3",n},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["edition",this._editionToJSON(),"options",this.options,"valuesOptions",this.valuesOptions,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},a.prototype.add=function(e,t,n,r){if(!o.isString(e))throw TypeError("name must be a string");if(!o.isInteger(t))throw TypeError("id must be an integer");if(void 0!==this.values[e])throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(void 0!==this.valuesById[t]){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return r&&(void 0===this.valuesOptions&&(this.valuesOptions={}),this.valuesOptions[e]=r||null),this.comments[e]=n||null,this},a.prototype.remove=function(e){if(!o.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(null==t)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this.valuesOptions&&delete this.valuesOptions[e],this},a.prototype.isReservedId=function(e){return i.isReservedId(this.reserved,e)},a.prototype.isReservedName=function(e){return i.isReservedName(this.reserved,e)}},6184(e,t,n){"use strict";e.exports=n(7759).extend({implicit:[n(9198),n(6199),n(4466),n(1461)]})},6199(e,t,n){"use strict";var r=n(5388);e.exports=new r("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},6237(e,t,n){"use strict";e.exports=l;var r,i=n(3610),o=i.LongBits,a=i.utf8;function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function l(e){this.buf=e,this.pos=0,this.len=e.length}var c,u="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new l(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new l(e);throw Error("illegal buffer")},p=function(){return i.Buffer?function(e){return(l.create=function(e){return i.Buffer.isBuffer(e)?new r(e):u(e)})(e)}:u};function f(){var e=new o(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw s(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw s(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function d(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function g(){if(this.pos+8>this.len)throw s(this,8);return new o(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}l.create=p(),l.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,l.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return c;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return c}),l.prototype.int32=function(){return 0|this.uint32()},l.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},l.prototype.bool=function(){return 0!==this.uint32()},l.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return d(this.buf,this.pos+=4)},l.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|d(this.buf,this.pos+=4)},l.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},l.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},l.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw s(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,n);if(t===n){var r=i.Buffer;return r?r.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,n)},l.prototype.string=function(){var e=this.bytes();return a.read(e,0,e.length)},l.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw s(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},l.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},l._configure=function(e){r=e,l.create=p(),r._configure();var t=i.Long?"toLong":"toNumber";i.merge(l.prototype,{int64:function(){return f.call(this)[t](!1)},uint64:function(){return f.call(this)[t](!0)},sint64:function(){return f.call(this).zzDecode()[t](!1)},fixed64:function(){return g.call(this)[t](!0)},sfixed64:function(){return g.call(this)[t](!1)}})}},6434(e,t,n){"use strict";var r=t,i=n(2551);r[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),n=this.lookup(t);if(n){var r="."===e["@type"].charAt(0)?e["@type"].slice(1):e["@type"];return-1===r.indexOf("/")&&(r="/"+r),this.create({type_url:r,value:n.encode(n.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){var n="",r="";if(t&&t.json&&e.type_url&&e.value){r=e.type_url.substring(e.type_url.lastIndexOf("/")+1),n=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var o=this.lookup(r);o&&(e=o.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof i){var a=e.$type.toObject(e,t);return""===n&&(n="type.googleapis.com/"),r=n+("."===e.$type.fullName[0]?e.$type.fullName.slice(1):e.$type.fullName),a["@type"]=r,a}return this.toObject(e,t)}}},6515(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8512),i=n(8771),o=n(5379);class a extends i.ActionBuilder{constructor(e,t){super(e),this.proto=o.sqlanvil.Operation.create(),this.session=e,this.config=t;const n=o.sqlanvil.Target.create({name:t.name,schema:t.schema});this.proto.target=this.applySessionToTarget(n,e.projectConfig,t.filename,{validateTarget:!0}),this.proto.canonicalTarget=this.applySessionToTarget(n,e.canonicalProjectConfig),this.proto.fileName=t.filename||"",this.proto.hasOutput=!0,this.proto.dependencyTargets=[o.sqlanvil.Target.create({name:t.dependsOn})]}getFileName(){return this.proto.fileName}getTarget(){return o.sqlanvil.Target.create(this.proto.target)}compile(){const e=this.config.schema?`"${this.config.schema}"."${this.config.name}"`:`"${this.config.name}"`,t=Object.entries(this.config.columns||{}).map((([e,t])=>`"${e}" ${t}`)),n=t.length>0?` (${t.join(", ")})`:"",i=Object.entries(this.config.options||{}).map((([e,t])=>`${e} '${String(t).replace(/'/g,"''")}'`)),a=i.length>0?` options (${i.join(", ")})`:"";return this.proto.queries=[`drop foreign table if exists ${e}`,`create foreign table ${e}${n} server "${this.config.server}"${a}`],r.verifyObjectMatchesProto(o.sqlanvil.Operation,this.proto,r.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM)}}t.ForeignTable=a},6660(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8512),i=n(5436),o=n(8545),a=n(2545),s=n(5379);class l extends i.ActionBuilder{constructor(e,t,n){var r;if(super(e),this.proto=s.sqlanvil.Declaration.create(),this.session=e,!t)return;const i=this.verifyConfig(t);if(!i.name)throw Error("Declarations must have a populated 'name' field.");const o=a.actionConfigToCompiledGraphTarget(i);return this.proto.target=this.applySessionToTarget(o,e.projectConfig,i.filename||n),this.proto.canonicalTarget=this.applySessionToTarget(o,e.canonicalProjectConfig),i.description&&this.description(i.description),(null===(r=i.columns)||void 0===r?void 0:r.length)&&this.columns(i.columns.map((e=>s.sqlanvil.ActionConfig.ColumnDescriptor.create(e)))),this.proto.fileName=i.filename||n,this.proto.tags=i.tags||[],this}description(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.description=e,this}columns(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.columns=o.ColumnDescriptors.mapConfigProtoToCompilationProto(e),this}getFileName(){return this.proto.fileName}getTarget(){return s.sqlanvil.Target.create(this.proto.target)}compile(){return r.verifyObjectMatchesProto(s.sqlanvil.Declaration,this.proto,r.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM)}verifyConfig(e){return e.database&&(e.project=e.database,delete e.database),e.schema&&(e.dataset=e.schema,delete e.schema),e.columns&&(e.columns=o.ColumnDescriptors.mapLegacyObjectToConfigProto(e.columns)),e.type&&delete e.type,r.verifyObjectMatchesProto(s.sqlanvil.ActionConfig.DeclarationConfig,e,r.VerifyProtoErrorBehaviour.SHOW_DOCS_LINK)}}t.Declaration=l},6663(e,t,n){"use strict";var r=n(5388),i=Object.prototype.hasOwnProperty;e.exports=new r("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var t,n=e;for(t in n)if(i.call(n,t)&&null!==n[t])return!1;return!0},construct:function(e){return null!==e?e:{}}})},6899(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8043),i=n(5379);function o(e){return t=>new Function("jctx",`const mainAsync = ${e};\nreturn mainAsync(jctx);`)(t)}function a(e){let t={};return"string"==typeof e?t.query=e:t=e,i.sqlanvil.JitTableResult.create(t)}function s(e,t){const n=i.sqlanvil.DbAdapter.create(((e,n,r)=>{t(e.name,n,r)}));switch(e.compilationTargetType){case i.sqlanvil.JitCompilationTargetType.JIT_COMPILATION_TARGET_TYPE_OPERATION:return function(e,t){return o(e.jitCode)(new r.SqlActionJitContext(t,e)).then((e=>{let t=[];return"string"==typeof e?t.push(e):Array.isArray(e)?t.push(...e):t=e.queries,i.sqlanvil.JitOperationResult.create({queries:t})}))}(e,n).then((e=>i.sqlanvil.JitCompilationResponse.create({operation:e})));case i.sqlanvil.JitCompilationTargetType.JIT_COMPILATION_TARGET_TYPE_TABLE:return function(e,t){return o(e.jitCode)(new r.TableJitContext(t,e)).then(a)}(e,n).then((e=>i.sqlanvil.JitCompilationResponse.create({table:e})));case i.sqlanvil.JitCompilationTargetType.JIT_COMPILATION_TARGET_TYPE_INCREMENTAL_TABLE:return function(e,t){const n=o(e.jitCode),s=new r.IncrementalTableJitContext(t,e,!0),l=new r.IncrementalTableJitContext(t,e,!1);return Promise.all([n(s),n(l)]).then((([e,t])=>i.sqlanvil.JitIncrementalTableResult.create({incremental:a(e),regular:a(t)})))}(e,n).then((e=>i.sqlanvil.JitCompilationResponse.create({incrementalTable:e})));case i.sqlanvil.JitCompilationTargetType.JIT_COMPILATION_TARGET_TYPE_ASSERTION:return function(e,t){return o(e.jitCode)(new r.SqlActionJitContext(t,e)).then((e=>i.sqlanvil.JitAssertionResult.create({query:e})))}(e,n).then((e=>i.sqlanvil.JitCompilationResponse.create({assertion:e})));default:throw new Error(`Unrecognized compilation target type: ${e.compilationTargetType}`)}}t.jitCompile=s,t.jitCompiler=function(e){return{compile:t=>s(i.sqlanvil.JitCompilationRequest.decode(t),e).then((e=>i.sqlanvil.JitCompilationResponse.encode(e).finish()))}}},6942(e,t,n){"use strict";var r=n(5388),i=Object.prototype.toString;e.exports=new r("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,o,a,s=e;for(a=new Array(s.length),t=0,n=s.length;t<n;t+=1){if(r=s[t],"[object Object]"!==i.call(r))return!1;if(1!==(o=Object.keys(r)).length)return!1;a[t]=[o[0],r[o[0]]]}return!0},construct:function(e){if(null===e)return[];var t,n,r,i,o,a=e;for(o=new Array(a.length),t=0,n=a.length;t<n;t+=1)r=a[t],i=Object.keys(r),o[t]=[i[0],r[i[0]]];return o}})},6946(e,t,n){"use strict";var r=n(5388),i=Object.prototype.hasOwnProperty,o=Object.prototype.toString;e.exports=new r("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,a,s,l=[],c=e;for(t=0,n=c.length;t<n;t+=1){if(r=c[t],s=!1,"[object Object]"!==o.call(r))return!1;for(a in r)if(i.call(r,a)){if(s)return!1;s=!0}if(!s)return!1;if(-1!==l.indexOf(a))return!1;l.push(a)}return!0},construct:function(e){return null!==e?e:[]}})},7180(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(9364)),a=n(8512),s=n(5436),l=n(7848),c=n(3788),u=n(6660),p=n(1299),f=n(2795),d=n(9293),g=n(2008),h=n(4098),y=n(8995),b=n(1287),m=n(3162),v=i(n(2545)),O=n(2545),T=n(2628),w=n(5379),j={defaultSchema:"sqlanvil",assertionSchema:"sqlanvil_assertions"};function P(e){return"view"===e||"table"===e||"incremental"===e}t.Session=class{constructor(e,t,n){this.actionAssertionMap=new O.ResolvableMap,this.init(e,t,n)}init(e,t,n){this.rootDir=e,this.projectConfig=w.sqlanvil.ProjectConfig.create(t||j),this.canonicalProjectConfig=function(e){return w.sqlanvil.ProjectConfig.create({warehouse:e.warehouse,defaultSchema:e.defaultSchema,defaultDatabase:e.defaultDatabase,assertionSchema:e.assertionSchema})}(w.sqlanvil.ProjectConfig.create(n||t||j)),this.actions=[],this.foreignServers=new Set,this.tests=[],this.graphErrors={compilationErrors:[]},this.jitContextData=new w.google.protobuf.Struct}compilationSql(){return new b.CompilationSql(this.projectConfig,T.version)}sqlxAction(e){const{sqlxConfig:t}=e,n=t.hasOwnProperty("type")?t.type:"operations";switch(e.sqlStatementCount>1&&"operations"!==n&&this.compileError("Actions may only contain more than one SQL statement if they are of type 'operations'."),t.hasOwnProperty("protected")&&"incremental"!==n&&this.compileError("Actions may only specify 'protected: true' if they are of type 'incremental'."),e.incrementalWhereContextable&&"incremental"!==n&&this.compileError("Actions may only include incremental_where if they are of type 'incremental'."),e.inputContextables.length>0&&"test"!==n&&this.compileError("Actions may only include input blocks if they are of type 'test'."),e.preOperationsContextable&&!P(n)&&this.compileError("Actions may only include pre_operations if they create a dataset."),e.postOperationsContextable&&!P(n)&&this.compileError("Actions may only include post_operations if they create a dataset."),t.filename||(t.filename=v.getCallerFile(this.rootDir)),n){case"view":const n=new y.View(this,t).query((t=>e.sqlContextable(t)[0]));e.incrementalWhereContextable&&n.where(e.incrementalWhereContextable),e.preOperationsContextable&&n.preOps(e.preOperationsContextable),e.postOperationsContextable&&n.postOps(e.postOperationsContextable),this.actions.push(n);break;case"incremental":const r=new p.IncrementalTable(this,t).query((t=>e.sqlContextable(t)[0]));e.incrementalWhereContextable&&r.where(e.incrementalWhereContextable),e.preOperationsContextable&&r.preOps(e.preOperationsContextable),e.postOperationsContextable&&r.postOps(e.postOperationsContextable),this.actions.push(r);break;case"table":const i=new g.Table(this,t).query((t=>e.sqlContextable(t)[0]));e.incrementalWhereContextable&&i.where(e.incrementalWhereContextable),e.preOperationsContextable&&i.preOps(e.preOperationsContextable),e.postOperationsContextable&&i.postOps(e.postOperationsContextable),this.actions.push(i);break;case"assertion":this.actions.push(new l.Assertion(this,t).query((t=>e.sqlContextable(t)[0])));break;case"dataPreparation":const o=new c.DataPreparation(this,t).query((t=>e.sqlContextable(t)[0]));this.actions.push(o);break;case"operations":this.actions.push(new d.Operation(this,t).queries(e.sqlContextable));break;case"declaration":this.declare(t);break;case"test":const a=this.test(t.name).config(t).expect((t=>e.sqlContextable(t)[0]));e.inputContextables.forEach((({refName:e,contextable:t})=>{a.input(e,t)}));break;default:throw new Error(`Unrecognized action type: ${t.type}`)}}findActions(e){const t=this.indexedActions.find(e);if(t.length<=1)return t;let n=t;if(!e.database&&this.projectConfig.defaultDatabase){const e=n.filter((e=>e.getTarget().database===this.projectConfig.defaultDatabase));e.length>0&&(n=e)}if(!e.schema&&this.projectConfig.defaultSchema){const e=n.filter((e=>e.getTarget().schema===this.projectConfig.defaultSchema));e.length>0&&(n=e)}return 1===n.length?n:t}resolve(e,...t){e=O.toResolvable(e,t);const n=this.findActions(v.resolvableAsTarget(e));if(n.length>1)return this.compileError(new Error(v.ambiguousActionNameMsg(e,n))),"";const r=n.length>0?n[0]:void 0;return r&&r instanceof d.Operation&&!r.getHasOutput()?(this.compileError(new Error("Actions cannot resolve operations which do not produce output.")),""):r?r instanceof u.Declaration?this.compilationSql().resolveTarget(r.getTarget()):this.compilationSql().resolveTarget(Object.assign(Object.assign({},r.getTarget()),{database:r.getTarget().database&&this.finalizeDatabase(r.getTarget().database),schema:this.finalizeSchema(r.getTarget().schema),name:this.finalizeName(r.getTarget().name)})):(this.compileError(new Error(`Could not resolve ${JSON.stringify(e)}`)),"")}operate(e,t){const n=v.getCallerFile(this.rootDir);let r;return t&&"object"==typeof t?r=new d.Operation(this,Object.assign({name:e,filename:n},t)):(r=new d.Operation(this,{name:e,filename:n}),t&&r.queries(t)),this.actions.push(r),r}rlsPolicy(e){const t=v.getCallerFile(this.rootDir),n=new s.RlsPolicy(this,Object.assign({filename:t},e));return this.actions.push(n),n}realtimePublication(e){const t=v.getCallerFile(this.rootDir),n=new s.RealtimePublication(this,Object.assign({filename:t},e));return this.actions.push(n),n}wrapper(e){const t=v.getCallerFile(this.rootDir),n=new s.Wrapper(this,Object.assign({filename:t},e));return this.actions.push(n),(e.foreignTables||[]).forEach((n=>{const r=new s.ForeignTable(this,{filename:t,name:n.name,schema:n.schema,server:e.server,options:n.options,columns:n.columns,dependsOn:e.name});this.actions.push(r)})),n}vectorIndex(e){const t=v.getCallerFile(this.rootDir),n=new s.VectorIndex(this,Object.assign({filename:t},e));return this.actions.push(n),n}publish(e,t){const n=v.getCallerFile(this.rootDir);let r=new y.View(this,{type:"view",name:e,filename:n});if(t)if("object"==typeof t)if("view"===(null==t?void 0:t.type)||void 0===t.type)r=new y.View(this,Object.assign({type:"view",name:e,filename:n},t));else if("incremental"===(null==t?void 0:t.type))r=new p.IncrementalTable(this,Object.assign({type:"incremental",name:e,filename:n},t));else{if("table"!==(null==t?void 0:t.type))throw Error(`Unrecognized table type: ${t.type}`);r=new g.Table(this,Object.assign({type:"table",name:e,filename:n},t))}else r.query(t);return this.actions.push(r),r}assert(e,t){const n=v.getCallerFile(this.rootDir);let r;return t&&"object"==typeof t?r=new l.Assertion(this,Object.assign({name:e,filename:n},t)):(r=new l.Assertion(this,{name:e,filename:n}),t&&r.query(t)),this.actions.push(r),r}declare(e){const t=e.filename||v.getCallerFile(this.rootDir),n=e.connection,r=this.projectConfig.warehouseConnection;if(!n||n===r){const n=new u.Declaration(this,e,t);return this.actions.push(n),n}const i=(this.projectConfig.connections||{})[n],o=new u.Declaration(this,e,t);if(!i)return this.compileError(new Error(`Unknown connection "${n}" on declaration "${e.name}".`),t,o.getTarget()),this.actions.push(o),o;const a=e.columnTypes||{};if(0===Object.keys(a).length)return this.compileError(new Error(`Declaration "${e.name}" on connection "${n}" requires \`columnTypes\`; run \`sqlanvil introspect ${n} ${e.schema||""}.${e.name}\`.`),t,o.getTarget()),this.actions.push(o),o;if("postgres"!==this.projectConfig.warehouse&&"supabase"!==this.projectConfig.warehouse)return this.compileError(new Error(`Reading connection "${n}" from a ${this.projectConfig.warehouse} warehouse is not yet supported.`),t,o.getTarget()),this.actions.push(o),o;const l=`${n}_srv`,c=`${n}_ext`;this.foreignServers.has(n)||(this.foreignServers.add(n),"bigquery"===i.platform?this.actions.push(new s.Wrapper(this,{filename:t,name:l,provider:"bigquery",server:l,serverOptions:{project_id:i.project,dataset_id:i.dataset},credential:{saKeyId:i.saKeyId}})):this.actions.push(new s.Wrapper(this,{filename:t,name:l,provider:"postgres_fdw",server:l,serverOptions:{host:i.host,port:String(i.port||5432),dbname:i.database},userMappingConnection:n})));const p="bigquery"===i.platform?{table:e.name}:{schema_name:e.schema||i.defaultSchema||"public",table_name:e.name};return this.actions.push(new s.ForeignTable(this,{filename:t,name:e.name,schema:c,server:l,options:p,columns:e.columnTypes,dependsOn:l})),o}test(e){const t=new h.Test(this,{name:e});return t.session=this,t.setFilename(v.getCallerFile(this.rootDir)),this.tests.push(t),t}notebook(e){const t=v.getCallerFile(this.rootDir),n=new f.Notebook(this,e,t);return this.actions.push(n),n}jitData(e,t){if(void 0!==this.jitContextData.fields[e])throw new Error(`JiT context data with key ${e} already exists.`);this.jitContextData.fields[e]=a.unknownToValue(t)}compileError(e,t,n){const r=t||v.getCallerFile(this.rootDir)||__filename,i=w.sqlanvil.CompilationError.create({fileName:r,actionName:n?m.targetAsReadableString(n):void 0,actionTarget:n});"string"==typeof e?i.message=e:(i.message=e.message,i.stack=e.stack),this.graphErrors.compilationErrors.push(i)}compile(){if(this.actions.push(...this.tests),this.indexedActions=new O.ResolvableMap(this.actions.map((e=>({actionTarget:e.getTarget(),value:e})))),this.projectConfig.vars&&!Object.values(this.projectConfig.vars).every((e=>"string"==typeof e)))throw new Error("Custom variables defined in workflow settings can only be strings.");const e=w.sqlanvil.CompiledGraph.create({projectConfig:this.projectConfig,tables:this.compileGraphChunk(this.actions.filter((e=>e instanceof g.Table||e instanceof y.View||e instanceof p.IncrementalTable))),operations:this.compileGraphChunk(this.actions.filter((e=>e instanceof d.Operation||e instanceof s.RlsPolicy||e instanceof s.RealtimePublication||e instanceof s.Wrapper||e instanceof s.ForeignTable||e instanceof s.VectorIndex))),assertions:this.compileGraphChunk(this.actions.filter((e=>e instanceof l.Assertion))),declarations:this.compileGraphChunk(this.actions.filter((e=>e instanceof u.Declaration))),tests:this.compileGraphChunk(this.actions.filter((e=>e instanceof h.Test))),notebooks:this.compileGraphChunk(this.actions.filter((e=>e instanceof f.Notebook))),dataPreparations:this.compileGraphChunk(this.actions.filter((e=>e instanceof c.DataPreparation))),graphErrors:this.graphErrors,sqlanvilCoreVersion:T.version,targets:this.actions.map((e=>e.getTarget())),jitData:this.jitContextData});return this.projectConfig.includeTestsInCompiledGraph&&this.addTestsToCompiledGraph(this.actions),this.fullyQualifyDependencies([].concat(e.tables,e.assertions,e.operations,e.notebooks,e.dataPreparations,e.tests)),this.alterActionName([].concat(e.tables,e.assertions,e.operations,e.notebooks,e.dataPreparations,e.tests),[].concat(e.declarations.map((e=>e.target)))),this.removeNonUniqueActionsFromCompiledGraph(e),this.checkTestNameUniqueness(e.tests),this.checkCircularity([].concat(e.tables,e.assertions,e.operations,e.notebooks,e.dataPreparations,e.tests)),a.verifyObjectMatchesProto(w.sqlanvil.CompiledGraph,e,a.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM),e}compileToBase64(){return a.encode64(w.sqlanvil.CompiledGraph,this.compile())}finalizeDatabase(e){return`${e}${this.getDatabaseSuffixWithUnderscore()}`}finalizeSchema(e){return`${e}${this.getSchemaSuffixWithUnderscore()}`}finalizeName(e){return`${this.getTablePrefixWithUnderscore()}${e}`}getDatabaseSuffixWithUnderscore(){return this.projectConfig.databaseSuffix?`_${this.projectConfig.databaseSuffix}`:""}getSchemaSuffixWithUnderscore(){return this.projectConfig.schemaSuffix?`_${this.projectConfig.schemaSuffix}`:""}getTablePrefixWithUnderscore(){return this.projectConfig.tablePrefix?`${this.projectConfig.tablePrefix}_`:""}compileGraphChunk(e){const t=[];return e.forEach((e=>{try{const n=e.compile();t.push(n)}catch(t){this.compileError(t,e.getFileName(),e.getTarget())}})),t}fullyQualifyDependencies(e){e.forEach((e=>{const t={};if(!(e instanceof w.sqlanvil.Declaration)&&e.dependencyTargets){for(const n of e.dependencyTargets){const r=this.findActions(n);if(0===r.length)this.compileError(new Error(`Missing dependency detected: Action "${m.targetAsReadableString(e.target)}" depends on "${v.stringifyResolvable(n)}" which does not exist`),e.fileName,e.target);else if(1===r.length){const e=r[0].getTarget();t[m.targetAsReadableString(e)]=e,n.includeDependentAssertions&&this.actionAssertionMap.find(n).forEach((e=>t[m.targetAsReadableString(e.getTarget())]=e.getTarget()))}else this.compileError(new Error(v.ambiguousActionNameMsg(n,r)),e.fileName,e.target)}e.dependencyTargets=Object.values(t)}}))}alterActionName(e,t){const{tablePrefix:n,schemaSuffix:r,databaseSuffix:i}=this.projectConfig;if(!n&&!r&&!i)return;const o=new Map;t.forEach((e=>o.set(m.targetStringifier.stringify(e),e))),e.forEach((e=>{o.set(m.targetStringifier.stringify(e.target),Object.assign(Object.assign({},e.target),{database:e.target.database&&`${e.target.database}${this.getDatabaseSuffixWithUnderscore()}`,schema:`${e.target.schema}${this.getSchemaSuffixWithUnderscore()}`,name:`${this.getTablePrefixWithUnderscore()}${e.target.name}`})),e.target=o.get(m.targetStringifier.stringify(e.target))}));const a=e=>o.has(m.targetStringifier.stringify(e))?o.get(m.targetStringifier.stringify(e)):e;e.forEach((e=>{e instanceof w.sqlanvil.Declaration||(e.dependencyTargets=(e.dependencyTargets||[]).map(a)),e instanceof w.sqlanvil.Assertion&&e.parentAction&&(e.parentAction=a(e.parentAction))}))}checkTestNameUniqueness(e){const t=[];e.forEach((e=>{t.includes(e.name)&&this.compileError(new Error(`Duplicate test name detected: "${e.name}"`),e.fileName),t.push(e.name)}))}checkCircularity(e){const t=new Map(e.map((e=>[m.targetStringifier.stringify(e.target),e]))),n=new o.default;e.forEach((e=>{const r=(e instanceof w.sqlanvil.Declaration||!e.dependencyTargets?[]:e.dependencyTargets).filter((e=>!!t.get(m.targetStringifier.stringify(e))));n.add(m.targetStringifier.stringify(e.target),r.map((e=>m.targetStringifier.stringify(e))))})),n.getCycles().forEach((e=>{const n=t.get(e[0].name),r=`Circular dependency detected in chain: [${e.map((e=>e.name)).join(" > ")} > ${m.targetAsReadableString(n.target)}]`;this.compileError(new Error(r),n.fileName,n.target)}))}addTestsToCompiledGraph(e){e.filter((e=>e instanceof h.Test)).map((e=>e)).forEach((e=>{const t=this.indexedActions.find(e.getTestTarget());t.forEach((e=>{e instanceof g.Table||e instanceof y.View||this.compileError(new Error(`Tests are only supported for Tables and Views. Action "${m.targetAsReadableString(e.getTarget())}" is not a table or view".`),e.getFileName(),e.getTarget())})),t.map((e=>e)).forEach((t=>t.dependencies(v.resolvableAsTarget(e.getTarget()))))}))}removeNonUniqueActionsFromCompiledGraph(e){function t(e){const t=new Set,n=new Set;return e.forEach((e=>{t.has(m.targetStringifier.stringify(e))&&n.add(m.targetStringifier.stringify(e)),t.add(m.targetStringifier.stringify(e))})),n}const n=[].concat(e.tables,e.assertions,e.operations,e.declarations,e.notebooks,e.dataPreparations),r=t(n.map((e=>e.target))),i=t(n.map((e=>e.canonicalTarget))),o=e=>{const t=r.has(m.targetStringifier.stringify(e.target)),n=i.has(m.targetStringifier.stringify(e.canonicalTarget));return t&&this.compileError(new Error(`Duplicate action name detected. Names within a schema must be unique across tables, declarations, assertions, and operations:\n"${JSON.stringify(e.target)}"`),e.fileName,e.target),n&&this.compileError(new Error(`Duplicate canonical target detected. Canonical targets must be unique across tables, declarations, assertions, and operations:\n"${JSON.stringify(e.canonicalTarget)}"`),e.fileName,e.target),!t&&!n};e.tables=e.tables.filter(o),e.operations=e.operations.filter(o),e.declarations=e.declarations.filter(o),e.assertions=e.assertions.filter(o),e.notebooks=e.notebooks.filter(o),e.dataPreparations=e.dataPreparations.filter(o)}}},7209(e,t,n){"use strict";e.exports=c,c.className="ReflectionObject";const r=n(1457);var i,o=n(3262),a={enum_type:"OPEN",field_presence:"EXPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"},s={enum_type:"CLOSED",field_presence:"EXPLICIT",json_format:"LEGACY_BEST_EFFORT",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"EXPANDED",utf8_validation:"NONE"},l={enum_type:"OPEN",field_presence:"IMPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"};function c(e,t){if(!o.isString(e))throw TypeError("name must be a string");if(t&&!o.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this._edition=null,this._defaultEdition="proto2",this._features={},this._featuresResolved=!1,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(c.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),c.prototype.toJSON=function(){throw Error()},c.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof i&&t._handleAdd(this)},c.prototype.onRemove=function(e){var t=e.root;t instanceof i&&t._handleRemove(this),this.parent=null,this.resolved=!1},c.prototype.resolve=function(){return this.resolved||this.root instanceof i&&(this.resolved=!0),this},c.prototype._resolveFeaturesRecursive=function(e){return this._resolveFeatures(this._edition||e)},c.prototype._resolveFeatures=function(e){if(!this._featuresResolved){var t={};if(!e)throw new Error("Unknown edition for "+this.fullName);var n=Object.assign(this.options?Object.assign({},this.options.features):{},this._inferLegacyProtoFeatures(e));if(this._edition){if("proto2"===e)t=Object.assign({},s);else if("proto3"===e)t=Object.assign({},l);else{if("2023"!==e)throw new Error("Unknown edition: "+e);t=Object.assign({},a)}return this._features=Object.assign(t,n||{}),void(this._featuresResolved=!0)}if(this.partOf instanceof r){var i=Object.assign({},this.partOf._features);this._features=Object.assign(i,n||{})}else if(this.declaringField);else{if(!this.parent)throw new Error("Unable to find a parent for "+this.fullName);var o=Object.assign({},this.parent._features);this._features=Object.assign(o,n||{})}this.extensionField&&(this.extensionField._features=this._features),this._featuresResolved=!0}},c.prototype._inferLegacyProtoFeatures=function(){return{}},c.prototype.getOption=function(e){if(this.options)return this.options[e]},c.prototype.setOption=function(e,t,n){return this.options||(this.options={}),/^features\./.test(e)?o.setProperty(this.options,e,t,n):n&&void 0!==this.options[e]||(this.getOption(e)!==t&&(this.resolved=!1),this.options[e]=t),this},c.prototype.setParsedOption=function(e,t,n){this.parsedOptions||(this.parsedOptions=[]);var r=this.parsedOptions;if(n){var i=r.find((function(t){return Object.prototype.hasOwnProperty.call(t,e)}));if(i){var a=i[e];o.setProperty(a,n,t)}else(i={})[e]=o.setProperty({},n,t),r.push(i)}else{var s={};s[e]=t,r.push(s)}return this},c.prototype.setOptions=function(e,t){if(e)for(var n=Object.keys(e),r=0;r<n.length;++r)this.setOption(n[r],e[n[r]],t);return this},c.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},c.prototype._editionToJSON=function(){if(this._edition&&"proto3"!==this._edition)return this._edition},c._configure=function(e){i=e}},7210(e,t,n){"use strict";var r=n(9243),i=n(4781);function o(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}e.exports.Type=n(5388),e.exports.Schema=n(2119),e.exports.FAILSAFE_SCHEMA=n(7759),e.exports.JSON_SCHEMA=n(6184),e.exports.CORE_SCHEMA=n(1769),e.exports.DEFAULT_SCHEMA=n(5489),e.exports.load=r.load,e.exports.loadAll=r.loadAll,e.exports.dump=i.dump,e.exports.YAMLException=n(1231),e.exports.types={binary:n(9342),float:n(1461),map:n(2369),null:n(9198),pairs:n(6942),set:n(6663),timestamp:n(127),bool:n(6199),int:n(4466),merge:n(1851),omap:n(6946),seq:n(8636),str:n(7212)},e.exports.safeLoad=o("safeLoad","load"),e.exports.safeLoadAll=o("safeLoadAll","loadAll"),e.exports.safeDump=o("safeDump","dump")},7212(e,t,n){"use strict";var r=n(5388);e.exports=new r("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}})},7287(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8512),i=n(8771),o=n(5379);function a(e){if(e.provider){const n=t.WRAPPER_PROVIDERS[e.provider];if(!n)throw new Error(`Unknown wrapper provider "${e.provider}". Supported providers: ${Object.keys(t.WRAPPER_PROVIDERS).join(", ")}.`);return n}if(!e.wrapper)throw new Error(`wrapper "${e.name}" must set either "provider" or an explicit "wrapper" extension name.`);if(!e.handler||!e.validator)throw new Error(`wrapper "${e.name}" without a "provider" preset must also set "handler" and "validator".`);return{extension:e.wrapper,wrapper:e.wrapper,handler:e.handler,validator:e.validator}}t.WRAPPER_PROVIDERS={bigquery:{extension:"wrappers",wrapper:"bigquery_wrapper",handler:"big_query_fdw_handler",validator:"big_query_fdw_validator"},postgres_fdw:{extension:"postgres_fdw",wrapper:"postgres_fdw",handler:"",validator:""}},t.resolveWrapper=a;class s extends i.ActionBuilder{constructor(e,t){super(e),this.proto=o.sqlanvil.Operation.create(),this.session=e,this.config=t;const n=o.sqlanvil.Target.create({name:t.name});this.proto.target=this.applySessionToTarget(n,e.projectConfig,t.filename,{validateTarget:!0}),this.proto.canonicalTarget=this.applySessionToTarget(n,e.canonicalProjectConfig),this.proto.fileName=t.filename||""}getFileName(){return this.proto.fileName}getTarget(){return o.sqlanvil.Target.create(this.proto.target)}compile(){const e=a(this.config),t=Object.assign({},this.config.serverOptions||this.config.options||{});this.config.credential&&this.config.credential.saKeyId&&(t.sa_key_id=this.config.credential.saKeyId);const n=Object.entries(t).map((([e,t])=>`${e} '${String(t).replace(/'/g,"''")}'`)),i=n.length>0?` options (${n.join(", ")})`:"",s=[`create extension if not exists "${e.extension}" cascade`];if(e.handler&&e.validator&&s.push(`do $$ begin if not exists (select 1 from pg_foreign_data_wrapper where fdwname = '${e.wrapper}') then create foreign data wrapper ${e.wrapper} handler ${e.handler} validator ${e.validator}; end if; end $$`),s.push(`drop server if exists "${this.config.server}" cascade`),s.push(`create server "${this.config.server}" foreign data wrapper "${e.wrapper}"${i}`),this.config.userMappingConnection){const e=this.config.userMappingConnection,t="${SA_CONN:"+e+":user}",n="${SA_CONN:"+e+":password}";s.push(`create user mapping for current_user server "${this.config.server}" options (user '${t}', password '${n}')`)}return this.proto.queries=s,r.verifyObjectMatchesProto(o.sqlanvil.Operation,this.proto,r.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM)}}t.Wrapper=s},7595(e,t,n){"use strict";e.exports=i;var r=n(3610);function i(e,t,n){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(n)}(i.prototype=Object.create(r.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function e(t,n,i,o,a){if(!o)throw TypeError("request must be specified");var s=this;if(!a)return r.asPromise(e,s,t,n,i,o);if(s.rpcImpl)try{return s.rpcImpl(t,n[s.requestDelimited?"encodeDelimited":"encode"](o).finish(),(function(e,n){if(e)return s.emit("error",e,t),a(e);if(null!==n){if(!(n instanceof i))try{n=i[s.responseDelimited?"decodeDelimited":"decode"](n)}catch(e){return s.emit("error",e,t),a(e)}return s.emit("data",n,t),a(null,n)}s.end(!0)}))}catch(e){return s.emit("error",e,t),void setTimeout((function(){a(e)}),0)}else setTimeout((function(){a(Error("already ended"))}),0)},i.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},7728(e,t,n){"use strict";e.exports=function(e){for(var t=o.codegen(["r","l","e"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(e.fieldsArray.filter((function(e){return e.map})).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()")("if(t===e)")("break")("switch(t>>>3){"),n=0;n<e.fieldsArray.length;++n){var s=e._fieldsArray[n].resolve(),l=s.resolvedType instanceof r?"int32":s.type,c="m"+o.safeProp(s.name);t("case %i: {",s.id),s.map?(t("if(%s===util.emptyObject)",c)("%s={}",c)("var c2 = r.uint32()+r.pos"),void 0!==i.defaults[s.keyType]?t("k=%j",i.defaults[s.keyType]):t("k=null"),void 0!==i.defaults[l]?t("value=%j",i.defaults[l]):t("value=null"),t("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",s.keyType)("case 2:"),void 0===i.basic[l]?t("value=types[%i].decode(r,r.uint32())",n):t("value=r.%s()",l),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==i.long[s.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',c):t("%s[k]=value",c)):s.repeated?(t("if(!(%s&&%s.length))",c,c)("%s=[]",c),void 0!==i.packed[l]&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",c,l)("}else"),void 0===i.basic[l]?t(s.delimited?"%s.push(types[%i].decode(r,undefined,((t&~7)|4)))":"%s.push(types[%i].decode(r,r.uint32()))",c,n):t("%s.push(r.%s())",c,l)):void 0===i.basic[l]?t(s.delimited?"%s=types[%i].decode(r,undefined,((t&~7)|4))":"%s=types[%i].decode(r,r.uint32())",c,n):t("%s=r.%s()",c,l),t("break")("}")}for(t("default:")("r.skipType(t&7)")("break")("}")("}"),n=0;n<e._fieldsArray.length;++n){var u=e._fieldsArray[n];u.required&&t("if(!m.hasOwnProperty(%j))",u.name)("throw util.ProtocolError(%j,{instance:m})",a(u))}return t("return m")};var r=n(5643),i=n(361),o=n(3262);function a(e){return"missing required '"+e.name+"'"}},7759(e,t,n){"use strict";var r=n(2119);e.exports=new r({explicit:[n(7212),n(8636),n(2369)]})},7848(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=n(8512),o=n(5436),a=r(n(9553)),s=n(2545),l=n(5379);class c extends o.ActionBuilder{constructor(e,t,n){if(super(e),this.proto=l.sqlanvil.Assertion.create(),this.session=e,!t)return;const r=this.verifyConfig(t);r.name||(r.name=a.basename(r.filename));const i=s.actionConfigToCompiledGraphTarget(r);return this.proto.target=this.applySessionToTarget(i,e.projectConfig,r.filename,{validateTarget:!0,useDefaultAssertionDataset:!0}),this.proto.canonicalTarget=this.applySessionToTarget(i,e.canonicalProjectConfig,void 0,{validateTarget:!1,useDefaultAssertionDataset:!0}),n&&(r.filename=s.resolveActionsConfigFilename(r.filename,n),this.query(s.nativeRequire(r.filename).query)),r.dependencyTargets&&this.dependencies(r.dependencyTargets.map((e=>s.configTargetToCompiledGraphTarget(l.sqlanvil.ActionConfig.Target.create(e))))),r.hermetic&&this.hermetic(r.hermetic),(r.disabled||e.projectConfig.disableAssertions)&&this.disabled(),r.tags&&this.tags(r.tags),r.description&&this.description(r.description),r.project&&this.database(r.project),r.dataset&&this.schema(r.dataset),r.filename&&(this.proto.fileName=r.filename),r.reservation&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.reservation=r.reservation),this}query(e){return this.contextableQuery=e,this}jitCode(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.compilationMode=l.sqlanvil.ActionCompilationMode.ACTION_COMPILATION_MODE_JIT,this.contextableJitCode=e,this}dependencies(e){return(Array.isArray(e)?e:[e]).forEach((e=>{const t=s.resolvableAsTarget(e);this.session.actionAssertionMap.set(t,this),this.proto.dependencyTargets.push(t)})),this}hermetic(e){this.proto.hermeticity=e?l.sqlanvil.ActionHermeticity.HERMETIC:l.sqlanvil.ActionHermeticity.NON_HERMETIC}disabled(e=!0){return this.proto.disabled=e,this}tags(e){return("string"==typeof e?[e]:e).forEach((e=>{this.proto.tags.indexOf(e)<0&&this.proto.tags.push(e)})),this}description(e){return this.proto.actionDescriptor={description:e},this}database(e){return this.proto.target=this.applySessionToTarget(l.sqlanvil.Target.create(Object.assign(Object.assign({},this.proto.target),{database:e})),this.session.projectConfig,this.proto.fileName,{validateTarget:!0,useDefaultAssertionDataset:!0}),this}schema(e){return this.proto.target=this.applySessionToTarget(l.sqlanvil.Target.create(Object.assign(Object.assign({},this.proto.target),{schema:e})),this.session.projectConfig,this.proto.fileName,{validateTarget:!0,useDefaultAssertionDataset:!0}),this}getFileName(){return this.proto.fileName}getTarget(){return l.sqlanvil.Target.create(this.proto.target)}getParentAction(){return l.sqlanvil.Target.create(this.proto.parentAction)}setParentAction(e){this.proto.parentAction=e}compile(){const e=new u(this);return this.contextableJitCode&&this.contextableQuery?(this.session.compileError(new Error("Assertion may set either .jitCode() or .query(), but not both."),this.proto.fileName,this.proto.target),this.proto):(this.contextableJitCode?(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.jitCode=this.contextableJitCode.toString()):(this.proto.query=e.apply(this.contextableQuery),s.validateQueryString(this.session,this.proto.query,this.proto.fileName)),i.verifyObjectMatchesProto(l.sqlanvil.Assertion,this.proto,i.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM))}verifyConfig(e){return e.dependencies&&(e.dependencyTargets=e.dependencies.map((e=>s.resolvableAsActionConfigTarget(e))),delete e.dependencies),e.database&&(e.project=e.database,delete e.database),e.schema&&(e.dataset=e.schema,delete e.schema),e.fileName&&(e.filename=e.fileName,delete e.fileName),e.type&&delete e.type,i.verifyObjectMatchesProto(l.sqlanvil.ActionConfig.AssertionConfig,e,i.VerifyProtoErrorBehaviour.SHOW_DOCS_LINK)}}t.Assertion=c;class u{constructor(e){this.assertion=e}self(){return this.resolve(this.assertion.getTarget())}name(){return this.assertion.session.finalizeName(this.assertion.getTarget().name)}ref(e,...t){return e=s.toResolvable(e,t),s.resolvableAsTarget(e)?(this.assertion.dependencies(e),this.resolve(e)):(this.assertion.session.compileError(new Error("Action name is not specified")),"")}resolve(e,...t){return this.assertion.session.resolve(e,...t)}schema(){return this.assertion.session.finalizeSchema(this.assertion.getTarget().schema)}database(){return this.assertion.getTarget().database?this.assertion.session.finalizeDatabase(this.assertion.getTarget().database):(this.assertion.session.compileError(new Error("Warehouse does not support multiple databases")),"")}dependencies(e){return this.assertion.dependencies(e),""}tags(e){return this.assertion.tags(e),""}when(e,t,n=""){return e?t:n}apply(e){return"function"==typeof e?e(this):e}}t.AssertionContext=u},7882(e,t,n){"use strict";e.exports=m;var r=n(8923);((m.prototype=Object.create(r.prototype)).constructor=m).className="Type";var i=n(5643),o=n(1457),a=n(1344),s=n(8252),l=n(9687),c=n(2551),u=n(6237),p=n(3449),f=n(3262),d=n(1080),g=n(7728),h=n(420),y=n(744),b=n(6434);function m(e,t){e=e.replace(/\W/g,""),r.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function v(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}Object.defineProperties(m.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var n=this.fields[e[t]],r=n.id;if(this._fieldsById[r])throw Error("duplicate id "+r+" in "+this);this._fieldsById[r]=n}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=f.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=f.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=m.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof c||((e.prototype=new c).constructor=e,f.merge(e.prototype,t)),e.$type=e.prototype.$type=this,f.merge(e,c,!0),this._ctor=e;for(var n=0;n<this.fieldsArray.length;++n)this._fieldsArray[n].resolve();var r={};for(n=0;n<this.oneofsArray.length;++n)r[this._oneofsArray[n].resolve().name]={get:f.oneOfGetter(this._oneofsArray[n].oneof),set:f.oneOfSetter(this._oneofsArray[n].oneof)};n&&Object.defineProperties(e.prototype,r)}}}),m.generateConstructor=function(e){for(var t,n=f.codegen(["p"],e.name),r=0;r<e.fieldsArray.length;++r)(t=e._fieldsArray[r]).map?n("this%s={}",f.safeProp(t.name)):t.repeated&&n("this%s=[]",f.safeProp(t.name));return n("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},m.fromJSON=function(e,t){var n=new m(e,t.options);n.extensions=t.extensions,n.reserved=t.reserved;for(var c=Object.keys(t.fields),u=0;u<c.length;++u)n.add((void 0!==t.fields[c[u]].keyType?s.fromJSON:a.fromJSON)(c[u],t.fields[c[u]]));if(t.oneofs)for(c=Object.keys(t.oneofs),u=0;u<c.length;++u)n.add(o.fromJSON(c[u],t.oneofs[c[u]]));if(t.nested)for(c=Object.keys(t.nested),u=0;u<c.length;++u){var p=t.nested[c[u]];n.add((void 0!==p.id?a.fromJSON:void 0!==p.fields?m.fromJSON:void 0!==p.values?i.fromJSON:void 0!==p.methods?l.fromJSON:r.fromJSON)(c[u],p))}return t.extensions&&t.extensions.length&&(n.extensions=t.extensions),t.reserved&&t.reserved.length&&(n.reserved=t.reserved),t.group&&(n.group=!0),t.comment&&(n.comment=t.comment),t.edition&&(n._edition=t.edition),n._defaultEdition="proto3",n},m.prototype.toJSON=function(e){var t=r.prototype.toJSON.call(this,e),n=!!e&&Boolean(e.keepComments);return f.toObject(["edition",this._editionToJSON(),"options",t&&t.options||void 0,"oneofs",r.arrayToJSON(this.oneofsArray,e),"fields",r.arrayToJSON(this.fieldsArray.filter((function(e){return!e.declaringField})),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",t&&t.nested||void 0,"comment",n?this.comment:void 0])},m.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;r.prototype.resolveAll.call(this);var e=this.oneofsArray;for(n=0;n<e.length;)e[n++].resolve();for(var t=this.fieldsArray,n=0;n<t.length;)t[n++].resolve();return this},m.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,r.prototype._resolveFeaturesRecursive.call(this,e),this.oneofsArray.forEach((t=>{t._resolveFeatures(e)})),this.fieldsArray.forEach((t=>{t._resolveFeatures(e)})),this):this},m.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},m.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof a&&void 0===e.extend){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),v(this)}return e instanceof o?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),v(this)):r.prototype.add.call(this,e)},m.prototype.remove=function(e){if(e instanceof a&&void 0===e.extend){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),v(this)}if(e instanceof o){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),v(this)}return r.prototype.remove.call(this,e)},m.prototype.isReservedId=function(e){return r.isReservedId(this.reserved,e)},m.prototype.isReservedName=function(e){return r.isReservedName(this.reserved,e)},m.prototype.create=function(e){return new this.ctor(e)},m.prototype.setup=function(){for(var e=this.fullName,t=[],n=0;n<this.fieldsArray.length;++n)t.push(this._fieldsArray[n].resolve().resolvedType);this.encode=d(this)({Writer:p,types:t,util:f}),this.decode=g(this)({Reader:u,types:t,util:f}),this.verify=h(this)({types:t,util:f}),this.fromObject=y.fromObject(this)({types:t,util:f}),this.toObject=y.toObject(this)({types:t,util:f});var r=b[e];if(r){var i=Object.create(this);i.fromObject=this.fromObject,this.fromObject=r.fromObject.bind(i),i.toObject=this.toObject,this.toObject=r.toObject.bind(i)}return this},m.prototype.encode=function(e,t){return this.setup().encode(e,t)},m.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},m.prototype.decode=function(e,t){return this.setup().decode(e,t)},m.prototype.decodeDelimited=function(e){return e instanceof u||(e=u.create(e)),this.decode(e,e.uint32())},m.prototype.verify=function(e){return this.setup().verify(e)},m.prototype.fromObject=function(e){return this.setup().fromObject(e)},m.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},m.d=function(e){return function(t){f.decorateType(t,e)}}},7983(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=n(8512),o=n(7848),a=n(3788),s=n(6660),l=n(1299),c=n(2795),u=n(9293),p=n(2008),f=n(8995),d=r(n(9553)),g=n(2545),h=n(8375),y=n(5379);function b(e,t){var n,r;try{(0,g.nativeRequire(null===(n=null==e?void 0:e.compileConfig)||void 0===n?void 0:n.extension.name).extension)().compile(e,t)}catch(n){t.compileError(n,null===(r=null==e?void 0:e.compileConfig)||void 0===r?void 0:r.extension.name)}}t.main=function(e){var t,n,r;const m=global;let v;v="string"==typeof e?i.decode64(y.sqlanvil.CoreExecutionRequest,e):y.sqlanvil.CoreExecutionRequest.decode(e);const O=v.compile,T=!(null===(n=null===(t=null==O?void 0:O.compileConfig)||void 0===t?void 0:t.extension)||void 0===n?void 0:n.compilationMode);let w=h.readWorkflowSettings(T);const j=null!==(r=O.compileConfig.projectConfigOverride)&&void 0!==r?r:{};w=y.sqlanvil.ProjectConfig.create(Object.assign(Object.assign(Object.assign({},w),j),{vars:Object.assign(Object.assign({},w.vars),j.vars),connections:Object.assign(Object.assign({},w.connections),j.connections)}));const P=g.nativeRequire("@sqlanvil/core").session;P.init(O.compileConfig.projectDir,w,w),m.sqlanvil=P,function(e,t){var n,r;(null===(r=null===(n=null==e?void 0:e.compileConfig)||void 0===n?void 0:n.extension)||void 0===r?void 0:r.compilationMode)===y.sqlanvil.ExtensionCompilationMode.PROLOGUE&&b(e,t)}(O,P),function(e,t){var n,r;(null===(r=null===(n=null==e?void 0:e.compileConfig)||void 0===n?void 0:n.extension)||void 0===r?void 0:r.compilationMode)!==y.sqlanvil.ExtensionCompilationMode.APPLICATION_CODE?function(e,t){const n=global,r={};e.compileConfig.filePaths.filter((e=>e.startsWith(`includes${d.separator}`))).filter((e=>2===e.split(d.separator).length)).filter((e=>"js"===d.fileExtension(e))).forEach((e=>{try{r[d.basename(e)]=g.nativeRequire(e)}catch(n){t.compileError(n,e)}})),Object.assign(n,r),n.publish=t.publish.bind(t),n.operate=t.operate.bind(t),n.assert=t.assert.bind(t),n.declare=t.declare.bind(t),n.notebook=t.notebook.bind(t),n.test=t.test.bind(t),n.jitData=t.jitData.bind(t),n.rlsPolicy=t.rlsPolicy.bind(t),n.realtimePublication=t.realtimePublication.bind(t),n.wrapper=t.wrapper.bind(t),n.vectorIndex=t.vectorIndex.bind(t),function(e,t){t.filter((e=>e.startsWith(`definitions${d.separator}`)&&"actions"===d.basename(e)&&"yaml"===d.fileExtension(e))).sort().forEach((t=>{const n=function(e,t){let n={};try{n=g.nativeRequire(t).asJson}catch(n){e.compileError(n,t)}return i.verifyObjectMatchesProto(y.sqlanvil.ActionConfigs,n,i.VerifyProtoErrorBehaviour.SHOW_DOCS_LINK),y.sqlanvil.ActionConfigs.fromObject(n)}(e,t);n.actions.forEach((n=>{const r=y.sqlanvil.ActionConfig.create(n);if(r.table)e.actions.push(new p.Table(e,y.sqlanvil.ActionConfig.TableConfig.create(r.table),t));else if(r.view)e.actions.push(new f.View(e,y.sqlanvil.ActionConfig.ViewConfig.create(r.view),t));else if(r.incrementalTable)e.actions.push(new l.IncrementalTable(e,y.sqlanvil.ActionConfig.IncrementalTableConfig.create(r.incrementalTable),t));else if(r.assertion)e.actions.push(new o.Assertion(e,y.sqlanvil.ActionConfig.AssertionConfig.create(r.assertion),t));else if(r.operation)e.actions.push(new u.Operation(e,y.sqlanvil.ActionConfig.OperationConfig.create(r.operation),t));else if(r.declaration){const n=y.sqlanvil.ActionConfig.DeclarationConfig.create(r.declaration);n.connection?(n.filename||(n.filename=t),e.declare(n)):e.actions.push(new s.Declaration(e,n))}else if(r.notebook)e.actions.push(new c.Notebook(e,y.sqlanvil.ActionConfig.NotebookConfig.create(r.notebook),t));else{if(!r.dataPreparation)throw Error("Empty action configs are not permitted.");e.actions.push(new a.DataPreparation(e,y.sqlanvil.ActionConfig.DataPreparationConfig.create(r.dataPreparation),t))}}))}))}(t,e.compileConfig.filePaths),e.compileConfig.filePaths.filter((e=>e.startsWith(`definitions${d.separator}`))).filter((e=>"js"===d.fileExtension(e)||"sqlx"===d.fileExtension(e))).sort().forEach((e=>{try{g.nativeRequire(e)}catch(n){t.compileError(n,e)}}))}(e,t):b(e,t)}(O,P);const q=y.sqlanvil.CoreExecutionResponse.create({compile:{compiledGraph:P.compile()}});return"string"==typeof e?i.encode64(y.sqlanvil.CoreExecutionResponse,q):y.sqlanvil.CoreExecutionResponse.encode(q).finish()}},8043(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3314),i=n(2545);class o{constructor(e,t){this.adapter=e,this.request=t,this.target=t.target;const n=t.dependencies,o=[this.target,...n];this.resolvableMap=new i.ResolvableMap(o.map((e=>{return{actionTarget:e,value:(t=e,`${t.database}.${t.schema}.${t.name}`)};var t}))),this.data=r.Structs.toObject(t.jitData),this.executionData=t.executionData}self(){return this.resolve(this.name())}name(){return this.target.name}ref(e,...t){return this.resolve(e,...t)}resolve(e,...t){e=i.toResolvable(e,t);const n=i.resolvableAsTarget(e),r=this.resolvableMap.find(n);if(r.length>1)throw new Error(i.ambiguousActionNameMsg(e,r));return this.resolveReference(i.stringifyResolvable(e),r.length>0?r[0]:void 0)}schema(){return this.target.schema}database(){return this.target.database}resolveReference(e,t){if(t)return`\`${t}\``;throw new Error(`Undeclared dependency referenced: ${e}.\nJiT action must have its dependencies declared explicitly.`)}}t.SqlActionJitContext=o;class a extends o{constructor(e,t){super(e,t)}when(e,t,n){return e?t:n||""}incremental(){return!1}}t.TableJitContext=a,t.IncrementalTableJitContext=class extends a{constructor(e,t,n){super(e,t),this.isIncrementalContext=n}incremental(){return this.isIncrementalContext}}},8045(e){"use strict";e.exports=function(e,t){for(var n=new Array(arguments.length-1),r=0,i=2,o=!0;i<arguments.length;)n[r++]=arguments[i++];return new Promise((function(i,a){n[r]=function(e){if(o)if(o=!1,e)a(e);else{for(var t=new Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];i.apply(null,t)}};try{e.apply(t||null,n)}catch(e){o&&(o=!1,a(e))}}))}},8083(e,t,n){"use strict";var r=n(8433);function i(e,t,n,r,i){var o="",a="",s=Math.floor(i/2)-1;return r-t>s&&(t=r-s+(o=" ... ").length),n-r>s&&(n=r+s-(a=" ...").length),{str:o+e.slice(t,n).replace(/\t/g,"→")+a,pos:r-t+o.length}}function o(e,t){return r.repeat(" ",t-e.length)+e}e.exports=function(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),"number"!=typeof t.indent&&(t.indent=1),"number"!=typeof t.linesBefore&&(t.linesBefore=3),"number"!=typeof t.linesAfter&&(t.linesAfter=2);for(var n,a=/\r?\n|\r|\0/g,s=[0],l=[],c=-1;n=a.exec(e.buffer);)l.push(n.index),s.push(n.index+n[0].length),e.position<=n.index&&c<0&&(c=s.length-2);c<0&&(c=s.length-1);var u,p,f="",d=Math.min(e.line+t.linesAfter,l.length).toString().length,g=t.maxLength-(t.indent+d+3);for(u=1;u<=t.linesBefore&&!(c-u<0);u++)p=i(e.buffer,s[c-u],l[c-u],e.position-(s[c]-s[c-u]),g),f=r.repeat(" ",t.indent)+o((e.line-u+1).toString(),d)+" | "+p.str+"\n"+f;for(p=i(e.buffer,s[c],l[c],e.position,g),f+=r.repeat(" ",t.indent)+o((e.line+1).toString(),d)+" | "+p.str+"\n",f+=r.repeat("-",t.indent+d+3+p.pos)+"^\n",u=1;u<=t.linesAfter&&!(c+u>=l.length);u++)p=i(e.buffer,s[c+u],l[c+u],e.position-(s[c]-s[c+u]),g),f+=r.repeat(" ",t.indent)+o((e.line+u+1).toString(),d)+" | "+p.str+"\n";return f.replace(/\n$/,"")}},8202(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8512),i=n(8771),o=n(5379);class a extends i.ActionBuilder{constructor(e,t){super(e),this.proto=o.sqlanvil.Operation.create(),this.session=e,this.config=t;const n=this.applySessionToTarget(o.sqlanvil.Target.create({name:t.table}),e.projectConfig),r=o.sqlanvil.Target.create({name:`${t.table}_idx_${t.name}`});this.proto.target=this.applySessionToTarget(r,e.projectConfig,t.filename,{validateTarget:!0}),this.proto.canonicalTarget=this.applySessionToTarget(r,e.canonicalProjectConfig),this.proto.fileName=t.filename||"",this.proto.dependencyTargets.push(n)}getFileName(){return this.proto.fileName}getTarget(){return o.sqlanvil.Target.create(this.proto.target)}compile(){var e;const t=this.finalizeTarget(o.sqlanvil.Target.create({name:this.config.table})),n=this.session.compilationSql().resolveTarget(t),i=(null===(e=this.config.params)||void 0===e?void 0:e.opclass)||"vector_cosine_ops",a=this.config.indexType?this.config.indexType.toLowerCase():"hnsw",s=[];if(this.config.params)for(const[e,t]of Object.entries(this.config.params))"opclass"!==e&&s.push(`${e} = ${t}`);const l=s.length>0?` with (${s.join(", ")})`:"",c=["create extension if not exists vector cascade",`drop index if exists "${this.config.name}"`,`create index "${this.config.name}" on ${n} using ${a} ("${this.config.column}" ${i})${l}`];return this.proto.queries=c,r.verifyObjectMatchesProto(o.sqlanvil.Operation,this.proto,r.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM)}}t.VectorIndex=a},8252(e,t,n){"use strict";e.exports=a;var r=n(1344);((a.prototype=Object.create(r.prototype)).constructor=a).className="MapField";var i=n(361),o=n(3262);function a(e,t,n,i,a,s){if(r.call(this,e,t,i,void 0,void 0,a,s),!o.isString(n))throw TypeError("keyType must be a string");this.keyType=n,this.resolvedKeyType=null,this.map=!0}a.fromJSON=function(e,t){return new a(e,t.id,t.keyType,t.type,t.options,t.comment)},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},a.prototype.resolve=function(){if(this.resolved)return this;if(void 0===i.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return r.prototype.resolve.call(this)},a.d=function(e,t,n){return"function"==typeof n?n=o.decorateType(n).name:n&&"object"==typeof n&&(n=o.decorateEnum(n).name),function(r,i){o.decorateType(r.constructor).add(new a(i,e,t,n))}}},8375(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7210),i=n(8512),o=n(390),a=n(2628),s=n(5379),l=require;function c(e){var t;const n=s.sqlanvil.ProjectConfig.create();if(e.defaultProject&&(n.defaultDatabase=e.defaultProject),e.defaultDataset&&(n.defaultSchema=e.defaultDataset),e.defaultLocation&&(n.defaultLocation=e.defaultLocation),e.defaultAssertionDataset&&(n.assertionSchema=e.defaultAssertionDataset),e.vars&&(n.vars=e.vars),e.projectSuffix&&(n.databaseSuffix=e.projectSuffix),e.datasetSuffix&&(n.schemaSuffix=e.datasetSuffix),e.namePrefix&&(n.tablePrefix=e.namePrefix),e.builtinAssertionNamePrefix&&(n.builtinAssertionNamePrefix=e.builtinAssertionNamePrefix),e.defaultNotebookRuntimeOptions){n.defaultNotebookRuntimeOptions={};const{outputBucket:t,runtimeTemplateName:r,repositorySnapshotDestination:i}=e.defaultNotebookRuntimeOptions;if(t&&(n.defaultNotebookRuntimeOptions.outputBucket=t),r&&(n.defaultNotebookRuntimeOptions.runtimeTemplateName=r),i)if(n.defaultNotebookRuntimeOptions.repositorySnapshotDestination={},i.repositorySnapshotUri)n.defaultNotebookRuntimeOptions.repositorySnapshotDestination.repositorySnapshotUri=i.repositorySnapshotUri;else{if(!t)throw Error("Invalid repository_snapshot_destination: either repository_snapshot_uri or output_bucket has to be defined");n.defaultNotebookRuntimeOptions.repositorySnapshotDestination.repositorySnapshotUri=t}}e.defaultIcebergConfig&&(n.defaultIcebergConfig={},e.defaultIcebergConfig.bucketName&&(n.defaultIcebergConfig.bucketName=e.defaultIcebergConfig.bucketName),e.defaultIcebergConfig.tableFolderRoot&&(n.defaultIcebergConfig.tableFolderRoot=e.defaultIcebergConfig.tableFolderRoot),e.defaultIcebergConfig.tableFolderSubpath&&(n.defaultIcebergConfig.tableFolderSubpath=e.defaultIcebergConfig.tableFolderSubpath),e.defaultIcebergConfig.connection&&(n.defaultIcebergConfig.connection=e.defaultIcebergConfig.connection)),e.disableAssertions&&(n.disableAssertions=e.disableAssertions),e.defaultReservation&&(n.defaultReservation=e.defaultReservation),e.includeTestsInCompiledGraph&&(n.includeTestsInCompiledGraph=e.includeTestsInCompiledGraph);const r=["bigquery","postgres","supabase","mysql"];if(e.connections&&(n.connections=e.connections,Object.keys(e.connections).forEach((t=>{const n=e.connections[t];if(!n.platform)throw new Error(`Connection "${t}" is missing required field "platform".`);if(!r.includes(n.platform))throw new Error(`Connection "${t}" has unsupported platform "${n.platform}". Supported platforms: ${r.join(", ")}.`)}))),e.warehouse){const i=null===(t=e.connections)||void 0===t?void 0:t[e.warehouse],o=i?i.platform:e.warehouse;if(!r.includes(o))throw new Error(i?`Connection "${e.warehouse}" has unsupported platform "${o}". Supported platforms: ${r.join(", ")}.`:`Unsupported warehouse "${e.warehouse}". Supported warehouses: ${r.join(", ")}.`);n.warehouse=o,i&&(n.warehouseConnection=e.warehouse)}else n.warehouse="bigquery";return n}t.readWorkflowSettings=function(e=!0){const t=global.workflowSettingsYaml||function(){var e;try{return l("workflow_settings.yaml")}catch(t){if(t instanceof SyntaxError||t instanceof r.YAMLException)throw t;if(null===(e=null==t?void 0:t.message)||void 0===e?void 0:e.includes(o.INVALID_YAML_ERROR_STRING))throw t;return}}();if(t){const e=t.asJson;if(!e)throw Error("workflow_settings.yaml is invalid");return c(function(e){let t=s.sqlanvil.WorkflowSettings.create();try{t=s.sqlanvil.WorkflowSettings.create(i.verifyObjectMatchesProto(s.sqlanvil.WorkflowSettings,e,i.VerifyProtoErrorBehaviour.SHOW_DOCS_LINK))}catch(e){if(e instanceof ReferenceError)throw ReferenceError(`Workflow settings error: ${e.message}`);throw e}if(t.sqlanvilCoreVersion&&t.sqlanvilCoreVersion!==a.version)throw Error(`Version mismatch: workflow settings specifies version ${t.sqlanvilCoreVersion}, but ${a.version} was found`);return t}(e))}if(e)throw Error("Failed to resolve workflow_settings.yaml");return s.sqlanvil.ProjectConfig.create()},t.workflowSettingsAsProjectConfig=c},8390(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8512),i=n(8771),o=n(5379);class a extends i.ActionBuilder{constructor(e,t){super(e),this.proto=o.sqlanvil.Operation.create(),this.session=e,this.config=t;const n=this.applySessionToTarget(o.sqlanvil.Target.create({name:t.table}),e.projectConfig),r=t.name||"supabase_realtime",i=o.sqlanvil.Target.create({name:`${t.table}_realtime_${r}`});this.proto.target=this.applySessionToTarget(i,e.projectConfig,t.filename,{validateTarget:!0}),this.proto.canonicalTarget=this.applySessionToTarget(i,e.canonicalProjectConfig),this.proto.fileName=t.filename||"",this.proto.dependencyTargets.push(n)}getFileName(){return this.proto.fileName}getTarget(){return o.sqlanvil.Target.create(this.proto.target)}compile(){const e=this.finalizeTarget(o.sqlanvil.Target.create({name:this.config.table})),t=this.session.compilationSql().resolveTarget(e),n=[`alter table ${t} replica identity full`,`alter publication ${this.config.name||"supabase_realtime"} add table ${t}`];return this.proto.queries=n,r.verifyObjectMatchesProto(o.sqlanvil.Operation,this.proto,r.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM)}}t.RealtimePublication=a},8433(e){"use strict";function t(e){return null==e}e.exports.isNothing=t,e.exports.isObject=function(e){return"object"==typeof e&&null!==e},e.exports.toArray=function(e){return Array.isArray(e)?e:t(e)?[]:[e]},e.exports.repeat=function(e,t){var n,r="";for(n=0;n<t;n+=1)r+=e;return r},e.exports.isNegativeZero=function(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e},e.exports.extend=function(e,t){var n,r,i,o;if(t)for(n=0,r=(o=Object.keys(t)).length;n<r;n+=1)e[i=o[n]]=t[i];return e}},8512(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2549),i=n(5379);var o;!function(e){e[e.DEFAULT=0]="DEFAULT",e[e.SUGGEST_REPORTING_TO_DATAFORM_TEAM=1]="SUGGEST_REPORTING_TO_DATAFORM_TEAM",e[e.SHOW_DOCS_LINK=2]="SHOW_DOCS_LINK"}(o=t.VerifyProtoErrorBehaviour||(t.VerifyProtoErrorBehaviour={}));const a=i.google.protobuf.Struct,s=a.verify;function l(e,t){return e===o.SHOW_DOCS_LINK?` See https://github.com/sqlanvil/docs/blob/main/reference/configs.md#${t.getTypeUrl("").replace(/\./g,"-").replace(/\//,"")} for allowed properties.`:""}function c(e,t={}){return function(e){return r.util.base64.encode(e,0,e.length)}(e.encode(e.create(t)).finish())}function u(e){if(null==e)return{nullValue:0};if("string"==typeof e)return{stringValue:e};if("number"==typeof e)return{numberValue:e};if("boolean"==typeof e)return{boolValue:e};if(Array.isArray(e))return{listValue:{values:e.map(u)}};if("object"==typeof e)return{structValue:e};throw new Error(`Unsupported value: ${e}`)}a.verify=function(e){if(e&&"object"==typeof e&&!("fields"in e)){const t={};for(const[n,r]of Object.entries(e))t[n]=u(r);Object.keys(e).forEach((t=>delete e[t])),e.fields=t}return s.call(this,e)},t.verifyObjectMatchesProto=function(e,t,n=o.DEFAULT){if(Array.isArray(t))throw ReferenceError("Expected a top-level object, but found an array");e.verify(t);const r=e.create(t);return function t(r,i){Object.entries(r).forEach((([r,a])=>{const s=i[r];if(typeof s!=typeof a){if(Array.isArray(a)&&0===a.length)return;if(!a)throw ReferenceError(`Unexpected empty value for "${r}".`+l(n,e));if("object"==typeof a&&0===Object.keys(a).length)return;if(n===o.SUGGEST_REPORTING_TO_DATAFORM_TEAM)throw ReferenceError(`Unexpected property "${r}" for "${e.getTypeUrl("").replace("/","")}", please report this to the sqlanvil team at https://github.com/sqlanvil/sqlanvil/issues.`);throw ReferenceError(`Unexpected property "${r}", or property value type of "${typeof a}" is incorrect.`+l(n,e))}"object"==typeof a&&t(a,s)}))}(t,e.toObject(r)),r},t.encode64=c,t.decode64=function(e,t){return t?e.decode(function(e){const t=new Uint8Array(r.util.base64.length(e));return r.util.base64.decode(e,t,0),t}(t)):e.create()},t.equals=function(e,t,n){return c(e,t)===c(e,n)},t.deepClone=function(e,t){return e.fromObject(e.toObject(e.create(t)))},t.unknownToValue=function e(t){if(null==t)return{nullValue:0};if("string"==typeof t)return{stringValue:t};if("number"==typeof t)return{numberValue:t};if("boolean"==typeof t)return{boolValue:t};if(Array.isArray(t))return{listValue:{values:t.map(e)}};if("object"==typeof t)return{structValue:{fields:Object.fromEntries(Object.entries(t).map((([t,n])=>[t,e(n)])))}};throw new Error(`Unsupported value: ${t}`)}},8545(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(2545)),o=n(5379);t.IRecordDescriptorProperties=()=>i.strictKeysOf()(["description","columns","displayName","tags","bigqueryPolicyTags"]);class a{static mapConfigProtoToCompilationProto(e){return e.map((e=>o.sqlanvil.ColumnDescriptor.create({path:e.path,description:e.description,tags:e.tags,bigqueryPolicyTags:e.bigqueryPolicyTags})))}static mapLegacyObjectToConfigProto(e){return Object.keys(e).map((t=>a.mapColumnDescriptionToProto([t],e[t]))).flat()}static mapColumnDescriptionToProto(e,t){if("string"==typeof t)return[o.sqlanvil.ColumnDescriptor.create({description:t,path:e})];const n=t?[o.sqlanvil.ActionConfig.ColumnDescriptor.create({path:e,description:t.description,tags:"string"==typeof t.tags?[t.tags]:t.tags,bigqueryPolicyTags:"string"==typeof t.bigqueryPolicyTags?[t.bigqueryPolicyTags]:t.bigqueryPolicyTags})]:[],r=t.columns?Object.keys(t.columns):[];return n.concat(r.map((n=>a.mapColumnDescriptionToProto(e.concat([n]),t.columns[n]))).flat())}}t.ColumnDescriptors=a;class s{static mapToColumnProtoArray(e,t){return Object.keys(e).map((n=>s.mapColumnDescriptionToProto([n],e[n],t))).flat()}static mapColumnDescriptionToProto(e,n,r){if("string"==typeof n)return[o.sqlanvil.ColumnDescriptor.create({description:n,path:e})];i.checkExcessProperties(r,n,t.IRecordDescriptorProperties(),`${e.join(".")} column descriptor`);const a=n?[o.sqlanvil.ColumnDescriptor.create({path:e,description:n.description,displayName:n.displayName,tags:"string"==typeof n.tags?[n.tags]:n.tags,bigqueryPolicyTags:"string"==typeof n.bigqueryPolicyTags?[n.bigqueryPolicyTags]:n.bigqueryPolicyTags})]:[],l=n.columns?Object.keys(n.columns):[];return a.concat(l.map((t=>s.mapColumnDescriptionToProto(e.concat([t]),n.columns[t],r))).flat())}}t.LegacyColumnDescriptors=s},8561(e){"use strict";function t(e,n){"string"==typeof e&&(n=e,e=void 0);var r=[];function i(e){if("string"!=typeof e){var n=o();if(t.verbose&&console.log("codegen: "+n),n="return "+n,e){for(var a=Object.keys(e),s=new Array(a.length+1),l=new Array(a.length),c=0;c<a.length;)s[c]=a[c],l[c]=e[a[c++]];return s[c]=n,Function.apply(null,s).apply(null,l)}return Function(n)()}for(var u=new Array(arguments.length-1),p=0;p<u.length;)u[p]=arguments[++p];if(p=0,e=e.replace(/%([%dfijs])/g,(function(e,t){var n=u[p++];switch(t){case"d":case"f":return String(Number(n));case"i":return String(Math.floor(n));case"j":return JSON.stringify(n);case"s":return String(n)}return"%"})),p!==u.length)throw Error("parameter count mismatch");return r.push(e),i}function o(t){return"function "+(t||n||"")+"("+(e&&e.join(",")||"")+"){\n "+r.join("\n ")+"\n}"}return i.toString=o,i}e.exports=t,t.verbose=!1},8636(e,t,n){"use strict";var r=n(5388);e.exports=new r("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}})},8771(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5379);t.ActionBuilder=class{constructor(e){this.includeAssertionsForDependency=new Map,this.session=e}applySessionToTarget(e,t,n,i){const o=(null==i?void 0:i.useDefaultAssertionDataset)&&t.assertionSchema||t.defaultSchema,a=r.sqlanvil.Target.create({name:e.name,schema:e.schema||o||void 0,database:e.database||t.defaultDatabase||void 0});return(null==i?void 0:i.validateTarget)&&this.validateTarget(e,n),a}finalizeTarget(e){return r.sqlanvil.Target.create({name:this.session.finalizeName(e.name),schema:e.schema?this.session.finalizeSchema(e.schema):void 0,database:e.database?this.session.finalizeDatabase(e.database):void 0})}generateInlineAssertions(e,t){var n,i,o;const a={uniqueKeyAssertions:[]};(null===(n=e.uniqueKey)||void 0===n?void 0:n.length)&&(null===(i=e.uniqueKeys)||void 0===i?void 0:i.length)&&this.session.compileError(new Error("Specify at most one of 'assertions.uniqueKey' and 'assertions.uniqueKeys'."));const s=this.session.projectConfig.builtinAssertionNamePrefix?`${this.session.projectConfig.builtinAssertionNamePrefix}_`:"";let l=e.uniqueKeys.map((e=>r.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey.create(e)));(null===(o=e.uniqueKey)||void 0===o?void 0:o.length)&&(l=[r.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey.create({uniqueKey:e.uniqueKey})]),l&&l.forEach((({uniqueKey:e},n)=>{const i=this.session.assert(`${s}${t.target.schema}_${t.target.name}_assertions_uniqueKey_${n}`,r.sqlanvil.ActionConfig.AssertionConfig.create({filename:t.fileName})).query((n=>this.session.compilationSql().indexAssertion(n.ref(t.target),e)));t.tags&&i.tags(t.tags),i.setParentAction(r.sqlanvil.Target.create(t.target)),t.disabled&&i.disabled(),a.uniqueKeyAssertions.push(i)}));const c=e.rowConditions||[];return e.nonNull&&("string"==typeof e.nonNull?[e.nonNull]:e.nonNull).forEach((e=>c.push(`${e} IS NOT NULL`))),c&&c.length>0&&(a.rowConditionsAssertion=this.session.assert(`${s}${t.target.schema}_${t.target.name}_assertions_rowConditions`,{filename:t.fileName}).query((e=>this.session.compilationSql().rowConditionsAssertion(e.ref(t.target),c))),a.rowConditionsAssertion.setParentAction(r.sqlanvil.Target.create(t.target)),t.disabled&&a.rowConditionsAssertion.disabled(),t.tags&&a.rowConditionsAssertion.tags(t.tags)),a}validateTarget(e,t){e.name.includes(".")&&this.session.compileError(new Error("Action target names cannot include '.'"),t,e),e.schema.includes(".")&&this.session.compileError(new Error("Action target datasets cannot include '.'"),t,e),e.database.includes(".")&&this.session.compileError(new Error("Action target projects cannot include '.'"),t,e)}}},8811(e,t,n){"use strict";e.exports=o;var r=n(7209);((o.prototype=Object.create(r.prototype)).constructor=o).className="Method";var i=n(3262);function o(e,t,n,o,a,s,l,c,u){if(i.isObject(a)?(l=a,a=s=void 0):i.isObject(s)&&(l=s,s=void 0),void 0!==t&&!i.isString(t))throw TypeError("type must be a string");if(!i.isString(n))throw TypeError("requestType must be a string");if(!i.isString(o))throw TypeError("responseType must be a string");r.call(this,e,l),this.type=t||"rpc",this.requestType=n,this.requestStream=!!a||void 0,this.responseType=o,this.responseStream=!!s||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=c,this.parsedOptions=u}o.fromJSON=function(e,t){return new o(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},o.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0,"parsedOptions",this.parsedOptions])},o.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),r.prototype.resolve.call(this))}},8839(e,t){"use strict";var n=t;n.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&"="===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};for(var r=new Array(64),i=new Array(123),o=0;o<64;)i[r[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;n.encode=function(e,t,n){for(var i,o=null,a=[],s=0,l=0;t<n;){var c=e[t++];switch(l){case 0:a[s++]=r[c>>2],i=(3&c)<<4,l=1;break;case 1:a[s++]=r[i|c>>4],i=(15&c)<<2,l=2;break;case 2:a[s++]=r[i|c>>6],a[s++]=r[63&c],l=0}s>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,a)),s=0)}return l&&(a[s++]=r[i],a[s++]=61,1===l&&(a[s++]=61)),o?(s&&o.push(String.fromCharCode.apply(String,a.slice(0,s))),o.join("")):String.fromCharCode.apply(String,a.slice(0,s))};var a="invalid encoding";n.decode=function(e,t,n){for(var r,o=n,s=0,l=0;l<e.length;){var c=e.charCodeAt(l++);if(61===c&&s>1)break;if(void 0===(c=i[c]))throw Error(a);switch(s){case 0:r=c,s=1;break;case 1:t[n++]=r<<2|(48&c)>>4,r=c,s=2;break;case 2:t[n++]=(15&r)<<4|(60&c)>>2,r=c,s=3;break;case 3:t[n++]=(3&r)<<6|c,s=0}}if(1===s)throw Error(a);return n-o},n.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},8923(e,t,n){"use strict";e.exports=p;var r=n(7209);((p.prototype=Object.create(r.prototype)).constructor=p).className="Namespace";var i,o,a,s=n(1344),l=n(3262),c=n(1457);function u(e,t){if(e&&e.length){for(var n={},r=0;r<e.length;++r)n[e[r].name]=e[r].toJSON(t);return n}}function p(e,t){r.call(this,e,t),this.nested=void 0,this._nestedArray=null,this._lookupCache={},this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0}function f(e){e._nestedArray=null,e._lookupCache={};for(var t=e;t=t.parent;)t._lookupCache={};return e}p.fromJSON=function(e,t){return new p(e,t.options).addJSON(t.nested)},p.arrayToJSON=u,p.isReservedId=function(e,t){if(e)for(var n=0;n<e.length;++n)if("string"!=typeof e[n]&&e[n][0]<=t&&e[n][1]>t)return!0;return!1},p.isReservedName=function(e,t){if(e)for(var n=0;n<e.length;++n)if(e[n]===t)return!0;return!1},Object.defineProperty(p.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=l.toArray(this.nested))}}),p.prototype.toJSON=function(e){return l.toObject(["options",this.options,"nested",u(this.nestedArray,e)])},p.prototype.addJSON=function(e){if(e)for(var t,n=Object.keys(e),r=0;r<n.length;++r)t=e[n[r]],this.add((void 0!==t.fields?i.fromJSON:void 0!==t.values?a.fromJSON:void 0!==t.methods?o.fromJSON:void 0!==t.id?s.fromJSON:p.fromJSON)(n[r],t));return this},p.prototype.get=function(e){return this.nested&&this.nested[e]||null},p.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof a)return this.nested[e].values;throw Error("no such enum: "+e)},p.prototype.add=function(e){if(!(e instanceof s&&void 0!==e.extend||e instanceof i||e instanceof c||e instanceof a||e instanceof o||e instanceof p))throw TypeError("object must be a valid nested object");if(this.nested){var t=this.get(e.name);if(t){if(!(t instanceof p&&e instanceof p)||t instanceof i||t instanceof o)throw Error("duplicate name '"+e.name+"' in "+this);for(var n=t.nestedArray,r=0;r<n.length;++r)e.add(n[r]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}}else this.nested={};this.nested[e.name]=e,this instanceof i||this instanceof o||this instanceof a||this instanceof s||e._edition||(e._edition=e._defaultEdition),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0;for(var l=this;l=l.parent;)l._needsRecursiveFeatureResolution=!0,l._needsRecursiveResolve=!0;return e.onAdd(this),f(this)},p.prototype.remove=function(e){if(!(e instanceof r))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),f(this)},p.prototype.define=function(e,t){if(l.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&""===e[0])throw Error("path must be relative");for(var n=this;e.length>0;){var r=e.shift();if(n.nested&&n.nested[r]){if(!((n=n.nested[r])instanceof p))throw Error("path conflicts with non-namespace objects")}else n.add(n=new p(r))}return t&&n.addJSON(t),n},p.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;this._resolveFeaturesRecursive(this._edition);var e=this.nestedArray,t=0;for(this.resolve();t<e.length;)e[t]instanceof p?e[t++].resolveAll():e[t++].resolve();return this._needsRecursiveResolve=!1,this},p.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(this._needsRecursiveFeatureResolution=!1,e=this._edition||e,r.prototype._resolveFeaturesRecursive.call(this,e),this.nestedArray.forEach((t=>{t._resolveFeaturesRecursive(e)})),this):this},p.prototype.lookup=function(e,t,n){if("boolean"==typeof t?(n=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),l.isString(e)&&e.length){if("."===e)return this.root;e=e.split(".")}else if(!e.length)return this;var r=e.join(".");if(""===e[0])return this.root.lookup(e.slice(1),t);var i=this.root._fullyQualifiedObjects&&this.root._fullyQualifiedObjects["."+r];if(i&&(!t||t.indexOf(i.constructor)>-1))return i;if((i=this._lookupImpl(e,r))&&(!t||t.indexOf(i.constructor)>-1))return i;if(n)return null;for(var o=this;o.parent;){if((i=o.parent._lookupImpl(e,r))&&(!t||t.indexOf(i.constructor)>-1))return i;o=o.parent}return null},p.prototype._lookupImpl=function(e,t){if(Object.prototype.hasOwnProperty.call(this._lookupCache,t))return this._lookupCache[t];var n=this.get(e[0]),r=null;if(n)1===e.length?r=n:n instanceof p&&(e=e.slice(1),r=n._lookupImpl(e,e.join(".")));else for(var i=0;i<this.nestedArray.length;++i)this._nestedArray[i]instanceof p&&(n=this._nestedArray[i]._lookupImpl(e,t))&&(r=n);return this._lookupCache[t]=r,r},p.prototype.lookupType=function(e){var t=this.lookup(e,[i]);if(!t)throw Error("no such type: "+e);return t},p.prototype.lookupEnum=function(e){var t=this.lookup(e,[a]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},p.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[i,a]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t},p.prototype.lookupService=function(e){var t=this.lookup(e,[o]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},p._configure=function(e,t,n){i=e,o=t,a=n}},8995(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=n(8512),o=n(5436),a=n(1299),s=n(2008),l=n(8545),c=r(n(9553)),u=n(2545),p=n(5379);class f extends o.ActionBuilder{constructor(e,t,n){var r;if(super(e),this.dependOnDependencyAssertions=!1,this.contextablePreOps=[],this.contextablePostOps=[],this.proto=p.sqlanvil.Table.create({type:"view",enumType:p.sqlanvil.TableType.VIEW,disabled:!1,tags:[]}),this.uniqueKeyAssertions=[],this.session=e,this.configPath=n,this.unverifiedConfig=Object.assign({},t),!t)return;const i=this.verifyConfig(t);i.name||(i.name=c.basename(i.filename));const o=u.actionConfigToCompiledGraphTarget(i);return this.proto.target=this.applySessionToTarget(o,e.projectConfig,i.filename,{validateTarget:!0}),this.proto.canonicalTarget=this.applySessionToTarget(o,e.canonicalProjectConfig),n&&(i.filename=u.resolveActionsConfigFilename(i.filename,n),this.query(u.nativeRequire(i.filename).query)),i.filename&&(this.proto.fileName=i.filename),i.dependOnDependencyAssertions&&this.setDependOnDependencyAssertions(i.dependOnDependencyAssertions),i.dependencyTargets&&this.dependencies(i.dependencyTargets.map((e=>u.configTargetToCompiledGraphTarget(p.sqlanvil.ActionConfig.Target.create(e))))),void 0!==i.hermetic&&this.hermetic(i.hermetic),i.disabled&&this.disabled(),i.tags&&this.tags(i.tags),i.description&&this.description(i.description),i.metadata&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.metadata=i.metadata),(null===(r=i.columns)||void 0===r?void 0:r.length)&&this.columns(i.columns.map((e=>p.sqlanvil.ActionConfig.ColumnDescriptor.create(e)))),i.project&&this.database(i.project),i.dataset&&this.schema(i.dataset),i.assertions&&this.assertions(p.sqlanvil.ActionConfig.TableAssertionsConfig.create(i.assertions)),i.materialized&&this.materialized(i.materialized),i.postgres&&this.postgres(i.postgres),i.preOperations&&this.preOps(i.preOperations),i.postOperations&&this.postOps(i.postOperations),(Object.keys(i.labels).length||Object.keys(i.additionalOptions).length||i.partitionBy.length>0||i.clusterBy.length>0)&&this.bigquery({partitionBy:i.partitionBy,clusterBy:i.clusterBy,labels:i.labels,additionalOptions:i.additionalOptions}),i.reservation&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.reservation=i.reservation),this}type(e){let t;switch(e){case"table":t=new s.Table(this.session,Object.assign(Object.assign({},this.unverifiedConfig),{type:"table"}),this.configPath);break;case"incremental":t=new a.IncrementalTable(this.session,Object.assign(Object.assign({},this.unverifiedConfig),{type:"incremental"}),this.configPath);break;case"view":return this;default:throw new Error(`Unexpected table type: ${e}`)}const n=this.session.actions.indexOf(this);if(-1===n)throw Error("Expected pre-existing action, but none found. Please report this to the sqlanvil team.");this.session.actions[n]=t}query(e){return this.contextableQuery=e,this}where(e){return this.contextableWhere=e,this}preOps(e){return this.contextablePreOps.push(e),this}postOps(e){return this.contextablePostOps.push(e),this}disabled(e=!0){var t;return this.proto.disabled=e,this.uniqueKeyAssertions.forEach((t=>t.disabled(e))),null===(t=this.rowConditionsAssertion)||void 0===t||t.disabled(e),this}materialized(e){this.proto.materialized=e}postgres(e){this.proto.postgres=p.sqlanvil.PostgresOptions.create(e)}bigquery(e){return this.proto.bigquery=p.sqlanvil.BigQueryOptions.create(e),e.labels&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.bigqueryLabels=e.labels),this}dependencies(e){return(Array.isArray(e)?e:[e]).forEach((e=>{const t=u.checkAssertionsForDependency(this,e);t&&this.proto.dependencyTargets.push(t)})),this}hermetic(e){this.proto.hermeticity=e?p.sqlanvil.ActionHermeticity.HERMETIC:p.sqlanvil.ActionHermeticity.NON_HERMETIC}tags(e){var t;return("string"==typeof e?[e]:e).forEach((e=>{this.proto.tags.push(e)})),this.uniqueKeyAssertions.forEach((t=>t.tags(e))),null===(t=this.rowConditionsAssertion)||void 0===t||t.tags(e),this}description(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.description=e,this}columns(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.columns=l.ColumnDescriptors.mapConfigProtoToCompilationProto(e),this}database(e){return this.proto.target=this.applySessionToTarget(p.sqlanvil.Target.create(Object.assign(Object.assign({},this.proto.target),{database:e})),this.session.projectConfig,this.proto.fileName,{validateTarget:!0}),this}schema(e){return this.proto.target=this.applySessionToTarget(p.sqlanvil.Target.create(Object.assign(Object.assign({},this.proto.target),{schema:e})),this.session.projectConfig,this.proto.fileName,{validateTarget:!0}),this}assertions(e){const t=this.generateInlineAssertions(e,this.proto);return this.uniqueKeyAssertions=t.uniqueKeyAssertions,this.rowConditionsAssertion=t.rowConditionsAssertion,this}setDependOnDependencyAssertions(e){return this.dependOnDependencyAssertions=e,this}jitCode(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.compilationMode=p.sqlanvil.ActionCompilationMode.ACTION_COMPILATION_MODE_JIT,this.contextableJitCode=e,this}getFileName(){return this.proto.fileName}getTarget(){return p.sqlanvil.Target.create(this.proto.target)}compile(){return this.contextableJitCode?this.compileJit():this.compileAot(),i.verifyObjectMatchesProto(p.sqlanvil.Table,this.proto,i.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM)}compileJit(){u.validateNoMixedCompilationMode(this.session,this.getFileName(),this.contextableQuery,this.contextableWhere,this.contextablePostOps,this.contextablePreOps),this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.jitCode=this.contextableJitCode.toString()}compileAot(){const e=new d(this),t=new d(this,!0);this.proto.query=e.apply(this.contextableQuery),this.proto.enumType===p.sqlanvil.TableType.INCREMENTAL&&(this.proto.incrementalQuery=t.apply(this.contextableQuery),this.proto.incrementalPreOps=this.contextifyOps(this.contextablePreOps,t),this.proto.incrementalPostOps=this.contextifyOps(this.contextablePostOps,t)),this.contextableWhere&&(this.proto.where=e.apply(this.contextableWhere)),this.proto.preOps=this.contextifyOps(this.contextablePreOps,e).filter((e=>!!e.trim())),this.proto.postOps=this.contextifyOps(this.contextablePostOps,e).filter((e=>!!e.trim())),u.validateQueryString(this.session,this.proto.query,this.proto.fileName),u.validateQueryString(this.session,this.proto.incrementalQuery,this.proto.fileName)}contextifyOps(e,t){let n=[];return e.forEach((e=>{const r=t.apply(e);n=n.concat("string"==typeof r?[r]:r)})),n}verifyConfig(e){e.type&&(delete e.type,e.dependencies&&(e.dependencyTargets=e.dependencies.map((e=>u.resolvableAsActionConfigTarget(e))),delete e.dependencies),e.database&&(e.project=e.database,delete e.database),e.schema&&(e.dataset=e.schema,delete e.schema),e.fileName&&(e.filename=e.fileName,delete e.fileName),e.columns&&(e.columns=l.ColumnDescriptors.mapLegacyObjectToConfigProto(e.columns)),(null==(e=o.LegacyConfigConverter.insertLegacyInlineAssertionsToConfigProto(e))?void 0:e.bigquery)&&(u.checkExcessProperties((e=>{throw e}),e.bigquery,u.strictKeysOf()(["labels","additionalOptions","partitionBy","clusterBy"]),"BigQuery view config"),e.bigquery.labels&&(e.labels=e.bigquery.labels,delete e.bigquery.labels),e.bigquery.additionalOptions&&(e.additionalOptions=e.bigquery.additionalOptions,delete e.bigquery.additionalOptions),e.bigquery.partitionBy&&(e.partitionBy=e.bigquery.partitionBy,delete e.bigquery.partitionBy),e.bigquery.clusterBy&&(e.clusterBy=e.bigquery.clusterBy,delete e.bigquery.clusterBy)));const t=i.verifyObjectMatchesProto(p.sqlanvil.ActionConfig.ViewConfig,e,i.VerifyProtoErrorBehaviour.SHOW_DOCS_LINK);return!t.materialized&&(t.partitionBy.length>0||t.clusterBy.length>0)&&this.session.compileError("partitionBy/clusterBy can be applied only to materialized views",t.filename,p.sqlanvil.Target.create({database:t.project,schema:t.dataset,name:t.name})),t}}t.View=f;class d{constructor(e,t=!1){this.view=e,this.isIncremental=t}self(){return this.resolve(this.view.getTarget())}name(){return this.view.session.finalizeName(this.view.getTarget().name)}ref(e,...t){return e=u.toResolvable(e,t),u.resolvableAsTarget(e)?(this.view.dependencies(e),this.resolve(e)):(this.view.session.compileError(new Error("Action name is not specified")),"")}resolve(e,...t){return this.view.session.resolve(e,...t)}schema(){return this.view.session.finalizeSchema(this.view.getTarget().schema)}database(){return this.view.getTarget().database?this.view.session.finalizeDatabase(this.view.getTarget().database):(this.view.session.compileError(new Error("Warehouse does not support multiple databases")),"")}where(e){return this.view.where(e),""}when(e,t,n=""){return e?t:n}incremental(){return!!this.isIncremental}preOps(e){return this.view.preOps(e),""}postOps(e){return this.view.postOps(e),""}disabled(){return this.view.disabled(),""}bigquery(e){return this.view.bigquery(e),""}dependencies(e){return this.view.dependencies(e),""}apply(e){return"function"==typeof e?e(this):e}tags(e){return this.view.tags(e),""}}t.ViewContext=d},9100(e,t,n){"use strict";var r=e.exports=n(5325);r.build="full",r.tokenize=n(527),r.parse=n(4863),r.common=n(5095),r.Root._configure(r.Type,r.parse,r.common)},9198(e,t,n){"use strict";var r=n(5388);e.exports=new r("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"})},9207(e,t){"use strict";var n=t,r=n.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},i=n.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),n=r(e),i="";n&&(i=t.shift()+"/");for(var o=0;o<t.length;)".."===t[o]?o>0&&".."!==t[o-1]?t.splice(--o,2):n?t.splice(o,1):++o:"."===t[o]?t.splice(o,1):++o;return i+t.join("/")};n.resolve=function(e,t,n){return n||(t=i(t)),r(t)?t:(n||(e=i(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?i(e+"/"+t):t)}},9243(e,t,n){"use strict";var r=n(8433),i=n(1231),o=n(8083),a=n(5489),s=Object.prototype.hasOwnProperty,l=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,c=/[\x85\u2028\u2029]/,u=/[,\[\]\{\}]/,p=/^(?:!|!!|![a-z\-]+!)$/i,f=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function d(e){return Object.prototype.toString.call(e)}function g(e){return 10===e||13===e}function h(e){return 9===e||32===e}function y(e){return 9===e||32===e||10===e||13===e}function b(e){return 44===e||91===e||93===e||123===e||125===e}function m(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function v(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e||9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"
":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function O(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}function T(e,t,n){"__proto__"===t?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}for(var w=new Array(256),j=new Array(256),P=0;P<256;P++)w[P]=v(P)?1:0,j[P]=v(P);function q(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||a,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function A(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=o(n),new i(t,n)}function C(e,t){throw A(e,t)}function S(e,t){e.onWarning&&e.onWarning.call(null,A(e,t))}var x={YAML:function(e,t,n){var r,i,o;null!==e.version&&C(e,"duplication of %YAML directive"),1!==n.length&&C(e,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&C(e,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),o=parseInt(r[2],10),1!==i&&C(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,1!==o&&2!==o&&S(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var r,i;2!==n.length&&C(e,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],p.test(r)||C(e,"ill-formed tag handle (first argument) of the TAG directive"),s.call(e.tagMap,r)&&C(e,'there is a previously declared suffix for "'+r+'" tag handle'),f.test(i)||C(e,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch(t){C(e,"tag prefix is malformed: "+i)}e.tagMap[r]=i}};function k(e,t,n,r){var i,o,a,s;if(t<n){if(s=e.input.slice(t,n),r)for(i=0,o=s.length;i<o;i+=1)9===(a=s.charCodeAt(i))||32<=a&&a<=1114111||C(e,"expected valid JSON character");else l.test(s)&&C(e,"the stream contains non-printable characters");e.result+=s}}function E(e,t,n,i){var o,a,l,c;for(r.isObject(n)||C(e,"cannot merge mappings; the provided source object is unacceptable"),l=0,c=(o=Object.keys(n)).length;l<c;l+=1)a=o[l],s.call(t,a)||(T(t,a,n[a]),i[a]=!0)}function N(e,t,n,r,i,o,a,l,c){var u,p;if(Array.isArray(i))for(u=0,p=(i=Array.prototype.slice.call(i)).length;u<p;u+=1)Array.isArray(i[u])&&C(e,"nested arrays are not supported inside keys"),"object"==typeof i&&"[object Object]"===d(i[u])&&(i[u]="[object Object]");if("object"==typeof i&&"[object Object]"===d(i)&&(i="[object Object]"),i=String(i),null===t&&(t={}),"tag:yaml.org,2002:merge"===r)if(Array.isArray(o))for(u=0,p=o.length;u<p;u+=1)E(e,t,o[u],n);else E(e,t,o,n);else e.json||s.call(n,i)||!s.call(t,i)||(e.line=a||e.line,e.lineStart=l||e.lineStart,e.position=c||e.position,C(e,"duplicated mapping key")),T(t,i,o),delete n[i];return t}function D(e){var t;10===(t=e.input.charCodeAt(e.position))?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):C(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function R(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);0!==i;){for(;h(i);)9===i&&-1===e.firstTabInLine&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&35===i)do{i=e.input.charCodeAt(++e.position)}while(10!==i&&13!==i&&0!==i);if(!g(i))break;for(D(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;32===i;)e.lineIndent++,i=e.input.charCodeAt(++e.position)}return-1!==n&&0!==r&&e.lineIndent<n&&S(e,"deficient indentation"),r}function _(e){var t,n=e.position;return!(45!==(t=e.input.charCodeAt(n))&&46!==t||t!==e.input.charCodeAt(n+1)||t!==e.input.charCodeAt(n+2)||(n+=3,0!==(t=e.input.charCodeAt(n))&&!y(t)))}function I(e,t){1===t?e.result+=" ":t>1&&(e.result+=r.repeat("\n",t-1))}function L(e,t){var n,r,i=e.tag,o=e.anchor,a=[],s=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),r=e.input.charCodeAt(e.position);0!==r&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,C(e,"tab characters must not be used in indentation")),45===r)&&y(e.input.charCodeAt(e.position+1));)if(s=!0,e.position++,R(e,!0,-1)&&e.lineIndent<=t)a.push(null),r=e.input.charCodeAt(e.position);else if(n=e.line,F(e,t,3,!1,!0),a.push(e.result),R(e,!0,-1),r=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==r)C(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return!!s&&(e.tag=i,e.anchor=o,e.kind="sequence",e.result=a,!0)}function M(e){var t,n,r,i,o=!1,a=!1;if(33!==(i=e.input.charCodeAt(e.position)))return!1;if(null!==e.tag&&C(e,"duplication of a tag property"),60===(i=e.input.charCodeAt(++e.position))?(o=!0,i=e.input.charCodeAt(++e.position)):33===i?(a=!0,n="!!",i=e.input.charCodeAt(++e.position)):n="!",t=e.position,o){do{i=e.input.charCodeAt(++e.position)}while(0!==i&&62!==i);e.position<e.length?(r=e.input.slice(t,e.position),i=e.input.charCodeAt(++e.position)):C(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==i&&!y(i);)33===i&&(a?C(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),p.test(n)||C(e,"named tag handle cannot contain such characters"),a=!0,t=e.position+1)),i=e.input.charCodeAt(++e.position);r=e.input.slice(t,e.position),u.test(r)&&C(e,"tag suffix cannot contain flow indicator characters")}r&&!f.test(r)&&C(e,"tag name cannot contain such characters: "+r);try{r=decodeURIComponent(r)}catch(t){C(e,"tag name is malformed: "+r)}return o?e.tag=r:s.call(e.tagMap,n)?e.tag=e.tagMap[n]+r:"!"===n?e.tag="!"+r:"!!"===n?e.tag="tag:yaml.org,2002:"+r:C(e,'undeclared tag handle "'+n+'"'),!0}function B(e){var t,n;if(38!==(n=e.input.charCodeAt(e.position)))return!1;for(null!==e.anchor&&C(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!y(n)&&!b(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&C(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function F(e,t,n,i,o){var a,l,c,u,p,f,d,v,T,P=1,q=!1,A=!1;if(null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=l=c=4===n||3===n,i&&R(e,!0,-1)&&(q=!0,e.lineIndent>t?P=1:e.lineIndent===t?P=0:e.lineIndent<t&&(P=-1)),1===P)for(;M(e)||B(e);)R(e,!0,-1)?(q=!0,c=a,e.lineIndent>t?P=1:e.lineIndent===t?P=0:e.lineIndent<t&&(P=-1)):c=!1;if(c&&(c=q||o),1!==P&&4!==n||(v=1===n||2===n?t:t+1,T=e.position-e.lineStart,1===P?c&&(L(e,T)||function(e,t,n){var r,i,o,a,s,l,c,u=e.tag,p=e.anchor,f={},d=Object.create(null),g=null,b=null,m=null,v=!1,O=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=f),c=e.input.charCodeAt(e.position);0!==c;){if(v||-1===e.firstTabInLine||(e.position=e.firstTabInLine,C(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),o=e.line,63!==c&&58!==c||!y(r)){if(a=e.line,s=e.lineStart,l=e.position,!F(e,n,2,!1,!0))break;if(e.line===o){for(c=e.input.charCodeAt(e.position);h(c);)c=e.input.charCodeAt(++e.position);if(58===c)y(c=e.input.charCodeAt(++e.position))||C(e,"a whitespace character is expected after the key-value separator within a block mapping"),v&&(N(e,f,d,g,b,null,a,s,l),g=b=m=null),O=!0,v=!1,i=!1,g=e.tag,b=e.result;else{if(!O)return e.tag=u,e.anchor=p,!0;C(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!O)return e.tag=u,e.anchor=p,!0;C(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===c?(v&&(N(e,f,d,g,b,null,a,s,l),g=b=m=null),O=!0,v=!0,i=!0):v?(v=!1,i=!0):C(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,c=r;if((e.line===o||e.lineIndent>t)&&(v&&(a=e.line,s=e.lineStart,l=e.position),F(e,t,4,!0,i)&&(v?b=e.result:m=e.result),v||(N(e,f,d,g,b,m,a,s,l),g=b=m=null),R(e,!0,-1),c=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&0!==c)C(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return v&&N(e,f,d,g,b,null,a,s,l),O&&(e.tag=u,e.anchor=p,e.kind="mapping",e.result=f),O}(e,T,v))||function(e,t){var n,r,i,o,a,s,l,c,u,p,f,d,g=!0,h=e.tag,b=e.anchor,m=Object.create(null);if(91===(d=e.input.charCodeAt(e.position)))a=93,c=!1,o=[];else{if(123!==d)return!1;a=125,c=!0,o={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=o),d=e.input.charCodeAt(++e.position);0!==d;){if(R(e,!0,t),(d=e.input.charCodeAt(e.position))===a)return e.position++,e.tag=h,e.anchor=b,e.kind=c?"mapping":"sequence",e.result=o,!0;g?44===d&&C(e,"expected the node content, but found ','"):C(e,"missed comma between flow collection entries"),f=null,s=l=!1,63===d&&y(e.input.charCodeAt(e.position+1))&&(s=l=!0,e.position++,R(e,!0,t)),n=e.line,r=e.lineStart,i=e.position,F(e,t,1,!1,!0),p=e.tag,u=e.result,R(e,!0,t),d=e.input.charCodeAt(e.position),!l&&e.line!==n||58!==d||(s=!0,d=e.input.charCodeAt(++e.position),R(e,!0,t),F(e,t,1,!1,!0),f=e.result),c?N(e,o,m,p,u,f,n,r,i):s?o.push(N(e,null,m,p,u,f,n,r,i)):o.push(u),R(e,!0,t),44===(d=e.input.charCodeAt(e.position))?(g=!0,d=e.input.charCodeAt(++e.position)):g=!1}C(e,"unexpected end of the stream within a flow collection")}(e,v)?A=!0:(l&&function(e,t){var n,i,o,a,s,l=1,c=!1,u=!1,p=t,f=0,d=!1;if(124===(a=e.input.charCodeAt(e.position)))i=!1;else{if(62!==a)return!1;i=!0}for(e.kind="scalar",e.result="";0!==a;)if(43===(a=e.input.charCodeAt(++e.position))||45===a)1===l?l=43===a?3:2:C(e,"repeat of a chomping mode identifier");else{if(!((o=48<=(s=a)&&s<=57?s-48:-1)>=0))break;0===o?C(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):u?C(e,"repeat of an indentation width identifier"):(p=t+o-1,u=!0)}if(h(a)){do{a=e.input.charCodeAt(++e.position)}while(h(a));if(35===a)do{a=e.input.charCodeAt(++e.position)}while(!g(a)&&0!==a)}for(;0!==a;){for(D(e),e.lineIndent=0,a=e.input.charCodeAt(e.position);(!u||e.lineIndent<p)&&32===a;)e.lineIndent++,a=e.input.charCodeAt(++e.position);if(!u&&e.lineIndent>p&&(p=e.lineIndent),g(a))f++;else{if(e.lineIndent<p){3===l?e.result+=r.repeat("\n",c?1+f:f):1===l&&c&&(e.result+="\n");break}for(i?h(a)?(d=!0,e.result+=r.repeat("\n",c?1+f:f)):d?(d=!1,e.result+=r.repeat("\n",f+1)):0===f?c&&(e.result+=" "):e.result+=r.repeat("\n",f):e.result+=r.repeat("\n",c?1+f:f),c=!0,u=!0,f=0,n=e.position;!g(a)&&0!==a;)a=e.input.charCodeAt(++e.position);k(e,n,e.position,!1)}}return!0}(e,v)||function(e,t){var n,r,i;if(39!==(n=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(k(e,r,e.position,!0),39!==(n=e.input.charCodeAt(++e.position)))return!0;r=e.position,e.position++,i=e.position}else g(n)?(k(e,r,i,!0),I(e,R(e,!1,t)),r=i=e.position):e.position===e.lineStart&&_(e)?C(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);C(e,"unexpected end of the stream within a single quoted scalar")}(e,v)||function(e,t){var n,r,i,o,a,s,l;if(34!==(s=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;0!==(s=e.input.charCodeAt(e.position));){if(34===s)return k(e,n,e.position,!0),e.position++,!0;if(92===s){if(k(e,n,e.position,!0),g(s=e.input.charCodeAt(++e.position)))R(e,!1,t);else if(s<256&&w[s])e.result+=j[s],e.position++;else if((a=120===(l=s)?2:117===l?4:85===l?8:0)>0){for(i=a,o=0;i>0;i--)(a=m(s=e.input.charCodeAt(++e.position)))>=0?o=(o<<4)+a:C(e,"expected hexadecimal character");e.result+=O(o),e.position++}else C(e,"unknown escape sequence");n=r=e.position}else g(s)?(k(e,n,r,!0),I(e,R(e,!1,t)),n=r=e.position):e.position===e.lineStart&&_(e)?C(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}C(e,"unexpected end of the stream within a double quoted scalar")}(e,v)?A=!0:function(e){var t,n,r;if(42!==(r=e.input.charCodeAt(e.position)))return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!y(r)&&!b(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&C(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),s.call(e.anchorMap,n)||C(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],R(e,!0,-1),!0}(e)?(A=!0,null===e.tag&&null===e.anchor||C(e,"alias node should not have any properties")):function(e,t,n){var r,i,o,a,s,l,c,u,p=e.kind,f=e.result;if(y(u=e.input.charCodeAt(e.position))||b(u)||35===u||38===u||42===u||33===u||124===u||62===u||39===u||34===u||37===u||64===u||96===u)return!1;if((63===u||45===u)&&(y(r=e.input.charCodeAt(e.position+1))||n&&b(r)))return!1;for(e.kind="scalar",e.result="",i=o=e.position,a=!1;0!==u;){if(58===u){if(y(r=e.input.charCodeAt(e.position+1))||n&&b(r))break}else if(35===u){if(y(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&_(e)||n&&b(u))break;if(g(u)){if(s=e.line,l=e.lineStart,c=e.lineIndent,R(e,!1,-1),e.lineIndent>=t){a=!0,u=e.input.charCodeAt(e.position);continue}e.position=o,e.line=s,e.lineStart=l,e.lineIndent=c;break}}a&&(k(e,i,o,!1),I(e,e.line-s),i=o=e.position,a=!1),h(u)||(o=e.position+1),u=e.input.charCodeAt(++e.position)}return k(e,i,o,!1),!!e.result||(e.kind=p,e.result=f,!1)}(e,v,1===n)&&(A=!0,null===e.tag&&(e.tag="?")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===P&&(A=c&&L(e,T))),null===e.tag)null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);else if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&C(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),u=0,p=e.implicitTypes.length;u<p;u+=1)if((d=e.implicitTypes[u]).resolve(e.result)){e.result=d.construct(e.result),e.tag=d.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else if("!"!==e.tag){if(s.call(e.typeMap[e.kind||"fallback"],e.tag))d=e.typeMap[e.kind||"fallback"][e.tag];else for(d=null,u=0,p=(f=e.typeMap.multi[e.kind||"fallback"]).length;u<p;u+=1)if(e.tag.slice(0,f[u].tag.length)===f[u].tag){d=f[u];break}d||C(e,"unknown tag !<"+e.tag+">"),null!==e.result&&d.kind!==e.kind&&C(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+d.kind+'", not "'+e.kind+'"'),d.resolve(e.result,e.tag)?(e.result=d.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):C(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||A}function U(e){var t,n,r,i,o=e.position,a=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(i=e.input.charCodeAt(e.position))&&(R(e,!0,-1),i=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==i));){for(a=!0,i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!y(i);)i=e.input.charCodeAt(++e.position);for(r=[],(n=e.input.slice(t,e.position)).length<1&&C(e,"directive name must not be less than one character in length");0!==i;){for(;h(i);)i=e.input.charCodeAt(++e.position);if(35===i){do{i=e.input.charCodeAt(++e.position)}while(0!==i&&!g(i));break}if(g(i))break;for(t=e.position;0!==i&&!y(i);)i=e.input.charCodeAt(++e.position);r.push(e.input.slice(t,e.position))}0!==i&&D(e),s.call(x,n)?x[n](e,n,r):S(e,'unknown document directive "'+n+'"')}R(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,R(e,!0,-1)):a&&C(e,"directives end mark is expected"),F(e,e.lineIndent-1,4,!1,!0),R(e,!0,-1),e.checkLineBreaks&&c.test(e.input.slice(o,e.position))&&S(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&_(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,R(e,!0,-1)):e.position<e.length-1&&C(e,"end of the stream or a document separator is expected")}function J(e,t){t=t||{},0!==(e=String(e)).length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var n=new q(e,t),r=e.indexOf("\0");for(-1!==r&&(n.position=r,C(n,"null byte is not allowed in input")),n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)U(n);return n.documents}e.exports.loadAll=function(e,t,n){null!==t&&"object"==typeof t&&void 0===n&&(n=t,t=null);var r=J(e,n);if("function"!=typeof t)return r;for(var i=0,o=r.length;i<o;i+=1)t(r[i])},e.exports.load=function(e,t){var n=J(e,t);if(0!==n.length){if(1===n.length)return n[0];throw new i("expected a single document in the stream, but found more")}}},9293(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=n(8512),o=n(5436),a=n(8545),s=r(n(9553)),l=n(2545),c=n(5379);class u extends o.ActionBuilder{constructor(e,t,n){var r;if(super(e),this.dependOnDependencyAssertions=!1,this.proto=c.sqlanvil.Operation.create(),this.session=e,!t)return;const i=this.verifyConfig(t);i.name||(i.name=s.basename(i.filename));const o=l.actionConfigToCompiledGraphTarget(i);return this.proto.target=this.applySessionToTarget(o,e.projectConfig,i.filename,{validateTarget:!0}),this.proto.canonicalTarget=this.applySessionToTarget(o,e.canonicalProjectConfig),n&&(i.filename=l.resolveActionsConfigFilename(i.filename,n),this.queries(l.nativeRequire(i.filename).query)),i.dependOnDependencyAssertions&&this.setDependOnDependencyAssertions(i.dependOnDependencyAssertions),i.dependencyTargets&&this.dependencies(i.dependencyTargets.map((e=>l.configTargetToCompiledGraphTarget(c.sqlanvil.ActionConfig.Target.create(e))))),void 0!==i.hermetic&&this.hermetic(i.hermetic),i.disabled&&this.disabled(),i.tags&&this.tags(i.tags),i.hasOutput&&this.hasOutput(i.hasOutput),i.description&&this.description(i.description),(null===(r=i.columns)||void 0===r?void 0:r.length)&&this.columns(i.columns.map((e=>c.sqlanvil.ActionConfig.ColumnDescriptor.create(e)))),i.project&&this.database(i.project),i.dataset&&this.schema(i.dataset),i.filename&&(this.proto.fileName=i.filename),i.reservation&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.reservation=i.reservation),this}queries(e){return this.contextableQueries=e,this}jitCode(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.compilationMode=c.sqlanvil.ActionCompilationMode.ACTION_COMPILATION_MODE_JIT,this.contextableJitCode=e,this}dependencies(e){return(Array.isArray(e)?e:[e]).forEach((e=>{const t=l.checkAssertionsForDependency(this,e);t&&this.proto.dependencyTargets.push(t)})),this}hermetic(e){this.proto.hermeticity=e?c.sqlanvil.ActionHermeticity.HERMETIC:c.sqlanvil.ActionHermeticity.NON_HERMETIC}disabled(e=!0){return this.proto.disabled=e,this}tags(e){return("string"==typeof e?[e]:e).forEach((e=>{this.proto.tags.indexOf(e)<0&&this.proto.tags.push(e)})),this}hasOutput(e){return this.proto.hasOutput=e,this}description(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.description=e,this}columns(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.columns=a.ColumnDescriptors.mapConfigProtoToCompilationProto(e),this}database(e){return this.proto.target=this.applySessionToTarget(c.sqlanvil.Target.create(Object.assign(Object.assign({},this.proto.target),{database:e})),this.session.projectConfig,this.proto.fileName,{validateTarget:!0}),this}schema(e){return this.proto.target=this.applySessionToTarget(c.sqlanvil.Target.create(Object.assign(Object.assign({},this.proto.target),{schema:e})),this.session.projectConfig,this.proto.fileName,{validateTarget:!0}),this}setDependOnDependencyAssertions(e){return this.dependOnDependencyAssertions=e,this}getFileName(){return this.proto.fileName}getTarget(){return c.sqlanvil.Target.create(this.proto.target)}getHasOutput(){return this.proto.hasOutput}compile(){var e,t;if((null===(t=null===(e=this.proto.actionDescriptor)||void 0===e?void 0:e.columns)||void 0===t?void 0:t.length)>0&&!this.proto.hasOutput&&this.session.compileError(new Error("Actions of type 'operations' may only describe columns if they specify 'hasOutput: true'."),this.proto.fileName),this.contextableJitCode)this.compileJit();else{const e=new p(this).apply(this.contextableQueries);this.proto.queries="string"==typeof e?[e]:e}return i.verifyObjectMatchesProto(c.sqlanvil.Operation,this.proto,i.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM)}compileJit(){if(this.contextableQueries){const e=new Error(`Cannot mix AoT and JiT compilation in action: ${this.contextableQueries}`);throw this.session.compileError(e,this.getFileName()),e}this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.jitCode=this.contextableJitCode.toString()}verifyConfig(e){return e.type&&(delete e.type,e.dependencies&&(e.dependencyTargets=e.dependencies.map((e=>l.resolvableAsActionConfigTarget(e))),delete e.dependencies),e.database&&(e.project=e.database,delete e.database),e.schema&&(e.dataset=e.schema,delete e.schema),e.fileName&&(e.filename=e.fileName,delete e.fileName),e.columns&&(e.columns=a.ColumnDescriptors.mapLegacyObjectToConfigProto(e.columns))),i.verifyObjectMatchesProto(c.sqlanvil.ActionConfig.OperationConfig,e,i.VerifyProtoErrorBehaviour.SHOW_DOCS_LINK)}}t.Operation=u;class p{constructor(e){this.operation=e}self(){return this.resolve(this.operation.getTarget())}name(){return this.operation.session.finalizeName(this.operation.getTarget().name)}ref(e,...t){return e=l.toResolvable(e,t),l.resolvableAsTarget(e)?(this.operation.dependencies(e),this.resolve(e)):(this.operation.session.compileError(new Error("Action name is not specified")),"")}resolve(e,...t){return this.operation.session.resolve(e,...t)}schema(){return this.operation.session.finalizeSchema(this.operation.getTarget().schema)}database(){return this.operation.getTarget().database?this.operation.session.finalizeDatabase(this.operation.getTarget().database):(this.operation.session.compileError(new Error("Warehouse does not support multiple databases")),"")}dependencies(e){return this.operation.dependencies(e),""}tags(e){return this.operation.tags(e),""}hasOutput(e){return this.operation.hasOutput(e),""}when(e,t,n=""){return e?t:n}apply(e){return"function"==typeof e?e(this):e}}t.OperationContext=p},9342(e,t,n){"use strict";var r=n(5388),i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";e.exports=new r("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=0,o=e.length,a=i;for(n=0;n<o;n++)if(!((t=a.indexOf(e.charAt(n)))>64)){if(t<0)return!1;r+=6}return r%8==0},construct:function(e){var t,n,r=e.replace(/[\r\n=]/g,""),o=r.length,a=i,s=0,l=[];for(t=0;t<o;t++)t%4==0&&t&&(l.push(s>>16&255),l.push(s>>8&255),l.push(255&s)),s=s<<6|a.indexOf(r.charAt(t));return 0==(n=o%4*6)?(l.push(s>>16&255),l.push(s>>8&255),l.push(255&s)):18===n?(l.push(s>>10&255),l.push(s>>2&255)):12===n&&l.push(s>>4&255),new Uint8Array(l)},predicate:function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function(e){var t,n,r="",o=0,a=e.length,s=i;for(t=0;t<a;t++)t%3==0&&t&&(r+=s[o>>18&63],r+=s[o>>12&63],r+=s[o>>6&63],r+=s[63&o]),o=(o<<8)+e[t];return 0==(n=a%3)?(r+=s[o>>18&63],r+=s[o>>12&63],r+=s[o>>6&63],r+=s[63&o]):2===n?(r+=s[o>>10&63],r+=s[o>>4&63],r+=s[o<<2&63],r+=s[64]):1===n&&(r+=s[o>>2&63],r+=s[o<<4&63],r+=s[64],r+=s[64]),r}})},9364(e){class t{constructor(e,t){this.name=e,this.successors=t,this.reset()}reset(){this.index=-1,this.lowLink=-1,this.onStack=!1,this.visited=!1}}class n{constructor(){this.vertices={}}add(e,n){const r=(n=Array.isArray(n)?n:[n]).map((e=>(this.vertices[e]||(this.vertices[e]=new t(e,[])),this.vertices[e])));return this.vertices[e]||(this.vertices[e]=new t(e)),this.vertices[e].successors=r.concat([]).reverse(),this}reset(){Object.keys(this.vertices).forEach((e=>{this.vertices[e].reset()}))}addAndVerify(e,t){this.add(e,t);const n=this.getCycles();if(n.length){let e=`Detected ${n.length} cycle${1===n.length?"":"s"}:`;e+="\n"+n.map((e=>{const t=e.map((e=>e.name));return` ${t.join(" -> ")} -> ${t[0]}`})).join("\n");const t=new Error(e);throw t.cycles=n,t}return this}dfs(e,t){this.reset();const n=[this.vertices[e]];let r;for(;r=n.pop();)r.visited||(t(r),r.visited=!0,r.successors.forEach((e=>n.push(e))))}getDescendants(e){const t=[];let n=!0;return this.dfs(e,(e=>{n?n=!1:t.push(e.name)})),t}hasCycle(){return this.getCycles().length>0}getStronglyConnectedComponents(){const e=Object.keys(this.vertices).map((e=>(this.vertices[e].reset(),this.vertices[e])));let t=0;const n=[],r=[],i=e=>{if(e.index=t,e.lowLink=t,t++,n.push(e),e.onStack=!0,e.successors.forEach((t=>{t.index<0?(i(t),e.lowLink=Math.min(e.lowLink,t.lowLink)):t.onStack&&(e.lowLink=Math.min(e.lowLink,t.index))})),e.lowLink===e.index){const t=[];let i;do{i=n.pop(),i.onStack=!1,t.push(i)}while(i!==e);r.push(t)}};return e.forEach((function(e){e.index<0&&i(e)})),r}getCycles(){return this.getStronglyConnectedComponents().filter((e=>{if(e.length>1)return!0;const t=e[0];return t&&t.successors.some((e=>e===t))}))}clone(){const e=new n;return Object.keys(this.vertices).forEach((t=>{const n=this.vertices[t];e.add(n.name,n.successors.map((e=>e.name)))})),e}toDot(){const e=this.vertices,t=["digraph {"];return this.getCycles().forEach(((e,n)=>{t.push(" subgraph cluster"+n+" {"),t.push(" color=red;"),t.push(" "+e.map((e=>e.name)).join("; ")+";"),t.push(" }")})),Object.keys(e).forEach((n=>{const r=e[n];r.successors.length&&r.successors.forEach((e=>{t.push(` ${r.name} -> ${e.name}`)}))})),t.push("}"),t.join("\n")+"\n"}}e.exports=n},9390(e){"use strict";e.exports=function(e,t,n){var r=n||8192,i=r>>>1,o=null,a=r;return function(n){if(n<1||n>i)return e(n);a+n>r&&(o=e(r),a=0);var s=t.call(o,a,a+=n);return 7&a&&(a=1+(7|a)),s}}},9410(e){"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=128===n[3];function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3]}function o(e,r,i){t[0]=e,r[i]=n[3],r[i+1]=n[2],r[i+2]=n[1],r[i+3]=n[0]}function a(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function s(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.writeFloatLE=r?i:o,e.writeFloatBE=r?o:i,e.readFloatLE=r?a:s,e.readFloatBE=r?s:a}():function(){function t(e,t,n,r){var i=t<0?1:0;if(i&&(t=-t),0===t)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var o=Math.floor(Math.log(t)/Math.LN2);e((i<<31|o+127<<23|8388607&Math.round(t*Math.pow(2,-o)*8388608))>>>0,n,r)}}function a(e,t,n){var r=e(t,n),i=2*(r>>31)+1,o=r>>>23&255,a=8388607&r;return 255===o?a?NaN:i*(1/0):0===o?1401298464324817e-60*i*a:i*Math.pow(2,o-150)*(a+8388608)}e.writeFloatLE=t.bind(null,n),e.writeFloatBE=t.bind(null,r),e.readFloatLE=a.bind(null,i),e.readFloatBE=a.bind(null,o)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=128===n[7];function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3],r[i+4]=n[4],r[i+5]=n[5],r[i+6]=n[6],r[i+7]=n[7]}function o(e,r,i){t[0]=e,r[i]=n[7],r[i+1]=n[6],r[i+2]=n[5],r[i+3]=n[4],r[i+4]=n[3],r[i+5]=n[2],r[i+6]=n[1],r[i+7]=n[0]}function a(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function s(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.writeDoubleLE=r?i:o,e.writeDoubleBE=r?o:i,e.readDoubleLE=r?a:s,e.readDoubleBE=r?s:a}():function(){function t(e,t,n,r,i,o){var a=r<0?1:0;if(a&&(r=-r),0===r)e(0,i,o+t),e(1/r>0?0:2147483648,i,o+n);else if(isNaN(r))e(0,i,o+t),e(2146959360,i,o+n);else if(r>17976931348623157e292)e(0,i,o+t),e((a<<31|2146435072)>>>0,i,o+n);else{var s;if(r<22250738585072014e-324)e((s=r/5e-324)>>>0,i,o+t),e((a<<31|s/4294967296)>>>0,i,o+n);else{var l=Math.floor(Math.log(r)/Math.LN2);1024===l&&(l=1023),e(4503599627370496*(s=r*Math.pow(2,-l))>>>0,i,o+t),e((a<<31|l+1023<<20|1048576*s&1048575)>>>0,i,o+n)}}}function a(e,t,n,r,i){var o=e(r,i+t),a=e(r,i+n),s=2*(a>>31)+1,l=a>>>20&2047,c=4294967296*(1048575&a)+o;return 2047===l?c?NaN:s*(1/0):0===l?5e-324*s*c:s*Math.pow(2,l-1075)*(c+4503599627370496)}e.writeDoubleLE=t.bind(null,n,0,4),e.writeDoubleBE=t.bind(null,r,4,0),e.readDoubleLE=a.bind(null,i,0,4),e.readDoubleBE=a.bind(null,o,4,0)}(),e}function n(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function r(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=255&e}function i(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},9553(e,t){"use strict";function n(e){return e.split(t.separator).slice(-1)[0]}function r(e){const t=n(e);return t.substring(0,t.lastIndexOf("."))}Object.defineProperty(t,"__esModule",{value:!0}),t.separator="undefined"!=typeof process&&"win32"===process.platform?"\\":"/",t.relativePath=function(e,n){if(0===n.length)return e;const r=e.substr(n.length);return r.startsWith(t.separator)?r.substr(1):r},t.filename=n,t.basename=r,t.dirName=function(e){return e.slice(0,e.lastIndexOf(t.separator))},t.join=function(...e){return e.map((e=>(e.startsWith(t.separator)&&(e=e.slice(1)),e.endsWith(t.separator)&&(e=e.slice(0,-1)),e))).join(t.separator)},t.escapedBasename=function(e){return r(e).replace(/\\/g,"\\\\")},t.fileExtension=function(e){return e.split(".").slice(-1)[0]},t.normalize=function(e){const t=[];let n=0;for(const r of e.split("/").filter((e=>!!e&&"."!==e)))".."===r?0===t.length?n++:t.pop():t.push(r);if(e.startsWith("/")){if(0===t.length)return"/";t.unshift("")}else if(t.unshift(...new Array(n).fill("..")),0===t.length)return".";return t.join("/")}},9687(e,t,n){"use strict";e.exports=s;var r=n(8923);((s.prototype=Object.create(r.prototype)).constructor=s).className="Service";var i=n(8811),o=n(3262),a=n(5047);function s(e,t){r.call(this,e,t),this.methods={},this._methodsArray=null}function l(e){return e._methodsArray=null,e}s.fromJSON=function(e,t){var n=new s(e,t.options);if(t.methods)for(var r=Object.keys(t.methods),o=0;o<r.length;++o)n.add(i.fromJSON(r[o],t.methods[r[o]]));return t.nested&&n.addJSON(t.nested),t.edition&&(n._edition=t.edition),n.comment=t.comment,n._defaultEdition="proto3",n},s.prototype.toJSON=function(e){var t=r.prototype.toJSON.call(this,e),n=!!e&&Boolean(e.keepComments);return o.toObject(["edition",this._editionToJSON(),"options",t&&t.options||void 0,"methods",r.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",n?this.comment:void 0])},Object.defineProperty(s.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=o.toArray(this.methods))}}),s.prototype.get=function(e){return this.methods[e]||r.prototype.get.call(this,e)},s.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;r.prototype.resolve.call(this);for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return this},s.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,r.prototype._resolveFeaturesRecursive.call(this,e),this.methodsArray.forEach((t=>{t._resolveFeaturesRecursive(e)})),this):this},s.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof i?(this.methods[e.name]=e,e.parent=this,l(this)):r.prototype.add.call(this,e)},s.prototype.remove=function(e){if(e instanceof i){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,l(this)}return r.prototype.remove.call(this,e)},s.prototype.create=function(e,t,n){for(var r,i=new a.Service(e,t,n),s=0;s<this.methodsArray.length;++s){var l=o.lcFirst((r=this._methodsArray[s]).resolve().name).replace(/[^$\w_]/g,"");i[l]=o.codegen(["r","c"],o.isReserved(l)?l+"_":l)("return this.rpcCall(m,q,s,r,c)")({m:r,q:r.resolvedRequestType.ctor,s:r.resolvedResponseType.ctor})}return i}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}var __webpack_exports__={};(()=>{"use strict";var e=__webpack_exports__;Object.defineProperty(e,"__esModule",{value:!0});var t=__webpack_require__(472);e.compiler=t.compiler,e.indexFileGenerator=t.indexFileGenerator,e.jitCompiler=t.jitCompiler,e.main=t.main,e.session=t.session,e.supportedFeatures=t.supportedFeatures,e.version=t.version})(),module.exports=__webpack_exports__})();
|
|
15
|
+
(()=>{var __webpack_modules__={127(e,t,n){"use strict";var r=n(5388),i=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),o=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");e.exports=new r("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==i.exec(e)||null!==o.exec(e))},construct:function(e){var t,n,r,a,s,l,c,u,p=0,f=null;if(null===(t=i.exec(e))&&(t=o.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,a=+t[3],!t[4])return new Date(Date.UTC(n,r,a));if(s=+t[4],l=+t[5],c=+t[6],t[7]){for(p=t[7].slice(0,3);p.length<3;)p+="0";p=+p}return t[9]&&(f=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(f=-f)),u=new Date(Date.UTC(n,r,a,s,l,c,p)),f&&u.setTime(u.getTime()-f),u},instanceOf:Date,represent:function(e){return e.toISOString()}})},361(e,t,n){"use strict";var r=t,i=n(3262),o=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function a(e,t){var n=0,r={};for(t|=0;n<e.length;)r[o[n+t]]=e[n++];return r}r.basic=a([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),r.defaults=a([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",i.emptyArray,null]),r.long=a([0,0,0,1,1],7),r.mapKey=a([0,0,0,5,5,0,0,0,1,1,0,2],2),r.packed=a([1,5,0,0,0,5,5,0,0,0,1,1,0])},390(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=n(7210),o=r(n(9553)),a=n(3165),s=["self","ref","resolve","name","when","incremental","schema","database"].map((e=>`const ${e} = ctx.${e} ? ctx.${e}.bind(ctx) : undefined;`)).join("\n"),l=["EXPECT"].map((e=>`const ${e} = ctx.${e} ? ctx.${e} : undefined;`)).join("\n");function c(e){const t=[""];return e.forEach((e=>{"string"==typeof e||e.type!==a.SyntaxTreeNodeType.SQL_STATEMENT_SEPARATOR?t[t.length-1]+=function(e){return"string"==typeof e?u.get(a.SyntaxTreeNodeType.SQL_LITERAL_STRING)(e):e.concatenate(u)}(e):t.push("")})),t}t.INVALID_YAML_ERROR_STRING="is not a valid YAML file",t.compile=function(e,n){if("sqlx"===o.fileExtension(n))return function(e,t){const{config:n,js:r,sql:i,incremental:u,preOperations:p,postOperations:f,inputs:d}=function(e){let t="",n="";e.children().filter(a.SyntaxTreeNode.isSyntaxTreeNode).filter((e=>e.type===a.SyntaxTreeNodeType.JAVASCRIPT)).forEach((e=>{const r=e.concatenate();r.startsWith("config")?t=r.slice(7):n+=r.slice(4,-1)}));const r=c(e.children().filter((e=>"string"==typeof e||[a.SyntaxTreeNodeType.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER,a.SyntaxTreeNodeType.SQL_COMMENT,a.SyntaxTreeNodeType.SQL_LITERAL_STRING,a.SyntaxTreeNodeType.SQL_LITERAL_MULTILINE_STRING,a.SyntaxTreeNodeType.SQL_STATEMENT_SEPARATOR].includes(e.type))));let i="",o=[],s=[];const l=[];return e.children().filter(a.SyntaxTreeNode.isSyntaxTreeNode).filter((e=>e.type===a.SyntaxTreeNodeType.SQL)).forEach((e=>{const t=e.children()[0],n=e.children().slice(-1)[0],r=c((1===e.children().length?new a.SyntaxTreeNode(a.SyntaxTreeNodeType.SQL,[t.slice(t.indexOf("{")+1,t.lastIndexOf("}"))]):new a.SyntaxTreeNode(a.SyntaxTreeNodeType.SQL,[t.slice(t.indexOf("{")+1),...e.children().slice(1,-1),n.slice(0,n.lastIndexOf("}"))])).children());if(t.startsWith("incremental_where")){if(r.length>1)throw new Error("'incremental_where' code blocks may only contain a single SQL statement.");i=r[0]}else if(t.startsWith("pre_operations"))o=r;else if(t.startsWith("post_operations"))s=r;else if(t.startsWith("input")){if(r.length>1)throw new Error("'input' code blocks may only contain a single SQL statement.");const e=t.slice(t.indexOf('"'),t.lastIndexOf('"')+1).split(",").map((e=>e.trim().slice(1,-1)));l.push({labelParts:e,value:r[0]})}})),{config:t,js:n,sql:r,incremental:i,preOperations:o,postOperations:s,inputs:l}}(e);return`sqlanvil.sqlxAction({\n sqlxConfig: {\n name: "${o.escapedBasename(t)}",\n type: "operations",\n ...${n||"{}"}\n },\n sqlStatementCount: ${i.length},\n sqlContextable: (ctx) => {\n ${s}\n ${l}\n ${r}\n return [${i.map((e=>`\`${e}\``))}];\n },\n incrementalWhereContextable: ${u?`(ctx) => {\n ${s}\n ${l}\n ${r}\n return \`${u}\`\n }`:"undefined"},\n preOperationsContextable: ${p.length>0?`(ctx) => {\n ${s}\n ${l}\n ${r}\n return [${p.map((e=>`\`${e}\``))}];\n }`:"undefined"},\n postOperationsContextable: ${f.length>0?`(ctx) => {\n ${s}\n ${l}\n ${r}\n return [${f.map((e=>`\`${e}\``))}];\n }`:"undefined"},\n inputContextables: [\n ${d.map((({labelParts:e,value:t})=>`{\n refName: [${e.map((e=>`"${e}"`)).join(", ")}],\n contextable: (ctx) => {\n ${r}\n return \`${t}\`;\n }\n }`)).join(",")}\n ]\n});\n`}(a.SyntaxTreeNode.create(e),n);if("yaml"===o.fileExtension(n)||"yml"===o.fileExtension(n))try{const t=i.load(e);return`exports.asJson = ${JSON.stringify(t)}`}catch(e){if(e instanceof i.YAMLException)throw new Error(`${n} ${t.INVALID_YAML_ERROR_STRING}: ${e}`);throw e}if("ipynb"===o.fileExtension(n)){let t={};try{t=JSON.parse(e)}catch(e){throw new Error(`Error parsing ${n} as JSON: ${e}`)}return`exports.asJson = ${JSON.stringify(t)}`}return"sql"===o.fileExtension(n)?`exports.query = \`${e.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\${/g,"\\${")}\`;`:e},t.extractJsBlocks=function(e){const t=[];return{sql:e.replace(/^\s*\/\*[jJ][sS]\s*[\r\n]+((?:[^*]|[\r\n]|(?:\*+(?:[^*/]|[\r\n])))*)\*+\/|^\s*\-\-[jJ][sS]\s(.*)/gm,((e,n,r)=>(n&&t.push(n),r&&t.push(r),""))).replace(/([^\\])`/g,((e,t)=>t+"\\`")).trim(),js:t.map((e=>e.trim())).join("\n")}};const u=new Map([[a.SyntaxTreeNodeType.SQL_COMMENT,e=>e.replace(/`/g,"\\`").replace(/\${/g,"\\${")],[a.SyntaxTreeNodeType.SQL_LITERAL_STRING,e=>e.replace(/\\/g,"\\\\").replace(/\`/g,"\\`")],[a.SyntaxTreeNodeType.SQL_LITERAL_MULTILINE_STRING,e=>e.replace(/\\/g,"\\\\").replace(/\`/g,"\\`")]])},420(e,t,n){"use strict";e.exports=function(e){var t=i.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),n={};e.oneofsArray.length&&t("var p={}");for(var r=0;r<e.fieldsArray.length;++r){var l=e._fieldsArray[r].resolve(),c="m"+i.safeProp(l.name);if(l.optional&&t("if(%s!=null&&m.hasOwnProperty(%j)){",c,l.name),l.map)t("if(!util.isObject(%s))",c)("return%j",o(l,"object"))("var k=Object.keys(%s)",c)("for(var i=0;i<k.length;++i){"),s(t,l,"k[i]"),a(t,l,r,c+"[k[i]]")("}");else if(l.repeated)t("if(!Array.isArray(%s))",c)("return%j",o(l,"array"))("for(var i=0;i<%s.length;++i){",c),a(t,l,r,c+"[i]")("}");else{if(l.partOf){var u=i.safeProp(l.partOf.name);1===n[l.partOf.name]&&t("if(p%s===1)",u)("return%j",l.partOf.name+": multiple values"),n[l.partOf.name]=1,t("p%s=1",u)}a(t,l,r,c)}l.optional&&t("}")}return t("return null")};var r=n(5643),i=n(3262);function o(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function a(e,t,n,i){if(t.resolvedType)if(t.resolvedType instanceof r){e("switch(%s){",i)("default:")("return%j",o(t,"enum value"));for(var a=Object.keys(t.resolvedType.values),s=0;s<a.length;++s)e("case %i:",t.resolvedType.values[a[s]]);e("break")("}")}else e("{")("var e=types[%i].verify(%s);",n,i)("if(e)")("return%j+e",t.name+".")("}");else switch(t.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.isInteger(%s))",i)("return%j",o(t,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",i,i,i,i)("return%j",o(t,"integer|Long"));break;case"float":case"double":e('if(typeof %s!=="number")',i)("return%j",o(t,"number"));break;case"bool":e('if(typeof %s!=="boolean")',i)("return%j",o(t,"boolean"));break;case"string":e("if(!util.isString(%s))",i)("return%j",o(t,"string"));break;case"bytes":e('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',i,i,i)("return%j",o(t,"buffer"))}return e}function s(e,t,n){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",n)("return%j",o(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",n)("return%j",o(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",n)("return%j",o(t,"boolean key"))}return e}},472(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(390);t.compiler=r.compile;const i=n(6899);t.jitCompiler=i.jitCompiler;const o=n(7983);t.main=o.main;const a=n(7180),s=n(2628);t.version=s.version;const l=n(5379),c=(global._DF_SESSION||(global._DF_SESSION=new a.Session),global._DF_SESSION);t.session=c;const u=[l.sqlanvil.SupportedFeatures.ARRAY_BUFFER_IPC];t.supportedFeatures=u,t.indexFileGenerator=function(){throw new Error("@sqlanvil/cli ^3.0.0 required.")}},527(e){"use strict";e.exports=p;var t=/[\s{}=;:[\],'"()<>]/g,n=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,r=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,i=/^ *[*/]+ */,o=/^\s*\*?\/*/,a=/\n/g,s=/\s/,l=/\\(.?)/g,c={0:"\0",r:"\r",n:"\n",t:"\t"};function u(e){return e.replace(l,(function(e,t){switch(t){case"\\":case"":return t;default:return c[t]||""}}))}function p(e,l){e=e.toString();var c=0,p=e.length,f=1,d=0,g={},h=[],y=null;function m(e){return Error("illegal "+e+" (line "+f+")")}function b(t){return e.charAt(t)}function v(t,n,r){var s,c={type:e.charAt(t++),lineEmpty:!1,leading:r},u=t-(l?2:3);do{if(--u<0||"\n"===(s=e.charAt(u))){c.lineEmpty=!0;break}}while(" "===s||"\t"===s);for(var p=e.substring(t,n).split(a),h=0;h<p.length;++h)p[h]=p[h].replace(l?o:i,"").trim();c.text=p.join("\n").trim(),g[f]=c,d=f}function O(t){var n=T(t),r=e.substring(t,n);return/^\s*\/\//.test(r)}function T(e){for(var t=e;t<p&&"\n"!==b(t);)t++;return t}function w(){if(h.length>0)return h.shift();if(y)return function(){var t="'"===y?r:n;t.lastIndex=c-1;var i=t.exec(e);if(!i)throw m("string");return c=t.lastIndex,j(y),y=null,u(i[1])}();var i,o,a,d,g,w=0===c;do{if(c===p)return null;for(i=!1;s.test(a=b(c));)if("\n"===a&&(w=!0,++f),++c===p)return null;if("/"===b(c)){if(++c===p)throw m("comment");if("/"===b(c))if(l){if(d=c,g=!1,O(c-1)){g=!0;do{if((c=T(c))===p)break;if(c++,!w)break}while(O(c))}else c=Math.min(p,T(c)+1);g&&(v(d,c,w),w=!0),f++,i=!0}else{for(g="/"===b(d=c+1);"\n"!==b(++c);)if(c===p)return null;++c,g&&(v(d,c-1,w),w=!0),++f,i=!0}else{if("*"!==(a=b(c)))return"/";d=c+1,g=l||"*"===b(d);do{if("\n"===a&&++f,++c===p)throw m("comment");o=a,a=b(c)}while("*"!==o||"/"!==a);++c,g&&(v(d,c-2,w),w=!0),i=!0}}}while(i);var q=c;if(t.lastIndex=0,!t.test(b(q++)))for(;q<p&&!t.test(b(q));)++q;var P=e.substring(c,c=q);return'"'!==P&&"'"!==P||(y=P),P}function j(e){h.push(e)}function q(){if(!h.length){var e=w();if(null===e)return null;j(e)}return h[0]}return Object.defineProperty({next:w,peek:q,push:j,skip:function(e,t){var n=q();if(n===e)return w(),!0;if(!t)throw m("token '"+n+"', '"+e+"' expected");return!1},cmnt:function(e){var t,n=null;return void 0===e?(t=g[f-1],delete g[f-1],t&&(l||"*"===t.type||t.lineEmpty)&&(n=t.leading?t.text:null)):(d<e&&q(),t=g[e],delete g[e],!t||t.lineEmpty||!l&&"/"!==t.type||(n=t.leading?null:t.text)),n}},"line",{get:function(){return f}})}p.unescape=u},744(e,t,n){"use strict";var r=t,i=n(5643),o=n(3262);function a(e,t,n,r){var o=!1;if(t.resolvedType)if(t.resolvedType instanceof i){e("switch(d%s){",r);for(var a=t.resolvedType.values,s=Object.keys(a),l=0;l<s.length;++l)a[s[l]]!==t.typeDefault||o||(e("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',r,r,r),t.repeated||e("break"),o=!0),e("case%j:",s[l])("case %i:",a[s[l]])("m%s=%j",r,a[s[l]])("break");e("}")}else e('if(typeof d%s!=="object")',r)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",r,n,r);else{var c=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",r,r);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",r,r);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",r,r);break;case"uint64":c=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",r,r,c)('else if(typeof d%s==="string")',r)("m%s=parseInt(d%s,10)",r,r)('else if(typeof d%s==="number")',r)("m%s=d%s",r,r)('else if(typeof d%s==="object")',r)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",r,r,r,c?"true":"");break;case"bytes":e('if(typeof d%s==="string")',r)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",r,r,r)("else if(d%s.length >= 0)",r)("m%s=d%s",r,r);break;case"string":e("m%s=String(d%s)",r,r);break;case"bool":e("m%s=Boolean(d%s)",r,r)}}return e}function s(e,t,n,r){if(t.resolvedType)t.resolvedType instanceof i?e("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",r,n,r,r,n,r,r):e("d%s=types[%i].toObject(m%s,o)",r,n,r);else{var o=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",r,r,r,r);break;case"uint64":o=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',r)("d%s=o.longs===String?String(m%s):m%s",r,r,r)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",r,r,r,r,o?"true":"",r);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",r,r,r,r,r);break;default:e("d%s=m%s",r,r)}}return e}r.fromObject=function(e){var t=e.fieldsArray,n=o.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return n("return new this.ctor");n("var m=new this.ctor");for(var r=0;r<t.length;++r){var s=t[r].resolve(),l=o.safeProp(s.name);s.map?(n("if(d%s){",l)('if(typeof d%s!=="object")',l)("throw TypeError(%j)",s.fullName+": object expected")("m%s={}",l)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",l),a(n,s,r,l+"[ks[i]]")("}")("}")):s.repeated?(n("if(d%s){",l)("if(!Array.isArray(d%s))",l)("throw TypeError(%j)",s.fullName+": array expected")("m%s=[]",l)("for(var i=0;i<d%s.length;++i){",l),a(n,s,r,l+"[i]")("}")("}")):(s.resolvedType instanceof i||n("if(d%s!=null){",l),a(n,s,r,l),s.resolvedType instanceof i||n("}"))}return n("return m")},r.toObject=function(e){var t=e.fieldsArray.slice().sort(o.compareFieldsById);if(!t.length)return o.codegen()("return {}");for(var n=o.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),r=[],a=[],l=[],c=0;c<t.length;++c)t[c].partOf||(t[c].resolve().repeated?r:t[c].map?a:l).push(t[c]);if(r.length){for(n("if(o.arrays||o.defaults){"),c=0;c<r.length;++c)n("d%s=[]",o.safeProp(r[c].name));n("}")}if(a.length){for(n("if(o.objects||o.defaults){"),c=0;c<a.length;++c)n("d%s={}",o.safeProp(a[c].name));n("}")}if(l.length){for(n("if(o.defaults){"),c=0;c<l.length;++c){var u=l[c],p=o.safeProp(u.name);if(u.resolvedType instanceof i)n("d%s=o.enums===String?%j:%j",p,u.resolvedType.valuesById[u.typeDefault],u.typeDefault);else if(u.long)n("if(util.Long){")("var n=new util.Long(%i,%i,%j)",u.typeDefault.low,u.typeDefault.high,u.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",p)("}else")("d%s=o.longs===String?%j:%i",p,u.typeDefault.toString(),u.typeDefault.toNumber());else if(u.bytes){var f="["+Array.prototype.slice.call(u.typeDefault).join(",")+"]";n("if(o.bytes===String)d%s=%j",p,String.fromCharCode.apply(String,u.typeDefault))("else{")("d%s=%s",p,f)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",p,p)("}")}else n("d%s=%j",p,u.typeDefault)}n("}")}var d=!1;for(c=0;c<t.length;++c){u=t[c];var g=e._fieldsArray.indexOf(u);p=o.safeProp(u.name),u.map?(d||(d=!0,n("var ks2")),n("if(m%s&&(ks2=Object.keys(m%s)).length){",p,p)("d%s={}",p)("for(var j=0;j<ks2.length;++j){"),s(n,u,g,p+"[ks2[j]]")("}")):u.repeated?(n("if(m%s&&m%s.length){",p,p)("d%s=[]",p)("for(var j=0;j<m%s.length;++j){",p),s(n,u,g,p+"[j]")("}")):(n("if(m%s!=null&&m.hasOwnProperty(%j)){",p,u.name),s(n,u,g,p),u.partOf&&n("if(o.oneofs)")("d%s=%j",o.safeProp(u.partOf.name),u.name)),n("}")}return n("return d")}},818(e,t,n){"use strict";e.exports=o;var r=n(3449);(o.prototype=Object.create(r.prototype)).constructor=o;var i=n(3610);function o(){r.call(this)}function a(e,t,n){e.length<40?i.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}o._configure=function(){o.alloc=i._Buffer_allocUnsafe,o.writeBytesBuffer=i.Buffer&&i.Buffer.prototype instanceof Uint8Array&&"set"===i.Buffer.prototype.set.name?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},o.prototype.bytes=function(e){i.isString(e)&&(e=i._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(o.writeBytesBuffer,t,e),this},o.prototype.string=function(e){var t=i.Buffer.byteLength(e);return this.uint32(t),t&&this._push(a,t,e),this},o._configure()},887(e,t){var n,r;void 0===(r="function"==typeof(n=function(){"use strict";var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n="boolean"==typeof(new RegExp).sticky;function r(e){return e&&"[object RegExp]"===t.call(e)}function i(e){return e&&"object"==typeof e&&!r(e)&&!Array.isArray(e)}function o(e){return"("+e+")"}function a(e){return e.length?"(?:"+e.map((function(e){return"(?:"+e+")"})).join("|")+")":"(?!)"}function s(e){if("string"==typeof e)return"(?:"+(e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+")");if(r(e)){if(e.ignoreCase)throw new Error("RegExp /i flag not allowed");if(e.global)throw new Error("RegExp /g flag is implied");if(e.sticky)throw new Error("RegExp /y flag is implied");if(e.multiline)throw new Error("RegExp /m flag is implied");return e.source}throw new Error("Not a pattern: "+e)}function l(t,n){if(i(n)||(n={match:n}),n.include)throw new Error("Matching rules cannot also include states");var o={defaultType:t,lineBreaks:!!n.error||!!n.fallback,pop:!1,next:null,push:null,error:!1,fallback:!1,value:null,type:null,shouldThrow:!1};for(var a in n)e.call(n,a)&&(o[a]=n[a]);if("string"==typeof o.type&&t!==o.type)throw new Error("Type transform cannot be a string (type '"+o.type+"' for token '"+t+"')");var s=o.match;return o.match=Array.isArray(s)?s:s?[s]:[],o.match.sort((function(e,t){return r(e)&&r(t)?0:r(t)?-1:r(e)?1:t.length-e.length})),o}function c(e){return Array.isArray(e)?function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];if(r.include)for(var i=[].concat(r.include),o=0;o<i.length;o++)t.push({include:i[o]});else{if(!r.type)throw new Error("Rule has no type: "+JSON.stringify(r));t.push(l(r.type,r))}}return t}(e):function(e){for(var t=Object.getOwnPropertyNames(e),n=[],r=0;r<t.length;r++){var o=t[r],a=e[o],s=[].concat(a);if("include"!==o){var c=[];s.forEach((function(e){i(e)?(c.length&&n.push(l(o,c)),n.push(l(o,e)),c=[]):c.push(e)})),c.length&&n.push(l(o,c))}else for(var u=0;u<s.length;u++)n.push({include:s[u]})}return n}(e)}var u=l("error",{lineBreaks:!0,shouldThrow:!0});function p(e,t){for(var i=null,l=Object.create(null),c=!0,p=null,f=[],d=[],g=0;g<e.length;g++)e[g].fallback&&(c=!1);for(g=0;g<e.length;g++){var h=e[g];if(h.include)throw new Error("Inheritance is not allowed in stateless lexers");if(h.error||h.fallback){if(i)throw!h.fallback==!i.fallback?new Error("Multiple "+(h.fallback?"fallback":"error")+" rules not allowed (for token '"+h.defaultType+"')"):new Error("fallback and error are mutually exclusive (for token '"+h.defaultType+"')");i=h}var y=h.match.slice();if(c)for(;y.length&&"string"==typeof y[0]&&1===y[0].length;)l[y.shift().charCodeAt(0)]=h;if(h.pop||h.push||h.next){if(!t)throw new Error("State-switching options are not allowed in stateless lexers (for token '"+h.defaultType+"')");if(h.fallback)throw new Error("State-switching options are not allowed on fallback tokens (for token '"+h.defaultType+"')")}if(0!==y.length){c=!1,f.push(h);for(var m=0;m<y.length;m++){var b=y[m];if(r(b))if(null===p)p=b.unicode;else if(p!==b.unicode&&!1===h.fallback)throw new Error("If one rule is /u then all must be")}var v=a(y.map(s)),O=new RegExp(v);if(O.test(""))throw new Error("RegExp matches empty string: "+O);if(new RegExp("|"+v).exec("").length-1>0)throw new Error("RegExp has capture groups: "+O+"\nUse (?: … ) instead");if(!h.lineBreaks&&O.test("\n"))throw new Error("Rule should declare lineBreaks: "+O);d.push(o(v))}}var T=i&&i.fallback,w=n&&!T?"ym":"gm",j=n||T?"":"|";return!0===p&&(w+="u"),{regexp:new RegExp(a(d)+j,w),groups:f,fast:l,error:i||u}}function f(e,t,n){var r=e&&(e.push||e.next);if(r&&!n[r])throw new Error("Missing state '"+r+"' (in token '"+e.defaultType+"' of state '"+t+"')");if(e&&e.pop&&1!=+e.pop)throw new Error("pop must be 1 (in token '"+e.defaultType+"' of state '"+t+"')")}var d=function(e,t){this.startState=t,this.states=e,this.buffer="",this.stack=[],this.reset()};d.prototype.reset=function(e,t){return this.buffer=e||"",this.index=0,this.line=t?t.line:1,this.col=t?t.col:1,this.queuedToken=t?t.queuedToken:null,this.queuedThrow=t?t.queuedThrow:null,this.setState(t?t.state:this.startState),this.stack=t&&t.stack?t.stack.slice():[],this},d.prototype.save=function(){return{line:this.line,col:this.col,state:this.state,stack:this.stack.slice(),queuedToken:this.queuedToken,queuedThrow:this.queuedThrow}},d.prototype.setState=function(e){if(e&&this.state!==e){this.state=e;var t=this.states[e];this.groups=t.groups,this.error=t.error,this.re=t.regexp,this.fast=t.fast}},d.prototype.popState=function(){this.setState(this.stack.pop())},d.prototype.pushState=function(e){this.stack.push(this.state),this.setState(e)};var g=n?function(e,t){return e.exec(t)}:function(e,t){var n=e.exec(t);return 0===n[0].length?null:n};function h(){return this.value}if(d.prototype._getGroup=function(e){for(var t=this.groups.length,n=0;n<t;n++)if(void 0!==e[n+1])return this.groups[n];throw new Error("Cannot find token type for matched text")},d.prototype.next=function(){var e=this.index;if(this.queuedGroup){var t=this._token(this.queuedGroup,this.queuedText,e);return this.queuedGroup=null,this.queuedText="",t}var n=this.buffer;if(e!==n.length){if(a=this.fast[n.charCodeAt(e)])return this._token(a,n.charAt(e),e);var r=this.re;r.lastIndex=e;var i=g(r,n),o=this.error;if(null==i)return this._token(o,n.slice(e,n.length),e);var a=this._getGroup(i),s=i[0];return o.fallback&&i.index!==e?(this.queuedGroup=a,this.queuedText=s,this._token(o,n.slice(e,i.index),e)):this._token(a,s,e)}},d.prototype._token=function(e,t,n){var r=0;if(e.lineBreaks){var i=/\n/g,o=1;if("\n"===t)r=1;else for(;i.exec(t);)r++,o=i.lastIndex}var a={type:"function"==typeof e.type&&e.type(t)||e.defaultType,value:"function"==typeof e.value?e.value(t):t,text:t,toString:h,offset:n,lineBreaks:r,line:this.line,col:this.col},s=t.length;if(this.index+=s,this.line+=r,0!==r?this.col=s-o+1:this.col+=s,e.shouldThrow)throw new Error(this.formatError(a,"invalid syntax"));return e.pop?this.popState():e.push?this.pushState(e.push):e.next&&this.setState(e.next),a},"undefined"!=typeof Symbol&&Symbol.iterator){var y=function(e){this.lexer=e};y.prototype.next=function(){var e=this.lexer.next();return{value:e,done:!e}},y.prototype[Symbol.iterator]=function(){return this},d.prototype[Symbol.iterator]=function(){return new y(this)}}return d.prototype.formatError=function(e,t){if(null==e){var n=this.buffer.slice(this.index);e={text:n,offset:this.index,lineBreaks:-1===n.indexOf("\n")?0:1,line:this.line,col:this.col}}var r=Math.max(0,e.offset-e.col+1),i=e.lineBreaks?e.text.indexOf("\n"):e.text.length,o=this.buffer.substring(r,e.offset+i);return t+=" at line "+e.line+" col "+e.col+":\n\n",(t+=" "+o+"\n")+" "+Array(e.col).join(" ")+"^"},d.prototype.clone=function(){return new d(this.states,this.state)},d.prototype.has=function(e){return!0},{compile:function(e){var t=p(c(e));return new d({start:t},"start")},states:function(e,t){var n=e.$all?c(e.$all):[];delete e.$all;var r=Object.getOwnPropertyNames(e);t||(t=r[0]);for(var i=Object.create(null),o=0;o<r.length;o++)i[v=r[o]]=c(e[v]).concat(n);for(o=0;o<r.length;o++)for(var a=i[v=r[o]],s=Object.create(null),l=0;l<a.length;l++){var u=a[l];if(u.include){var g=[l,1];if(u.include!==v&&!s[u.include]){s[u.include]=!0;var h=i[u.include];if(!h)throw new Error("Cannot include nonexistent state '"+u.include+"' (in state '"+v+"')");for(var y=0;y<h.length;y++){var m=h[y];-1===a.indexOf(m)&&g.push(m)}}a.splice.apply(a,g),l--}}var b=Object.create(null);for(o=0;o<r.length;o++){var v;b[v=r[o]]=p(i[v],!0)}for(o=0;o<r.length;o++){var O=r[o],T=b[O],w=T.groups;for(l=0;l<w.length;l++)f(w[l],O,b);var j=Object.getOwnPropertyNames(T.fast);for(l=0;l<j.length;l++)f(T.fast[j[l]],O,b)}return new d(b,t)},error:Object.freeze({error:!0}),fallback:Object.freeze({fallback:!0}),keywords:function(e){for(var t=Object.create(null),n=Object.create(null),r=Object.getOwnPropertyNames(e),i=0;i<r.length;i++){var o=r[i],a=e[o];(Array.isArray(a)?a:[a]).forEach((function(e){if((n[e.length]=n[e.length]||[]).push(e),"string"!=typeof e)throw new Error("keyword must be string (in keyword '"+o+"')");t[e]=o}))}function s(e){return JSON.stringify(e)}var l="";for(var c in l+="switch (value.length) {\n",n){var u=n[c];l+="case "+c+":\n",l+="switch (value) {\n",u.forEach((function(e){var n=t[e];l+="case "+s(e)+": return "+s(n)+"\n"})),l+="}\n"}return l+="}\n",Function("value",l)}}})?n.apply(t,[]):n)||(e.exports=r)},1080(e,t,n){"use strict";e.exports=function(e){for(var t,n=o.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),s=e.fieldsArray.slice().sort(o.compareFieldsById),l=0;l<s.length;++l){var c=s[l].resolve(),u=e._fieldsArray.indexOf(c),p=c.resolvedType instanceof r?"int32":c.type,f=i.basic[p];t="m"+o.safeProp(c.name),c.map?(n("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",t,c.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",t)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(c.id<<3|2)>>>0,8|i.mapKey[c.keyType],c.keyType),void 0===f?n("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",u,t):n(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|f,p,t),n("}")("}")):c.repeated?(n("if(%s!=null&&%s.length){",t,t),c.packed&&void 0!==i.packed[p]?n("w.uint32(%i).fork()",(c.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",p,t)("w.ldelim()"):(n("for(var i=0;i<%s.length;++i)",t),void 0===f?a(n,c,u,t+"[i]"):n("w.uint32(%i).%s(%s[i])",(c.id<<3|f)>>>0,p,t)),n("}")):(c.optional&&n("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,c.name),void 0===f?a(n,c,u,t):n("w.uint32(%i).%s(%s)",(c.id<<3|f)>>>0,p,t))}return n("return w")};var r=n(5643),i=n(361),o=n(3262);function a(e,t,n,r){return t.delimited?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",n,r,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",n,r,(t.id<<3|2)>>>0)}},1231(e){"use strict";function t(e,t){var n="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+="\n\n"+e.mark.snippet),r+" "+n):r}function n(e,n){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=n,this.message=t(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n.prototype.toString=function(e){return this.name+": "+t(this,e)},e.exports=n},1287(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CompilationSql=class{constructor(e,t){this.project=e,this.sqlanvilCoreVersion=t}get warehouse(){return(this.project.warehouse||"bigquery").toLowerCase()}resolveTarget(e){const t=e.database||this.project.defaultDatabase,n=e.schema||this.project.defaultSchema,r=e.name;return"postgres"===this.warehouse||"supabase"===this.warehouse?t?`"${t}"."${n}"."${r}"`:`"${n}"."${r}"`:"mysql"===this.warehouse?`\`${n}\`.\`${r}\``:t?`\`${t}.${n}.${r}\``:`\`${n}.${r}\``}sqlString(e){return"postgres"===this.warehouse||"supabase"===this.warehouse?`'${e.replace(/'/g,"''")}'`:`'${e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}'`}indexAssertion(e,t){const n=t.map((e=>"postgres"===this.warehouse||"supabase"===this.warehouse?`"${e.replace(/"/g,'""')}"`:"mysql"===this.warehouse?`\`${e.replace(/`/g,"``")}\``:e)).join(", ");return`\nSELECT\n *\nFROM (\n SELECT\n ${n},\n COUNT(1) AS index_row_count\n FROM ${e}\n GROUP BY ${n}\n ) AS data\nWHERE index_row_count > 1\n`}rowConditionsAssertion(e,t){return t.map((t=>`\nSELECT\n ${this.sqlString(t)} AS failing_row_condition,\n *\nFROM ${e}\nWHERE NOT (${t})\n`)).join("UNION ALL")}}},1299(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=n(8512),o=n(5436),a=n(2008),s=n(8995),l=n(8545),c=r(n(9553)),u=n(2545),p=n(5379);class f extends o.ActionBuilder{constructor(e,t,n){var r,i,o,a,s,l;if(super(e),this.dependOnDependencyAssertions=!1,this.contextablePreOps=[],this.contextablePostOps=[],this.proto=p.sqlanvil.Table.create({type:"incremental",enumType:p.sqlanvil.TableType.INCREMENTAL,disabled:!1,tags:[]}),this.uniqueKeyAssertions=[],this.session=e,this.configPath=n,this.unverifiedConfig=Object.assign({},t),!t)return;const f=this.verifyConfig(t);f.name||(f.name=c.basename(f.filename));const d=u.actionConfigToCompiledGraphTarget(f);return this.proto.target=this.applySessionToTarget(d,e.projectConfig,f.filename,{validateTarget:!0}),this.proto.canonicalTarget=this.applySessionToTarget(d,e.canonicalProjectConfig),n&&(f.filename=u.resolveActionsConfigFilename(f.filename,n),this.query(u.nativeRequire(f.filename).query)),f.filename&&(this.proto.fileName=f.filename),f.dependOnDependencyAssertions&&this.setDependOnDependencyAssertions(f.dependOnDependencyAssertions),f.dependencyTargets&&this.dependencies(f.dependencyTargets.map((e=>u.configTargetToCompiledGraphTarget(p.sqlanvil.ActionConfig.Target.create(e))))),void 0!==f.hermetic&&this.hermetic(f.hermetic),f.disabled&&this.disabled(),f.tags&&this.tags(f.tags),f.description&&this.description(f.description),f.metadata&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.metadata=f.metadata),(null===(r=f.columns)||void 0===r?void 0:r.length)&&this.columns(f.columns.map((e=>p.sqlanvil.ActionConfig.ColumnDescriptor.create(e)))),f.project&&this.database(f.project),f.dataset&&this.schema(f.dataset),f.assertions&&this.assertions(p.sqlanvil.ActionConfig.TableAssertionsConfig.create(f.assertions)),f.uniqueKey&&this.uniqueKey(f.uniqueKey),this.protected(f.protected),f.preOperations&&this.preOps(f.preOperations),f.postOperations&&this.postOps(f.postOperations),this.bigquery(Object.assign({partitionBy:f.partitionBy,clusterBy:f.clusterBy,updatePartitionFilter:f.updatePartitionFilter,labels:f.labels,partitionExpirationDays:f.partitionExpirationDays,requirePartitionFilter:f.requirePartitionFilter,additionalOptions:f.additionalOptions},f.iceberg?{connection:u.getConnectionForIcebergTable(f.iceberg.connection,null===(i=e.projectConfig.defaultIcebergConfig)||void 0===i?void 0:i.connection),fileFormat:u.getFileFormatValueForIcebergTable(null===(o=f.iceberg.fileFormat)||void 0===o?void 0:o.toString()),tableFormat:p.sqlanvil.TableFormat.ICEBERG,storageUri:u.getStorageUriForIcebergTable(u.getEffectiveBucketName(null===(a=e.projectConfig.defaultIcebergConfig)||void 0===a?void 0:a.bucketName,f.iceberg.bucketName),u.getEffectiveTableFolderRoot(null===(s=e.projectConfig.defaultIcebergConfig)||void 0===s?void 0:s.tableFolderRoot,f.iceberg.tableFolderRoot),u.getEffectiveTableFolderSubpath(this.proto.target.schema,this.proto.target.name,null===(l=e.projectConfig.defaultIcebergConfig)||void 0===l?void 0:l.tableFolderSubpath,f.iceberg.tableFolderSubpath))}:{})),f.postgres&&this.postgres(f.postgres),f.supabase&&this.supabase(f.supabase),f.mysql&&this.mysql(f.mysql),this.proto.onSchemaChange=this.mapOnSchemaChange(f.onSchemaChange),f.reservation&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.reservation=f.reservation),this}type(e){let t;switch(e){case"table":t=new a.Table(this.session,Object.assign(Object.assign({},this.unverifiedConfig),{type:"table"}),this.configPath);break;case"incremental":return this;case"view":t=new s.View(this.session,Object.assign(Object.assign({},this.unverifiedConfig),{type:"view"}),this.configPath);break;default:throw new Error(`Unexpected table type: ${e}`)}const n=this.session.actions.indexOf(this);if(-1===n)throw Error("Expected pre-existing action, but none found. Please report this to the sqlanvil team.");this.session.actions[n]=t}query(e){return this.contextableQuery=e,this}where(e){return this.contextableWhere=e,this}jitCode(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.compilationMode=p.sqlanvil.ActionCompilationMode.ACTION_COMPILATION_MODE_JIT,this.contextableJitCode=e,this}preOps(e){return this.contextablePreOps.push(e),this}postOps(e){return this.contextablePostOps.push(e),this}disabled(e=!0){var t;return this.proto.disabled=e,this.uniqueKeyAssertions.forEach((t=>t.disabled(e))),null===(t=this.rowConditionsAssertion)||void 0===t||t.disabled(e),this}protected(e){return this.proto.protected=null==e||e,this}uniqueKey(e){this.proto.uniqueKey=e}bigquery(e){e.labels&&Object.keys(e.labels).length>0&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.bigqueryLabels=e.labels);const t=o.LegacyConfigConverter.legacyConvertBigQueryOptions(e);return Object.values(t).length>0&&(this.proto.bigquery=p.sqlanvil.BigQueryOptions.create(t)),this}postgres(e){return this.proto.postgres=p.sqlanvil.PostgresOptions.create(e),this}mysql(e){return this.proto.mysql=p.sqlanvil.MysqlOptions.create(e),this}supabase(e){return this.proto.supabase=p.sqlanvil.SupabaseOptions.create(e),this}dependencies(e){return(Array.isArray(e)?e:[e]).forEach((e=>this.proto.dependencyTargets.push(u.checkAssertionsForDependency(this,e)))),this}hermetic(e){this.proto.hermeticity=e?p.sqlanvil.ActionHermeticity.HERMETIC:p.sqlanvil.ActionHermeticity.NON_HERMETIC}tags(e){var t;return("string"==typeof e?[e]:e).forEach((e=>{this.proto.tags.push(e)})),this.uniqueKeyAssertions.forEach((t=>t.tags(e))),null===(t=this.rowConditionsAssertion)||void 0===t||t.tags(e),this}description(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.description=e,this}columns(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.columns=l.ColumnDescriptors.mapConfigProtoToCompilationProto(e),this}database(e){return this.proto.target=this.applySessionToTarget(p.sqlanvil.Target.create(Object.assign(Object.assign({},this.proto.target),{database:e})),this.session.projectConfig,this.proto.fileName,{validateTarget:!0}),this}schema(e){return this.proto.target=this.applySessionToTarget(p.sqlanvil.Target.create(Object.assign(Object.assign({},this.proto.target),{schema:e})),this.session.projectConfig,this.proto.fileName,{validateTarget:!0}),this}assertions(e){const t=this.generateInlineAssertions(e,this.proto);return this.uniqueKeyAssertions=t.uniqueKeyAssertions,this.rowConditionsAssertion=t.rowConditionsAssertion,this}setDependOnDependencyAssertions(e){return this.dependOnDependencyAssertions=e,this}getFileName(){return this.proto.fileName}getTarget(){return p.sqlanvil.Target.create(this.proto.target)}compile(){var e,t;return this.contextableJitCode?this.compileJit():this.compileAot(),(null===(e=this.proto.bigquery)||void 0===e?void 0:e.connection)&&u.validateConnectionFormat(this.proto.bigquery.connection),(null===(t=this.proto.bigquery)||void 0===t?void 0:t.storageUri)&&u.validateStorageUriFormat(this.proto.bigquery.storageUri),i.verifyObjectMatchesProto(p.sqlanvil.Table,this.proto,i.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM)}compileJit(){u.validateNoMixedCompilationMode(this.session,this.getFileName(),this.contextableQuery,this.contextableWhere,this.contextablePostOps,this.contextablePreOps),this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.jitCode=this.contextableJitCode.toString()}compileAot(){const e=new d(this),t=new d(this,!0);this.proto.query=e.apply(this.contextableQuery),this.proto.incrementalQuery=t.apply(this.contextableQuery),this.proto.incrementalPreOps=this.contextifyOps(this.contextablePreOps,t),this.proto.incrementalPostOps=this.contextifyOps(this.contextablePostOps,t),this.contextableWhere&&(this.proto.where=e.apply(this.contextableWhere)),this.proto.preOps=this.contextifyOps(this.contextablePreOps,e).filter((e=>!!e.trim())),this.proto.postOps=this.contextifyOps(this.contextablePostOps,e).filter((e=>!!e.trim())),u.validateQueryString(this.session,this.proto.query,this.proto.fileName),u.validateQueryString(this.session,this.proto.incrementalQuery,this.proto.fileName)}contextifyOps(e,t){let n=[];return e.forEach((e=>{const r=t.apply(e);n=n.concat("string"==typeof r?[r]:r)})),n}verifyConfig(e){if(e.type&&(delete e.type,e.dependencies&&(e.dependencyTargets=e.dependencies.map((e=>u.resolvableAsActionConfigTarget(e))),delete e.dependencies),e.database&&(e.project=e.database,delete e.database),e.schema&&(e.dataset=e.schema,delete e.schema),e.fileName&&(e.filename=e.fileName,delete e.fileName),e.columns&&(e.columns=l.ColumnDescriptors.mapLegacyObjectToConfigProto(e.columns)),e=o.LegacyConfigConverter.insertLegacyInlineAssertionsToConfigProto(e),(e=o.LegacyConfigConverter.insertLegacyBigQueryOptionsToConfigProto(e)).bigquery&&u.checkExcessProperties((e=>{throw e}),e.bigquery,u.strictKeysOf()(["partitionBy","clusterBy","updatePartitionFilter","labels","partitionExpirationDays","requirePartitionFilter","additionalOptions","iceberg"]),"BigQuery table config")),e.iceberg&&e.iceberg.fileFormat&&"PARQUET"!==e.iceberg.fileFormat.toUpperCase())throw new ReferenceError(`Unexpected file format; only "PARQUET" is allowed, got "${e.iceberg.fileFormat}".`);const t=i.verifyObjectMatchesProto(p.sqlanvil.ActionConfig.IncrementalTableConfig,e,i.VerifyProtoErrorBehaviour.SHOW_DOCS_LINK);return t.additionalOptions&&o.checkConfigAdditionalOptionsOverlap(t,this.session),t}mapOnSchemaChange(e){if(!e)return p.sqlanvil.OnSchemaChange.IGNORE;if("number"==typeof e)switch(e){case p.sqlanvil.ActionConfig.OnSchemaChange.IGNORE:return p.sqlanvil.OnSchemaChange.IGNORE;case p.sqlanvil.ActionConfig.OnSchemaChange.FAIL:return p.sqlanvil.OnSchemaChange.FAIL;case p.sqlanvil.ActionConfig.OnSchemaChange.EXTEND:return p.sqlanvil.OnSchemaChange.EXTEND;case p.sqlanvil.ActionConfig.OnSchemaChange.SYNCHRONIZE:return p.sqlanvil.OnSchemaChange.SYNCHRONIZE;default:throw new Error(`OnSchemaChange value "${e}" is not supported`)}switch(e.toString().toUpperCase()){case"IGNORE":return p.sqlanvil.OnSchemaChange.IGNORE;case"FAIL":return p.sqlanvil.OnSchemaChange.FAIL;case"EXTEND":return p.sqlanvil.OnSchemaChange.EXTEND;case"SYNCHRONIZE":return p.sqlanvil.OnSchemaChange.SYNCHRONIZE;default:throw new Error(`OnSchemaChange value "${e}" is not supported`)}}}t.IncrementalTable=f;class d{constructor(e,t=!1){this.incrementalTable=e,this.isIncremental=t}self(){return this.resolve(this.incrementalTable.getTarget())}name(){return this.incrementalTable.session.finalizeName(this.incrementalTable.getTarget().name)}ref(e,...t){return e=u.toResolvable(e,t),u.resolvableAsTarget(e)?(this.incrementalTable.dependencies(e),this.resolve(e)):(this.incrementalTable.session.compileError(new Error("Action name is not specified")),"")}resolve(e,...t){return this.incrementalTable.session.resolve(e,...t)}schema(){return this.incrementalTable.session.finalizeSchema(this.incrementalTable.getTarget().schema)}database(){return this.incrementalTable.getTarget().database?this.incrementalTable.session.finalizeDatabase(this.incrementalTable.getTarget().database):(this.incrementalTable.session.compileError(new Error("Warehouse does not support multiple databases")),"")}where(e){return this.incrementalTable.where(e),""}when(e,t,n=""){return e?t:n}incremental(){return!!this.isIncremental}preOps(e){return this.incrementalTable.preOps(e),""}postOps(e){return this.incrementalTable.postOps(e),""}disabled(){return this.incrementalTable.disabled(),""}bigquery(e){return this.incrementalTable.bigquery(e),""}dependencies(e){return this.incrementalTable.dependencies(e),""}apply(e){return"function"==typeof e?e(this):e}tags(e){return this.incrementalTable.tags(e),""}}t.IncrementalTableContext=d},1344(e,t,n){"use strict";e.exports=c;var r=n(7209);((c.prototype=Object.create(r.prototype)).constructor=c).className="Field";var i,o=n(5643),a=n(361),s=n(3262),l=/^required|optional|repeated$/;function c(e,t,n,i,o,c,u){if(s.isObject(i)?(u=o,c=i,i=o=void 0):s.isObject(o)&&(u=c,c=o,o=void 0),r.call(this,e,c),!s.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!s.isString(n))throw TypeError("type must be a string");if(void 0!==i&&!l.test(i=i.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==o&&!s.isString(o))throw TypeError("extend must be a string");"proto3_optional"===i&&(i="optional"),this.rule=i&&"optional"!==i?i:void 0,this.type=n,this.id=t,this.extend=o||void 0,this.repeated="repeated"===i,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!s.Long&&void 0!==a.long[n],this.bytes="bytes"===n,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.comment=u}c.fromJSON=function(e,t){var n=new c(e,t.id,t.type,t.rule,t.extend,t.options,t.comment);return t.edition&&(n._edition=t.edition),n._defaultEdition="proto3",n},Object.defineProperty(c.prototype,"required",{get:function(){return"LEGACY_REQUIRED"===this._features.field_presence}}),Object.defineProperty(c.prototype,"optional",{get:function(){return!this.required}}),Object.defineProperty(c.prototype,"delimited",{get:function(){return this.resolvedType instanceof i&&"DELIMITED"===this._features.message_encoding}}),Object.defineProperty(c.prototype,"packed",{get:function(){return"PACKED"===this._features.repeated_field_encoding}}),Object.defineProperty(c.prototype,"hasPresence",{get:function(){return!this.repeated&&!this.map&&(this.partOf||this.declaringField||this.extensionField||"IMPLICIT"!==this._features.field_presence)}}),c.prototype.setOption=function(e,t,n){return r.prototype.setOption.call(this,e,t,n)},c.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return s.toObject(["edition",this._editionToJSON(),"rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},c.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=a.defaults[this.type])?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof i?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof o&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof o||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=s.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"==typeof this.typeDefault){var e;s.base64.test(this.typeDefault)?s.base64.decode(this.typeDefault,e=s.newBuffer(s.base64.length(this.typeDefault)),0):s.utf8.write(this.typeDefault,e=s.newBuffer(s.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=s.emptyObject:this.repeated?this.defaultValue=s.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof i&&(this.parent.ctor.prototype[this.name]=this.defaultValue),r.prototype.resolve.call(this)},c.prototype._inferLegacyProtoFeatures=function(e){if("proto2"!==e&&"proto3"!==e)return{};var t={};if("required"===this.rule&&(t.field_presence="LEGACY_REQUIRED"),this.parent&&void 0===a.defaults[this.type]){var n=this.parent.get(this.type.split(".").pop());n&&n instanceof i&&n.group&&(t.message_encoding="DELIMITED")}return!0===this.getOption("packed")?t.repeated_field_encoding="PACKED":!1===this.getOption("packed")&&(t.repeated_field_encoding="EXPANDED"),t},c.prototype._resolveFeatures=function(e){return r.prototype._resolveFeatures.call(this,this._edition||e)},c.d=function(e,t,n,r){return"function"==typeof t?t=s.decorateType(t).name:t&&"object"==typeof t&&(t=s.decorateEnum(t).name),function(i,o){s.decorateType(i.constructor).add(new c(o,e,t,n,{default:r}))}},c._configure=function(e){i=e}},1447(e,t){"use strict";var n=t;n.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)(n=e.charCodeAt(r))<128?t+=1:n<2048?t+=2:55296==(64512&n)&&56320==(64512&e.charCodeAt(r+1))?(++r,t+=4):t+=3;return t},n.read=function(e,t,n){if(n-t<1)return"";for(var r,i=null,o=[],a=0;t<n;)(r=e[t++])<128?o[a++]=r:r>191&&r<224?o[a++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[a++]=55296+(r>>10),o[a++]=56320+(1023&r)):o[a++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),a=0);return i?(a&&i.push(String.fromCharCode.apply(String,o.slice(0,a))),i.join("")):String.fromCharCode.apply(String,o.slice(0,a))},n.write=function(e,t,n){for(var r,i,o=n,a=0;a<e.length;++a)(r=e.charCodeAt(a))<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(i=e.charCodeAt(a+1)))?(r=65536+((1023&r)<<10)+(1023&i),++a,t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=63&r|128);return n-o}},1457(e,t,n){"use strict";e.exports=a;var r=n(7209);((a.prototype=Object.create(r.prototype)).constructor=a).className="OneOf";var i=n(1344),o=n(3262);function a(e,t,n,i){if(Array.isArray(t)||(n=t,t=void 0),r.call(this,e,n),void 0!==t&&!Array.isArray(t))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=i}function s(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}a.fromJSON=function(e,t){return new a(e,t.oneof,t.options,t.comment)},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},a.prototype.add=function(e){if(!(e instanceof i))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,s(this),this},a.prototype.remove=function(e){if(!(e instanceof i))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),(t=this.oneof.indexOf(e.name))>-1&&this.oneof.splice(t,1),e.partOf=null,this},a.prototype.onAdd=function(e){r.prototype.onAdd.call(this,e);for(var t=0;t<this.oneof.length;++t){var n=e.get(this.oneof[t]);n&&!n.partOf&&(n.partOf=this,this.fieldsArray.push(n))}s(this)},a.prototype.onRemove=function(e){for(var t,n=0;n<this.fieldsArray.length;++n)(t=this.fieldsArray[n]).parent&&t.parent.remove(t);r.prototype.onRemove.call(this,e)},Object.defineProperty(a.prototype,"isProto3Optional",{get:function(){if(null==this.fieldsArray||1!==this.fieldsArray.length)return!1;var e=this.fieldsArray[0];return null!=e.options&&!0===e.options.proto3_optional}}),a.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,n){o.decorateType(t.constructor).add(new a(n,e)),Object.defineProperty(t,n,{get:o.oneOfGetter(e),set:o.oneOfSetter(e)})}}},1461(e,t,n){"use strict";var r=n(8433),i=n(5388),o=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),a=/^[-+]?[0-9]+e/;e.exports=new i("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!o.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||r.isNegativeZero(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(r.isNegativeZero(e))return"-0.0";return n=e.toString(10),a.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"})},1769(e,t,n){"use strict";e.exports=n(6184)},1851(e,t,n){"use strict";var r=n(5388);e.exports=new r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}})},2008(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=n(8512),o=n(5436),a=n(1299),s=n(8995),l=n(8545),c=r(n(9553)),u=n(2545),p=n(5379);class f extends o.ActionBuilder{constructor(e,t,n){var r,i,o,a,s,l;if(super(e),this.dependOnDependencyAssertions=!1,this.contextablePreOps=[],this.contextablePostOps=[],this.proto=p.sqlanvil.Table.create({type:"table",enumType:p.sqlanvil.TableType.TABLE,disabled:!1,tags:[]}),this.uniqueKeyAssertions=[],this.session=e,this.configPath=n,this.unverifiedConfig=Object.assign({},t),!t)return;const f=this.verifyConfig(t);f.name||(f.name=c.basename(f.filename));const d=u.actionConfigToCompiledGraphTarget(f);return this.proto.target=this.applySessionToTarget(d,e.projectConfig,f.filename,{validateTarget:!0}),this.proto.canonicalTarget=this.applySessionToTarget(d,e.canonicalProjectConfig),n&&(f.filename=u.resolveActionsConfigFilename(f.filename,n),this.query(u.nativeRequire(f.filename).query)),f.filename&&(this.proto.fileName=f.filename),f.dependOnDependencyAssertions&&this.setDependOnDependencyAssertions(f.dependOnDependencyAssertions),f.dependencyTargets&&this.dependencies(f.dependencyTargets),void 0!==f.hermetic&&this.hermetic(f.hermetic),f.disabled&&this.disabled(),f.tags&&this.tags(f.tags),f.description&&this.description(f.description),f.metadata&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.metadata=f.metadata),(null===(r=f.columns)||void 0===r?void 0:r.length)&&this.columns(f.columns.map((e=>p.sqlanvil.ActionConfig.ColumnDescriptor.create(e)))),f.assertions&&this.assertions(p.sqlanvil.ActionConfig.TableAssertionsConfig.create(f.assertions)),f.preOperations&&this.preOps(f.preOperations),f.postOperations&&this.postOps(f.postOperations),this.bigquery(Object.assign({partitionBy:f.partitionBy,clusterBy:f.clusterBy,labels:f.labels,partitionExpirationDays:f.partitionExpirationDays,requirePartitionFilter:f.requirePartitionFilter,additionalOptions:f.additionalOptions},f.iceberg?{connection:u.getConnectionForIcebergTable(f.iceberg.connection,null===(i=e.projectConfig.defaultIcebergConfig)||void 0===i?void 0:i.connection),fileFormat:u.getFileFormatValueForIcebergTable(null===(o=f.iceberg.fileFormat)||void 0===o?void 0:o.toString()),tableFormat:p.sqlanvil.TableFormat.ICEBERG,storageUri:u.getStorageUriForIcebergTable(u.getEffectiveBucketName(null===(a=e.projectConfig.defaultIcebergConfig)||void 0===a?void 0:a.bucketName,f.iceberg.bucketName),u.getEffectiveTableFolderRoot(null===(s=e.projectConfig.defaultIcebergConfig)||void 0===s?void 0:s.tableFolderRoot,f.iceberg.tableFolderRoot),u.getEffectiveTableFolderSubpath(this.proto.target.schema,this.proto.target.name,null===(l=e.projectConfig.defaultIcebergConfig)||void 0===l?void 0:l.tableFolderSubpath,f.iceberg.tableFolderSubpath))}:{})),f.postgres&&this.postgres(f.postgres),f.supabase&&this.supabase(f.supabase),f.mysql&&this.mysql(f.mysql),f.reservation&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.reservation=f.reservation),this}type(e){let t;switch(e){case"table":return this;case"incremental":t=new a.IncrementalTable(this.session,Object.assign(Object.assign({},this.unverifiedConfig),{type:"incremental"}),this.configPath);break;case"view":t=new s.View(this.session,Object.assign(Object.assign({},this.unverifiedConfig),{type:"view"}),this.configPath);break;default:throw new Error(`Unexpected table type: ${e}`)}const n=this.session.actions.indexOf(this);if(-1===n)throw Error("Expected pre-existing action, but none found. Please report this to the sqlanvil team.");this.session.actions[n]=t}query(e){return this.contextableQuery=e,this}where(e){return this.contextableWhere=e,this}jitCode(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.compilationMode=p.sqlanvil.ActionCompilationMode.ACTION_COMPILATION_MODE_JIT,this.contextableJitCode=e,this}preOps(e){return this.contextablePreOps.push(e),this}postOps(e){return this.contextablePostOps.push(e),this}disabled(e=!0){var t;return this.proto.disabled=e,this.uniqueKeyAssertions.forEach((t=>t.disabled(e))),null===(t=this.rowConditionsAssertion)||void 0===t||t.disabled(e),this}bigquery(e){e.labels&&Object.keys(e.labels).length>0&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.bigqueryLabels=e.labels);const t=o.LegacyConfigConverter.legacyConvertBigQueryOptions(e);return Object.values(t).length>0&&(this.proto.bigquery=p.sqlanvil.BigQueryOptions.create(t)),this}postgres(e){return this.proto.postgres=p.sqlanvil.PostgresOptions.create(e),this}mysql(e){return this.proto.mysql=p.sqlanvil.MysqlOptions.create(e),this}supabase(e){return this.proto.supabase=p.sqlanvil.SupabaseOptions.create(e),this}dependencies(e){return(Array.isArray(e)?e:[e]).forEach((e=>{const t=u.checkAssertionsForDependency(this,e);t&&this.proto.dependencyTargets.push(t)})),this}hermetic(e){this.proto.hermeticity=e?p.sqlanvil.ActionHermeticity.HERMETIC:p.sqlanvil.ActionHermeticity.NON_HERMETIC}tags(e){var t;return("string"==typeof e?[e]:e).forEach((e=>{this.proto.tags.push(e)})),this.uniqueKeyAssertions.forEach((t=>t.tags(e))),null===(t=this.rowConditionsAssertion)||void 0===t||t.tags(e),this}description(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.description=e,this}columns(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.columns=l.ColumnDescriptors.mapConfigProtoToCompilationProto(e),this}database(e){return this.proto.target=this.applySessionToTarget(p.sqlanvil.Target.create(Object.assign(Object.assign({},this.proto.target),{database:e})),this.session.projectConfig,this.proto.fileName,{validateTarget:!0}),this}schema(e){return this.proto.target=this.applySessionToTarget(p.sqlanvil.Target.create(Object.assign(Object.assign({},this.proto.target),{schema:e})),this.session.projectConfig,this.proto.fileName,{validateTarget:!0}),this}assertions(e){const t=this.generateInlineAssertions(e,this.proto);return this.uniqueKeyAssertions=t.uniqueKeyAssertions,this.rowConditionsAssertion=t.rowConditionsAssertion,this}setDependOnDependencyAssertions(e){return this.dependOnDependencyAssertions=e,this}getFileName(){return this.proto.fileName}getTarget(){return p.sqlanvil.Target.create(this.proto.target)}compile(){var e,t;return this.contextableJitCode?this.compileJit():this.compileAot(),(null===(e=this.proto.bigquery)||void 0===e?void 0:e.connection)&&u.validateConnectionFormat(this.proto.bigquery.connection),(null===(t=this.proto.bigquery)||void 0===t?void 0:t.storageUri)&&u.validateStorageUriFormat(this.proto.bigquery.storageUri),i.verifyObjectMatchesProto(p.sqlanvil.Table,this.proto,i.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM)}compileJit(){u.validateNoMixedCompilationMode(this.session,this.getFileName(),this.contextableQuery,this.contextableWhere,this.contextablePostOps,this.contextablePreOps),this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.jitCode=this.contextableJitCode.toString()}compileAot(){const e=new d(this),t=new d(this,!0);this.proto.query=e.apply(this.contextableQuery),this.proto.enumType===p.sqlanvil.TableType.INCREMENTAL&&(this.proto.incrementalQuery=t.apply(this.contextableQuery),this.proto.incrementalPreOps=this.contextifyOps(this.contextablePreOps,t),this.proto.incrementalPostOps=this.contextifyOps(this.contextablePostOps,t)),this.contextableWhere&&(this.proto.where=e.apply(this.contextableWhere)),this.proto.preOps=this.contextifyOps(this.contextablePreOps,e).filter((e=>!!e.trim())),this.proto.postOps=this.contextifyOps(this.contextablePostOps,e).filter((e=>!!e.trim())),u.validateQueryString(this.session,this.proto.query,this.proto.fileName),u.validateQueryString(this.session,this.proto.incrementalQuery,this.proto.fileName)}contextifyOps(e,t){let n=[];return e.forEach((e=>{const r=t.apply(e);n=n.concat("string"==typeof r?[r]:r)})),n}verifyConfig(e){if(e.type){if("table"!==e.type)throw ReferenceError(`Unexpected type for Table; want "table", got ${e.type}`);if(delete e.type,e.dependencies&&(e.dependencyTargets=e.dependencies.map((e=>u.resolvableAsActionConfigTarget(e))),delete e.dependencies),e.database&&(e.project=e.database,delete e.database),e.schema&&(e.dataset=e.schema,delete e.schema),e.fileName&&(e.filename=e.fileName,delete e.fileName),e.columns&&(e.columns=l.ColumnDescriptors.mapLegacyObjectToConfigProto(e.columns)),e=o.LegacyConfigConverter.insertLegacyInlineAssertionsToConfigProto(e),(e=o.LegacyConfigConverter.insertLegacyBigQueryOptionsToConfigProto(e)).bigquery&&u.checkExcessProperties((e=>{throw e}),e.bigquery,u.strictKeysOf()(["partitionBy","clusterBy","updatePartitionFilter","labels","partitionExpirationDays","requirePartitionFilter","additionalOptions","iceberg"]),"BigQuery table config"),e.iceberg&&e.iceberg.fileFormat&&"PARQUET"!==e.iceberg.fileFormat.toUpperCase())throw new ReferenceError(`Unexpected file format; only "PARQUET" is allowed, got "${e.iceberg.fileFormat}".`)}const t=i.verifyObjectMatchesProto(p.sqlanvil.ActionConfig.TableConfig,e,i.VerifyProtoErrorBehaviour.SHOW_DOCS_LINK);return t.partitionBy||!t.partitionExpirationDays&&!t.requirePartitionFilter||this.session.compileError("requirePartitionFilter/partitionExpirationDays are not valid for non partitioned BigQuery tables",t.filename,p.sqlanvil.Target.create({database:t.project,schema:t.dataset,name:t.name})),t.additionalOptions&&o.checkConfigAdditionalOptionsOverlap(t,this.session),t}}t.Table=f;class d{constructor(e,t=!1){this.table=e,this.isIncremental=t}self(){return this.resolve(this.table.getTarget())}name(){return this.table.session.finalizeName(this.table.getTarget().name)}ref(e,...t){return e=u.toResolvable(e,t),u.resolvableAsTarget(e)?(this.table.dependencies(e),this.resolve(e)):(this.table.session.compileError(new Error("Action name is not specified")),"")}resolve(e,...t){return this.table.session.resolve(e,...t)}schema(){return this.table.session.finalizeSchema(this.table.getTarget().schema)}database(){return this.table.getTarget().database?this.table.session.finalizeDatabase(this.table.getTarget().database):(this.table.session.compileError(new Error("Warehouse does not support multiple databases")),"")}type(e){return this.table.type(e),""}where(e){return this.table.where(e),""}when(e,t,n=""){return e?t:n}incremental(){return!!this.isIncremental}preOps(e){return this.table.preOps(e),""}postOps(e){return this.table.postOps(e),""}disabled(){return this.table.disabled(),""}bigquery(e){return this.table.bigquery(e),""}dependencies(e){return this.table.dependencies(e),""}apply(e){return"function"==typeof e?e(this):e}tags(e){return this.table.tags(e),""}}t.TableContext=d},2119(e,t,n){"use strict";var r=n(1231),i=n(5388);function o(e,t){var n=[];return e[t].forEach((function(e){var t=n.length;n.forEach((function(n,r){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=r)})),n[t]=e})),n}function a(e){return this.extend(e)}a.prototype.extend=function(e){var t=[],n=[];if(e instanceof i)n.push(e);else if(Array.isArray(e))n=n.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new r("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit))}t.forEach((function(e){if(!(e instanceof i))throw new r("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new r("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(e.multi)throw new r("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),n.forEach((function(e){if(!(e instanceof i))throw new r("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var s=Object.create(a.prototype);return s.implicit=(this.implicit||[]).concat(t),s.explicit=(this.explicit||[]).concat(n),s.compiledImplicit=o(s,"implicit"),s.compiledExplicit=o(s,"explicit"),s.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function r(e){e.multi?(n.multi[e.kind].push(e),n.multi.fallback.push(e)):n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(r);return n}(s.compiledImplicit,s.compiledExplicit),s},e.exports=a},2239(e,t,n){"use strict";e.exports=i;var r=n(3610);function i(e,t){this.lo=e>>>0,this.hi=t>>>0}var o=i.zero=new i(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var a=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(e){if(0===e)return o;var t=e<0;t&&(e=-e);var n=e>>>0,r=(e-n)/4294967296>>>0;return t&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new i(n,r)},i.from=function(e){if("number"==typeof e)return i.fromNumber(e);if(r.isString(e)){if(!r.Long)return i.fromNumber(parseInt(e,10));e=r.Long.fromString(e)}return e.low||e.high?new i(e.low>>>0,e.high>>>0):o},i.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+4294967296*n)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(e){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var s=String.prototype.charCodeAt;i.fromHash=function(e){return e===a?o:new i((s.call(e,0)|s.call(e,1)<<8|s.call(e,2)<<16|s.call(e,3)<<24)>>>0,(s.call(e,4)|s.call(e,5)<<8|s.call(e,6)<<16|s.call(e,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},i.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},i.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}},2369(e,t,n){"use strict";var r=n(5388);e.exports=new r("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})},2545(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=n(3788),o=r(n(9553)),a=n(5379);t.nativeRequire=require,t.matchPatterns=function(e,t){const n=[];return e.forEach((e=>{if(e.includes("."))t.includes(e)&&n.push(e);else{const r=t.filter((t=>e===t.split(".").slice(-1)[0]));if(0===r.length)return;if(r.length>1)throw new Error(p(e,r));n.push(r[0])}})),n},t.getCallerFile=function(e){let t;const n=function(){const e=Error.stackTraceLimit,t=Error.prepareStackTrace;try{return Error.stackTraceLimit=Number.POSITIVE_INFINITY,Error.prepareStackTrace=(e,t)=>t,(new Error).stack}finally{Error.stackTraceLimit=e,Error.prepareStackTrace=t}}();for(;n.length;){const r=n.shift().getFileName();if(r&&r.includes(e)&&!r.includes("node_modules")&&(t=r,r.includes(`definitions${o.separator}`)||r.includes(`models${o.separator}`)))break}if(!t){if(!global.__sqlanvil_current_file)throw new Error("Unable to find valid caller file; please report this issue.");t=global.__sqlanvil_current_file}return o.relativePath(t,e)},t.graphHasErrors=function(e){var t;return(null===(t=e.graphErrors)||void 0===t?void 0:t.compilationErrors.length)>0};const s="Invalid input. Accepted inputs include: a single object containing an (optional) 'database', (optional) 'schema', and 'name', or 1-3 inputs consisting of an (optional) database, (optional) schema, and 'name'.";function l(e){return!e.some((e=>"string"!=typeof e))&&e.length>0&&e.length<=3}function c(e){if("string"==typeof e)return a.sqlanvil.Target.create({name:e});const t=e;return t instanceof a.sqlanvil.ActionConfig.Target||void 0!==t.dataset||void 0!==t.project?a.sqlanvil.Target.create({name:t.name,schema:t.dataset,database:t.project,includeDependentAssertions:t.includeDependentAssertions}):a.sqlanvil.Target.create(e)}function u(e){return"string"==typeof e?e:JSON.stringify(e)}function p(e,t){const n="string"==typeof t[0]?t:t.map((e=>`${e.getTarget().schema}.${e.getTarget().name}`));return`Ambiguous Action name: ${u(e)}. Did you mean one of: ${n.join(", ")}.`}function f(e,t){switch(e){case"table":return a.sqlanvil.TableType.TABLE;case"incremental":return a.sqlanvil.TableType.INCREMENTAL;case"view":return a.sqlanvil.TableType.VIEW;default:if(t)throw new Error(`Unexpected table type: ${e}`);return a.sqlanvil.TableType.UNKNOWN_TYPE}}function d(e){return a.sqlanvil.TableType[e].toLowerCase()}t.toResolvable=function(e,t=[]){if(Array.isArray(e)&&t.length>0)throw new Error(s);if(0===t.length&&!Array.isArray(e))return e;const n=Array.isArray(e)?e.reverse():[e,...t].reverse();if(!l(n))throw new Error(s);const[r,i,o]=n;return{database:o,schema:i,name:r}},t.resolvableAsTarget=c,t.resolvableAsActionConfigTarget=function(e){if("string"==typeof e){const t=e.split(".").reverse();if(!l(t))throw new Error(s);const[n,r,i]=t;return{name:n,dataset:r,project:i}}return e},t.stringifyResolvable=u,t.ambiguousActionNameMsg=p,t.target=function(e,t,n,r){return a.sqlanvil.Target.create({name:t,schema:n||e.defaultSchema||void 0,database:r||e.defaultDatabase||void 0})},t.strictKeysOf=function(){return e=>e},t.checkExcessProperties=function(e,t,n,r){const i=Object.keys(t).filter((e=>!n.includes(e)));i.length>0&&e(new Error(`Unexpected property "${i[0]}"${r?` in ${r}`:""}. Supported properties are: ${JSON.stringify(n)}`))},t.validateQueryString=function(e,t,n){";"===(null==t?void 0:t.trim().slice(-1))&&e.compileError(new Error("Semi-colons are not allowed at the end of SQL statements."),n)},t.validateNoMixedCompilationMode=function(e,t,n,r,i,o){let a=[];i.forEach((e=>{a=a.concat("object"==typeof e?e:[e])}));let s=[];o.forEach((e=>{s=s.concat("object"==typeof e?e:[e])}));const l=[];if(n&&l.push("query"),r&&l.push("where"),a.length&&l.push("postOps"),s.length&&l.push("preOps"),l.length){const n=new Error(`Cannot mix AoT and JiT compilation in action. The following AoT properties were found: ${l.join(", ")}`);throw e.compileError(n,t),n}},t.validateConnectionFormat=function(e){const t=/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+$/.test(e)||/^projects\/[^/]+\/locations\/[^/]+\/connections\/[^/]+$/.test(e);if("DEFAULT"!==e&&!t)throw new Error("The connection must be in the format `{project}.{location}.{connection_id}` or `projects/{project}/locations/{location}/connections/{connection_id}`, or be set to `DEFAULT`.")},t.validateStorageUriFormat=function(e){if(!/^gs:\/\/([^/]+)\/(.+)$/.test(e))throw new Error("The storage URI must be in the format `gs://{bucket_name}/{path_to_data}`.")},t.getFileFormatValueForIcebergTable=function(e){if(!e)return a.sqlanvil.FileFormat.PARQUET;if("PARQUET"===e.toUpperCase())return a.sqlanvil.FileFormat.PARQUET;throw new Error(`File format ${e} is not supported.`)},t.getConnectionForIcebergTable=function(e,t){return e||t||"DEFAULT"},t.getStorageUriForIcebergTable=function(e,t,n){return`gs://${e}/${t}/${n}`},t.getEffectiveBucketName=function(e,t){if(t)return t;if(e)return e;throw new Error("When defining an Iceberg table, bucket name must be defined in workflow_settings.yaml or the config block.")},t.getEffectiveTableFolderRoot=function(e,t){return t||e||"_sqlanvil"},t.getEffectiveTableFolderSubpath=function(e,t,n,r){return r||n||`${e}/${t}`},t.tableTypeStringToEnum=f,t.tableTypeEnumToString=d,t.setOrValidateTableEnumType=function(e){let t=null;if(""!==e.type&&void 0!==e.type&&(t=f(e.type,!0)),e.enumType===a.sqlanvil.TableType.UNKNOWN_TYPE||void 0===e.enumType)e.enumType=t;else if(null!==t&&e.enumType!==t)throw new Error(`Table str type "${e.type}" and enumType "${d(e.enumType)}" are not equivalent.`)},t.extractActionDetailsFromFileName=function(e){const t=o.basename(e);return{fileExtension:o.fileExtension(e),fileNameAsTargetName:t}},t.configTargetToCompiledGraphTarget=function(e){const t={name:e.name};return e.project&&(t.database=e.project),e.dataset&&(t.schema=e.dataset),e.hasOwnProperty("includeDependentAssertions")&&(t.includeDependentAssertions=e.includeDependentAssertions),a.sqlanvil.Target.create(t)},t.actionConfigToCompiledGraphTarget=function(e){const t=a.sqlanvil.Target.create({name:e.name});return"project"in e&&void 0!==e.project&&(t.database=e.project),"location"in e&&void 0!==e.location&&(t.schema=e.location),"dataset"in e&&void 0!==e.dataset&&(t.schema=e.dataset),t},t.resolveActionsConfigFilename=function(e,t){return o.normalize(o.join(o.dirName(t),e))},t.checkAssertionsForDependency=function(e,t){const n=c(t);n.hasOwnProperty("includeDependentAssertions")||e instanceof i.DataPreparation||(n.includeDependentAssertions=e.dependOnDependencyAssertions);const r=e.session.compilationSql().resolveTarget(n);if(!e.includeAssertionsForDependency.has(r)||e.includeAssertionsForDependency.get(r)===n.includeDependentAssertions)return e.includeAssertionsForDependency.set(r,n.includeDependentAssertions),n;e.session.compileError(`Conflicting "includeDependentAssertions" properties are not allowed. Dependency ${n.name} has different values set for this property.`,e.getFileName(),e.getTarget())},t.ResolvableMap=class{constructor(e){if(this.byName=new Map,this.bySchemaAndName=new Map,this.byDatabaseAndName=new Map,this.byDatabaseSchemaAndName=new Map,e)for(const{actionTarget:t,value:n}of e)this.set(t,n)}set(e,t){if(this.setByNameLevel(this.byName,e.name,t),e.schema&&this.setBySchemaLevel(this.bySchemaAndName,e,t),e.database){this.byDatabaseAndName.has(e.database)||this.byDatabaseAndName.set(e.database,new Map);const n=this.byDatabaseAndName.get(e.database);if(this.setByNameLevel(n,e.name,t),e.schema){this.byDatabaseSchemaAndName.has(e.database)||this.byDatabaseSchemaAndName.set(e.database,new Map);const n=this.byDatabaseSchemaAndName.get(e.database);this.setBySchemaLevel(n,e,t)}}}find(e){var t,n,r,i;return e.database?e.schema?(null===(n=null===(t=this.byDatabaseSchemaAndName.get(e.database))||void 0===t?void 0:t.get(e.schema))||void 0===n?void 0:n.get(e.name))||[]:(null===(r=this.byDatabaseAndName.get(e.database))||void 0===r?void 0:r.get(e.name))||[]:e.schema?(null===(i=this.bySchemaAndName.get(e.schema))||void 0===i?void 0:i.get(e.name))||[]:this.byName.get(e.name)||[]}setByNameLevel(e,t,n){e.has(t)||e.set(t,[]),e.get(t).push(n)}setBySchemaLevel(e,t,n){e.has(t.schema)||e.set(t.schema,new Map);const r=e.get(t.schema);this.setByNameLevel(r,t.name,n)}}},2549(e,t,n){"use strict";e.exports=n(9100)},2551(e,t,n){"use strict";e.exports=i;var r=n(3610);function i(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n){var r=t[n];"__proto__"!==r&&(this[r]=e[r])}}i.create=function(e){return this.$type.create(e)},i.encode=function(e,t){return this.$type.encode(e,t)},i.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},i.decode=function(e){return this.$type.decode(e)},i.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},i.verify=function(e){return this.$type.verify(e)},i.fromObject=function(e){return this.$type.fromObject(e)},i.toObject=function(e,t){return this.$type.toObject(e,t)},i.prototype.toJSON=function(){return this.$type.toObject(this,r.toJSONOptions)}},2628(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version="1.7.0",t.dataformVersion="3.0.59"},2795(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=n(8512),o=n(5436),a=r(n(9553)),s=n(2545),l=n(5379);class c extends o.ActionBuilder{constructor(e,t,n){super(e),this.dependOnDependencyAssertions=!1,this.proto=l.sqlanvil.Notebook.create();const r=this.verifyConfig(t);r.name||(r.name=a.basename(r.filename));const i=s.actionConfigToCompiledGraphTarget(r);r.filename=s.resolveActionsConfigFilename(r.filename,n),this.session=e,this.proto.target=this.applySessionToTarget(i,e.projectConfig,r.filename,{validateTarget:!0}),this.proto.canonicalTarget=this.applySessionToTarget(i,e.canonicalProjectConfig),this.proto.tags=r.tags,this.dependOnDependencyAssertions=r.dependOnDependencyAssertions,r.dependencyTargets&&this.dependencies(r.dependencyTargets.map((e=>s.configTargetToCompiledGraphTarget(l.sqlanvil.ActionConfig.Target.create(e))))),this.proto.fileName=r.filename,r.disabled&&(this.proto.disabled=r.disabled);const o=s.nativeRequire(r.filename).asJson;this.proto.notebookContents=JSON.stringify(function(e,t){if(!("cells"in e))throw new Error(`Notebook at ${t} is invalid: cells field not present`);return"metadata"in e&&(e.metadata={}),e.cells.forEach((e=>{"outputs"in e&&(e.outputs=[]),"execution_count"in e&&(e.execution_count=null),"metadata"in e&&(e.metadata={})})),e}(o,r.filename))}ipynb(e){return this.proto.notebookContents=JSON.stringify(e),this}dependencies(e){return(Array.isArray(e)?e:[e]).forEach((e=>{const t=s.checkAssertionsForDependency(this,e);t&&this.proto.dependencyTargets.push(t)})),this}getFileName(){return this.proto.fileName}getTarget(){return l.sqlanvil.Target.create(this.proto.target)}compile(){return i.verifyObjectMatchesProto(l.sqlanvil.Notebook,this.proto,i.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM)}verifyConfig(e){return i.verifyObjectMatchesProto(l.sqlanvil.ActionConfig.NotebookConfig,e,i.VerifyProtoErrorBehaviour.SHOW_DOCS_LINK)}}t.Notebook=c},3158(e,t,n){"use strict";e.exports=o;var r=n(6237);(o.prototype=Object.create(r.prototype)).constructor=o;var i=n(3610);function o(e){r.call(this,e)}o._configure=function(){i.Buffer&&(o.prototype._slice=i.Buffer.prototype.slice)},o.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},o._configure()},3162(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3913);t.targetStringifier=new r.JSONObjectStringifier,t.targetAsReadableString=function(e){const t=[e.name,e.schema];return e.database&&t.push(e.database),t.reverse().join(".")}},3165(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(887)),o="sql",a="jsBlock",s="jsTemplateString",l="innerSqlBlock",c="innerSingleQuote",u="innerDoubleQuote",p="innerTripleSingleQuote",f="innerTripleDoubleQuote",d={START_CONFIG:o+"_startConfig",START_JS:o+"_startJs",START_INCREMENTAL:o+"_startIncremental",START_PRE_OPERATIONS:o+"_startPreOperations",START_POST_OPERATIONS:o+"_startPostOperations",START_INPUT:o+"_startInput",STATEMENT_SEPERATOR:o+"_statementSeparator",SINGLE_LINE_COMMENT:o+"_singleLineComment",MULTI_LINE_COMMENT:o+"_multiLineComment",START_JS_PLACEHOLDER:o+"_startJsPlaceholder",BACKTICK:o+"_backtick",START_QUOTE_SINGLE:o+"_startQuoteSingle",START_QUOTE_DOUBLE:o+"_startQuoteDouble",START_TRIPLE_QUOTE_SINGLE:o+"_startTripleQuoteSingle",START_TRIPLE_QUOTE_DOUBLE:o+"_startTripleQuoteDouble",CAPTURE_EVERYTHING_ELSE:o+"_captureEverythingElse"},g={SINGLE_LINE_COMMENT:a+"_singleLineComment",MULTI_LINE_COMMENT:a+"_multiLineComment",SINGLE_QUOTE_STRING:a+"_singleQuoteString",DOUBLE_QUOTE_STRING:a+"_doubleQuoteString",START_JS_TEMPLATE_STRING:a+"_startJsTemplateString",START_JS_BLOCK:a+"_startJsBlock",CLOSE_BLOCK:a+"_closeBlock",CAPTURE_EVERYTHING_ELSE:a+"_captureEverythingElse"},h={ESCAPED_BACKSLASH:s+"_escapedBackslash",ESCAPED_DOLLAR_BRACE:s+"_escapedDollarBrace",START_JS_BLOCK:s+"_startJsBlock",CLOSE_STRING:s+"_closeString",CAPTURE_EVERYTHING_ELSE:s+"_captureEverythingElse"},y={STATEMENT_SEPERATOR:l+"_statementSeparator",SINGLE_LINE_COMMENT:l+"_singleLineComment",MULTI_LINE_COMMENT:l+"_multiLineComment",START_JS_PLACEHOLDER:l+"_startJsPlaceholder",CLOSE_BLOCK:l+"_closeBlock",BACKTICK:l+"_backtick",START_QUOTE_SINGLE:l+"_startQuoteSingle",START_QUOTE_DOUBLE:l+"_startQuoteDouble",START_TRIPLE_QUOTE_SINGLE:l+"_startTripleQuoteSingle",START_TRIPLE_QUOTE_DOUBLE:l+"_startTripleQuoteDouble",CAPTURE_EVERYTHING_ELSE:l+"_captureEverythingElse"},m={ESCAPED_BACKSLASH:c+"_escapedBackslash",ESCAPED_QUOTE:c+"_escapedQuoteSingle",START_JS_PLACEHOLDER:c+"_startJsPlaceholder",CLOSE_QUOTE:c+"_closeQuoteSingle",CAPTURE_EVERYTHING_ELSE:c+"_captureEverythingElse"},b={ESCAPED_BACKSLASH:u+"_escapedBackslash",ESCAPED_QUOTE:u+"_escapedQuoteDouble",START_JS_PLACEHOLDER:u+"_startJsPlaceholder",CLOSE_QUOTE:u+"_closeQuoteDouble",CAPTURE_EVERYTHING_ELSE:u+"_captureEverythingElse"},v={ESCAPED_BACKSLASH:p+"_escapedBackslash",START_JS_PLACEHOLDER:p+"_startJsPlaceholder",CLOSE_QUOTE:p+"_closeTripleQuoteSingle",CAPTURE_EVERYTHING_ELSE:p+"_captureEverythingElse"},O={ESCAPED_BACKSLASH:f+"_escapedBackslash",START_JS_PLACEHOLDER:f+"_startJsPlaceholder",CLOSE_QUOTE:f+"_closeTripleQuoteDouble",CAPTURE_EVERYTHING_ELSE:f+"_captureEverythingElse"},T=i.states(function(){const e={};e[d.START_CONFIG]={match:"config {",push:a},e[d.START_JS]={match:"js {",push:a},e[d.START_INCREMENTAL]={match:"incremental_where {",push:l},e[d.START_PRE_OPERATIONS]={match:"pre_operations {",push:l},e[d.START_POST_OPERATIONS]={match:"post_operations {",push:l},e[d.START_INPUT]={match:/input "[a-zA-Z0-9_-]+"(?:,\s*"[a-zA-Z0-9_-]+")* {/,push:l},e[d.STATEMENT_SEPERATOR]=/[^\S\r\n]*---[^\S\r\n]*$/,e[d.SINGLE_LINE_COMMENT]=/--.*?$/,e[d.MULTI_LINE_COMMENT]=/\/\*[\s\S]*?\*\//,e[d.START_JS_PLACEHOLDER]={match:"${",push:a},e[d.BACKTICK]="`",e[d.START_TRIPLE_QUOTE_SINGLE]={match:"'''",push:p},e[d.START_TRIPLE_QUOTE_DOUBLE]={match:'"""',push:f},e[d.START_QUOTE_SINGLE]={match:"'",push:c},e[d.START_QUOTE_DOUBLE]={match:'"',push:u},e[d.CAPTURE_EVERYTHING_ELSE]={match:/[\s\S]+?/,lineBreaks:!0};const t={};t[g.SINGLE_LINE_COMMENT]=/\/\/.*?$/,t[g.MULTI_LINE_COMMENT]=/\/\*[\s\S]*?\*\//,t[g.SINGLE_QUOTE_STRING]=/'(?:\\['\\]|[^\n'\\])*'/,t[g.DOUBLE_QUOTE_STRING]=/"(?:\\["\\]|[^\n"\\])*"/,t[g.START_JS_TEMPLATE_STRING]={match:"`",push:s},t[g.START_JS_BLOCK]={match:"{",push:a},t[g.CLOSE_BLOCK]={match:"}",pop:1},t[g.CAPTURE_EVERYTHING_ELSE]={match:/[\s\S]+?/,lineBreaks:!0};const n={};n[h.ESCAPED_BACKSLASH]=/\\\\/,n[h.ESCAPED_DOLLAR_BRACE]=/\\\${`/,n[h.START_JS_BLOCK]={match:"${",push:a},n[h.CLOSE_STRING]={match:"`",pop:1},n[h.CAPTURE_EVERYTHING_ELSE]={match:/[\s\S]+?/,lineBreaks:!0};const r={};r[y.STATEMENT_SEPERATOR]=/[^\S\r\n]*---[^\S\r\n]*$/,r[y.SINGLE_LINE_COMMENT]=/--.*?$/,r[y.MULTI_LINE_COMMENT]=/\/\*[\s\S]*?\*\//,r[y.START_JS_PLACEHOLDER]={match:"${",push:a},r[y.CLOSE_BLOCK]={match:"}",pop:1},r[y.BACKTICK]="`",r[y.START_TRIPLE_QUOTE_SINGLE]={match:"'''",push:p},r[y.START_TRIPLE_QUOTE_DOUBLE]={match:'"""',push:f},r[y.START_QUOTE_SINGLE]={match:"'",push:c},r[y.START_QUOTE_DOUBLE]={match:'"',push:u},r[y.CAPTURE_EVERYTHING_ELSE]={match:/[\s\S]+?/,lineBreaks:!0};const i={};i[m.ESCAPED_BACKSLASH]="\\\\",i[m.ESCAPED_QUOTE]="\\'",i[m.START_JS_PLACEHOLDER]={match:"${",push:a},i[m.CLOSE_QUOTE]={match:"'",pop:1},i[m.CAPTURE_EVERYTHING_ELSE]={match:/[\s\S]+?/,lineBreaks:!0};const T={};T[b.ESCAPED_BACKSLASH]="\\\\",T[b.ESCAPED_QUOTE]={match:'\\"'},i[b.START_JS_PLACEHOLDER]={match:"${",push:a},T[b.CLOSE_QUOTE]={match:'"',pop:1},T[b.CAPTURE_EVERYTHING_ELSE]={match:/[\s\S]+?/,lineBreaks:!0};const w={};w[v.ESCAPED_BACKSLASH]="\\\\",w[v.START_JS_PLACEHOLDER]={match:"${",push:a},w[v.CLOSE_QUOTE]={match:"'''",pop:1},w[v.CAPTURE_EVERYTHING_ELSE]={match:/[\s\S]+?/,lineBreaks:!0};const j={};j[O.ESCAPED_BACKSLASH]="\\\\",j[O.START_JS_PLACEHOLDER]={match:"${",push:a},j[O.CLOSE_QUOTE]={match:'"""',pop:1},j[O.CAPTURE_EVERYTHING_ELSE]={match:/[\s\S]+?/,lineBreaks:!0};const q={};return q[o]=e,q[a]=t,q[s]=n,q[l]=r,q[c]=i,q[u]=T,q[p]=w,q[f]=j,q}());var w;!function(e){e[e.JAVASCRIPT=0]="JAVASCRIPT",e[e.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER=1]="JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER",e[e.SQL=2]="SQL",e[e.SQL_COMMENT=3]="SQL_COMMENT",e[e.SQL_LITERAL_STRING=4]="SQL_LITERAL_STRING",e[e.SQL_LITERAL_MULTILINE_STRING=5]="SQL_LITERAL_MULTILINE_STRING",e[e.SQL_STATEMENT_SEPARATOR=6]="SQL_STATEMENT_SEPARATOR"}(w=t.SyntaxTreeNodeType||(t.SyntaxTreeNodeType={}));const j=new Map([[d.START_CONFIG,w.JAVASCRIPT],[d.START_INCREMENTAL,w.SQL],[d.START_INPUT,w.SQL],[d.START_JS,w.JAVASCRIPT],[d.START_JS_PLACEHOLDER,w.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER],[d.START_POST_OPERATIONS,w.SQL],[d.START_PRE_OPERATIONS,w.SQL],[d.START_QUOTE_SINGLE,w.SQL_LITERAL_STRING],[d.START_QUOTE_DOUBLE,w.SQL_LITERAL_STRING],[d.START_TRIPLE_QUOTE_SINGLE,w.SQL_LITERAL_MULTILINE_STRING],[d.START_TRIPLE_QUOTE_DOUBLE,w.SQL_LITERAL_MULTILINE_STRING],[g.START_JS_BLOCK,w.JAVASCRIPT],[h.START_JS_BLOCK,w.JAVASCRIPT],[y.START_JS_PLACEHOLDER,w.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER],[y.START_QUOTE_SINGLE,w.SQL_LITERAL_STRING],[y.START_QUOTE_DOUBLE,w.SQL_LITERAL_STRING],[y.START_TRIPLE_QUOTE_SINGLE,w.SQL_LITERAL_MULTILINE_STRING],[y.START_TRIPLE_QUOTE_DOUBLE,w.SQL_LITERAL_MULTILINE_STRING],[m.START_JS_PLACEHOLDER,w.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER],[b.START_JS_PLACEHOLDER,w.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER],[v.START_JS_PLACEHOLDER,w.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER],[O.START_JS_PLACEHOLDER,w.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER]]),q=new Set([g.CLOSE_BLOCK,y.CLOSE_BLOCK,m.CLOSE_QUOTE,b.CLOSE_QUOTE,v.CLOSE_QUOTE,O.CLOSE_QUOTE]),P=new Map([[d.MULTI_LINE_COMMENT,w.SQL_COMMENT],[d.SINGLE_LINE_COMMENT,w.SQL_COMMENT],[d.STATEMENT_SEPERATOR,w.SQL_STATEMENT_SEPARATOR],[y.MULTI_LINE_COMMENT,w.SQL_COMMENT],[y.SINGLE_LINE_COMMENT,w.SQL_COMMENT],[y.STATEMENT_SEPERATOR,w.SQL_STATEMENT_SEPARATOR]]);class A{constructor(e,t=[]){this.type=e,this.allChildren=t}static create(e){const t=new A(w.SQL);let n=t;const r=[n];T.reset(e);for(const e of T){if(!e.type)throw new Error("Undefined token type encountered.");if(j.has(e.type)){const t=j.get(e.type);if(t===w.SQL&&n.type!==w.SQL)throw new Error("SQL syntax tree nodes may only be children of other SQL nodes.");const i=new A(t,[e.value]);r.push(i),n.push(i),n=i}else q.has(e.type)?(n.push(e.value),r.pop(),n=r[r.length-1]):P.has(e.type)?n.push(new A(P.get(e.type)).push(e.value)):n.push(e.value)}return t}static isSyntaxTreeNode(e){return"string"!=typeof e}children(){return this.allChildren.slice()}concatenate(e){const t=(null==e?void 0:e.has(this.type))?e.get(this.type):e=>e;return this.allChildren.map((e=>"string"==typeof e?t(e):e.concatenate())).join("")}push(e){return this.allChildren.length>0&&"string"==typeof e&&"string"==typeof this.allChildren[this.allChildren.length-1]?(this.allChildren[this.allChildren.length-1]=this.allChildren[this.allChildren.length-1]+e,this):(this.allChildren.push(e),this)}equals(e){return this.type===e.type&&(this.allChildren.length===e.children().length&&!this.allChildren.some(((t,n)=>{return!(typeof(r=t)==typeof(i=e.children()[n])&&("string"==typeof r||"string"==typeof i?r===i:r.equals(i)));var r,i})))}}t.SyntaxTreeNode=A},3262(e,t,n){"use strict";var r,i,o=e.exports=n(3610),a=n(4529);o.codegen=n(8561),o.fetch=n(5212),o.path=n(9207),o.fs=o.inquire("fs"),o.toArray=function(e){if(e){for(var t=Object.keys(e),n=new Array(t.length),r=0;r<t.length;)n[r]=e[t[r++]];return n}return[]},o.toObject=function(e){for(var t={},n=0;n<e.length;){var r=e[n++],i=e[n++];void 0!==i&&(t[r]=i)}return t};var s=/\\/g,l=/"/g;o.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},o.safeProp=function(e){return!/^[$\w_]+$/.test(e)||o.isReserved(e)?'["'+e.replace(s,"\\\\").replace(l,'\\"')+'"]':"."+e},o.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var c=/_([a-z])/g;o.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(c,(function(e,t){return t.toUpperCase()}))},o.compareFieldsById=function(e,t){return e.id-t.id},o.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(o.decorateRoot.remove(e.$type),e.$type.name=t,o.decorateRoot.add(e.$type)),e.$type;r||(r=n(7882));var i=new r(t||e.name);return o.decorateRoot.add(i),i.ctor=e,Object.defineProperty(e,"$type",{value:i,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:i,enumerable:!1}),i};var u=0;o.decorateEnum=function(e){if(e.$type)return e.$type;i||(i=n(5643));var t=new i("Enum"+u++,e);return o.decorateRoot.add(t),Object.defineProperty(e,"$type",{value:t,enumerable:!1}),t},o.setProperty=function(e,t,n,r){if("object"!=typeof e)throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return function e(t,n,i){var o=n.shift();if("__proto__"===o||"prototype"===o)return t;if(n.length>0)t[o]=e(t[o]||{},n,i);else{var a=t[o];if(a&&r)return t;a&&(i=[].concat(a).concat(i)),t[o]=i}return t}(e,t=t.split("."),n)},Object.defineProperty(o,"decorateRoot",{get:function(){return a.decorated||(a.decorated=new(n(5330)))}})},3314(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Structs=class{static toObject(e){if(!e||!e.fields)return;const t={};for(const[n,r]of Object.entries(e.fields))t[n]=this.fromValue(r);return t}static fromObject(e){const t={};for(const[n,r]of Object.entries(e))t[n]=this.toValue(r);return{fields:t}}static fromValue(e){return null!==e.nullValue&&void 0!==e.nullValue?null:null!==e.numberValue&&void 0!==e.numberValue?e.numberValue:null!==e.stringValue&&void 0!==e.stringValue?e.stringValue:null!==e.boolValue&&void 0!==e.boolValue?e.boolValue:null!==e.structValue&&void 0!==e.structValue?this.toObject(e.structValue):null!==e.listValue&&void 0!==e.listValue?(e.listValue.values||[]).map((e=>this.fromValue(e))):void 0}static toValue(e){return"number"==typeof e?{numberValue:e}:"string"==typeof e?{stringValue:e}:"boolean"==typeof e?{boolValue:e}:null==e?{nullValue:0}:Array.isArray(e)?{listValue:{values:e.map((e=>this.toValue(e)))}}:"object"==typeof e?{structValue:this.fromObject(e)}:{nullValue:0}}}},3449(e,t,n){"use strict";e.exports=p;var r,i=n(3610),o=i.LongBits,a=i.base64,s=i.utf8;function l(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function c(){}function u(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function p(){this.len=0,this.head=new l(c,0,0),this.tail=this.head,this.states=null}var f=function(){return i.Buffer?function(){return(p.create=function(){return new r})()}:function(){return new p}};function d(e,t,n){t[n]=255&e}function g(e,t){this.len=e,this.next=void 0,this.val=t}function h(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function y(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}p.create=f(),p.alloc=function(e){return new i.Array(e)},i.Array!==Array&&(p.alloc=i.pool(p.alloc,i.Array.prototype.subarray)),p.prototype._push=function(e,t,n){return this.tail=this.tail.next=new l(e,t,n),this.len+=t,this},g.prototype=Object.create(l.prototype),g.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},p.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new g((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},p.prototype.int32=function(e){return e<0?this._push(h,10,o.fromNumber(e)):this.uint32(e)},p.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},p.prototype.uint64=function(e){var t=o.from(e);return this._push(h,t.length(),t)},p.prototype.int64=p.prototype.uint64,p.prototype.sint64=function(e){var t=o.from(e).zzEncode();return this._push(h,t.length(),t)},p.prototype.bool=function(e){return this._push(d,1,e?1:0)},p.prototype.fixed32=function(e){return this._push(y,4,e>>>0)},p.prototype.sfixed32=p.prototype.fixed32,p.prototype.fixed64=function(e){var t=o.from(e);return this._push(y,4,t.lo)._push(y,4,t.hi)},p.prototype.sfixed64=p.prototype.fixed64,p.prototype.float=function(e){return this._push(i.float.writeFloatLE,4,e)},p.prototype.double=function(e){return this._push(i.float.writeDoubleLE,8,e)};var m=i.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};p.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(d,1,0);if(i.isString(e)){var n=p.alloc(t=a.length(e));a.decode(e,n,0),e=n}return this.uint32(t)._push(m,t,e)},p.prototype.string=function(e){var t=s.length(e);return t?this.uint32(t)._push(s.write,t,e):this._push(d,1,0)},p.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new l(c,0,0),this.len=0,this},p.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new l(c,0,0),this.len=0),this},p.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},p.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},p._configure=function(e){r=e,p.create=f(),r._configure()}},3560(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8512),i=n(8771),o=n(5379);class a extends i.ActionBuilder{constructor(e,t){super(e),this.proto=o.sqlanvil.Operation.create(),this.session=e,this.config=t;const n=this.applySessionToTarget(o.sqlanvil.Target.create({name:t.table}),e.projectConfig),r=o.sqlanvil.Target.create({name:`${t.table}_policy_${t.name}`});this.proto.target=this.applySessionToTarget(r,e.projectConfig,t.filename,{validateTarget:!0}),this.proto.canonicalTarget=this.applySessionToTarget(r,e.canonicalProjectConfig),this.proto.fileName=t.filename||"",this.proto.dependencyTargets.push(n)}getFileName(){return this.proto.fileName}getTarget(){return o.sqlanvil.Target.create(this.proto.target)}compile(){const e=this.finalizeTarget(o.sqlanvil.Target.create({name:this.config.table})),t=this.session.compilationSql().resolveTarget(e),n=`"${this.config.name}"`,i=[`alter table ${t} enable row level security`,`drop policy if exists ${n} on ${t}`,`create policy ${n} on ${t} for ${this.config.command?this.config.command.toUpperCase():"ALL"} to ${this.config.roles&&this.config.roles.length>0?this.config.roles.join(", "):"PUBLIC"}${this.config.using?` USING (${this.config.using})`:""}${this.config.withCheck?` WITH CHECK (${this.config.withCheck})`:""}`];return this.proto.queries=i,r.verifyObjectMatchesProto(o.sqlanvil.Operation,this.proto,r.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM)}}t.RlsPolicy=a},3610(e,t,n){"use strict";var r=t;function i(e,t,n){for(var r=Object.keys(t),i=0;i<r.length;++i)void 0!==e[r[i]]&&n||(e[r[i]]=t[r[i]]);return e}function o(e){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&i(this,n)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}r.asPromise=n(8045),r.base64=n(8839),r.EventEmitter=n(4358),r.float=n(9410),r.inquire=n(4153),r.utf8=n(1447),r.pool=n(9390),r.LongBits=n(2239),r.isNode=Boolean("undefined"!=typeof global&&global&&global.process&&global.process.versions&&global.process.versions.node),r.global=r.isNode&&global||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},r.isString=function(e){return"string"==typeof e||e instanceof String},r.isObject=function(e){return e&&"object"==typeof e},r.isset=r.isSet=function(e,t){var n=e[t];return!(null==n||!e.hasOwnProperty(t))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"==typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){var n=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(n.lo,n.hi,t):n.toNumber(Boolean(t))},r.merge=i,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=o,r.ProtocolError=o("ProtocolError"),r.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},r.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},r._configure=function(){var e=r.Buffer;e?(r._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},r._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):r._Buffer_from=r._Buffer_allocUnsafe=null}},3788(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=n(7210),o=n(8512),a=n(5436),s=r(n(9553)),l=n(2545),c=n(5379);class u extends a.ActionBuilder{constructor(e,t,n){if(super(e),this.proto=c.sqlanvil.DataPreparation.create(),this.session=e,t.name)t.name.endsWith(".dp")&&t.filename.endsWith(".dp.sqlx")&&(t.name=t.name.slice(0,-3));else{const e=s.filename(t.filename);if(e.toLowerCase().endsWith(".dp.yaml")||e.toLowerCase().endsWith(".dp.sqlx"))t.name=e.slice(0,-8);else{if(!e.toLowerCase().endsWith(".yaml")&&!e.toLowerCase().endsWith(".sqlx"))throw new Error("Only YAML and SQLX files are supported");t.name=e.slice(0,-5)}}const r=s.fileExtension(t.filename);"yaml"===r?this.configureYaml(e,t,n):"sqlx"===r&&this.configureSqlx(e,t)}config(e){return e.database&&this.database(e.database),e.project&&this.database(e.project),e.schema&&this.schema(e.schema),e.dataset&&this.schema(e.dataset),this}query(e){return this.contextableQuery=e,this}dependencies(e){return(Array.isArray(e)?e:[e]).forEach((e=>this.proto.dependencyTargets.push(l.checkAssertionsForDependency(this,e)))),this}getFileName(){return this.proto.fileName}getTarget(){return c.sqlanvil.Target.create(this.proto.target)}compile(){if(null!=this.contextableQuery){const e=new p(this);this.proto.query=e.apply(this.contextableQuery).trim(),l.validateQueryString(this.session,this.proto.query,this.proto.fileName)}return o.verifyObjectMatchesProto(c.sqlanvil.DataPreparation,this.proto,o.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM)}database(e){return this.proto.target=this.applySessionToTarget(c.sqlanvil.Target.create(Object.assign(Object.assign({},this.proto.target),{database:e})),this.session.projectConfig,this.proto.fileName,{validateTarget:!0}),this}schema(e){return this.proto.target=this.applySessionToTarget(c.sqlanvil.Target.create(Object.assign(Object.assign({},this.proto.target),{schema:e})),this.session.projectConfig,this.proto.fileName,{validateTarget:!0}),this}configureYamlWithoutTargets(e,t,n){const r=c.sqlanvil.Target.create({name:n.name});this.proto.target=this.finalizeTarget(this.applySessionToTarget(r,t.projectConfig,n.filename,{validateTarget:!0})),this.proto.targets=[this.proto.target],this.proto.canonicalTarget=this.applySessionToTarget(r,t.canonicalProjectConfig),this.proto.canonicalTargets=[this.proto.canonicalTarget];const o=this.applySessionToDataPreparationContents(e);this.proto.dataPreparationYaml=i.dump(o)}configureYamlWithTargets(e,t,n,r){const o=e.map((e=>this.applySessionToTarget(e,n.projectConfig,r.filename,{validateTarget:!0})));this.proto.targets=o.map((e=>this.finalizeTarget(e))),this.proto.canonicalTargets=e.map((e=>this.applySessionToTarget(e,n.canonicalProjectConfig)));const a=this.applySessionToDataPreparationContents(t);this.proto.dataPreparationYaml=i.dump(a),this.proto.target=o[0],this.proto.canonicalTarget=this.proto.canonicalTargets[0]}applySessionToDataPreparationContents(e){var t;if(!e)return e;const n=null===(t=e.configuration)||void 0===t?void 0:t.errorTable;return n&&(e.configuration.errorTable=this.applySessionToTableReference(n)),e.nodes&&e.nodes.forEach(((t,n)=>{var r,i;const o=null===(r=t.source)||void 0===r?void 0:r.table;o&&(e.nodes[n].source.table=this.applySessionToTableReference(o));const a=null===(i=t.destination)||void 0===i?void 0:i.table;a&&(e.nodes[n].destination.table=this.applySessionToTableReference(a))})),e}applySessionToTableReference(e){const t={database:e.project,schema:e.dataset,name:e.table},n=this.applySessionToTarget(c.sqlanvil.Target.create(t),this.session.projectConfig);let r={table:this.session.finalizeName(n.name)};return n.schema&&(r=Object.assign({dataset:this.session.finalizeSchema(n.schema)},r)),n.database&&(r=Object.assign({project:this.session.finalizeDatabase(n.database)},r)),r}getTargets(e){const t=[];return e&&e.nodes&&e.nodes.forEach((e=>{var n;const r=null===(n=e.destination)||void 0===n?void 0:n.table;if(r){const e={database:r.project,schema:r.dataset,name:r.table};t.push(c.sqlanvil.Target.create(e))}})),t}configureYaml(e,t,n){t.filename=l.resolveActionsConfigFilename(t.filename,n);const r=l.nativeRequire(t.filename).asJson,i=this.getTargets(r);i.length>0?this.configureYamlWithTargets(i,r,e,t):this.configureYamlWithoutTargets(r,e,t),this.proto.tags=t.tags,t.dependencyTargets&&this.dependencies(t.dependencyTargets.map((e=>l.configTargetToCompiledGraphTarget(c.sqlanvil.ActionConfig.Target.create(e))))),this.proto.fileName=t.filename,t.disabled&&(this.proto.disabled=t.disabled)}configureSqlx(e,t){var n,r,i;const o=[];if(o.push(l.actionConfigToCompiledGraphTarget(t)),null!=t.errorTable){const e=c.sqlanvil.ActionConfig.DataPreparationConfig.ErrorTableConfig.create(t.errorTable),n=l.actionConfigToCompiledGraphTarget(e);this.proto.errorTableRetentionDays=e.retentionDays,o.push(n)}this.proto.load=this.mapLoadMode(null===(n=t.loadMode)||void 0===n?void 0:n.mode,null===(r=t.loadMode)||void 0===r?void 0:r.incrementalColumn,null===(i=t.loadMode)||void 0===i?void 0:i.uniqueKey),this.proto.targets=o.map((n=>this.applySessionToTarget(n,e.projectConfig,t.filename,{validateTarget:!0}))).map((e=>this.finalizeTarget(e))),this.proto.target=this.proto.targets[0],this.proto.targets.length>1&&(this.proto.errorTable=this.proto.targets[1]),this.proto.canonicalTargets=o.map((t=>this.applySessionToTarget(t,e.canonicalProjectConfig))),this.proto.canonicalTarget=this.proto.canonicalTargets[0],t.dependencyTargets&&this.dependencies(t.dependencyTargets.map((e=>l.configTargetToCompiledGraphTarget(c.sqlanvil.ActionConfig.Target.create(e))))),this.proto.tags=t.tags,this.proto.fileName=t.filename,t.disabled&&(this.proto.disabled=t.disabled),this.query(l.nativeRequire(t.filename).query)}mapLoadMode(e,t,n){if(!e)return c.sqlanvil.LoadConfiguration.create({replace:{}});switch(e.toString().toUpperCase()){case"REPLACE_TABLE":return c.sqlanvil.LoadConfiguration.create({replace:{}});case"APPEND":return c.sqlanvil.LoadConfiguration.create({append:{}});case"MAXIMUM":return c.sqlanvil.LoadConfiguration.create({maximum:{columnName:this.validateLoadModeColumnName(t)}});case"UNIQUE":return c.sqlanvil.LoadConfiguration.create({unique:{columnName:this.validateLoadModeColumnName(t)}});case"MERGE":return c.sqlanvil.LoadConfiguration.create({merge:{uniqueKey:this.validateUniqueKey(n)}});default:throw new Error(`LoadMode value "${e}" is not supported`)}}validateLoadModeColumnName(e){if(!e||""===e)throw new Error("columnName is required for MAXIMUM and UNIQUE load modes.");return e}validateUniqueKey(e){if(!e||e.length<1)throw new Error("uniqueKey is required for MERGE load mode.");return e}}t.DataPreparation=u;class p{constructor(e,t=!1){this.dataPreparation=e,this.isIncremental=t,this.EXPECT=" /* @@VALIDATION */ WHERE "}config(e){return this.dataPreparation.config(e),""}self(){return this.resolve(this.dataPreparation.getTarget())}name(){return this.dataPreparation.session.finalizeName(this.dataPreparation.getTarget().name)}ref(e,...t){return e=l.toResolvable(e,t),l.resolvableAsTarget(e)?(this.dataPreparation.dependencies(e),this.resolve(e)):(this.dataPreparation.session.compileError(new Error("Action name is not specified")),"")}resolve(e,...t){return this.dataPreparation.session.resolve(e,...t)}schema(){return this.dataPreparation.session.finalizeSchema(this.dataPreparation.getTarget().schema)}database(){return this.dataPreparation.getTarget().database?this.dataPreparation.session.finalizeDatabase(this.dataPreparation.getTarget().database):(this.dataPreparation.session.compileError(new Error("Warehouse does not support multiple databases")),"")}when(e,t,n=""){return e?t:n}incremental(){return!!this.isIncremental}dependencies(e){return this.dataPreparation.dependencies(e),""}apply(e){return"function"==typeof e?e(this):e}}t.DataPreparationContext=p},3913(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JSONObjectStringifier=class{stringify(e){return JSON.stringify(Object.keys(e).sort().reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:e[n]})),{}))}parse(e){return JSON.parse(e)}}},4098(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8512),i=n(5436),o=n(1299),a=n(2008),s=n(8995),l=n(3162),c=n(2545),u=n(5379),p=c.strictKeysOf()(["type","dataset","name","filename","tags"]);class f extends i.ActionBuilder{constructor(e,t){super(e),this.contextableInputs=new Map,this.proto=u.sqlanvil.Test.create(),this.session=e,t&&this.config(t)}config(e){if(c.checkExcessProperties((e=>this.session.compileError(e)),e,p,"test config"),e.name&&(this.proto.name=e.name),e.dataset){this.testTarget=u.sqlanvil.Target.create(this.applySessionToTarget(c.resolvableAsTarget(c.toResolvable(e.dataset)),this.session.projectConfig));const t=u.sqlanvil.Target.create(this.applySessionToTarget(c.resolvableAsTarget(c.toResolvable(e.dataset)),this.session.canonicalProjectConfig));this.proto.target=h(this.testTarget,this.proto.name),this.proto.canonicalTarget=h(t,this.proto.name)}return e.filename&&(this.proto.fileName=e.filename),e.tags&&(this.proto.tags=e.tags),this}dataset(e){return this.config({dataset:e}),this}input(e,t){return this.contextableInputs.set(l.targetStringifier.stringify(c.resolvableAsTarget(c.toResolvable(e))),t),this}expect(e){return this.contextableQuery=e,this}getFileName(){return this.proto.fileName}getTarget(){return u.sqlanvil.Target.create(this.proto.target)}getTestTarget(){return u.sqlanvil.Target.create(this.testTarget)}setFilename(e){this.proto.fileName=e}compile(){const e=new d(this);if(!this.testTarget)return this.session.compileError(new Error("Tests must operate upon a specified dataset."),this.proto.fileName),this.proto;{const t=this.session.indexedActions.find(this.testTarget);if(t.length>1)return this.session.compileError(new Error(c.ambiguousActionNameMsg(this.testTarget,t)),this.proto.fileName),this.proto;const n=t.length>0?t[0]:void 0;if(!n||!(n instanceof a.Table||n instanceof s.View||n instanceof o.IncrementalTable))return this.session.compileError(new Error(`Dataset ${c.stringifyResolvable(this.testTarget)} could not be found.`),this.proto.fileName),this.proto;{const t=new g(e);this.proto.testQuery=t.apply(n.contextableQuery)}}return this.proto.expectedOutputQuery=e.apply(this.contextableQuery),this.proto.testQuery.trim()||this.session.compileError(new Error("Test query is empty."),this.proto.fileName),this.proto.expectedOutputQuery.trim()||this.session.compileError(new Error("Expected query is empty."),this.proto.fileName),r.verifyObjectMatchesProto(u.sqlanvil.Test,this.proto,r.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM)}}t.Test=f;class d{constructor(e){this.test=e}apply(e){return"function"==typeof e?e(this):e}}t.TestContext=d;class g{constructor(e){this.testContext=e}ref(e,...t){return this.resolve(e,...t)}resolve(e,...t){const n=c.resolvableAsTarget(c.toResolvable(e,t));return this.testContext.test.contextableInputs.has(l.targetStringifier.stringify(n))?`(${this.testContext.apply(this.testContext.test.contextableInputs.get(l.targetStringifier.stringify(n)))})`:(this.testContext.test.session.compileError(new Error(`Input for dataset "${JSON.stringify(n)}" has not been provided. Provided inputs: ${Array.from(this.testContext.test.contextableInputs.keys()).map((e=>JSON.stringify(e)))}`)),"")}apply(e){return"function"==typeof e?e(this):e}config(e){return""}self(){return""}name(){return""}type(e){return""}schema(){return""}database(){return""}where(e){return""}when(e,t,n=""){return e?t:n}incremental(){return!1}preOps(e){return""}postOps(e){return""}disabled(){return""}dependencies(e){return""}tags(e){return""}}function h(e,t){return u.sqlanvil.Target.create({database:e.database,schema:e.schema,name:t})}},4153(module){"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},4358(e){"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var n=this._listeners[e],r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this}},4394(e,t,n){"use strict";var r=t;function i(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=n(3449),r.BufferWriter=n(818),r.Reader=n(6237),r.BufferReader=n(3158),r.util=n(3610),r.rpc=n(5047),r.roots=n(4529),r.configure=i,i()},4466(e,t,n){"use strict";var r=n(8433),i=n(5388);function o(e){return 48<=e&&e<=55}function a(e){return 48<=e&&e<=57}e.exports=new i("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=e.length,i=0,s=!1;if(!r)return!1;if("-"!==(t=e[i])&&"+"!==t||(t=e[++i]),"0"===t){if(i+1===r)return!0;if("b"===(t=e[++i])){for(i++;i<r;i++)if("_"!==(t=e[i])){if("0"!==t&&"1"!==t)return!1;s=!0}return s&&"_"!==t}if("x"===t){for(i++;i<r;i++)if("_"!==(t=e[i])){if(!(48<=(n=e.charCodeAt(i))&&n<=57||65<=n&&n<=70||97<=n&&n<=102))return!1;s=!0}return s&&"_"!==t}if("o"===t){for(i++;i<r;i++)if("_"!==(t=e[i])){if(!o(e.charCodeAt(i)))return!1;s=!0}return s&&"_"!==t}}if("_"===t)return!1;for(;i<r;i++)if("_"!==(t=e[i])){if(!a(e.charCodeAt(i)))return!1;s=!0}return!(!s||"_"===t)},construct:function(e){var t,n=e,r=1;if(-1!==n.indexOf("_")&&(n=n.replace(/_/g,"")),"-"!==(t=n[0])&&"+"!==t||("-"===t&&(r=-1),t=(n=n.slice(1))[0]),"0"===n)return 0;if("0"===t){if("b"===n[1])return r*parseInt(n.slice(2),2);if("x"===n[1])return r*parseInt(n.slice(2),16);if("o"===n[1])return r*parseInt(n.slice(2),8)}return r*parseInt(n,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!r.isNegativeZero(e)},represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},4529(e){"use strict";e.exports={}},4565(e,t,n){"use strict";e.exports=n(4394)},4781(e,t,n){"use strict";var r=n(8433),i=n(1231),o=n(5489),a=Object.prototype.toString,s=Object.prototype.hasOwnProperty,l=65279,c={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},u=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],p=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function f(e){var t,n,o;if(t=e.toString(16).toUpperCase(),e<=255)n="x",o=2;else if(e<=65535)n="u",o=4;else{if(!(e<=4294967295))throw new i("code point within a string may not be greater than 0xFFFFFFFF");n="U",o=8}return"\\"+n+r.repeat("0",o-t.length)+t}function d(e){this.schema=e.schema||o,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=r.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=function(e,t){var n,r,i,o,a,l,c;if(null===t)return{};for(n={},i=0,o=(r=Object.keys(t)).length;i<o;i+=1)a=r[i],l=String(t[a]),"!!"===a.slice(0,2)&&(a="tag:yaml.org,2002:"+a.slice(2)),(c=e.compiledTypeMap.fallback[a])&&s.call(c.styleAliases,l)&&(l=c.styleAliases[l]),n[a]=l;return n}(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType='"'===e.quotingType?2:1,this.forceQuotes=e.forceQuotes||!1,this.replacer="function"==typeof e.replacer?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function g(e,t){for(var n,i=r.repeat(" ",t),o=0,a=-1,s="",l=e.length;o<l;)-1===(a=e.indexOf("\n",o))?(n=e.slice(o),o=l):(n=e.slice(o,a+1),o=a+1),n.length&&"\n"!==n&&(s+=i),s+=n;return s}function h(e,t){return"\n"+r.repeat(" ",e.indent*t)}function y(e){return 32===e||9===e}function m(e){return 32<=e&&e<=126||161<=e&&e<=55295&&8232!==e&&8233!==e||57344<=e&&e<=65533&&e!==l||65536<=e&&e<=1114111}function b(e){return m(e)&&e!==l&&13!==e&&10!==e}function v(e,t,n){var r=b(e),i=r&&!y(e);return(n?r:r&&44!==e&&91!==e&&93!==e&&123!==e&&125!==e)&&35!==e&&!(58===t&&!i)||b(t)&&!y(t)&&35===e||58===t&&i}function O(e,t){var n,r=e.charCodeAt(t);return r>=55296&&r<=56319&&t+1<e.length&&(n=e.charCodeAt(t+1))>=56320&&n<=57343?1024*(r-55296)+n-56320+65536:r}function T(e){return/^\n* /.test(e)}function w(e,t,n,r,o){e.dump=function(){if(0===t.length)return 2===e.quotingType?'""':"''";if(!e.noCompatMode&&(-1!==u.indexOf(t)||p.test(t)))return 2===e.quotingType?'"'+t+'"':"'"+t+"'";var a=e.indent*Math.max(1,n),s=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-a),d=r||e.flowLevel>-1&&n>=e.flowLevel;switch(function(e,t,n,r,i,o,a,s){var c,u,p=0,f=null,d=!1,g=!1,h=-1!==r,b=-1,w=m(u=O(e,0))&&u!==l&&!y(u)&&45!==u&&63!==u&&58!==u&&44!==u&&91!==u&&93!==u&&123!==u&&125!==u&&35!==u&&38!==u&&42!==u&&33!==u&&124!==u&&61!==u&&62!==u&&39!==u&&34!==u&&37!==u&&64!==u&&96!==u&&function(e){return!y(e)&&58!==e}(O(e,e.length-1));if(t||a)for(c=0;c<e.length;p>=65536?c+=2:c++){if(!m(p=O(e,c)))return 5;w=w&&v(p,f,s),f=p}else{for(c=0;c<e.length;p>=65536?c+=2:c++){if(10===(p=O(e,c)))d=!0,h&&(g=g||c-b-1>r&&" "!==e[b+1],b=c);else if(!m(p))return 5;w=w&&v(p,f,s),f=p}g=g||h&&c-b-1>r&&" "!==e[b+1]}return d||g?n>9&&T(e)?5:a?2===o?5:2:g?4:3:!w||a||i(e)?2===o?5:2:1}(t,d,e.indent,s,(function(t){return function(e,t){var n,r;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(e.implicitTypes[n].resolve(t))return!0;return!1}(e,t)}),e.quotingType,e.forceQuotes&&!r,o)){case 1:return t;case 2:return"'"+t.replace(/'/g,"''")+"'";case 3:return"|"+j(t,e.indent)+q(g(t,a));case 4:return">"+j(t,e.indent)+q(g(function(e,t){for(var n,r,i,o=/(\n+)([^\n]*)/g,a=(i=-1!==(i=e.indexOf("\n"))?i:e.length,o.lastIndex=i,P(e.slice(0,i),t)),s="\n"===e[0]||" "===e[0];r=o.exec(e);){var l=r[1],c=r[2];n=" "===c[0],a+=l+(s||n||""===c?"":"\n")+P(c,t),s=n}return a}(t,s),a));case 5:return'"'+function(e){for(var t,n="",r=0,i=0;i<e.length;r>=65536?i+=2:i++)r=O(e,i),!(t=c[r])&&m(r)?(n+=e[i],r>=65536&&(n+=e[i+1])):n+=t||f(r);return n}(t)+'"';default:throw new i("impossible error: invalid scalar style")}}()}function j(e,t){var n=T(e)?String(t):"",r="\n"===e[e.length-1];return n+(!r||"\n"!==e[e.length-2]&&"\n"!==e?r?"":"-":"+")+"\n"}function q(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function P(e,t){if(""===e||" "===e[0])return e;for(var n,r,i=/ [^ ]/g,o=0,a=0,s=0,l="";n=i.exec(e);)(s=n.index)-o>t&&(r=a>o?a:s,l+="\n"+e.slice(o,r),o=r+1),a=s;return l+="\n",e.length-o>t&&a>o?l+=e.slice(o,a)+"\n"+e.slice(a+1):l+=e.slice(o),l.slice(1)}function A(e,t,n,r){var i,o,a,s="",l=e.tag;for(i=0,o=n.length;i<o;i+=1)a=n[i],e.replacer&&(a=e.replacer.call(n,String(i),a)),(S(e,t+1,a,!0,!0,!1,!0)||void 0===a&&S(e,t+1,null,!0,!0,!1,!0))&&(r&&""===s||(s+=h(e,t)),e.dump&&10===e.dump.charCodeAt(0)?s+="-":s+="- ",s+=e.dump);e.tag=l,e.dump=s||"[]"}function C(e,t,n){var r,o,l,c,u,p;for(l=0,c=(o=n?e.explicitTypes:e.implicitTypes).length;l<c;l+=1)if(((u=o[l]).instanceOf||u.predicate)&&(!u.instanceOf||"object"==typeof t&&t instanceof u.instanceOf)&&(!u.predicate||u.predicate(t))){if(n?u.multi&&u.representName?e.tag=u.representName(t):e.tag=u.tag:e.tag="?",u.represent){if(p=e.styleMap[u.tag]||u.defaultStyle,"[object Function]"===a.call(u.represent))r=u.represent(t,p);else{if(!s.call(u.represent,p))throw new i("!<"+u.tag+'> tag resolver accepts not "'+p+'" style');r=u.represent[p](t,p)}e.dump=r}return!0}return!1}function S(e,t,n,r,o,s,l){e.tag=null,e.dump=n,C(e,n,!1)||C(e,n,!0);var c,u=a.call(e.dump),p=r;r&&(r=e.flowLevel<0||e.flowLevel>t);var f,d,g="[object Object]"===u||"[object Array]"===u;if(g&&(d=-1!==(f=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||d||2!==e.indent&&t>0)&&(o=!1),d&&e.usedDuplicates[f])e.dump="*ref_"+f;else{if(g&&d&&!e.usedDuplicates[f]&&(e.usedDuplicates[f]=!0),"[object Object]"===u)r&&0!==Object.keys(e.dump).length?(function(e,t,n,r){var o,a,s,l,c,u,p="",f=e.tag,d=Object.keys(n);if(!0===e.sortKeys)d.sort();else if("function"==typeof e.sortKeys)d.sort(e.sortKeys);else if(e.sortKeys)throw new i("sortKeys must be a boolean or a function");for(o=0,a=d.length;o<a;o+=1)u="",r&&""===p||(u+=h(e,t)),l=n[s=d[o]],e.replacer&&(l=e.replacer.call(n,s,l)),S(e,t+1,s,!0,!0,!0)&&((c=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024)&&(e.dump&&10===e.dump.charCodeAt(0)?u+="?":u+="? "),u+=e.dump,c&&(u+=h(e,t)),S(e,t+1,l,!0,c)&&(e.dump&&10===e.dump.charCodeAt(0)?u+=":":u+=": ",p+=u+=e.dump));e.tag=f,e.dump=p||"{}"}(e,t,e.dump,o),d&&(e.dump="&ref_"+f+e.dump)):(function(e,t,n){var r,i,o,a,s,l="",c=e.tag,u=Object.keys(n);for(r=0,i=u.length;r<i;r+=1)s="",""!==l&&(s+=", "),e.condenseFlow&&(s+='"'),a=n[o=u[r]],e.replacer&&(a=e.replacer.call(n,o,a)),S(e,t,o,!1,!1)&&(e.dump.length>1024&&(s+="? "),s+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),S(e,t,a,!1,!1)&&(l+=s+=e.dump));e.tag=c,e.dump="{"+l+"}"}(e,t,e.dump),d&&(e.dump="&ref_"+f+" "+e.dump));else if("[object Array]"===u)r&&0!==e.dump.length?(e.noArrayIndent&&!l&&t>0?A(e,t-1,e.dump,o):A(e,t,e.dump,o),d&&(e.dump="&ref_"+f+e.dump)):(function(e,t,n){var r,i,o,a="",s=e.tag;for(r=0,i=n.length;r<i;r+=1)o=n[r],e.replacer&&(o=e.replacer.call(n,String(r),o)),(S(e,t,o,!1,!1)||void 0===o&&S(e,t,null,!1,!1))&&(""!==a&&(a+=","+(e.condenseFlow?"":" ")),a+=e.dump);e.tag=s,e.dump="["+a+"]"}(e,t,e.dump),d&&(e.dump="&ref_"+f+" "+e.dump));else{if("[object String]"!==u){if("[object Undefined]"===u)return!1;if(e.skipInvalid)return!1;throw new i("unacceptable kind of an object to dump "+u)}"?"!==e.tag&&w(e,e.dump,t,s,p)}null!==e.tag&&"?"!==e.tag&&(c=encodeURI("!"===e.tag[0]?e.tag.slice(1):e.tag).replace(/!/g,"%21"),c="!"===e.tag[0]?"!"+c:"tag:yaml.org,2002:"===c.slice(0,18)?"!!"+c.slice(18):"!<"+c+">",e.dump=c+" "+e.dump)}return!0}function x(e,t){var n,r,i=[],o=[];for(k(e,i,o),n=0,r=o.length;n<r;n+=1)t.duplicates.push(i[o[n]]);t.usedDuplicates=new Array(r)}function k(e,t,n){var r,i,o;if(null!==e&&"object"==typeof e)if(-1!==(i=t.indexOf(e)))-1===n.indexOf(i)&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,o=e.length;i<o;i+=1)k(e[i],t,n);else for(i=0,o=(r=Object.keys(e)).length;i<o;i+=1)k(e[r[i]],t,n)}e.exports.dump=function(e,t){var n=new d(t=t||{});n.noRefs||x(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},"",r)),S(n,0,r,!0,!0)?n.dump+"\n":""}},4863(e,t,n){"use strict";e.exports=q,q.filename=null,q.defaults={keepCase:!1};var r=n(527),i=n(5330),o=n(7882),a=n(1344),s=n(8252),l=n(1457),c=n(5643),u=n(9687),p=n(8811),f=n(7209),d=n(361),g=n(3262),h=/^[1-9][0-9]*$/,y=/^-?[1-9][0-9]*$/,m=/^0[x][0-9a-fA-F]+$/,b=/^-?0[x][0-9a-fA-F]+$/,v=/^0[0-7]+$/,O=/^-?0[0-7]+$/,T=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,w=/^[a-zA-Z_][a-zA-Z_0-9]*$/,j=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;function q(e,t,n){t instanceof i||(n=t,t=new i),n||(n=q.defaults);var P,A,C,S,x=n.preferTrailingComment||!1,k=r(e,n.alternateCommentMode||!1),E=k.next,D=k.push,N=k.peek,R=k.skip,_=k.cmnt,I=!0,L="proto2",M=t,B=[],F={},U=n.keepCase?function(e){return e}:g.camelCase;function J(e,t,n){var r=q.filename;return n||(q.filename=null),Error("illegal "+(t||"token")+" '"+e+"' ("+(r?r+", ":"")+"line "+k.line+")")}function V(){var e,t=[];do{if('"'!==(e=E())&&"'"!==e)throw J(e);t.push(E()),R(e),e=N()}while('"'===e||"'"===e);return t.join("")}function K(e){var t=E();switch(t){case"'":case'"':return D(t),V();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return function(e){var t=1;switch("-"===e.charAt(0)&&(t=-1,e=e.substring(1)),e){case"inf":case"INF":case"Inf":return t*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(h.test(e))return t*parseInt(e,10);if(m.test(e))return t*parseInt(e,16);if(v.test(e))return t*parseInt(e,8);if(T.test(e))return t*parseFloat(e);throw J(e,"number",!0)}(t)}catch(n){if(e&&j.test(t))return t;throw J(t,"value")}}function G(e,t){var n,r;do{if(!t||'"'!==(n=N())&&"'"!==n)try{e.push([r=Q(E()),R("to",!0)?Q(E()):r])}catch(r){if(!(t&&j.test(n)&&L>=2023))throw r;e.push(n)}else{var i=V();if(e.push(i),L>=2023)throw J(i,"id")}}while(R(",",!0));var o={options:void 0,setOption:function(e,t){void 0===this.options&&(this.options={}),this.options[e]=t}};Z(o,(function(e){if("option"!==e)throw J(e);ne(o,e),R(";")}),(function(){oe(o)}))}function Q(e,t){switch(e){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!t&&"-"===e.charAt(0))throw J(e,"id");if(y.test(e))return parseInt(e,10);if(b.test(e))return parseInt(e,16);if(O.test(e))return parseInt(e,8);throw J(e,"id")}function $(){if(void 0!==P)throw J("package");if(P=E(),!j.test(P))throw J(P,"name");M=M.define(P),R(";")}function W(){var e,t=N();switch(t){case"weak":e=C||(C=[]),E();break;case"public":E();default:e=A||(A=[])}t=V(),R(";"),e.push(t)}function H(){if(R("="),(L=V())<2023)throw J(L,"syntax");R(";")}function z(){if(R("="),L=V(),!["2023"].includes(L))throw J(L,"edition");R(";")}function Y(e,t){switch(t){case"option":return ne(e,t),R(";"),!0;case"message":return X(e,t),!0;case"enum":return te(e,t),!0;case"service":return function(e,t){if(!w.test(t=E()))throw J(t,"service name");var n=new u(t);Z(n,(function(e){if(!Y(n,e)){if("rpc"!==e)throw J(e);!function(e,t){var n=_(),r=t;if(!w.test(t=E()))throw J(t,"name");var i,o,a,s,l=t;if(R("("),R("stream",!0)&&(o=!0),!j.test(t=E()))throw J(t);if(i=t,R(")"),R("returns"),R("("),R("stream",!0)&&(s=!0),!j.test(t=E()))throw J(t);a=t,R(")");var c=new p(l,r,i,a,o,s);c.comment=n,Z(c,(function(e){if("option"!==e)throw J(e);ne(c,e),R(";")})),e.add(c)}(n,e)}})),e.add(n),e===M&&B.push(n)}(e,t),!0;case"extend":return function(e,t){if(!j.test(t=E()))throw J(t,"reference");var n=t;Z(null,(function(t){switch(t){case"required":case"repeated":ee(e,t,n);break;case"optional":ee(e,"proto3"===L?"proto3_optional":"optional",n);break;default:if("proto2"===L||!j.test(t))throw J(t);D(t),ee(e,"optional",n)}}))}(e,t),!0}return!1}function Z(e,t,n){var r=k.line;if(e&&("string"!=typeof e.comment&&(e.comment=_()),e.filename=q.filename),R("{",!0)){for(var i;"}"!==(i=E());)t(i);R(";",!0)}else n&&n(),R(";"),e&&("string"!=typeof e.comment||x)&&(e.comment=_(r)||e.comment)}function X(e,t){if(!w.test(t=E()))throw J(t,"type name");var n=new o(t);Z(n,(function(e){if(!Y(n,e))switch(e){case"map":!function(e){R("<");var t=E();if(void 0===d.mapKey[t])throw J(t,"type");R(",");var n=E();if(!j.test(n))throw J(n,"type");R(">");var r=E();if(!w.test(r))throw J(r,"name");R("=");var i=new s(U(r),Q(E()),t,n);Z(i,(function(e){if("option"!==e)throw J(e);ne(i,e),R(";")}),(function(){oe(i)})),e.add(i)}(n);break;case"required":if("proto2"!==L)throw J(e);case"repeated":ee(n,e);break;case"optional":if("proto3"===L)ee(n,"proto3_optional");else{if("proto2"!==L)throw J(e);ee(n,"optional")}break;case"oneof":!function(e,t){if(!w.test(t=E()))throw J(t,"name");var n=new l(U(t));Z(n,(function(e){"option"===e?(ne(n,e),R(";")):(D(e),ee(n,"optional"))})),e.add(n)}(n,e);break;case"extensions":G(n.extensions||(n.extensions=[]));break;case"reserved":G(n.reserved||(n.reserved=[]),!0);break;default:if("proto2"===L||!j.test(e))throw J(e);D(e),ee(n,"optional")}})),e.add(n),e===M&&B.push(n)}function ee(e,t,n){var r=E();if("group"!==r){for(;r.endsWith(".")||N().startsWith(".");)r+=E();if(!j.test(r))throw J(r,"type");var i=E();if(!w.test(i))throw J(i,"name");i=U(i),R("=");var s=new a(i,Q(E()),r,t,n);if(Z(s,(function(e){if("option"!==e)throw J(e);ne(s,e),R(";")}),(function(){oe(s)})),"proto3_optional"===t){var c=new l("_"+i);s.setOption("proto3_optional",!0),c.add(s),e.add(c)}else e.add(s);e===M&&B.push(s)}else!function(e,t){if(L>=2023)throw J("group");var n=E();if(!w.test(n))throw J(n,"name");var r=g.lcFirst(n);n===r&&(n=g.ucFirst(n)),R("=");var i=Q(E()),s=new o(n);s.group=!0;var l=new a(r,i,n,t);l.filename=q.filename,Z(s,(function(e){switch(e){case"option":ne(s,e),R(";");break;case"required":case"repeated":ee(s,e);break;case"optional":ee(s,"proto3"===L?"proto3_optional":"optional");break;case"message":X(s,e);break;case"enum":te(s,e);break;case"reserved":G(s.reserved||(s.reserved=[]),!0);break;default:throw J(e)}})),e.add(s).add(l)}(e,t)}function te(e,t){if(!w.test(t=E()))throw J(t,"name");var n=new c(t);Z(n,(function(e){switch(e){case"option":ne(n,e),R(";");break;case"reserved":G(n.reserved||(n.reserved=[]),!0),void 0===n.reserved&&(n.reserved=[]);break;default:!function(e,t){if(!w.test(t))throw J(t,"name");R("=");var n=Q(E(),!0),r={options:void 0,getOption:function(e){return this.options[e]},setOption:function(e,t){f.prototype.setOption.call(r,e,t)},setParsedOption:function(){}};Z(r,(function(e){if("option"!==e)throw J(e);ne(r,e),R(";")}),(function(){oe(r)})),e.add(t,n,r.comment,r.parsedOptions||r.options)}(n,e)}})),e.add(n),e===M&&B.push(n)}function ne(e,t){var n,r,i=!0;for("option"===t&&(t=E());"="!==t;){if("("===t){var o=E();R(")"),t="("+o+")"}if(i){if(i=!1,t.includes(".")&&!t.includes("(")){var a=t.split(".");n=a[0]+".",t=a[1];continue}n=t}else r=r?r+=t:t;t=E()}var s=re(e,r?n.concat(r):n);r=r&&"."===r[0]?r.slice(1):r,function(e,t,n,r){e.setParsedOption&&e.setParsedOption(t,n,r)}(e,n=n&&"."===n[n.length-1]?n.slice(0,-1):n,s,r)}function re(e,t){if(R("{",!0)){for(var n={};!R("}",!0);){if(!w.test(S=E()))throw J(S,"name");if(null===S)throw J(S,"end of input");var r,i=S;if(R(":",!0),"{"===N())r=re(e,t+"."+S);else if("["===N()){var o;if(r=[],R("[",!0)){do{o=K(!0),r.push(o)}while(R(",",!0));R("]"),void 0!==o&&ie(e,t+"."+S,o)}}else r=K(!0),ie(e,t+"."+S,r);var a=n[i];a&&(r=[].concat(a).concat(r)),n[i]=r,R(",",!0),R(";",!0)}return n}var s=K(!0);return ie(e,t,s),s}function ie(e,t,n){M===e&&/^features\./.test(t)?F[t]=n:e.setOption&&e.setOption(t,n)}function oe(e){if(R("[",!0)){do{ne(e,"option")}while(R(",",!0));R("]")}return e}for(;null!==(S=E());)switch(S){case"package":if(!I)throw J(S);$();break;case"import":if(!I)throw J(S);W();break;case"syntax":if(!I)throw J(S);H();break;case"edition":if(!I)throw J(S);z();break;case"option":ne(M,S),R(";",!0);break;default:if(Y(M,S)){I=!1;continue}throw J(S)}return B.forEach((e=>{e._edition=L,Object.keys(F).forEach((t=>{void 0===e.getOption(t)&&e.setOption(t,F[t],!0)}))})),q.filename=null,{package:P,imports:A,weakImports:C,root:t}}},5047(e,t,n){"use strict";t.Service=n(7595)},5095(e){"use strict";e.exports=r;var t,n=/\/|\./;function r(e,t){n.test(e)||(e="google/protobuf/"+e+".proto",t={nested:{google:{nested:{protobuf:{nested:t}}}}}),r[e]=t}r("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}),r("duration",{Duration:t={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}),r("timestamp",{Timestamp:t}),r("empty",{Empty:{fields:{}}}),r("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}}),r("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}}),r("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}}),r.get=function(e){return r[e]||null}},5212(e,t,n){"use strict";e.exports=o;var r=n(8045),i=n(4153)("fs");function o(e,t,n){return"function"==typeof t?(n=t,t={}):t||(t={}),n?!t.xhr&&i&&i.readFile?i.readFile(e,(function(r,i){return r&&"undefined"!=typeof XMLHttpRequest?o.xhr(e,t,n):r?n(r):n(null,t.binary?i:i.toString("utf8"))})):o.xhr(e,t,n):r(o,this,e,t)}o.xhr=function(e,t,n){var r=new XMLHttpRequest;r.onreadystatechange=function(){if(4===r.readyState){if(0!==r.status&&200!==r.status)return n(Error("status "+r.status));if(t.binary){var e=r.response;if(!e){e=[];for(var i=0;i<r.responseText.length;++i)e.push(255&r.responseText.charCodeAt(i))}return n(null,"undefined"!=typeof Uint8Array?new Uint8Array(e):e)}return n(null,r.responseText)}},t.binary&&("overrideMimeType"in r&&r.overrideMimeType("text/plain; charset=x-user-defined"),r.responseType="arraybuffer"),r.open("GET",e),r.send()}},5325(e,t,n){"use strict";var r=e.exports=n(4394);r.build="light",r.load=function(e,t,n){return"function"==typeof t?(n=t,t=new r.Root):t||(t=new r.Root),t.load(e,n)},r.loadSync=function(e,t){return t||(t=new r.Root),t.loadSync(e)},r.encoder=n(1080),r.decoder=n(7728),r.verifier=n(420),r.converter=n(744),r.ReflectionObject=n(7209),r.Namespace=n(8923),r.Root=n(5330),r.Enum=n(5643),r.Type=n(7882),r.Field=n(1344),r.OneOf=n(1457),r.MapField=n(8252),r.Service=n(9687),r.Method=n(8811),r.Message=n(2551),r.wrappers=n(6434),r.types=n(361),r.util=n(3262),r.ReflectionObject._configure(r.Root),r.Namespace._configure(r.Type,r.Service,r.Enum),r.Root._configure(r.Type),r.Field._configure(r.Type)},5330(e,t,n){"use strict";e.exports=p;var r=n(8923);((p.prototype=Object.create(r.prototype)).constructor=p).className="Root";var i,o,a,s=n(1344),l=n(5643),c=n(1457),u=n(3262);function p(e){r.call(this,"",e),this.deferred=[],this.files=[],this._edition="proto2",this._fullyQualifiedObjects={}}function f(){}p.fromJSON=function(e,t){return t||(t=new p),e.options&&t.setOptions(e.options),t.addJSON(e.nested).resolveAll()},p.prototype.resolvePath=u.path.resolve,p.prototype.fetch=u.fetch,p.prototype.load=function e(t,n,r){"function"==typeof n&&(r=n,n=void 0);var i=this;if(!r)return u.asPromise(e,i,t,n);var s=r===f;function l(e,t){if(r){if(s)throw e;t&&t.resolveAll();var n=r;r=null,n(e,t)}}function c(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var n=e.substring(t);if(n in a)return n}return null}function p(e,t){try{if(u.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),u.isString(t)){o.filename=e;var r,a=o(t,i,n),p=0;if(a.imports)for(;p<a.imports.length;++p)(r=c(a.imports[p])||i.resolvePath(e,a.imports[p]))&&d(r);if(a.weakImports)for(p=0;p<a.weakImports.length;++p)(r=c(a.weakImports[p])||i.resolvePath(e,a.weakImports[p]))&&d(r,!0)}else i.setOptions(t.options).addJSON(t.nested)}catch(e){l(e)}s||g||l(null,i)}function d(e,t){if(e=c(e)||e,!(i.files.indexOf(e)>-1))if(i.files.push(e),e in a)s?p(e,a[e]):(++g,setTimeout((function(){--g,p(e,a[e])})));else if(s){var n;try{n=u.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||l(e))}p(e,n)}else++g,i.fetch(e,(function(n,o){--g,r&&(n?t?g||l(null,i):l(n):p(e,o))}))}var g=0;u.isString(t)&&(t=[t]);for(var h,y=0;y<t.length;++y)(h=i.resolvePath("",t[y]))&&d(h);return s?(i.resolveAll(),i):(g||l(null,i),i)},p.prototype.loadSync=function(e,t){if(!u.isNode)throw Error("not supported");return this.load(e,t,f)},p.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map((function(e){return"'extend "+e.extend+"' in "+e.parent.fullName})).join(", "));return r.prototype.resolveAll.call(this)};var d=/^[A-Z]/;function g(e,t){var n=t.parent.lookup(t.extend);if(n){var r=new s(t.fullName,t.id,t.type,t.rule,void 0,t.options);return n.get(r.name)||(r.declaringField=t,t.extensionField=r,n.add(r)),!0}return!1}p.prototype._handleAdd=function(e){if(e instanceof s)void 0===e.extend||e.extensionField||g(0,e)||this.deferred.push(e);else if(e instanceof l)d.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof c)){if(e instanceof i)for(var t=0;t<this.deferred.length;)g(0,this.deferred[t])?this.deferred.splice(t,1):++t;for(var n=0;n<e.nestedArray.length;++n)this._handleAdd(e._nestedArray[n]);d.test(e.name)&&(e.parent[e.name]=e)}(e instanceof i||e instanceof l||e instanceof s)&&(this._fullyQualifiedObjects[e.fullName]=e)},p.prototype._handleRemove=function(e){if(e instanceof s){if(void 0!==e.extend)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}}else if(e instanceof l)d.test(e.name)&&delete e.parent[e.name];else if(e instanceof r){for(var n=0;n<e.nestedArray.length;++n)this._handleRemove(e._nestedArray[n]);d.test(e.name)&&delete e.parent[e.name]}delete this._fullyQualifiedObjects[e.fullName]},p._configure=function(e,t,n){i=e,o=t,a=n}},5379(e,t,n){var r,i,o;i=[n(4565)],void 0===(o="function"==typeof(r=function(e){"use strict";var t,n,r,i=e.Reader,o=e.Writer,a=e.util,s=e.roots.default||(e.roots.default={});return s.sqlanvil=((r={}).WorkflowSettings=function(){function t(e){if(this.vars={},this.connections={},this.environments={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.sqlanvilCoreVersion="",t.prototype.defaultProject="",t.prototype.defaultDataset="",t.prototype.defaultLocation="",t.prototype.defaultAssertionDataset="",t.prototype.vars=a.emptyObject,t.prototype.projectSuffix="",t.prototype.datasetSuffix="",t.prototype.namePrefix="",t.prototype.defaultNotebookRuntimeOptions=null,t.prototype.builtinAssertionNamePrefix="",t.prototype.defaultIcebergConfig=null,t.prototype.disableAssertions=!1,t.prototype.defaultReservation="",t.prototype.extension=null,t.prototype.includeTestsInCompiledGraph=!1,t.prototype.warehouse="",t.prototype.connections=a.emptyObject,t.prototype.environments=a.emptyObject,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.sqlanvilCoreVersion&&Object.hasOwnProperty.call(e,"sqlanvilCoreVersion")&&t.uint32(10).string(e.sqlanvilCoreVersion),null!=e.defaultProject&&Object.hasOwnProperty.call(e,"defaultProject")&&t.uint32(18).string(e.defaultProject),null!=e.defaultDataset&&Object.hasOwnProperty.call(e,"defaultDataset")&&t.uint32(26).string(e.defaultDataset),null!=e.defaultLocation&&Object.hasOwnProperty.call(e,"defaultLocation")&&t.uint32(34).string(e.defaultLocation),null!=e.defaultAssertionDataset&&Object.hasOwnProperty.call(e,"defaultAssertionDataset")&&t.uint32(42).string(e.defaultAssertionDataset),null!=e.vars&&Object.hasOwnProperty.call(e,"vars"))for(var n=Object.keys(e.vars),r=0;r<n.length;++r)t.uint32(50).fork().uint32(10).string(n[r]).uint32(18).string(e.vars[n[r]]).ldelim();if(null!=e.projectSuffix&&Object.hasOwnProperty.call(e,"projectSuffix")&&t.uint32(58).string(e.projectSuffix),null!=e.datasetSuffix&&Object.hasOwnProperty.call(e,"datasetSuffix")&&t.uint32(66).string(e.datasetSuffix),null!=e.namePrefix&&Object.hasOwnProperty.call(e,"namePrefix")&&t.uint32(74).string(e.namePrefix),null!=e.defaultNotebookRuntimeOptions&&Object.hasOwnProperty.call(e,"defaultNotebookRuntimeOptions")&&s.sqlanvil.NotebookRuntimeOptionsConfig.encode(e.defaultNotebookRuntimeOptions,t.uint32(82).fork()).ldelim(),null!=e.builtinAssertionNamePrefix&&Object.hasOwnProperty.call(e,"builtinAssertionNamePrefix")&&t.uint32(90).string(e.builtinAssertionNamePrefix),null!=e.defaultIcebergConfig&&Object.hasOwnProperty.call(e,"defaultIcebergConfig")&&s.sqlanvil.DefaultIcebergConfig.encode(e.defaultIcebergConfig,t.uint32(98).fork()).ldelim(),null!=e.disableAssertions&&Object.hasOwnProperty.call(e,"disableAssertions")&&t.uint32(104).bool(e.disableAssertions),null!=e.defaultReservation&&Object.hasOwnProperty.call(e,"defaultReservation")&&t.uint32(114).string(e.defaultReservation),null!=e.extension&&Object.hasOwnProperty.call(e,"extension")&&s.sqlanvil.Extension.encode(e.extension,t.uint32(122).fork()).ldelim(),null!=e.includeTestsInCompiledGraph&&Object.hasOwnProperty.call(e,"includeTestsInCompiledGraph")&&t.uint32(128).bool(e.includeTestsInCompiledGraph),null!=e.warehouse&&Object.hasOwnProperty.call(e,"warehouse")&&t.uint32(138).string(e.warehouse),null!=e.connections&&Object.hasOwnProperty.call(e,"connections"))for(n=Object.keys(e.connections),r=0;r<n.length;++r)t.uint32(146).fork().uint32(10).string(n[r]),s.sqlanvil.ConnectionConfig.encode(e.connections[n[r]],t.uint32(18).fork()).ldelim().ldelim();if(null!=e.environments&&Object.hasOwnProperty.call(e,"environments"))for(n=Object.keys(e.environments),r=0;r<n.length;++r)t.uint32(154).fork().uint32(10).string(n[r]),s.sqlanvil.Environment.encode(e.environments[n[r]],t.uint32(18).fork()).ldelim().ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r,o,l=void 0===t?e.len:e.pos+t,c=new s.sqlanvil.WorkflowSettings;e.pos<l;){var u=e.uint32();if(u===n)break;switch(u>>>3){case 1:c.sqlanvilCoreVersion=e.string();break;case 2:c.defaultProject=e.string();break;case 3:c.defaultDataset=e.string();break;case 4:c.defaultLocation=e.string();break;case 5:c.defaultAssertionDataset=e.string();break;case 6:c.vars===a.emptyObject&&(c.vars={});var p=e.uint32()+e.pos;for(r="",o="";e.pos<p;)switch((f=e.uint32())>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}c.vars[r]=o;break;case 7:c.projectSuffix=e.string();break;case 8:c.datasetSuffix=e.string();break;case 9:c.namePrefix=e.string();break;case 10:c.defaultNotebookRuntimeOptions=s.sqlanvil.NotebookRuntimeOptionsConfig.decode(e,e.uint32());break;case 11:c.builtinAssertionNamePrefix=e.string();break;case 12:c.defaultIcebergConfig=s.sqlanvil.DefaultIcebergConfig.decode(e,e.uint32());break;case 13:c.disableAssertions=e.bool();break;case 14:c.defaultReservation=e.string();break;case 15:c.extension=s.sqlanvil.Extension.decode(e,e.uint32());break;case 16:c.includeTestsInCompiledGraph=e.bool();break;case 17:c.warehouse=e.string();break;case 18:for(c.connections===a.emptyObject&&(c.connections={}),p=e.uint32()+e.pos,r="",o=null;e.pos<p;)switch((f=e.uint32())>>>3){case 1:r=e.string();break;case 2:o=s.sqlanvil.ConnectionConfig.decode(e,e.uint32());break;default:e.skipType(7&f)}c.connections[r]=o;break;case 19:for(c.environments===a.emptyObject&&(c.environments={}),p=e.uint32()+e.pos,r="",o=null;e.pos<p;){var f;switch((f=e.uint32())>>>3){case 1:r=e.string();break;case 2:o=s.sqlanvil.Environment.decode(e,e.uint32());break;default:e.skipType(7&f)}}c.environments[r]=o;break;default:e.skipType(7&u)}}return c},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.sqlanvilCoreVersion&&e.hasOwnProperty("sqlanvilCoreVersion")&&!a.isString(e.sqlanvilCoreVersion))return"sqlanvilCoreVersion: string expected";if(null!=e.defaultProject&&e.hasOwnProperty("defaultProject")&&!a.isString(e.defaultProject))return"defaultProject: string expected";if(null!=e.defaultDataset&&e.hasOwnProperty("defaultDataset")&&!a.isString(e.defaultDataset))return"defaultDataset: string expected";if(null!=e.defaultLocation&&e.hasOwnProperty("defaultLocation")&&!a.isString(e.defaultLocation))return"defaultLocation: string expected";if(null!=e.defaultAssertionDataset&&e.hasOwnProperty("defaultAssertionDataset")&&!a.isString(e.defaultAssertionDataset))return"defaultAssertionDataset: string expected";if(null!=e.vars&&e.hasOwnProperty("vars")){if(!a.isObject(e.vars))return"vars: object expected";for(var t=Object.keys(e.vars),n=0;n<t.length;++n)if(!a.isString(e.vars[t[n]]))return"vars: string{k:string} expected"}if(null!=e.projectSuffix&&e.hasOwnProperty("projectSuffix")&&!a.isString(e.projectSuffix))return"projectSuffix: string expected";if(null!=e.datasetSuffix&&e.hasOwnProperty("datasetSuffix")&&!a.isString(e.datasetSuffix))return"datasetSuffix: string expected";if(null!=e.namePrefix&&e.hasOwnProperty("namePrefix")&&!a.isString(e.namePrefix))return"namePrefix: string expected";if(null!=e.defaultNotebookRuntimeOptions&&e.hasOwnProperty("defaultNotebookRuntimeOptions")&&(r=s.sqlanvil.NotebookRuntimeOptionsConfig.verify(e.defaultNotebookRuntimeOptions)))return"defaultNotebookRuntimeOptions."+r;if(null!=e.builtinAssertionNamePrefix&&e.hasOwnProperty("builtinAssertionNamePrefix")&&!a.isString(e.builtinAssertionNamePrefix))return"builtinAssertionNamePrefix: string expected";if(null!=e.defaultIcebergConfig&&e.hasOwnProperty("defaultIcebergConfig")&&(r=s.sqlanvil.DefaultIcebergConfig.verify(e.defaultIcebergConfig)))return"defaultIcebergConfig."+r;if(null!=e.disableAssertions&&e.hasOwnProperty("disableAssertions")&&"boolean"!=typeof e.disableAssertions)return"disableAssertions: boolean expected";if(null!=e.defaultReservation&&e.hasOwnProperty("defaultReservation")&&!a.isString(e.defaultReservation))return"defaultReservation: string expected";if(null!=e.extension&&e.hasOwnProperty("extension")&&(r=s.sqlanvil.Extension.verify(e.extension)))return"extension."+r;if(null!=e.includeTestsInCompiledGraph&&e.hasOwnProperty("includeTestsInCompiledGraph")&&"boolean"!=typeof e.includeTestsInCompiledGraph)return"includeTestsInCompiledGraph: boolean expected";if(null!=e.warehouse&&e.hasOwnProperty("warehouse")&&!a.isString(e.warehouse))return"warehouse: string expected";if(null!=e.connections&&e.hasOwnProperty("connections")){if(!a.isObject(e.connections))return"connections: object expected";for(t=Object.keys(e.connections),n=0;n<t.length;++n)if(r=s.sqlanvil.ConnectionConfig.verify(e.connections[t[n]]))return"connections."+r}if(null!=e.environments&&e.hasOwnProperty("environments")){if(!a.isObject(e.environments))return"environments: object expected";for(t=Object.keys(e.environments),n=0;n<t.length;++n){var r;if(r=s.sqlanvil.Environment.verify(e.environments[t[n]]))return"environments."+r}}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.WorkflowSettings)return e;var t=new s.sqlanvil.WorkflowSettings;if(null!=e.sqlanvilCoreVersion&&(t.sqlanvilCoreVersion=String(e.sqlanvilCoreVersion)),null!=e.defaultProject&&(t.defaultProject=String(e.defaultProject)),null!=e.defaultDataset&&(t.defaultDataset=String(e.defaultDataset)),null!=e.defaultLocation&&(t.defaultLocation=String(e.defaultLocation)),null!=e.defaultAssertionDataset&&(t.defaultAssertionDataset=String(e.defaultAssertionDataset)),e.vars){if("object"!=typeof e.vars)throw TypeError(".sqlanvil.WorkflowSettings.vars: object expected");t.vars={};for(var n=Object.keys(e.vars),r=0;r<n.length;++r)t.vars[n[r]]=String(e.vars[n[r]])}if(null!=e.projectSuffix&&(t.projectSuffix=String(e.projectSuffix)),null!=e.datasetSuffix&&(t.datasetSuffix=String(e.datasetSuffix)),null!=e.namePrefix&&(t.namePrefix=String(e.namePrefix)),null!=e.defaultNotebookRuntimeOptions){if("object"!=typeof e.defaultNotebookRuntimeOptions)throw TypeError(".sqlanvil.WorkflowSettings.defaultNotebookRuntimeOptions: object expected");t.defaultNotebookRuntimeOptions=s.sqlanvil.NotebookRuntimeOptionsConfig.fromObject(e.defaultNotebookRuntimeOptions)}if(null!=e.builtinAssertionNamePrefix&&(t.builtinAssertionNamePrefix=String(e.builtinAssertionNamePrefix)),null!=e.defaultIcebergConfig){if("object"!=typeof e.defaultIcebergConfig)throw TypeError(".sqlanvil.WorkflowSettings.defaultIcebergConfig: object expected");t.defaultIcebergConfig=s.sqlanvil.DefaultIcebergConfig.fromObject(e.defaultIcebergConfig)}if(null!=e.disableAssertions&&(t.disableAssertions=Boolean(e.disableAssertions)),null!=e.defaultReservation&&(t.defaultReservation=String(e.defaultReservation)),null!=e.extension){if("object"!=typeof e.extension)throw TypeError(".sqlanvil.WorkflowSettings.extension: object expected");t.extension=s.sqlanvil.Extension.fromObject(e.extension)}if(null!=e.includeTestsInCompiledGraph&&(t.includeTestsInCompiledGraph=Boolean(e.includeTestsInCompiledGraph)),null!=e.warehouse&&(t.warehouse=String(e.warehouse)),e.connections){if("object"!=typeof e.connections)throw TypeError(".sqlanvil.WorkflowSettings.connections: object expected");for(t.connections={},n=Object.keys(e.connections),r=0;r<n.length;++r){if("object"!=typeof e.connections[n[r]])throw TypeError(".sqlanvil.WorkflowSettings.connections: object expected");t.connections[n[r]]=s.sqlanvil.ConnectionConfig.fromObject(e.connections[n[r]])}}if(e.environments){if("object"!=typeof e.environments)throw TypeError(".sqlanvil.WorkflowSettings.environments: object expected");for(t.environments={},n=Object.keys(e.environments),r=0;r<n.length;++r){if("object"!=typeof e.environments[n[r]])throw TypeError(".sqlanvil.WorkflowSettings.environments: object expected");t.environments[n[r]]=s.sqlanvil.Environment.fromObject(e.environments[n[r]])}}return t},t.toObject=function(e,t){t||(t={});var n,r={};if((t.objects||t.defaults)&&(r.vars={},r.connections={},r.environments={}),t.defaults&&(r.sqlanvilCoreVersion="",r.defaultProject="",r.defaultDataset="",r.defaultLocation="",r.defaultAssertionDataset="",r.projectSuffix="",r.datasetSuffix="",r.namePrefix="",r.defaultNotebookRuntimeOptions=null,r.builtinAssertionNamePrefix="",r.defaultIcebergConfig=null,r.disableAssertions=!1,r.defaultReservation="",r.extension=null,r.includeTestsInCompiledGraph=!1,r.warehouse=""),null!=e.sqlanvilCoreVersion&&e.hasOwnProperty("sqlanvilCoreVersion")&&(r.sqlanvilCoreVersion=e.sqlanvilCoreVersion),null!=e.defaultProject&&e.hasOwnProperty("defaultProject")&&(r.defaultProject=e.defaultProject),null!=e.defaultDataset&&e.hasOwnProperty("defaultDataset")&&(r.defaultDataset=e.defaultDataset),null!=e.defaultLocation&&e.hasOwnProperty("defaultLocation")&&(r.defaultLocation=e.defaultLocation),null!=e.defaultAssertionDataset&&e.hasOwnProperty("defaultAssertionDataset")&&(r.defaultAssertionDataset=e.defaultAssertionDataset),e.vars&&(n=Object.keys(e.vars)).length){r.vars={};for(var i=0;i<n.length;++i)r.vars[n[i]]=e.vars[n[i]]}if(null!=e.projectSuffix&&e.hasOwnProperty("projectSuffix")&&(r.projectSuffix=e.projectSuffix),null!=e.datasetSuffix&&e.hasOwnProperty("datasetSuffix")&&(r.datasetSuffix=e.datasetSuffix),null!=e.namePrefix&&e.hasOwnProperty("namePrefix")&&(r.namePrefix=e.namePrefix),null!=e.defaultNotebookRuntimeOptions&&e.hasOwnProperty("defaultNotebookRuntimeOptions")&&(r.defaultNotebookRuntimeOptions=s.sqlanvil.NotebookRuntimeOptionsConfig.toObject(e.defaultNotebookRuntimeOptions,t)),null!=e.builtinAssertionNamePrefix&&e.hasOwnProperty("builtinAssertionNamePrefix")&&(r.builtinAssertionNamePrefix=e.builtinAssertionNamePrefix),null!=e.defaultIcebergConfig&&e.hasOwnProperty("defaultIcebergConfig")&&(r.defaultIcebergConfig=s.sqlanvil.DefaultIcebergConfig.toObject(e.defaultIcebergConfig,t)),null!=e.disableAssertions&&e.hasOwnProperty("disableAssertions")&&(r.disableAssertions=e.disableAssertions),null!=e.defaultReservation&&e.hasOwnProperty("defaultReservation")&&(r.defaultReservation=e.defaultReservation),null!=e.extension&&e.hasOwnProperty("extension")&&(r.extension=s.sqlanvil.Extension.toObject(e.extension,t)),null!=e.includeTestsInCompiledGraph&&e.hasOwnProperty("includeTestsInCompiledGraph")&&(r.includeTestsInCompiledGraph=e.includeTestsInCompiledGraph),null!=e.warehouse&&e.hasOwnProperty("warehouse")&&(r.warehouse=e.warehouse),e.connections&&(n=Object.keys(e.connections)).length)for(r.connections={},i=0;i<n.length;++i)r.connections[n[i]]=s.sqlanvil.ConnectionConfig.toObject(e.connections[n[i]],t);if(e.environments&&(n=Object.keys(e.environments)).length)for(r.environments={},i=0;i<n.length;++i)r.environments[n[i]]=s.sqlanvil.Environment.toObject(e.environments[n[i]],t);return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.WorkflowSettings"},t}(),r.Environment=function(){function t(e){if(this.vars={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.schemaSuffix="",t.prototype.vars=a.emptyObject,t.prototype.defaultDatabase="",t.prototype.defaultLocation="",t.prototype.credentials="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.schemaSuffix&&Object.hasOwnProperty.call(e,"schemaSuffix")&&t.uint32(10).string(e.schemaSuffix),null!=e.vars&&Object.hasOwnProperty.call(e,"vars"))for(var n=Object.keys(e.vars),r=0;r<n.length;++r)t.uint32(18).fork().uint32(10).string(n[r]).uint32(18).string(e.vars[n[r]]).ldelim();return null!=e.defaultDatabase&&Object.hasOwnProperty.call(e,"defaultDatabase")&&t.uint32(26).string(e.defaultDatabase),null!=e.defaultLocation&&Object.hasOwnProperty.call(e,"defaultLocation")&&t.uint32(34).string(e.defaultLocation),null!=e.credentials&&Object.hasOwnProperty.call(e,"credentials")&&t.uint32(42).string(e.credentials),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r,o,l=void 0===t?e.len:e.pos+t,c=new s.sqlanvil.Environment;e.pos<l;){var u=e.uint32();if(u===n)break;switch(u>>>3){case 1:c.schemaSuffix=e.string();break;case 2:c.vars===a.emptyObject&&(c.vars={});var p=e.uint32()+e.pos;for(r="",o="";e.pos<p;){var f=e.uint32();switch(f>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}}c.vars[r]=o;break;case 3:c.defaultDatabase=e.string();break;case 4:c.defaultLocation=e.string();break;case 5:c.credentials=e.string();break;default:e.skipType(7&u)}}return c},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.schemaSuffix&&e.hasOwnProperty("schemaSuffix")&&!a.isString(e.schemaSuffix))return"schemaSuffix: string expected";if(null!=e.vars&&e.hasOwnProperty("vars")){if(!a.isObject(e.vars))return"vars: object expected";for(var t=Object.keys(e.vars),n=0;n<t.length;++n)if(!a.isString(e.vars[t[n]]))return"vars: string{k:string} expected"}return null!=e.defaultDatabase&&e.hasOwnProperty("defaultDatabase")&&!a.isString(e.defaultDatabase)?"defaultDatabase: string expected":null!=e.defaultLocation&&e.hasOwnProperty("defaultLocation")&&!a.isString(e.defaultLocation)?"defaultLocation: string expected":null!=e.credentials&&e.hasOwnProperty("credentials")&&!a.isString(e.credentials)?"credentials: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.Environment)return e;var t=new s.sqlanvil.Environment;if(null!=e.schemaSuffix&&(t.schemaSuffix=String(e.schemaSuffix)),e.vars){if("object"!=typeof e.vars)throw TypeError(".sqlanvil.Environment.vars: object expected");t.vars={};for(var n=Object.keys(e.vars),r=0;r<n.length;++r)t.vars[n[r]]=String(e.vars[n[r]])}return null!=e.defaultDatabase&&(t.defaultDatabase=String(e.defaultDatabase)),null!=e.defaultLocation&&(t.defaultLocation=String(e.defaultLocation)),null!=e.credentials&&(t.credentials=String(e.credentials)),t},t.toObject=function(e,t){t||(t={});var n,r={};if((t.objects||t.defaults)&&(r.vars={}),t.defaults&&(r.schemaSuffix="",r.defaultDatabase="",r.defaultLocation="",r.credentials=""),null!=e.schemaSuffix&&e.hasOwnProperty("schemaSuffix")&&(r.schemaSuffix=e.schemaSuffix),e.vars&&(n=Object.keys(e.vars)).length){r.vars={};for(var i=0;i<n.length;++i)r.vars[n[i]]=e.vars[n[i]]}return null!=e.defaultDatabase&&e.hasOwnProperty("defaultDatabase")&&(r.defaultDatabase=e.defaultDatabase),null!=e.defaultLocation&&e.hasOwnProperty("defaultLocation")&&(r.defaultLocation=e.defaultLocation),null!=e.credentials&&e.hasOwnProperty("credentials")&&(r.credentials=e.credentials),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.Environment"},t}(),r.ConnectionConfig=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.platform="",t.prototype.project="",t.prototype.dataset="",t.prototype.saKeyId="",t.prototype.host="",t.prototype.port=0,t.prototype.database="",t.prototype.defaultSchema="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.platform&&Object.hasOwnProperty.call(e,"platform")&&t.uint32(10).string(e.platform),null!=e.project&&Object.hasOwnProperty.call(e,"project")&&t.uint32(18).string(e.project),null!=e.dataset&&Object.hasOwnProperty.call(e,"dataset")&&t.uint32(26).string(e.dataset),null!=e.saKeyId&&Object.hasOwnProperty.call(e,"saKeyId")&&t.uint32(34).string(e.saKeyId),null!=e.host&&Object.hasOwnProperty.call(e,"host")&&t.uint32(42).string(e.host),null!=e.port&&Object.hasOwnProperty.call(e,"port")&&t.uint32(48).uint32(e.port),null!=e.database&&Object.hasOwnProperty.call(e,"database")&&t.uint32(58).string(e.database),null!=e.defaultSchema&&Object.hasOwnProperty.call(e,"defaultSchema")&&t.uint32(66).string(e.defaultSchema),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ConnectionConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.platform=e.string();break;case 2:o.project=e.string();break;case 3:o.dataset=e.string();break;case 4:o.saKeyId=e.string();break;case 5:o.host=e.string();break;case 6:o.port=e.uint32();break;case 7:o.database=e.string();break;case 8:o.defaultSchema=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.platform&&e.hasOwnProperty("platform")&&!a.isString(e.platform)?"platform: string expected":null!=e.project&&e.hasOwnProperty("project")&&!a.isString(e.project)?"project: string expected":null!=e.dataset&&e.hasOwnProperty("dataset")&&!a.isString(e.dataset)?"dataset: string expected":null!=e.saKeyId&&e.hasOwnProperty("saKeyId")&&!a.isString(e.saKeyId)?"saKeyId: string expected":null!=e.host&&e.hasOwnProperty("host")&&!a.isString(e.host)?"host: string expected":null!=e.port&&e.hasOwnProperty("port")&&!a.isInteger(e.port)?"port: integer expected":null!=e.database&&e.hasOwnProperty("database")&&!a.isString(e.database)?"database: string expected":null!=e.defaultSchema&&e.hasOwnProperty("defaultSchema")&&!a.isString(e.defaultSchema)?"defaultSchema: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ConnectionConfig)return e;var t=new s.sqlanvil.ConnectionConfig;return null!=e.platform&&(t.platform=String(e.platform)),null!=e.project&&(t.project=String(e.project)),null!=e.dataset&&(t.dataset=String(e.dataset)),null!=e.saKeyId&&(t.saKeyId=String(e.saKeyId)),null!=e.host&&(t.host=String(e.host)),null!=e.port&&(t.port=e.port>>>0),null!=e.database&&(t.database=String(e.database)),null!=e.defaultSchema&&(t.defaultSchema=String(e.defaultSchema)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.platform="",n.project="",n.dataset="",n.saKeyId="",n.host="",n.port=0,n.database="",n.defaultSchema=""),null!=e.platform&&e.hasOwnProperty("platform")&&(n.platform=e.platform),null!=e.project&&e.hasOwnProperty("project")&&(n.project=e.project),null!=e.dataset&&e.hasOwnProperty("dataset")&&(n.dataset=e.dataset),null!=e.saKeyId&&e.hasOwnProperty("saKeyId")&&(n.saKeyId=e.saKeyId),null!=e.host&&e.hasOwnProperty("host")&&(n.host=e.host),null!=e.port&&e.hasOwnProperty("port")&&(n.port=e.port),null!=e.database&&e.hasOwnProperty("database")&&(n.database=e.database),null!=e.defaultSchema&&e.hasOwnProperty("defaultSchema")&&(n.defaultSchema=e.defaultSchema),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ConnectionConfig"},t}(),r.DefaultIcebergConfig=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.bucketName="",t.prototype.tableFolderRoot="",t.prototype.tableFolderSubpath="",t.prototype.connection="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.bucketName&&Object.hasOwnProperty.call(e,"bucketName")&&t.uint32(10).string(e.bucketName),null!=e.tableFolderRoot&&Object.hasOwnProperty.call(e,"tableFolderRoot")&&t.uint32(18).string(e.tableFolderRoot),null!=e.tableFolderSubpath&&Object.hasOwnProperty.call(e,"tableFolderSubpath")&&t.uint32(26).string(e.tableFolderSubpath),null!=e.connection&&Object.hasOwnProperty.call(e,"connection")&&t.uint32(34).string(e.connection),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.DefaultIcebergConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.bucketName=e.string();break;case 2:o.tableFolderRoot=e.string();break;case 3:o.tableFolderSubpath=e.string();break;case 4:o.connection=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.bucketName&&e.hasOwnProperty("bucketName")&&!a.isString(e.bucketName)?"bucketName: string expected":null!=e.tableFolderRoot&&e.hasOwnProperty("tableFolderRoot")&&!a.isString(e.tableFolderRoot)?"tableFolderRoot: string expected":null!=e.tableFolderSubpath&&e.hasOwnProperty("tableFolderSubpath")&&!a.isString(e.tableFolderSubpath)?"tableFolderSubpath: string expected":null!=e.connection&&e.hasOwnProperty("connection")&&!a.isString(e.connection)?"connection: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.DefaultIcebergConfig)return e;var t=new s.sqlanvil.DefaultIcebergConfig;return null!=e.bucketName&&(t.bucketName=String(e.bucketName)),null!=e.tableFolderRoot&&(t.tableFolderRoot=String(e.tableFolderRoot)),null!=e.tableFolderSubpath&&(t.tableFolderSubpath=String(e.tableFolderSubpath)),null!=e.connection&&(t.connection=String(e.connection)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.bucketName="",n.tableFolderRoot="",n.tableFolderSubpath="",n.connection=""),null!=e.bucketName&&e.hasOwnProperty("bucketName")&&(n.bucketName=e.bucketName),null!=e.tableFolderRoot&&e.hasOwnProperty("tableFolderRoot")&&(n.tableFolderRoot=e.tableFolderRoot),null!=e.tableFolderSubpath&&e.hasOwnProperty("tableFolderSubpath")&&(n.tableFolderSubpath=e.tableFolderSubpath),null!=e.connection&&e.hasOwnProperty("connection")&&(n.connection=e.connection),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.DefaultIcebergConfig"},t}(),r.ActionConfigs=function(){function t(e){if(this.actions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.actions=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.actions&&e.actions.length)for(var n=0;n<e.actions.length;++n)s.sqlanvil.ActionConfig.encode(e.actions[n],t.uint32(10).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionConfigs;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?(o.actions&&o.actions.length||(o.actions=[]),o.actions.push(s.sqlanvil.ActionConfig.decode(e,e.uint32()))):e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.actions&&e.hasOwnProperty("actions")){if(!Array.isArray(e.actions))return"actions: array expected";for(var t=0;t<e.actions.length;++t){var n=s.sqlanvil.ActionConfig.verify(e.actions[t]);if(n)return"actions."+n}}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfigs)return e;var t=new s.sqlanvil.ActionConfigs;if(e.actions){if(!Array.isArray(e.actions))throw TypeError(".sqlanvil.ActionConfigs.actions: array expected");t.actions=[];for(var n=0;n<e.actions.length;++n){if("object"!=typeof e.actions[n])throw TypeError(".sqlanvil.ActionConfigs.actions: object expected");t.actions[n]=s.sqlanvil.ActionConfig.fromObject(e.actions[n])}}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.actions=[]),e.actions&&e.actions.length){n.actions=[];for(var r=0;r<e.actions.length;++r)n.actions[r]=s.sqlanvil.ActionConfig.toObject(e.actions[r],t)}return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfigs"},t}(),r.ActionConfig=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var n,r,l;return t.prototype.table=null,t.prototype.view=null,t.prototype.incrementalTable=null,t.prototype.assertion=null,t.prototype.operation=null,t.prototype.declaration=null,t.prototype.notebook=null,t.prototype.dataPreparation=null,t.prototype.rlsPolicy=null,t.prototype.realtimePublication=null,t.prototype.foreignWrapper=null,t.prototype.vectorIndex=null,Object.defineProperty(t.prototype,"action",{get:a.oneOfGetter(n=["table","view","incrementalTable","assertion","operation","declaration","notebook","dataPreparation","rlsPolicy","realtimePublication","foreignWrapper","vectorIndex"]),set:a.oneOfSetter(n)}),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.table&&Object.hasOwnProperty.call(e,"table")&&s.sqlanvil.ActionConfig.TableConfig.encode(e.table,t.uint32(10).fork()).ldelim(),null!=e.view&&Object.hasOwnProperty.call(e,"view")&&s.sqlanvil.ActionConfig.ViewConfig.encode(e.view,t.uint32(18).fork()).ldelim(),null!=e.incrementalTable&&Object.hasOwnProperty.call(e,"incrementalTable")&&s.sqlanvil.ActionConfig.IncrementalTableConfig.encode(e.incrementalTable,t.uint32(26).fork()).ldelim(),null!=e.assertion&&Object.hasOwnProperty.call(e,"assertion")&&s.sqlanvil.ActionConfig.AssertionConfig.encode(e.assertion,t.uint32(34).fork()).ldelim(),null!=e.operation&&Object.hasOwnProperty.call(e,"operation")&&s.sqlanvil.ActionConfig.OperationConfig.encode(e.operation,t.uint32(42).fork()).ldelim(),null!=e.declaration&&Object.hasOwnProperty.call(e,"declaration")&&s.sqlanvil.ActionConfig.DeclarationConfig.encode(e.declaration,t.uint32(50).fork()).ldelim(),null!=e.notebook&&Object.hasOwnProperty.call(e,"notebook")&&s.sqlanvil.ActionConfig.NotebookConfig.encode(e.notebook,t.uint32(58).fork()).ldelim(),null!=e.dataPreparation&&Object.hasOwnProperty.call(e,"dataPreparation")&&s.sqlanvil.ActionConfig.DataPreparationConfig.encode(e.dataPreparation,t.uint32(66).fork()).ldelim(),null!=e.rlsPolicy&&Object.hasOwnProperty.call(e,"rlsPolicy")&&s.sqlanvil.ActionConfig.RlsPolicyConfig.encode(e.rlsPolicy,t.uint32(74).fork()).ldelim(),null!=e.realtimePublication&&Object.hasOwnProperty.call(e,"realtimePublication")&&s.sqlanvil.ActionConfig.RealtimePublicationConfig.encode(e.realtimePublication,t.uint32(82).fork()).ldelim(),null!=e.foreignWrapper&&Object.hasOwnProperty.call(e,"foreignWrapper")&&s.sqlanvil.ActionConfig.ForeignWrapperConfig.encode(e.foreignWrapper,t.uint32(90).fork()).ldelim(),null!=e.vectorIndex&&Object.hasOwnProperty.call(e,"vectorIndex")&&s.sqlanvil.ActionConfig.VectorIndexConfig.encode(e.vectorIndex,t.uint32(98).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.table=s.sqlanvil.ActionConfig.TableConfig.decode(e,e.uint32());break;case 2:o.view=s.sqlanvil.ActionConfig.ViewConfig.decode(e,e.uint32());break;case 3:o.incrementalTable=s.sqlanvil.ActionConfig.IncrementalTableConfig.decode(e,e.uint32());break;case 4:o.assertion=s.sqlanvil.ActionConfig.AssertionConfig.decode(e,e.uint32());break;case 5:o.operation=s.sqlanvil.ActionConfig.OperationConfig.decode(e,e.uint32());break;case 6:o.declaration=s.sqlanvil.ActionConfig.DeclarationConfig.decode(e,e.uint32());break;case 7:o.notebook=s.sqlanvil.ActionConfig.NotebookConfig.decode(e,e.uint32());break;case 8:o.dataPreparation=s.sqlanvil.ActionConfig.DataPreparationConfig.decode(e,e.uint32());break;case 9:o.rlsPolicy=s.sqlanvil.ActionConfig.RlsPolicyConfig.decode(e,e.uint32());break;case 10:o.realtimePublication=s.sqlanvil.ActionConfig.RealtimePublicationConfig.decode(e,e.uint32());break;case 11:o.foreignWrapper=s.sqlanvil.ActionConfig.ForeignWrapperConfig.decode(e,e.uint32());break;case 12:o.vectorIndex=s.sqlanvil.ActionConfig.VectorIndexConfig.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.table&&e.hasOwnProperty("table")&&(t.action=1,n=s.sqlanvil.ActionConfig.TableConfig.verify(e.table)))return"table."+n;if(null!=e.view&&e.hasOwnProperty("view")){if(1===t.action)return"action: multiple values";if(t.action=1,n=s.sqlanvil.ActionConfig.ViewConfig.verify(e.view))return"view."+n}if(null!=e.incrementalTable&&e.hasOwnProperty("incrementalTable")){if(1===t.action)return"action: multiple values";if(t.action=1,n=s.sqlanvil.ActionConfig.IncrementalTableConfig.verify(e.incrementalTable))return"incrementalTable."+n}if(null!=e.assertion&&e.hasOwnProperty("assertion")){if(1===t.action)return"action: multiple values";if(t.action=1,n=s.sqlanvil.ActionConfig.AssertionConfig.verify(e.assertion))return"assertion."+n}if(null!=e.operation&&e.hasOwnProperty("operation")){if(1===t.action)return"action: multiple values";if(t.action=1,n=s.sqlanvil.ActionConfig.OperationConfig.verify(e.operation))return"operation."+n}if(null!=e.declaration&&e.hasOwnProperty("declaration")){if(1===t.action)return"action: multiple values";if(t.action=1,n=s.sqlanvil.ActionConfig.DeclarationConfig.verify(e.declaration))return"declaration."+n}if(null!=e.notebook&&e.hasOwnProperty("notebook")){if(1===t.action)return"action: multiple values";if(t.action=1,n=s.sqlanvil.ActionConfig.NotebookConfig.verify(e.notebook))return"notebook."+n}if(null!=e.dataPreparation&&e.hasOwnProperty("dataPreparation")){if(1===t.action)return"action: multiple values";if(t.action=1,n=s.sqlanvil.ActionConfig.DataPreparationConfig.verify(e.dataPreparation))return"dataPreparation."+n}if(null!=e.rlsPolicy&&e.hasOwnProperty("rlsPolicy")){if(1===t.action)return"action: multiple values";if(t.action=1,n=s.sqlanvil.ActionConfig.RlsPolicyConfig.verify(e.rlsPolicy))return"rlsPolicy."+n}if(null!=e.realtimePublication&&e.hasOwnProperty("realtimePublication")){if(1===t.action)return"action: multiple values";if(t.action=1,n=s.sqlanvil.ActionConfig.RealtimePublicationConfig.verify(e.realtimePublication))return"realtimePublication."+n}if(null!=e.foreignWrapper&&e.hasOwnProperty("foreignWrapper")){if(1===t.action)return"action: multiple values";if(t.action=1,n=s.sqlanvil.ActionConfig.ForeignWrapperConfig.verify(e.foreignWrapper))return"foreignWrapper."+n}if(null!=e.vectorIndex&&e.hasOwnProperty("vectorIndex")){if(1===t.action)return"action: multiple values";var n;if(t.action=1,n=s.sqlanvil.ActionConfig.VectorIndexConfig.verify(e.vectorIndex))return"vectorIndex."+n}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig)return e;var t=new s.sqlanvil.ActionConfig;if(null!=e.table){if("object"!=typeof e.table)throw TypeError(".sqlanvil.ActionConfig.table: object expected");t.table=s.sqlanvil.ActionConfig.TableConfig.fromObject(e.table)}if(null!=e.view){if("object"!=typeof e.view)throw TypeError(".sqlanvil.ActionConfig.view: object expected");t.view=s.sqlanvil.ActionConfig.ViewConfig.fromObject(e.view)}if(null!=e.incrementalTable){if("object"!=typeof e.incrementalTable)throw TypeError(".sqlanvil.ActionConfig.incrementalTable: object expected");t.incrementalTable=s.sqlanvil.ActionConfig.IncrementalTableConfig.fromObject(e.incrementalTable)}if(null!=e.assertion){if("object"!=typeof e.assertion)throw TypeError(".sqlanvil.ActionConfig.assertion: object expected");t.assertion=s.sqlanvil.ActionConfig.AssertionConfig.fromObject(e.assertion)}if(null!=e.operation){if("object"!=typeof e.operation)throw TypeError(".sqlanvil.ActionConfig.operation: object expected");t.operation=s.sqlanvil.ActionConfig.OperationConfig.fromObject(e.operation)}if(null!=e.declaration){if("object"!=typeof e.declaration)throw TypeError(".sqlanvil.ActionConfig.declaration: object expected");t.declaration=s.sqlanvil.ActionConfig.DeclarationConfig.fromObject(e.declaration)}if(null!=e.notebook){if("object"!=typeof e.notebook)throw TypeError(".sqlanvil.ActionConfig.notebook: object expected");t.notebook=s.sqlanvil.ActionConfig.NotebookConfig.fromObject(e.notebook)}if(null!=e.dataPreparation){if("object"!=typeof e.dataPreparation)throw TypeError(".sqlanvil.ActionConfig.dataPreparation: object expected");t.dataPreparation=s.sqlanvil.ActionConfig.DataPreparationConfig.fromObject(e.dataPreparation)}if(null!=e.rlsPolicy){if("object"!=typeof e.rlsPolicy)throw TypeError(".sqlanvil.ActionConfig.rlsPolicy: object expected");t.rlsPolicy=s.sqlanvil.ActionConfig.RlsPolicyConfig.fromObject(e.rlsPolicy)}if(null!=e.realtimePublication){if("object"!=typeof e.realtimePublication)throw TypeError(".sqlanvil.ActionConfig.realtimePublication: object expected");t.realtimePublication=s.sqlanvil.ActionConfig.RealtimePublicationConfig.fromObject(e.realtimePublication)}if(null!=e.foreignWrapper){if("object"!=typeof e.foreignWrapper)throw TypeError(".sqlanvil.ActionConfig.foreignWrapper: object expected");t.foreignWrapper=s.sqlanvil.ActionConfig.ForeignWrapperConfig.fromObject(e.foreignWrapper)}if(null!=e.vectorIndex){if("object"!=typeof e.vectorIndex)throw TypeError(".sqlanvil.ActionConfig.vectorIndex: object expected");t.vectorIndex=s.sqlanvil.ActionConfig.VectorIndexConfig.fromObject(e.vectorIndex)}return t},t.toObject=function(e,t){t||(t={});var n={};return null!=e.table&&e.hasOwnProperty("table")&&(n.table=s.sqlanvil.ActionConfig.TableConfig.toObject(e.table,t),t.oneofs&&(n.action="table")),null!=e.view&&e.hasOwnProperty("view")&&(n.view=s.sqlanvil.ActionConfig.ViewConfig.toObject(e.view,t),t.oneofs&&(n.action="view")),null!=e.incrementalTable&&e.hasOwnProperty("incrementalTable")&&(n.incrementalTable=s.sqlanvil.ActionConfig.IncrementalTableConfig.toObject(e.incrementalTable,t),t.oneofs&&(n.action="incrementalTable")),null!=e.assertion&&e.hasOwnProperty("assertion")&&(n.assertion=s.sqlanvil.ActionConfig.AssertionConfig.toObject(e.assertion,t),t.oneofs&&(n.action="assertion")),null!=e.operation&&e.hasOwnProperty("operation")&&(n.operation=s.sqlanvil.ActionConfig.OperationConfig.toObject(e.operation,t),t.oneofs&&(n.action="operation")),null!=e.declaration&&e.hasOwnProperty("declaration")&&(n.declaration=s.sqlanvil.ActionConfig.DeclarationConfig.toObject(e.declaration,t),t.oneofs&&(n.action="declaration")),null!=e.notebook&&e.hasOwnProperty("notebook")&&(n.notebook=s.sqlanvil.ActionConfig.NotebookConfig.toObject(e.notebook,t),t.oneofs&&(n.action="notebook")),null!=e.dataPreparation&&e.hasOwnProperty("dataPreparation")&&(n.dataPreparation=s.sqlanvil.ActionConfig.DataPreparationConfig.toObject(e.dataPreparation,t),t.oneofs&&(n.action="dataPreparation")),null!=e.rlsPolicy&&e.hasOwnProperty("rlsPolicy")&&(n.rlsPolicy=s.sqlanvil.ActionConfig.RlsPolicyConfig.toObject(e.rlsPolicy,t),t.oneofs&&(n.action="rlsPolicy")),null!=e.realtimePublication&&e.hasOwnProperty("realtimePublication")&&(n.realtimePublication=s.sqlanvil.ActionConfig.RealtimePublicationConfig.toObject(e.realtimePublication,t),t.oneofs&&(n.action="realtimePublication")),null!=e.foreignWrapper&&e.hasOwnProperty("foreignWrapper")&&(n.foreignWrapper=s.sqlanvil.ActionConfig.ForeignWrapperConfig.toObject(e.foreignWrapper,t),t.oneofs&&(n.action="foreignWrapper")),null!=e.vectorIndex&&e.hasOwnProperty("vectorIndex")&&(n.vectorIndex=s.sqlanvil.ActionConfig.VectorIndexConfig.toObject(e.vectorIndex,t),t.oneofs&&(n.action="vectorIndex")),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig"},t.Target=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.project="",t.prototype.dataset="",t.prototype.name="",t.prototype.includeDependentAssertions=!1,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.project&&Object.hasOwnProperty.call(e,"project")&&t.uint32(10).string(e.project),null!=e.dataset&&Object.hasOwnProperty.call(e,"dataset")&&t.uint32(18).string(e.dataset),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(34).string(e.name),null!=e.includeDependentAssertions&&Object.hasOwnProperty.call(e,"includeDependentAssertions")&&t.uint32(40).bool(e.includeDependentAssertions),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionConfig.Target;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.project=e.string();break;case 2:o.dataset=e.string();break;case 4:o.name=e.string();break;case 5:o.includeDependentAssertions=e.bool();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.project&&e.hasOwnProperty("project")&&!a.isString(e.project)?"project: string expected":null!=e.dataset&&e.hasOwnProperty("dataset")&&!a.isString(e.dataset)?"dataset: string expected":null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name)?"name: string expected":null!=e.includeDependentAssertions&&e.hasOwnProperty("includeDependentAssertions")&&"boolean"!=typeof e.includeDependentAssertions?"includeDependentAssertions: boolean expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.Target)return e;var t=new s.sqlanvil.ActionConfig.Target;return null!=e.project&&(t.project=String(e.project)),null!=e.dataset&&(t.dataset=String(e.dataset)),null!=e.name&&(t.name=String(e.name)),null!=e.includeDependentAssertions&&(t.includeDependentAssertions=Boolean(e.includeDependentAssertions)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.project="",n.dataset="",n.name="",n.includeDependentAssertions=!1),null!=e.project&&e.hasOwnProperty("project")&&(n.project=e.project),null!=e.dataset&&e.hasOwnProperty("dataset")&&(n.dataset=e.dataset),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.includeDependentAssertions&&e.hasOwnProperty("includeDependentAssertions")&&(n.includeDependentAssertions=e.includeDependentAssertions),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.Target"},t}(),t.ColumnDescriptor=function(){function t(e){if(this.path=[],this.bigqueryPolicyTags=[],this.tags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.path=a.emptyArray,t.prototype.description="",t.prototype.bigqueryPolicyTags=a.emptyArray,t.prototype.tags=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.path&&e.path.length)for(var n=0;n<e.path.length;++n)t.uint32(10).string(e.path[n]);if(null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(18).string(e.description),null!=e.bigqueryPolicyTags&&e.bigqueryPolicyTags.length)for(n=0;n<e.bigqueryPolicyTags.length;++n)t.uint32(26).string(e.bigqueryPolicyTags[n]);if(null!=e.tags&&e.tags.length)for(n=0;n<e.tags.length;++n)t.uint32(34).string(e.tags[n]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionConfig.ColumnDescriptor;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.path&&o.path.length||(o.path=[]),o.path.push(e.string());break;case 2:o.description=e.string();break;case 3:o.bigqueryPolicyTags&&o.bigqueryPolicyTags.length||(o.bigqueryPolicyTags=[]),o.bigqueryPolicyTags.push(e.string());break;case 4:o.tags&&o.tags.length||(o.tags=[]),o.tags.push(e.string());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.path&&e.hasOwnProperty("path")){if(!Array.isArray(e.path))return"path: array expected";for(var t=0;t<e.path.length;++t)if(!a.isString(e.path[t]))return"path: string[] expected"}if(null!=e.description&&e.hasOwnProperty("description")&&!a.isString(e.description))return"description: string expected";if(null!=e.bigqueryPolicyTags&&e.hasOwnProperty("bigqueryPolicyTags")){if(!Array.isArray(e.bigqueryPolicyTags))return"bigqueryPolicyTags: array expected";for(t=0;t<e.bigqueryPolicyTags.length;++t)if(!a.isString(e.bigqueryPolicyTags[t]))return"bigqueryPolicyTags: string[] expected"}if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!a.isString(e.tags[t]))return"tags: string[] expected"}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.ColumnDescriptor)return e;var t=new s.sqlanvil.ActionConfig.ColumnDescriptor;if(e.path){if(!Array.isArray(e.path))throw TypeError(".sqlanvil.ActionConfig.ColumnDescriptor.path: array expected");t.path=[];for(var n=0;n<e.path.length;++n)t.path[n]=String(e.path[n])}if(null!=e.description&&(t.description=String(e.description)),e.bigqueryPolicyTags){if(!Array.isArray(e.bigqueryPolicyTags))throw TypeError(".sqlanvil.ActionConfig.ColumnDescriptor.bigqueryPolicyTags: array expected");for(t.bigqueryPolicyTags=[],n=0;n<e.bigqueryPolicyTags.length;++n)t.bigqueryPolicyTags[n]=String(e.bigqueryPolicyTags[n])}if(e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.ColumnDescriptor.tags: array expected");for(t.tags=[],n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.path=[],n.bigqueryPolicyTags=[],n.tags=[]),t.defaults&&(n.description=""),e.path&&e.path.length){n.path=[];for(var r=0;r<e.path.length;++r)n.path[r]=e.path[r]}if(null!=e.description&&e.hasOwnProperty("description")&&(n.description=e.description),e.bigqueryPolicyTags&&e.bigqueryPolicyTags.length)for(n.bigqueryPolicyTags=[],r=0;r<e.bigqueryPolicyTags.length;++r)n.bigqueryPolicyTags[r]=e.bigqueryPolicyTags[r];if(e.tags&&e.tags.length)for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=e.tags[r];return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.ColumnDescriptor"},t}(),t.TableAssertionsConfig=function(){function t(e){if(this.uniqueKey=[],this.uniqueKeys=[],this.nonNull=[],this.rowConditions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.uniqueKey=a.emptyArray,t.prototype.uniqueKeys=a.emptyArray,t.prototype.nonNull=a.emptyArray,t.prototype.rowConditions=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.uniqueKey&&e.uniqueKey.length)for(var n=0;n<e.uniqueKey.length;++n)t.uint32(10).string(e.uniqueKey[n]);if(null!=e.uniqueKeys&&e.uniqueKeys.length)for(n=0;n<e.uniqueKeys.length;++n)s.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey.encode(e.uniqueKeys[n],t.uint32(18).fork()).ldelim();if(null!=e.nonNull&&e.nonNull.length)for(n=0;n<e.nonNull.length;++n)t.uint32(26).string(e.nonNull[n]);if(null!=e.rowConditions&&e.rowConditions.length)for(n=0;n<e.rowConditions.length;++n)t.uint32(34).string(e.rowConditions[n]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionConfig.TableAssertionsConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.uniqueKey&&o.uniqueKey.length||(o.uniqueKey=[]),o.uniqueKey.push(e.string());break;case 2:o.uniqueKeys&&o.uniqueKeys.length||(o.uniqueKeys=[]),o.uniqueKeys.push(s.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey.decode(e,e.uint32()));break;case 3:o.nonNull&&o.nonNull.length||(o.nonNull=[]),o.nonNull.push(e.string());break;case 4:o.rowConditions&&o.rowConditions.length||(o.rowConditions=[]),o.rowConditions.push(e.string());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.uniqueKey&&e.hasOwnProperty("uniqueKey")){if(!Array.isArray(e.uniqueKey))return"uniqueKey: array expected";for(var t=0;t<e.uniqueKey.length;++t)if(!a.isString(e.uniqueKey[t]))return"uniqueKey: string[] expected"}if(null!=e.uniqueKeys&&e.hasOwnProperty("uniqueKeys")){if(!Array.isArray(e.uniqueKeys))return"uniqueKeys: array expected";for(t=0;t<e.uniqueKeys.length;++t){var n=s.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey.verify(e.uniqueKeys[t]);if(n)return"uniqueKeys."+n}}if(null!=e.nonNull&&e.hasOwnProperty("nonNull")){if(!Array.isArray(e.nonNull))return"nonNull: array expected";for(t=0;t<e.nonNull.length;++t)if(!a.isString(e.nonNull[t]))return"nonNull: string[] expected"}if(null!=e.rowConditions&&e.hasOwnProperty("rowConditions")){if(!Array.isArray(e.rowConditions))return"rowConditions: array expected";for(t=0;t<e.rowConditions.length;++t)if(!a.isString(e.rowConditions[t]))return"rowConditions: string[] expected"}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.TableAssertionsConfig)return e;var t=new s.sqlanvil.ActionConfig.TableAssertionsConfig;if(e.uniqueKey){if(!Array.isArray(e.uniqueKey))throw TypeError(".sqlanvil.ActionConfig.TableAssertionsConfig.uniqueKey: array expected");t.uniqueKey=[];for(var n=0;n<e.uniqueKey.length;++n)t.uniqueKey[n]=String(e.uniqueKey[n])}if(e.uniqueKeys){if(!Array.isArray(e.uniqueKeys))throw TypeError(".sqlanvil.ActionConfig.TableAssertionsConfig.uniqueKeys: array expected");for(t.uniqueKeys=[],n=0;n<e.uniqueKeys.length;++n){if("object"!=typeof e.uniqueKeys[n])throw TypeError(".sqlanvil.ActionConfig.TableAssertionsConfig.uniqueKeys: object expected");t.uniqueKeys[n]=s.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey.fromObject(e.uniqueKeys[n])}}if(e.nonNull){if(!Array.isArray(e.nonNull))throw TypeError(".sqlanvil.ActionConfig.TableAssertionsConfig.nonNull: array expected");for(t.nonNull=[],n=0;n<e.nonNull.length;++n)t.nonNull[n]=String(e.nonNull[n])}if(e.rowConditions){if(!Array.isArray(e.rowConditions))throw TypeError(".sqlanvil.ActionConfig.TableAssertionsConfig.rowConditions: array expected");for(t.rowConditions=[],n=0;n<e.rowConditions.length;++n)t.rowConditions[n]=String(e.rowConditions[n])}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.uniqueKey=[],n.uniqueKeys=[],n.nonNull=[],n.rowConditions=[]),e.uniqueKey&&e.uniqueKey.length){n.uniqueKey=[];for(var r=0;r<e.uniqueKey.length;++r)n.uniqueKey[r]=e.uniqueKey[r]}if(e.uniqueKeys&&e.uniqueKeys.length)for(n.uniqueKeys=[],r=0;r<e.uniqueKeys.length;++r)n.uniqueKeys[r]=s.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey.toObject(e.uniqueKeys[r],t);if(e.nonNull&&e.nonNull.length)for(n.nonNull=[],r=0;r<e.nonNull.length;++r)n.nonNull[r]=e.nonNull[r];if(e.rowConditions&&e.rowConditions.length)for(n.rowConditions=[],r=0;r<e.rowConditions.length;++r)n.rowConditions[r]=e.rowConditions[r];return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.TableAssertionsConfig"},t.UniqueKey=function(){function t(e){if(this.uniqueKey=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.uniqueKey=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.uniqueKey&&e.uniqueKey.length)for(var n=0;n<e.uniqueKey.length;++n)t.uint32(10).string(e.uniqueKey[n]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?(o.uniqueKey&&o.uniqueKey.length||(o.uniqueKey=[]),o.uniqueKey.push(e.string())):e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.uniqueKey&&e.hasOwnProperty("uniqueKey")){if(!Array.isArray(e.uniqueKey))return"uniqueKey: array expected";for(var t=0;t<e.uniqueKey.length;++t)if(!a.isString(e.uniqueKey[t]))return"uniqueKey: string[] expected"}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey)return e;var t=new s.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey;if(e.uniqueKey){if(!Array.isArray(e.uniqueKey))throw TypeError(".sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey.uniqueKey: array expected");t.uniqueKey=[];for(var n=0;n<e.uniqueKey.length;++n)t.uniqueKey[n]=String(e.uniqueKey[n])}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.uniqueKey=[]),e.uniqueKey&&e.uniqueKey.length){n.uniqueKey=[];for(var r=0;r<e.uniqueKey.length;++r)n.uniqueKey[r]=e.uniqueKey[r]}return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey"},t}(),t}(),t.IcebergTableConfig=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var n,r;return t.prototype.fileFormat=0,t.prototype.connection="",t.prototype.bucketName="",t.prototype.tableFolderRoot="",t.prototype.tableFolderSubpath="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.fileFormat&&Object.hasOwnProperty.call(e,"fileFormat")&&t.uint32(8).int32(e.fileFormat),null!=e.connection&&Object.hasOwnProperty.call(e,"connection")&&t.uint32(18).string(e.connection),null!=e.bucketName&&Object.hasOwnProperty.call(e,"bucketName")&&t.uint32(26).string(e.bucketName),null!=e.tableFolderRoot&&Object.hasOwnProperty.call(e,"tableFolderRoot")&&t.uint32(34).string(e.tableFolderRoot),null!=e.tableFolderSubpath&&Object.hasOwnProperty.call(e,"tableFolderSubpath")&&t.uint32(42).string(e.tableFolderSubpath),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionConfig.IcebergTableConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.fileFormat=e.int32();break;case 2:o.connection=e.string();break;case 3:o.bucketName=e.string();break;case 4:o.tableFolderRoot=e.string();break;case 5:o.tableFolderSubpath=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.fileFormat&&e.hasOwnProperty("fileFormat"))switch(e.fileFormat){default:return"fileFormat: enum value expected";case 0:case 1:}return null!=e.connection&&e.hasOwnProperty("connection")&&!a.isString(e.connection)?"connection: string expected":null!=e.bucketName&&e.hasOwnProperty("bucketName")&&!a.isString(e.bucketName)?"bucketName: string expected":null!=e.tableFolderRoot&&e.hasOwnProperty("tableFolderRoot")&&!a.isString(e.tableFolderRoot)?"tableFolderRoot: string expected":null!=e.tableFolderSubpath&&e.hasOwnProperty("tableFolderSubpath")&&!a.isString(e.tableFolderSubpath)?"tableFolderSubpath: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.IcebergTableConfig)return e;var t=new s.sqlanvil.ActionConfig.IcebergTableConfig;switch(e.fileFormat){default:if("number"==typeof e.fileFormat){t.fileFormat=e.fileFormat;break}break;case"FILE_FORMAT_UNSPECIFIED":case 0:t.fileFormat=0;break;case"PARQUET":case 1:t.fileFormat=1}return null!=e.connection&&(t.connection=String(e.connection)),null!=e.bucketName&&(t.bucketName=String(e.bucketName)),null!=e.tableFolderRoot&&(t.tableFolderRoot=String(e.tableFolderRoot)),null!=e.tableFolderSubpath&&(t.tableFolderSubpath=String(e.tableFolderSubpath)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.fileFormat=t.enums===String?"FILE_FORMAT_UNSPECIFIED":0,n.connection="",n.bucketName="",n.tableFolderRoot="",n.tableFolderSubpath=""),null!=e.fileFormat&&e.hasOwnProperty("fileFormat")&&(n.fileFormat=t.enums===String?void 0===s.sqlanvil.ActionConfig.IcebergTableConfig.FileFormat[e.fileFormat]?e.fileFormat:s.sqlanvil.ActionConfig.IcebergTableConfig.FileFormat[e.fileFormat]:e.fileFormat),null!=e.connection&&e.hasOwnProperty("connection")&&(n.connection=e.connection),null!=e.bucketName&&e.hasOwnProperty("bucketName")&&(n.bucketName=e.bucketName),null!=e.tableFolderRoot&&e.hasOwnProperty("tableFolderRoot")&&(n.tableFolderRoot=e.tableFolderRoot),null!=e.tableFolderSubpath&&e.hasOwnProperty("tableFolderSubpath")&&(n.tableFolderSubpath=e.tableFolderSubpath),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.IcebergTableConfig"},t.FileFormat=(n={},(r=Object.create(n))[n[0]="FILE_FORMAT_UNSPECIFIED"]=0,r[n[1]="PARQUET"]=1,r),t}(),t.TableConfig=function(){function t(e){if(this.dependencyTargets=[],this.tags=[],this.preOperations=[],this.postOperations=[],this.columns=[],this.clusterBy=[],this.labels={},this.additionalOptions={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.dataset="",t.prototype.project="",t.prototype.dependencyTargets=a.emptyArray,t.prototype.filename="",t.prototype.tags=a.emptyArray,t.prototype.disabled=!1,t.prototype.preOperations=a.emptyArray,t.prototype.postOperations=a.emptyArray,t.prototype.description="",t.prototype.columns=a.emptyArray,t.prototype.partitionBy="",t.prototype.partitionExpirationDays=0,t.prototype.requirePartitionFilter=!1,t.prototype.clusterBy=a.emptyArray,t.prototype.labels=a.emptyObject,t.prototype.additionalOptions=a.emptyObject,t.prototype.dependOnDependencyAssertions=!1,t.prototype.assertions=null,t.prototype.hermetic=!1,t.prototype.iceberg=null,t.prototype.metadata=null,t.prototype.reservation="",t.prototype.postgres=null,t.prototype.supabase=null,t.prototype.mysql=null,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.dataset&&Object.hasOwnProperty.call(e,"dataset")&&t.uint32(18).string(e.dataset),null!=e.project&&Object.hasOwnProperty.call(e,"project")&&t.uint32(26).string(e.project),null!=e.dependencyTargets&&e.dependencyTargets.length)for(var n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.ActionConfig.Target.encode(e.dependencyTargets[n],t.uint32(34).fork()).ldelim();if(null!=e.filename&&Object.hasOwnProperty.call(e,"filename")&&t.uint32(42).string(e.filename),null!=e.tags&&e.tags.length)for(n=0;n<e.tags.length;++n)t.uint32(50).string(e.tags[n]);if(null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(56).bool(e.disabled),null!=e.preOperations&&e.preOperations.length)for(n=0;n<e.preOperations.length;++n)t.uint32(66).string(e.preOperations[n]);if(null!=e.postOperations&&e.postOperations.length)for(n=0;n<e.postOperations.length;++n)t.uint32(74).string(e.postOperations[n]);if(null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(82).string(e.description),null!=e.columns&&e.columns.length)for(n=0;n<e.columns.length;++n)s.sqlanvil.ActionConfig.ColumnDescriptor.encode(e.columns[n],t.uint32(90).fork()).ldelim();if(null!=e.partitionBy&&Object.hasOwnProperty.call(e,"partitionBy")&&t.uint32(98).string(e.partitionBy),null!=e.partitionExpirationDays&&Object.hasOwnProperty.call(e,"partitionExpirationDays")&&t.uint32(104).int32(e.partitionExpirationDays),null!=e.requirePartitionFilter&&Object.hasOwnProperty.call(e,"requirePartitionFilter")&&t.uint32(112).bool(e.requirePartitionFilter),null!=e.clusterBy&&e.clusterBy.length)for(n=0;n<e.clusterBy.length;++n)t.uint32(122).string(e.clusterBy[n]);if(null!=e.labels&&Object.hasOwnProperty.call(e,"labels")){var r=Object.keys(e.labels);for(n=0;n<r.length;++n)t.uint32(130).fork().uint32(10).string(r[n]).uint32(18).string(e.labels[r[n]]).ldelim()}if(null!=e.additionalOptions&&Object.hasOwnProperty.call(e,"additionalOptions"))for(r=Object.keys(e.additionalOptions),n=0;n<r.length;++n)t.uint32(138).fork().uint32(10).string(r[n]).uint32(18).string(e.additionalOptions[r[n]]).ldelim();return null!=e.dependOnDependencyAssertions&&Object.hasOwnProperty.call(e,"dependOnDependencyAssertions")&&t.uint32(144).bool(e.dependOnDependencyAssertions),null!=e.assertions&&Object.hasOwnProperty.call(e,"assertions")&&s.sqlanvil.ActionConfig.TableAssertionsConfig.encode(e.assertions,t.uint32(154).fork()).ldelim(),null!=e.hermetic&&Object.hasOwnProperty.call(e,"hermetic")&&t.uint32(160).bool(e.hermetic),null!=e.iceberg&&Object.hasOwnProperty.call(e,"iceberg")&&s.sqlanvil.ActionConfig.IcebergTableConfig.encode(e.iceberg,t.uint32(178).fork()).ldelim(),null!=e.metadata&&Object.hasOwnProperty.call(e,"metadata")&&s.sqlanvil.ActionConfig.Metadata.encode(e.metadata,t.uint32(186).fork()).ldelim(),null!=e.reservation&&Object.hasOwnProperty.call(e,"reservation")&&t.uint32(194).string(e.reservation),null!=e.postgres&&Object.hasOwnProperty.call(e,"postgres")&&s.sqlanvil.PostgresOptions.encode(e.postgres,t.uint32(202).fork()).ldelim(),null!=e.supabase&&Object.hasOwnProperty.call(e,"supabase")&&s.sqlanvil.SupabaseOptions.encode(e.supabase,t.uint32(210).fork()).ldelim(),null!=e.mysql&&Object.hasOwnProperty.call(e,"mysql")&&s.sqlanvil.MysqlOptions.encode(e.mysql,t.uint32(218).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r,o,l=void 0===t?e.len:e.pos+t,c=new s.sqlanvil.ActionConfig.TableConfig;e.pos<l;){var u=e.uint32();if(u===n)break;switch(u>>>3){case 1:c.name=e.string();break;case 2:c.dataset=e.string();break;case 3:c.project=e.string();break;case 4:c.dependencyTargets&&c.dependencyTargets.length||(c.dependencyTargets=[]),c.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32()));break;case 5:c.filename=e.string();break;case 6:c.tags&&c.tags.length||(c.tags=[]),c.tags.push(e.string());break;case 7:c.disabled=e.bool();break;case 8:c.preOperations&&c.preOperations.length||(c.preOperations=[]),c.preOperations.push(e.string());break;case 9:c.postOperations&&c.postOperations.length||(c.postOperations=[]),c.postOperations.push(e.string());break;case 10:c.description=e.string();break;case 11:c.columns&&c.columns.length||(c.columns=[]),c.columns.push(s.sqlanvil.ActionConfig.ColumnDescriptor.decode(e,e.uint32()));break;case 12:c.partitionBy=e.string();break;case 13:c.partitionExpirationDays=e.int32();break;case 14:c.requirePartitionFilter=e.bool();break;case 15:c.clusterBy&&c.clusterBy.length||(c.clusterBy=[]),c.clusterBy.push(e.string());break;case 16:c.labels===a.emptyObject&&(c.labels={});var p=e.uint32()+e.pos;for(r="",o="";e.pos<p;)switch((f=e.uint32())>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}c.labels[r]=o;break;case 17:for(c.additionalOptions===a.emptyObject&&(c.additionalOptions={}),p=e.uint32()+e.pos,r="",o="";e.pos<p;){var f;switch((f=e.uint32())>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}}c.additionalOptions[r]=o;break;case 18:c.dependOnDependencyAssertions=e.bool();break;case 19:c.assertions=s.sqlanvil.ActionConfig.TableAssertionsConfig.decode(e,e.uint32());break;case 20:c.hermetic=e.bool();break;case 22:c.iceberg=s.sqlanvil.ActionConfig.IcebergTableConfig.decode(e,e.uint32());break;case 23:c.metadata=s.sqlanvil.ActionConfig.Metadata.decode(e,e.uint32());break;case 24:c.reservation=e.string();break;case 25:c.postgres=s.sqlanvil.PostgresOptions.decode(e,e.uint32());break;case 26:c.supabase=s.sqlanvil.SupabaseOptions.decode(e,e.uint32());break;case 27:c.mysql=s.sqlanvil.MysqlOptions.decode(e,e.uint32());break;default:e.skipType(7&u)}}return c},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.dataset&&e.hasOwnProperty("dataset")&&!a.isString(e.dataset))return"dataset: string expected";if(null!=e.project&&e.hasOwnProperty("project")&&!a.isString(e.project))return"project: string expected";if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var t=0;t<e.dependencyTargets.length;++t)if(r=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[t]))return"dependencyTargets."+r}if(null!=e.filename&&e.hasOwnProperty("filename")&&!a.isString(e.filename))return"filename: string expected";if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!a.isString(e.tags[t]))return"tags: string[] expected"}if(null!=e.disabled&&e.hasOwnProperty("disabled")&&"boolean"!=typeof e.disabled)return"disabled: boolean expected";if(null!=e.preOperations&&e.hasOwnProperty("preOperations")){if(!Array.isArray(e.preOperations))return"preOperations: array expected";for(t=0;t<e.preOperations.length;++t)if(!a.isString(e.preOperations[t]))return"preOperations: string[] expected"}if(null!=e.postOperations&&e.hasOwnProperty("postOperations")){if(!Array.isArray(e.postOperations))return"postOperations: array expected";for(t=0;t<e.postOperations.length;++t)if(!a.isString(e.postOperations[t]))return"postOperations: string[] expected"}if(null!=e.description&&e.hasOwnProperty("description")&&!a.isString(e.description))return"description: string expected";if(null!=e.columns&&e.hasOwnProperty("columns")){if(!Array.isArray(e.columns))return"columns: array expected";for(t=0;t<e.columns.length;++t)if(r=s.sqlanvil.ActionConfig.ColumnDescriptor.verify(e.columns[t]))return"columns."+r}if(null!=e.partitionBy&&e.hasOwnProperty("partitionBy")&&!a.isString(e.partitionBy))return"partitionBy: string expected";if(null!=e.partitionExpirationDays&&e.hasOwnProperty("partitionExpirationDays")&&!a.isInteger(e.partitionExpirationDays))return"partitionExpirationDays: integer expected";if(null!=e.requirePartitionFilter&&e.hasOwnProperty("requirePartitionFilter")&&"boolean"!=typeof e.requirePartitionFilter)return"requirePartitionFilter: boolean expected";if(null!=e.clusterBy&&e.hasOwnProperty("clusterBy")){if(!Array.isArray(e.clusterBy))return"clusterBy: array expected";for(t=0;t<e.clusterBy.length;++t)if(!a.isString(e.clusterBy[t]))return"clusterBy: string[] expected"}if(null!=e.labels&&e.hasOwnProperty("labels")){if(!a.isObject(e.labels))return"labels: object expected";var n=Object.keys(e.labels);for(t=0;t<n.length;++t)if(!a.isString(e.labels[n[t]]))return"labels: string{k:string} expected"}if(null!=e.additionalOptions&&e.hasOwnProperty("additionalOptions")){if(!a.isObject(e.additionalOptions))return"additionalOptions: object expected";for(n=Object.keys(e.additionalOptions),t=0;t<n.length;++t)if(!a.isString(e.additionalOptions[n[t]]))return"additionalOptions: string{k:string} expected"}return null!=e.dependOnDependencyAssertions&&e.hasOwnProperty("dependOnDependencyAssertions")&&"boolean"!=typeof e.dependOnDependencyAssertions?"dependOnDependencyAssertions: boolean expected":null!=e.assertions&&e.hasOwnProperty("assertions")&&(r=s.sqlanvil.ActionConfig.TableAssertionsConfig.verify(e.assertions))?"assertions."+r:null!=e.hermetic&&e.hasOwnProperty("hermetic")&&"boolean"!=typeof e.hermetic?"hermetic: boolean expected":null!=e.iceberg&&e.hasOwnProperty("iceberg")&&(r=s.sqlanvil.ActionConfig.IcebergTableConfig.verify(e.iceberg))?"iceberg."+r:null!=e.metadata&&e.hasOwnProperty("metadata")&&(r=s.sqlanvil.ActionConfig.Metadata.verify(e.metadata))?"metadata."+r:null!=e.reservation&&e.hasOwnProperty("reservation")&&!a.isString(e.reservation)?"reservation: string expected":null!=e.postgres&&e.hasOwnProperty("postgres")&&(r=s.sqlanvil.PostgresOptions.verify(e.postgres))?"postgres."+r:null!=e.supabase&&e.hasOwnProperty("supabase")&&(r=s.sqlanvil.SupabaseOptions.verify(e.supabase))?"supabase."+r:null!=e.mysql&&e.hasOwnProperty("mysql")&&(r=s.sqlanvil.MysqlOptions.verify(e.mysql))?"mysql."+r:null;var r},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.TableConfig)return e;var t=new s.sqlanvil.ActionConfig.TableConfig;if(null!=e.name&&(t.name=String(e.name)),null!=e.dataset&&(t.dataset=String(e.dataset)),null!=e.project&&(t.project=String(e.project)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.TableConfig.dependencyTargets: array expected");t.dependencyTargets=[];for(var n=0;n<e.dependencyTargets.length;++n){if("object"!=typeof e.dependencyTargets[n])throw TypeError(".sqlanvil.ActionConfig.TableConfig.dependencyTargets: object expected");t.dependencyTargets[n]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[n])}}if(null!=e.filename&&(t.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.TableConfig.tags: array expected");for(t.tags=[],n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}if(null!=e.disabled&&(t.disabled=Boolean(e.disabled)),e.preOperations){if(!Array.isArray(e.preOperations))throw TypeError(".sqlanvil.ActionConfig.TableConfig.preOperations: array expected");for(t.preOperations=[],n=0;n<e.preOperations.length;++n)t.preOperations[n]=String(e.preOperations[n])}if(e.postOperations){if(!Array.isArray(e.postOperations))throw TypeError(".sqlanvil.ActionConfig.TableConfig.postOperations: array expected");for(t.postOperations=[],n=0;n<e.postOperations.length;++n)t.postOperations[n]=String(e.postOperations[n])}if(null!=e.description&&(t.description=String(e.description)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.ActionConfig.TableConfig.columns: array expected");for(t.columns=[],n=0;n<e.columns.length;++n){if("object"!=typeof e.columns[n])throw TypeError(".sqlanvil.ActionConfig.TableConfig.columns: object expected");t.columns[n]=s.sqlanvil.ActionConfig.ColumnDescriptor.fromObject(e.columns[n])}}if(null!=e.partitionBy&&(t.partitionBy=String(e.partitionBy)),null!=e.partitionExpirationDays&&(t.partitionExpirationDays=0|e.partitionExpirationDays),null!=e.requirePartitionFilter&&(t.requirePartitionFilter=Boolean(e.requirePartitionFilter)),e.clusterBy){if(!Array.isArray(e.clusterBy))throw TypeError(".sqlanvil.ActionConfig.TableConfig.clusterBy: array expected");for(t.clusterBy=[],n=0;n<e.clusterBy.length;++n)t.clusterBy[n]=String(e.clusterBy[n])}if(e.labels){if("object"!=typeof e.labels)throw TypeError(".sqlanvil.ActionConfig.TableConfig.labels: object expected");t.labels={};var r=Object.keys(e.labels);for(n=0;n<r.length;++n)t.labels[r[n]]=String(e.labels[r[n]])}if(e.additionalOptions){if("object"!=typeof e.additionalOptions)throw TypeError(".sqlanvil.ActionConfig.TableConfig.additionalOptions: object expected");for(t.additionalOptions={},r=Object.keys(e.additionalOptions),n=0;n<r.length;++n)t.additionalOptions[r[n]]=String(e.additionalOptions[r[n]])}if(null!=e.dependOnDependencyAssertions&&(t.dependOnDependencyAssertions=Boolean(e.dependOnDependencyAssertions)),null!=e.assertions){if("object"!=typeof e.assertions)throw TypeError(".sqlanvil.ActionConfig.TableConfig.assertions: object expected");t.assertions=s.sqlanvil.ActionConfig.TableAssertionsConfig.fromObject(e.assertions)}if(null!=e.hermetic&&(t.hermetic=Boolean(e.hermetic)),null!=e.iceberg){if("object"!=typeof e.iceberg)throw TypeError(".sqlanvil.ActionConfig.TableConfig.iceberg: object expected");t.iceberg=s.sqlanvil.ActionConfig.IcebergTableConfig.fromObject(e.iceberg)}if(null!=e.metadata){if("object"!=typeof e.metadata)throw TypeError(".sqlanvil.ActionConfig.TableConfig.metadata: object expected");t.metadata=s.sqlanvil.ActionConfig.Metadata.fromObject(e.metadata)}if(null!=e.reservation&&(t.reservation=String(e.reservation)),null!=e.postgres){if("object"!=typeof e.postgres)throw TypeError(".sqlanvil.ActionConfig.TableConfig.postgres: object expected");t.postgres=s.sqlanvil.PostgresOptions.fromObject(e.postgres)}if(null!=e.supabase){if("object"!=typeof e.supabase)throw TypeError(".sqlanvil.ActionConfig.TableConfig.supabase: object expected");t.supabase=s.sqlanvil.SupabaseOptions.fromObject(e.supabase)}if(null!=e.mysql){if("object"!=typeof e.mysql)throw TypeError(".sqlanvil.ActionConfig.TableConfig.mysql: object expected");t.mysql=s.sqlanvil.MysqlOptions.fromObject(e.mysql)}return t},t.toObject=function(e,t){t||(t={});var n,r={};if((t.arrays||t.defaults)&&(r.dependencyTargets=[],r.tags=[],r.preOperations=[],r.postOperations=[],r.columns=[],r.clusterBy=[]),(t.objects||t.defaults)&&(r.labels={},r.additionalOptions={}),t.defaults&&(r.name="",r.dataset="",r.project="",r.filename="",r.disabled=!1,r.description="",r.partitionBy="",r.partitionExpirationDays=0,r.requirePartitionFilter=!1,r.dependOnDependencyAssertions=!1,r.assertions=null,r.hermetic=!1,r.iceberg=null,r.metadata=null,r.reservation="",r.postgres=null,r.supabase=null,r.mysql=null),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),null!=e.dataset&&e.hasOwnProperty("dataset")&&(r.dataset=e.dataset),null!=e.project&&e.hasOwnProperty("project")&&(r.project=e.project),e.dependencyTargets&&e.dependencyTargets.length){r.dependencyTargets=[];for(var i=0;i<e.dependencyTargets.length;++i)r.dependencyTargets[i]=s.sqlanvil.ActionConfig.Target.toObject(e.dependencyTargets[i],t)}if(null!=e.filename&&e.hasOwnProperty("filename")&&(r.filename=e.filename),e.tags&&e.tags.length)for(r.tags=[],i=0;i<e.tags.length;++i)r.tags[i]=e.tags[i];if(null!=e.disabled&&e.hasOwnProperty("disabled")&&(r.disabled=e.disabled),e.preOperations&&e.preOperations.length)for(r.preOperations=[],i=0;i<e.preOperations.length;++i)r.preOperations[i]=e.preOperations[i];if(e.postOperations&&e.postOperations.length)for(r.postOperations=[],i=0;i<e.postOperations.length;++i)r.postOperations[i]=e.postOperations[i];if(null!=e.description&&e.hasOwnProperty("description")&&(r.description=e.description),e.columns&&e.columns.length)for(r.columns=[],i=0;i<e.columns.length;++i)r.columns[i]=s.sqlanvil.ActionConfig.ColumnDescriptor.toObject(e.columns[i],t);if(null!=e.partitionBy&&e.hasOwnProperty("partitionBy")&&(r.partitionBy=e.partitionBy),null!=e.partitionExpirationDays&&e.hasOwnProperty("partitionExpirationDays")&&(r.partitionExpirationDays=e.partitionExpirationDays),null!=e.requirePartitionFilter&&e.hasOwnProperty("requirePartitionFilter")&&(r.requirePartitionFilter=e.requirePartitionFilter),e.clusterBy&&e.clusterBy.length)for(r.clusterBy=[],i=0;i<e.clusterBy.length;++i)r.clusterBy[i]=e.clusterBy[i];if(e.labels&&(n=Object.keys(e.labels)).length)for(r.labels={},i=0;i<n.length;++i)r.labels[n[i]]=e.labels[n[i]];if(e.additionalOptions&&(n=Object.keys(e.additionalOptions)).length)for(r.additionalOptions={},i=0;i<n.length;++i)r.additionalOptions[n[i]]=e.additionalOptions[n[i]];return null!=e.dependOnDependencyAssertions&&e.hasOwnProperty("dependOnDependencyAssertions")&&(r.dependOnDependencyAssertions=e.dependOnDependencyAssertions),null!=e.assertions&&e.hasOwnProperty("assertions")&&(r.assertions=s.sqlanvil.ActionConfig.TableAssertionsConfig.toObject(e.assertions,t)),null!=e.hermetic&&e.hasOwnProperty("hermetic")&&(r.hermetic=e.hermetic),null!=e.iceberg&&e.hasOwnProperty("iceberg")&&(r.iceberg=s.sqlanvil.ActionConfig.IcebergTableConfig.toObject(e.iceberg,t)),null!=e.metadata&&e.hasOwnProperty("metadata")&&(r.metadata=s.sqlanvil.ActionConfig.Metadata.toObject(e.metadata,t)),null!=e.reservation&&e.hasOwnProperty("reservation")&&(r.reservation=e.reservation),null!=e.postgres&&e.hasOwnProperty("postgres")&&(r.postgres=s.sqlanvil.PostgresOptions.toObject(e.postgres,t)),null!=e.supabase&&e.hasOwnProperty("supabase")&&(r.supabase=s.sqlanvil.SupabaseOptions.toObject(e.supabase,t)),null!=e.mysql&&e.hasOwnProperty("mysql")&&(r.mysql=s.sqlanvil.MysqlOptions.toObject(e.mysql,t)),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.TableConfig"},t}(),t.Metadata=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.overview="",t.prototype.extraProperties=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.overview&&Object.hasOwnProperty.call(e,"overview")&&t.uint32(10).string(e.overview),null!=e.extraProperties&&Object.hasOwnProperty.call(e,"extraProperties")&&s.google.protobuf.Struct.encode(e.extraProperties,t.uint32(18).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionConfig.Metadata;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.overview=e.string();break;case 2:o.extraProperties=s.google.protobuf.Struct.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.overview&&e.hasOwnProperty("overview")&&!a.isString(e.overview))return"overview: string expected";if(null!=e.extraProperties&&e.hasOwnProperty("extraProperties")){var t=s.google.protobuf.Struct.verify(e.extraProperties);if(t)return"extraProperties."+t}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.Metadata)return e;var t=new s.sqlanvil.ActionConfig.Metadata;if(null!=e.overview&&(t.overview=String(e.overview)),null!=e.extraProperties){if("object"!=typeof e.extraProperties)throw TypeError(".sqlanvil.ActionConfig.Metadata.extraProperties: object expected");t.extraProperties=s.google.protobuf.Struct.fromObject(e.extraProperties)}return t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.overview="",n.extraProperties=null),null!=e.overview&&e.hasOwnProperty("overview")&&(n.overview=e.overview),null!=e.extraProperties&&e.hasOwnProperty("extraProperties")&&(n.extraProperties=s.google.protobuf.Struct.toObject(e.extraProperties,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.Metadata"},t}(),t.ViewConfig=function(){function t(e){if(this.dependencyTargets=[],this.tags=[],this.preOperations=[],this.postOperations=[],this.clusterBy=[],this.columns=[],this.labels={},this.additionalOptions={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.dataset="",t.prototype.project="",t.prototype.dependencyTargets=a.emptyArray,t.prototype.filename="",t.prototype.tags=a.emptyArray,t.prototype.disabled=!1,t.prototype.preOperations=a.emptyArray,t.prototype.postOperations=a.emptyArray,t.prototype.materialized=!1,t.prototype.partitionBy="",t.prototype.clusterBy=a.emptyArray,t.prototype.description="",t.prototype.columns=a.emptyArray,t.prototype.labels=a.emptyObject,t.prototype.additionalOptions=a.emptyObject,t.prototype.dependOnDependencyAssertions=!1,t.prototype.hermetic=!1,t.prototype.assertions=null,t.prototype.metadata=null,t.prototype.reservation="",t.prototype.postgres=null,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.dataset&&Object.hasOwnProperty.call(e,"dataset")&&t.uint32(18).string(e.dataset),null!=e.project&&Object.hasOwnProperty.call(e,"project")&&t.uint32(26).string(e.project),null!=e.dependencyTargets&&e.dependencyTargets.length)for(var n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.ActionConfig.Target.encode(e.dependencyTargets[n],t.uint32(34).fork()).ldelim();if(null!=e.filename&&Object.hasOwnProperty.call(e,"filename")&&t.uint32(42).string(e.filename),null!=e.tags&&e.tags.length)for(n=0;n<e.tags.length;++n)t.uint32(50).string(e.tags[n]);if(null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(56).bool(e.disabled),null!=e.preOperations&&e.preOperations.length)for(n=0;n<e.preOperations.length;++n)t.uint32(66).string(e.preOperations[n]);if(null!=e.postOperations&&e.postOperations.length)for(n=0;n<e.postOperations.length;++n)t.uint32(74).string(e.postOperations[n]);if(null!=e.materialized&&Object.hasOwnProperty.call(e,"materialized")&&t.uint32(80).bool(e.materialized),null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(90).string(e.description),null!=e.columns&&e.columns.length)for(n=0;n<e.columns.length;++n)s.sqlanvil.ActionConfig.ColumnDescriptor.encode(e.columns[n],t.uint32(98).fork()).ldelim();if(null!=e.labels&&Object.hasOwnProperty.call(e,"labels")){var r=Object.keys(e.labels);for(n=0;n<r.length;++n)t.uint32(106).fork().uint32(10).string(r[n]).uint32(18).string(e.labels[r[n]]).ldelim()}if(null!=e.additionalOptions&&Object.hasOwnProperty.call(e,"additionalOptions"))for(r=Object.keys(e.additionalOptions),n=0;n<r.length;++n)t.uint32(114).fork().uint32(10).string(r[n]).uint32(18).string(e.additionalOptions[r[n]]).ldelim();if(null!=e.dependOnDependencyAssertions&&Object.hasOwnProperty.call(e,"dependOnDependencyAssertions")&&t.uint32(120).bool(e.dependOnDependencyAssertions),null!=e.hermetic&&Object.hasOwnProperty.call(e,"hermetic")&&t.uint32(128).bool(e.hermetic),null!=e.assertions&&Object.hasOwnProperty.call(e,"assertions")&&s.sqlanvil.ActionConfig.TableAssertionsConfig.encode(e.assertions,t.uint32(138).fork()).ldelim(),null!=e.partitionBy&&Object.hasOwnProperty.call(e,"partitionBy")&&t.uint32(146).string(e.partitionBy),null!=e.clusterBy&&e.clusterBy.length)for(n=0;n<e.clusterBy.length;++n)t.uint32(154).string(e.clusterBy[n]);return null!=e.metadata&&Object.hasOwnProperty.call(e,"metadata")&&s.sqlanvil.ActionConfig.Metadata.encode(e.metadata,t.uint32(162).fork()).ldelim(),null!=e.reservation&&Object.hasOwnProperty.call(e,"reservation")&&t.uint32(170).string(e.reservation),null!=e.postgres&&Object.hasOwnProperty.call(e,"postgres")&&s.sqlanvil.PostgresOptions.encode(e.postgres,t.uint32(178).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r,o,l=void 0===t?e.len:e.pos+t,c=new s.sqlanvil.ActionConfig.ViewConfig;e.pos<l;){var u=e.uint32();if(u===n)break;switch(u>>>3){case 1:c.name=e.string();break;case 2:c.dataset=e.string();break;case 3:c.project=e.string();break;case 4:c.dependencyTargets&&c.dependencyTargets.length||(c.dependencyTargets=[]),c.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32()));break;case 5:c.filename=e.string();break;case 6:c.tags&&c.tags.length||(c.tags=[]),c.tags.push(e.string());break;case 7:c.disabled=e.bool();break;case 8:c.preOperations&&c.preOperations.length||(c.preOperations=[]),c.preOperations.push(e.string());break;case 9:c.postOperations&&c.postOperations.length||(c.postOperations=[]),c.postOperations.push(e.string());break;case 10:c.materialized=e.bool();break;case 18:c.partitionBy=e.string();break;case 19:c.clusterBy&&c.clusterBy.length||(c.clusterBy=[]),c.clusterBy.push(e.string());break;case 11:c.description=e.string();break;case 12:c.columns&&c.columns.length||(c.columns=[]),c.columns.push(s.sqlanvil.ActionConfig.ColumnDescriptor.decode(e,e.uint32()));break;case 13:c.labels===a.emptyObject&&(c.labels={});var p=e.uint32()+e.pos;for(r="",o="";e.pos<p;)switch((f=e.uint32())>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}c.labels[r]=o;break;case 14:for(c.additionalOptions===a.emptyObject&&(c.additionalOptions={}),p=e.uint32()+e.pos,r="",o="";e.pos<p;){var f;switch((f=e.uint32())>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}}c.additionalOptions[r]=o;break;case 15:c.dependOnDependencyAssertions=e.bool();break;case 16:c.hermetic=e.bool();break;case 17:c.assertions=s.sqlanvil.ActionConfig.TableAssertionsConfig.decode(e,e.uint32());break;case 20:c.metadata=s.sqlanvil.ActionConfig.Metadata.decode(e,e.uint32());break;case 21:c.reservation=e.string();break;case 22:c.postgres=s.sqlanvil.PostgresOptions.decode(e,e.uint32());break;default:e.skipType(7&u)}}return c},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.dataset&&e.hasOwnProperty("dataset")&&!a.isString(e.dataset))return"dataset: string expected";if(null!=e.project&&e.hasOwnProperty("project")&&!a.isString(e.project))return"project: string expected";if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var t=0;t<e.dependencyTargets.length;++t)if(r=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[t]))return"dependencyTargets."+r}if(null!=e.filename&&e.hasOwnProperty("filename")&&!a.isString(e.filename))return"filename: string expected";if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!a.isString(e.tags[t]))return"tags: string[] expected"}if(null!=e.disabled&&e.hasOwnProperty("disabled")&&"boolean"!=typeof e.disabled)return"disabled: boolean expected";if(null!=e.preOperations&&e.hasOwnProperty("preOperations")){if(!Array.isArray(e.preOperations))return"preOperations: array expected";for(t=0;t<e.preOperations.length;++t)if(!a.isString(e.preOperations[t]))return"preOperations: string[] expected"}if(null!=e.postOperations&&e.hasOwnProperty("postOperations")){if(!Array.isArray(e.postOperations))return"postOperations: array expected";for(t=0;t<e.postOperations.length;++t)if(!a.isString(e.postOperations[t]))return"postOperations: string[] expected"}if(null!=e.materialized&&e.hasOwnProperty("materialized")&&"boolean"!=typeof e.materialized)return"materialized: boolean expected";if(null!=e.partitionBy&&e.hasOwnProperty("partitionBy")&&!a.isString(e.partitionBy))return"partitionBy: string expected";if(null!=e.clusterBy&&e.hasOwnProperty("clusterBy")){if(!Array.isArray(e.clusterBy))return"clusterBy: array expected";for(t=0;t<e.clusterBy.length;++t)if(!a.isString(e.clusterBy[t]))return"clusterBy: string[] expected"}if(null!=e.description&&e.hasOwnProperty("description")&&!a.isString(e.description))return"description: string expected";if(null!=e.columns&&e.hasOwnProperty("columns")){if(!Array.isArray(e.columns))return"columns: array expected";for(t=0;t<e.columns.length;++t)if(r=s.sqlanvil.ActionConfig.ColumnDescriptor.verify(e.columns[t]))return"columns."+r}if(null!=e.labels&&e.hasOwnProperty("labels")){if(!a.isObject(e.labels))return"labels: object expected";var n=Object.keys(e.labels);for(t=0;t<n.length;++t)if(!a.isString(e.labels[n[t]]))return"labels: string{k:string} expected"}if(null!=e.additionalOptions&&e.hasOwnProperty("additionalOptions")){if(!a.isObject(e.additionalOptions))return"additionalOptions: object expected";for(n=Object.keys(e.additionalOptions),t=0;t<n.length;++t)if(!a.isString(e.additionalOptions[n[t]]))return"additionalOptions: string{k:string} expected"}return null!=e.dependOnDependencyAssertions&&e.hasOwnProperty("dependOnDependencyAssertions")&&"boolean"!=typeof e.dependOnDependencyAssertions?"dependOnDependencyAssertions: boolean expected":null!=e.hermetic&&e.hasOwnProperty("hermetic")&&"boolean"!=typeof e.hermetic?"hermetic: boolean expected":null!=e.assertions&&e.hasOwnProperty("assertions")&&(r=s.sqlanvil.ActionConfig.TableAssertionsConfig.verify(e.assertions))?"assertions."+r:null!=e.metadata&&e.hasOwnProperty("metadata")&&(r=s.sqlanvil.ActionConfig.Metadata.verify(e.metadata))?"metadata."+r:null!=e.reservation&&e.hasOwnProperty("reservation")&&!a.isString(e.reservation)?"reservation: string expected":null!=e.postgres&&e.hasOwnProperty("postgres")&&(r=s.sqlanvil.PostgresOptions.verify(e.postgres))?"postgres."+r:null;var r},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.ViewConfig)return e;var t=new s.sqlanvil.ActionConfig.ViewConfig;if(null!=e.name&&(t.name=String(e.name)),null!=e.dataset&&(t.dataset=String(e.dataset)),null!=e.project&&(t.project=String(e.project)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.ViewConfig.dependencyTargets: array expected");t.dependencyTargets=[];for(var n=0;n<e.dependencyTargets.length;++n){if("object"!=typeof e.dependencyTargets[n])throw TypeError(".sqlanvil.ActionConfig.ViewConfig.dependencyTargets: object expected");t.dependencyTargets[n]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[n])}}if(null!=e.filename&&(t.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.ViewConfig.tags: array expected");for(t.tags=[],n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}if(null!=e.disabled&&(t.disabled=Boolean(e.disabled)),e.preOperations){if(!Array.isArray(e.preOperations))throw TypeError(".sqlanvil.ActionConfig.ViewConfig.preOperations: array expected");for(t.preOperations=[],n=0;n<e.preOperations.length;++n)t.preOperations[n]=String(e.preOperations[n])}if(e.postOperations){if(!Array.isArray(e.postOperations))throw TypeError(".sqlanvil.ActionConfig.ViewConfig.postOperations: array expected");for(t.postOperations=[],n=0;n<e.postOperations.length;++n)t.postOperations[n]=String(e.postOperations[n])}if(null!=e.materialized&&(t.materialized=Boolean(e.materialized)),null!=e.partitionBy&&(t.partitionBy=String(e.partitionBy)),e.clusterBy){if(!Array.isArray(e.clusterBy))throw TypeError(".sqlanvil.ActionConfig.ViewConfig.clusterBy: array expected");for(t.clusterBy=[],n=0;n<e.clusterBy.length;++n)t.clusterBy[n]=String(e.clusterBy[n])}if(null!=e.description&&(t.description=String(e.description)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.ActionConfig.ViewConfig.columns: array expected");for(t.columns=[],n=0;n<e.columns.length;++n){if("object"!=typeof e.columns[n])throw TypeError(".sqlanvil.ActionConfig.ViewConfig.columns: object expected");t.columns[n]=s.sqlanvil.ActionConfig.ColumnDescriptor.fromObject(e.columns[n])}}if(e.labels){if("object"!=typeof e.labels)throw TypeError(".sqlanvil.ActionConfig.ViewConfig.labels: object expected");t.labels={};var r=Object.keys(e.labels);for(n=0;n<r.length;++n)t.labels[r[n]]=String(e.labels[r[n]])}if(e.additionalOptions){if("object"!=typeof e.additionalOptions)throw TypeError(".sqlanvil.ActionConfig.ViewConfig.additionalOptions: object expected");for(t.additionalOptions={},r=Object.keys(e.additionalOptions),n=0;n<r.length;++n)t.additionalOptions[r[n]]=String(e.additionalOptions[r[n]])}if(null!=e.dependOnDependencyAssertions&&(t.dependOnDependencyAssertions=Boolean(e.dependOnDependencyAssertions)),null!=e.hermetic&&(t.hermetic=Boolean(e.hermetic)),null!=e.assertions){if("object"!=typeof e.assertions)throw TypeError(".sqlanvil.ActionConfig.ViewConfig.assertions: object expected");t.assertions=s.sqlanvil.ActionConfig.TableAssertionsConfig.fromObject(e.assertions)}if(null!=e.metadata){if("object"!=typeof e.metadata)throw TypeError(".sqlanvil.ActionConfig.ViewConfig.metadata: object expected");t.metadata=s.sqlanvil.ActionConfig.Metadata.fromObject(e.metadata)}if(null!=e.reservation&&(t.reservation=String(e.reservation)),null!=e.postgres){if("object"!=typeof e.postgres)throw TypeError(".sqlanvil.ActionConfig.ViewConfig.postgres: object expected");t.postgres=s.sqlanvil.PostgresOptions.fromObject(e.postgres)}return t},t.toObject=function(e,t){t||(t={});var n,r={};if((t.arrays||t.defaults)&&(r.dependencyTargets=[],r.tags=[],r.preOperations=[],r.postOperations=[],r.columns=[],r.clusterBy=[]),(t.objects||t.defaults)&&(r.labels={},r.additionalOptions={}),t.defaults&&(r.name="",r.dataset="",r.project="",r.filename="",r.disabled=!1,r.materialized=!1,r.description="",r.dependOnDependencyAssertions=!1,r.hermetic=!1,r.assertions=null,r.partitionBy="",r.metadata=null,r.reservation="",r.postgres=null),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),null!=e.dataset&&e.hasOwnProperty("dataset")&&(r.dataset=e.dataset),null!=e.project&&e.hasOwnProperty("project")&&(r.project=e.project),e.dependencyTargets&&e.dependencyTargets.length){r.dependencyTargets=[];for(var i=0;i<e.dependencyTargets.length;++i)r.dependencyTargets[i]=s.sqlanvil.ActionConfig.Target.toObject(e.dependencyTargets[i],t)}if(null!=e.filename&&e.hasOwnProperty("filename")&&(r.filename=e.filename),e.tags&&e.tags.length)for(r.tags=[],i=0;i<e.tags.length;++i)r.tags[i]=e.tags[i];if(null!=e.disabled&&e.hasOwnProperty("disabled")&&(r.disabled=e.disabled),e.preOperations&&e.preOperations.length)for(r.preOperations=[],i=0;i<e.preOperations.length;++i)r.preOperations[i]=e.preOperations[i];if(e.postOperations&&e.postOperations.length)for(r.postOperations=[],i=0;i<e.postOperations.length;++i)r.postOperations[i]=e.postOperations[i];if(null!=e.materialized&&e.hasOwnProperty("materialized")&&(r.materialized=e.materialized),null!=e.description&&e.hasOwnProperty("description")&&(r.description=e.description),e.columns&&e.columns.length)for(r.columns=[],i=0;i<e.columns.length;++i)r.columns[i]=s.sqlanvil.ActionConfig.ColumnDescriptor.toObject(e.columns[i],t);if(e.labels&&(n=Object.keys(e.labels)).length)for(r.labels={},i=0;i<n.length;++i)r.labels[n[i]]=e.labels[n[i]];if(e.additionalOptions&&(n=Object.keys(e.additionalOptions)).length)for(r.additionalOptions={},i=0;i<n.length;++i)r.additionalOptions[n[i]]=e.additionalOptions[n[i]];if(null!=e.dependOnDependencyAssertions&&e.hasOwnProperty("dependOnDependencyAssertions")&&(r.dependOnDependencyAssertions=e.dependOnDependencyAssertions),null!=e.hermetic&&e.hasOwnProperty("hermetic")&&(r.hermetic=e.hermetic),null!=e.assertions&&e.hasOwnProperty("assertions")&&(r.assertions=s.sqlanvil.ActionConfig.TableAssertionsConfig.toObject(e.assertions,t)),null!=e.partitionBy&&e.hasOwnProperty("partitionBy")&&(r.partitionBy=e.partitionBy),e.clusterBy&&e.clusterBy.length)for(r.clusterBy=[],i=0;i<e.clusterBy.length;++i)r.clusterBy[i]=e.clusterBy[i];return null!=e.metadata&&e.hasOwnProperty("metadata")&&(r.metadata=s.sqlanvil.ActionConfig.Metadata.toObject(e.metadata,t)),null!=e.reservation&&e.hasOwnProperty("reservation")&&(r.reservation=e.reservation),null!=e.postgres&&e.hasOwnProperty("postgres")&&(r.postgres=s.sqlanvil.PostgresOptions.toObject(e.postgres,t)),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.ViewConfig"},t}(),t.OnSchemaChange=(r={},(l=Object.create(r))[r[0]="IGNORE"]=0,l[r[1]="FAIL"]=1,l[r[2]="EXTEND"]=2,l[r[3]="SYNCHRONIZE"]=3,l),t.IncrementalTableConfig=function(){function t(e){if(this.dependencyTargets=[],this.tags=[],this.preOperations=[],this.postOperations=[],this.uniqueKey=[],this.columns=[],this.clusterBy=[],this.labels={},this.additionalOptions={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.dataset="",t.prototype.project="",t.prototype.dependencyTargets=a.emptyArray,t.prototype.filename="",t.prototype.tags=a.emptyArray,t.prototype.disabled=!1,t.prototype.preOperations=a.emptyArray,t.prototype.postOperations=a.emptyArray,t.prototype.protected=!1,t.prototype.uniqueKey=a.emptyArray,t.prototype.description="",t.prototype.columns=a.emptyArray,t.prototype.partitionBy="",t.prototype.partitionExpirationDays=0,t.prototype.requirePartitionFilter=!1,t.prototype.updatePartitionFilter="",t.prototype.clusterBy=a.emptyArray,t.prototype.labels=a.emptyObject,t.prototype.additionalOptions=a.emptyObject,t.prototype.dependOnDependencyAssertions=!1,t.prototype.assertions=null,t.prototype.hermetic=!1,t.prototype.onSchemaChange=0,t.prototype.iceberg=null,t.prototype.metadata=null,t.prototype.reservation="",t.prototype.postgres=null,t.prototype.supabase=null,t.prototype.mysql=null,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.dataset&&Object.hasOwnProperty.call(e,"dataset")&&t.uint32(18).string(e.dataset),null!=e.project&&Object.hasOwnProperty.call(e,"project")&&t.uint32(26).string(e.project),null!=e.dependencyTargets&&e.dependencyTargets.length)for(var n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.ActionConfig.Target.encode(e.dependencyTargets[n],t.uint32(34).fork()).ldelim();if(null!=e.filename&&Object.hasOwnProperty.call(e,"filename")&&t.uint32(42).string(e.filename),null!=e.tags&&e.tags.length)for(n=0;n<e.tags.length;++n)t.uint32(50).string(e.tags[n]);if(null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(56).bool(e.disabled),null!=e.preOperations&&e.preOperations.length)for(n=0;n<e.preOperations.length;++n)t.uint32(66).string(e.preOperations[n]);if(null!=e.postOperations&&e.postOperations.length)for(n=0;n<e.postOperations.length;++n)t.uint32(74).string(e.postOperations[n]);if(null!=e.protected&&Object.hasOwnProperty.call(e,"protected")&&t.uint32(80).bool(e.protected),null!=e.uniqueKey&&e.uniqueKey.length)for(n=0;n<e.uniqueKey.length;++n)t.uint32(90).string(e.uniqueKey[n]);if(null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(98).string(e.description),null!=e.columns&&e.columns.length)for(n=0;n<e.columns.length;++n)s.sqlanvil.ActionConfig.ColumnDescriptor.encode(e.columns[n],t.uint32(106).fork()).ldelim();if(null!=e.partitionBy&&Object.hasOwnProperty.call(e,"partitionBy")&&t.uint32(114).string(e.partitionBy),null!=e.partitionExpirationDays&&Object.hasOwnProperty.call(e,"partitionExpirationDays")&&t.uint32(120).int32(e.partitionExpirationDays),null!=e.requirePartitionFilter&&Object.hasOwnProperty.call(e,"requirePartitionFilter")&&t.uint32(128).bool(e.requirePartitionFilter),null!=e.updatePartitionFilter&&Object.hasOwnProperty.call(e,"updatePartitionFilter")&&t.uint32(138).string(e.updatePartitionFilter),null!=e.clusterBy&&e.clusterBy.length)for(n=0;n<e.clusterBy.length;++n)t.uint32(146).string(e.clusterBy[n]);if(null!=e.labels&&Object.hasOwnProperty.call(e,"labels")){var r=Object.keys(e.labels);for(n=0;n<r.length;++n)t.uint32(154).fork().uint32(10).string(r[n]).uint32(18).string(e.labels[r[n]]).ldelim()}if(null!=e.additionalOptions&&Object.hasOwnProperty.call(e,"additionalOptions"))for(r=Object.keys(e.additionalOptions),n=0;n<r.length;++n)t.uint32(162).fork().uint32(10).string(r[n]).uint32(18).string(e.additionalOptions[r[n]]).ldelim();return null!=e.dependOnDependencyAssertions&&Object.hasOwnProperty.call(e,"dependOnDependencyAssertions")&&t.uint32(168).bool(e.dependOnDependencyAssertions),null!=e.assertions&&Object.hasOwnProperty.call(e,"assertions")&&s.sqlanvil.ActionConfig.TableAssertionsConfig.encode(e.assertions,t.uint32(178).fork()).ldelim(),null!=e.hermetic&&Object.hasOwnProperty.call(e,"hermetic")&&t.uint32(184).bool(e.hermetic),null!=e.onSchemaChange&&Object.hasOwnProperty.call(e,"onSchemaChange")&&t.uint32(192).int32(e.onSchemaChange),null!=e.iceberg&&Object.hasOwnProperty.call(e,"iceberg")&&s.sqlanvil.ActionConfig.IcebergTableConfig.encode(e.iceberg,t.uint32(202).fork()).ldelim(),null!=e.metadata&&Object.hasOwnProperty.call(e,"metadata")&&s.sqlanvil.ActionConfig.Metadata.encode(e.metadata,t.uint32(210).fork()).ldelim(),null!=e.reservation&&Object.hasOwnProperty.call(e,"reservation")&&t.uint32(218).string(e.reservation),null!=e.postgres&&Object.hasOwnProperty.call(e,"postgres")&&s.sqlanvil.PostgresOptions.encode(e.postgres,t.uint32(226).fork()).ldelim(),null!=e.supabase&&Object.hasOwnProperty.call(e,"supabase")&&s.sqlanvil.SupabaseOptions.encode(e.supabase,t.uint32(234).fork()).ldelim(),null!=e.mysql&&Object.hasOwnProperty.call(e,"mysql")&&s.sqlanvil.MysqlOptions.encode(e.mysql,t.uint32(242).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r,o,l=void 0===t?e.len:e.pos+t,c=new s.sqlanvil.ActionConfig.IncrementalTableConfig;e.pos<l;){var u=e.uint32();if(u===n)break;switch(u>>>3){case 1:c.name=e.string();break;case 2:c.dataset=e.string();break;case 3:c.project=e.string();break;case 4:c.dependencyTargets&&c.dependencyTargets.length||(c.dependencyTargets=[]),c.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32()));break;case 5:c.filename=e.string();break;case 6:c.tags&&c.tags.length||(c.tags=[]),c.tags.push(e.string());break;case 7:c.disabled=e.bool();break;case 8:c.preOperations&&c.preOperations.length||(c.preOperations=[]),c.preOperations.push(e.string());break;case 9:c.postOperations&&c.postOperations.length||(c.postOperations=[]),c.postOperations.push(e.string());break;case 10:c.protected=e.bool();break;case 11:c.uniqueKey&&c.uniqueKey.length||(c.uniqueKey=[]),c.uniqueKey.push(e.string());break;case 12:c.description=e.string();break;case 13:c.columns&&c.columns.length||(c.columns=[]),c.columns.push(s.sqlanvil.ActionConfig.ColumnDescriptor.decode(e,e.uint32()));break;case 14:c.partitionBy=e.string();break;case 15:c.partitionExpirationDays=e.int32();break;case 16:c.requirePartitionFilter=e.bool();break;case 17:c.updatePartitionFilter=e.string();break;case 18:c.clusterBy&&c.clusterBy.length||(c.clusterBy=[]),c.clusterBy.push(e.string());break;case 19:c.labels===a.emptyObject&&(c.labels={});var p=e.uint32()+e.pos;for(r="",o="";e.pos<p;)switch((f=e.uint32())>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}c.labels[r]=o;break;case 20:for(c.additionalOptions===a.emptyObject&&(c.additionalOptions={}),p=e.uint32()+e.pos,r="",o="";e.pos<p;){var f;switch((f=e.uint32())>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}}c.additionalOptions[r]=o;break;case 21:c.dependOnDependencyAssertions=e.bool();break;case 22:c.assertions=s.sqlanvil.ActionConfig.TableAssertionsConfig.decode(e,e.uint32());break;case 23:c.hermetic=e.bool();break;case 24:c.onSchemaChange=e.int32();break;case 25:c.iceberg=s.sqlanvil.ActionConfig.IcebergTableConfig.decode(e,e.uint32());break;case 26:c.metadata=s.sqlanvil.ActionConfig.Metadata.decode(e,e.uint32());break;case 27:c.reservation=e.string();break;case 28:c.postgres=s.sqlanvil.PostgresOptions.decode(e,e.uint32());break;case 29:c.supabase=s.sqlanvil.SupabaseOptions.decode(e,e.uint32());break;case 30:c.mysql=s.sqlanvil.MysqlOptions.decode(e,e.uint32());break;default:e.skipType(7&u)}}return c},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.dataset&&e.hasOwnProperty("dataset")&&!a.isString(e.dataset))return"dataset: string expected";if(null!=e.project&&e.hasOwnProperty("project")&&!a.isString(e.project))return"project: string expected";if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var t=0;t<e.dependencyTargets.length;++t)if(r=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[t]))return"dependencyTargets."+r}if(null!=e.filename&&e.hasOwnProperty("filename")&&!a.isString(e.filename))return"filename: string expected";if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!a.isString(e.tags[t]))return"tags: string[] expected"}if(null!=e.disabled&&e.hasOwnProperty("disabled")&&"boolean"!=typeof e.disabled)return"disabled: boolean expected";if(null!=e.preOperations&&e.hasOwnProperty("preOperations")){if(!Array.isArray(e.preOperations))return"preOperations: array expected";for(t=0;t<e.preOperations.length;++t)if(!a.isString(e.preOperations[t]))return"preOperations: string[] expected"}if(null!=e.postOperations&&e.hasOwnProperty("postOperations")){if(!Array.isArray(e.postOperations))return"postOperations: array expected";for(t=0;t<e.postOperations.length;++t)if(!a.isString(e.postOperations[t]))return"postOperations: string[] expected"}if(null!=e.protected&&e.hasOwnProperty("protected")&&"boolean"!=typeof e.protected)return"protected: boolean expected";if(null!=e.uniqueKey&&e.hasOwnProperty("uniqueKey")){if(!Array.isArray(e.uniqueKey))return"uniqueKey: array expected";for(t=0;t<e.uniqueKey.length;++t)if(!a.isString(e.uniqueKey[t]))return"uniqueKey: string[] expected"}if(null!=e.description&&e.hasOwnProperty("description")&&!a.isString(e.description))return"description: string expected";if(null!=e.columns&&e.hasOwnProperty("columns")){if(!Array.isArray(e.columns))return"columns: array expected";for(t=0;t<e.columns.length;++t)if(r=s.sqlanvil.ActionConfig.ColumnDescriptor.verify(e.columns[t]))return"columns."+r}if(null!=e.partitionBy&&e.hasOwnProperty("partitionBy")&&!a.isString(e.partitionBy))return"partitionBy: string expected";if(null!=e.partitionExpirationDays&&e.hasOwnProperty("partitionExpirationDays")&&!a.isInteger(e.partitionExpirationDays))return"partitionExpirationDays: integer expected";if(null!=e.requirePartitionFilter&&e.hasOwnProperty("requirePartitionFilter")&&"boolean"!=typeof e.requirePartitionFilter)return"requirePartitionFilter: boolean expected";if(null!=e.updatePartitionFilter&&e.hasOwnProperty("updatePartitionFilter")&&!a.isString(e.updatePartitionFilter))return"updatePartitionFilter: string expected";if(null!=e.clusterBy&&e.hasOwnProperty("clusterBy")){if(!Array.isArray(e.clusterBy))return"clusterBy: array expected";for(t=0;t<e.clusterBy.length;++t)if(!a.isString(e.clusterBy[t]))return"clusterBy: string[] expected"}if(null!=e.labels&&e.hasOwnProperty("labels")){if(!a.isObject(e.labels))return"labels: object expected";var n=Object.keys(e.labels);for(t=0;t<n.length;++t)if(!a.isString(e.labels[n[t]]))return"labels: string{k:string} expected"}if(null!=e.additionalOptions&&e.hasOwnProperty("additionalOptions")){if(!a.isObject(e.additionalOptions))return"additionalOptions: object expected";for(n=Object.keys(e.additionalOptions),t=0;t<n.length;++t)if(!a.isString(e.additionalOptions[n[t]]))return"additionalOptions: string{k:string} expected"}if(null!=e.dependOnDependencyAssertions&&e.hasOwnProperty("dependOnDependencyAssertions")&&"boolean"!=typeof e.dependOnDependencyAssertions)return"dependOnDependencyAssertions: boolean expected";var r;if(null!=e.assertions&&e.hasOwnProperty("assertions")&&(r=s.sqlanvil.ActionConfig.TableAssertionsConfig.verify(e.assertions)))return"assertions."+r;if(null!=e.hermetic&&e.hasOwnProperty("hermetic")&&"boolean"!=typeof e.hermetic)return"hermetic: boolean expected";if(null!=e.onSchemaChange&&e.hasOwnProperty("onSchemaChange"))switch(e.onSchemaChange){default:return"onSchemaChange: enum value expected";case 0:case 1:case 2:case 3:}return null!=e.iceberg&&e.hasOwnProperty("iceberg")&&(r=s.sqlanvil.ActionConfig.IcebergTableConfig.verify(e.iceberg))?"iceberg."+r:null!=e.metadata&&e.hasOwnProperty("metadata")&&(r=s.sqlanvil.ActionConfig.Metadata.verify(e.metadata))?"metadata."+r:null!=e.reservation&&e.hasOwnProperty("reservation")&&!a.isString(e.reservation)?"reservation: string expected":null!=e.postgres&&e.hasOwnProperty("postgres")&&(r=s.sqlanvil.PostgresOptions.verify(e.postgres))?"postgres."+r:null!=e.supabase&&e.hasOwnProperty("supabase")&&(r=s.sqlanvil.SupabaseOptions.verify(e.supabase))?"supabase."+r:null!=e.mysql&&e.hasOwnProperty("mysql")&&(r=s.sqlanvil.MysqlOptions.verify(e.mysql))?"mysql."+r:null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.IncrementalTableConfig)return e;var t=new s.sqlanvil.ActionConfig.IncrementalTableConfig;if(null!=e.name&&(t.name=String(e.name)),null!=e.dataset&&(t.dataset=String(e.dataset)),null!=e.project&&(t.project=String(e.project)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.dependencyTargets: array expected");t.dependencyTargets=[];for(var n=0;n<e.dependencyTargets.length;++n){if("object"!=typeof e.dependencyTargets[n])throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.dependencyTargets: object expected");t.dependencyTargets[n]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[n])}}if(null!=e.filename&&(t.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.tags: array expected");for(t.tags=[],n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}if(null!=e.disabled&&(t.disabled=Boolean(e.disabled)),e.preOperations){if(!Array.isArray(e.preOperations))throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.preOperations: array expected");for(t.preOperations=[],n=0;n<e.preOperations.length;++n)t.preOperations[n]=String(e.preOperations[n])}if(e.postOperations){if(!Array.isArray(e.postOperations))throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.postOperations: array expected");for(t.postOperations=[],n=0;n<e.postOperations.length;++n)t.postOperations[n]=String(e.postOperations[n])}if(null!=e.protected&&(t.protected=Boolean(e.protected)),e.uniqueKey){if(!Array.isArray(e.uniqueKey))throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.uniqueKey: array expected");for(t.uniqueKey=[],n=0;n<e.uniqueKey.length;++n)t.uniqueKey[n]=String(e.uniqueKey[n])}if(null!=e.description&&(t.description=String(e.description)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.columns: array expected");for(t.columns=[],n=0;n<e.columns.length;++n){if("object"!=typeof e.columns[n])throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.columns: object expected");t.columns[n]=s.sqlanvil.ActionConfig.ColumnDescriptor.fromObject(e.columns[n])}}if(null!=e.partitionBy&&(t.partitionBy=String(e.partitionBy)),null!=e.partitionExpirationDays&&(t.partitionExpirationDays=0|e.partitionExpirationDays),null!=e.requirePartitionFilter&&(t.requirePartitionFilter=Boolean(e.requirePartitionFilter)),null!=e.updatePartitionFilter&&(t.updatePartitionFilter=String(e.updatePartitionFilter)),e.clusterBy){if(!Array.isArray(e.clusterBy))throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.clusterBy: array expected");for(t.clusterBy=[],n=0;n<e.clusterBy.length;++n)t.clusterBy[n]=String(e.clusterBy[n])}if(e.labels){if("object"!=typeof e.labels)throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.labels: object expected");t.labels={};var r=Object.keys(e.labels);for(n=0;n<r.length;++n)t.labels[r[n]]=String(e.labels[r[n]])}if(e.additionalOptions){if("object"!=typeof e.additionalOptions)throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.additionalOptions: object expected");for(t.additionalOptions={},r=Object.keys(e.additionalOptions),n=0;n<r.length;++n)t.additionalOptions[r[n]]=String(e.additionalOptions[r[n]])}if(null!=e.dependOnDependencyAssertions&&(t.dependOnDependencyAssertions=Boolean(e.dependOnDependencyAssertions)),null!=e.assertions){if("object"!=typeof e.assertions)throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.assertions: object expected");t.assertions=s.sqlanvil.ActionConfig.TableAssertionsConfig.fromObject(e.assertions)}switch(null!=e.hermetic&&(t.hermetic=Boolean(e.hermetic)),e.onSchemaChange){default:if("number"==typeof e.onSchemaChange){t.onSchemaChange=e.onSchemaChange;break}break;case"IGNORE":case 0:t.onSchemaChange=0;break;case"FAIL":case 1:t.onSchemaChange=1;break;case"EXTEND":case 2:t.onSchemaChange=2;break;case"SYNCHRONIZE":case 3:t.onSchemaChange=3}if(null!=e.iceberg){if("object"!=typeof e.iceberg)throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.iceberg: object expected");t.iceberg=s.sqlanvil.ActionConfig.IcebergTableConfig.fromObject(e.iceberg)}if(null!=e.metadata){if("object"!=typeof e.metadata)throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.metadata: object expected");t.metadata=s.sqlanvil.ActionConfig.Metadata.fromObject(e.metadata)}if(null!=e.reservation&&(t.reservation=String(e.reservation)),null!=e.postgres){if("object"!=typeof e.postgres)throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.postgres: object expected");t.postgres=s.sqlanvil.PostgresOptions.fromObject(e.postgres)}if(null!=e.supabase){if("object"!=typeof e.supabase)throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.supabase: object expected");t.supabase=s.sqlanvil.SupabaseOptions.fromObject(e.supabase)}if(null!=e.mysql){if("object"!=typeof e.mysql)throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.mysql: object expected");t.mysql=s.sqlanvil.MysqlOptions.fromObject(e.mysql)}return t},t.toObject=function(e,t){t||(t={});var n,r={};if((t.arrays||t.defaults)&&(r.dependencyTargets=[],r.tags=[],r.preOperations=[],r.postOperations=[],r.uniqueKey=[],r.columns=[],r.clusterBy=[]),(t.objects||t.defaults)&&(r.labels={},r.additionalOptions={}),t.defaults&&(r.name="",r.dataset="",r.project="",r.filename="",r.disabled=!1,r.protected=!1,r.description="",r.partitionBy="",r.partitionExpirationDays=0,r.requirePartitionFilter=!1,r.updatePartitionFilter="",r.dependOnDependencyAssertions=!1,r.assertions=null,r.hermetic=!1,r.onSchemaChange=t.enums===String?"IGNORE":0,r.iceberg=null,r.metadata=null,r.reservation="",r.postgres=null,r.supabase=null,r.mysql=null),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),null!=e.dataset&&e.hasOwnProperty("dataset")&&(r.dataset=e.dataset),null!=e.project&&e.hasOwnProperty("project")&&(r.project=e.project),e.dependencyTargets&&e.dependencyTargets.length){r.dependencyTargets=[];for(var i=0;i<e.dependencyTargets.length;++i)r.dependencyTargets[i]=s.sqlanvil.ActionConfig.Target.toObject(e.dependencyTargets[i],t)}if(null!=e.filename&&e.hasOwnProperty("filename")&&(r.filename=e.filename),e.tags&&e.tags.length)for(r.tags=[],i=0;i<e.tags.length;++i)r.tags[i]=e.tags[i];if(null!=e.disabled&&e.hasOwnProperty("disabled")&&(r.disabled=e.disabled),e.preOperations&&e.preOperations.length)for(r.preOperations=[],i=0;i<e.preOperations.length;++i)r.preOperations[i]=e.preOperations[i];if(e.postOperations&&e.postOperations.length)for(r.postOperations=[],i=0;i<e.postOperations.length;++i)r.postOperations[i]=e.postOperations[i];if(null!=e.protected&&e.hasOwnProperty("protected")&&(r.protected=e.protected),e.uniqueKey&&e.uniqueKey.length)for(r.uniqueKey=[],i=0;i<e.uniqueKey.length;++i)r.uniqueKey[i]=e.uniqueKey[i];if(null!=e.description&&e.hasOwnProperty("description")&&(r.description=e.description),e.columns&&e.columns.length)for(r.columns=[],i=0;i<e.columns.length;++i)r.columns[i]=s.sqlanvil.ActionConfig.ColumnDescriptor.toObject(e.columns[i],t);if(null!=e.partitionBy&&e.hasOwnProperty("partitionBy")&&(r.partitionBy=e.partitionBy),null!=e.partitionExpirationDays&&e.hasOwnProperty("partitionExpirationDays")&&(r.partitionExpirationDays=e.partitionExpirationDays),null!=e.requirePartitionFilter&&e.hasOwnProperty("requirePartitionFilter")&&(r.requirePartitionFilter=e.requirePartitionFilter),null!=e.updatePartitionFilter&&e.hasOwnProperty("updatePartitionFilter")&&(r.updatePartitionFilter=e.updatePartitionFilter),e.clusterBy&&e.clusterBy.length)for(r.clusterBy=[],i=0;i<e.clusterBy.length;++i)r.clusterBy[i]=e.clusterBy[i];if(e.labels&&(n=Object.keys(e.labels)).length)for(r.labels={},i=0;i<n.length;++i)r.labels[n[i]]=e.labels[n[i]];if(e.additionalOptions&&(n=Object.keys(e.additionalOptions)).length)for(r.additionalOptions={},i=0;i<n.length;++i)r.additionalOptions[n[i]]=e.additionalOptions[n[i]];return null!=e.dependOnDependencyAssertions&&e.hasOwnProperty("dependOnDependencyAssertions")&&(r.dependOnDependencyAssertions=e.dependOnDependencyAssertions),null!=e.assertions&&e.hasOwnProperty("assertions")&&(r.assertions=s.sqlanvil.ActionConfig.TableAssertionsConfig.toObject(e.assertions,t)),null!=e.hermetic&&e.hasOwnProperty("hermetic")&&(r.hermetic=e.hermetic),null!=e.onSchemaChange&&e.hasOwnProperty("onSchemaChange")&&(r.onSchemaChange=t.enums===String?void 0===s.sqlanvil.ActionConfig.OnSchemaChange[e.onSchemaChange]?e.onSchemaChange:s.sqlanvil.ActionConfig.OnSchemaChange[e.onSchemaChange]:e.onSchemaChange),null!=e.iceberg&&e.hasOwnProperty("iceberg")&&(r.iceberg=s.sqlanvil.ActionConfig.IcebergTableConfig.toObject(e.iceberg,t)),null!=e.metadata&&e.hasOwnProperty("metadata")&&(r.metadata=s.sqlanvil.ActionConfig.Metadata.toObject(e.metadata,t)),null!=e.reservation&&e.hasOwnProperty("reservation")&&(r.reservation=e.reservation),null!=e.postgres&&e.hasOwnProperty("postgres")&&(r.postgres=s.sqlanvil.PostgresOptions.toObject(e.postgres,t)),null!=e.supabase&&e.hasOwnProperty("supabase")&&(r.supabase=s.sqlanvil.SupabaseOptions.toObject(e.supabase,t)),null!=e.mysql&&e.hasOwnProperty("mysql")&&(r.mysql=s.sqlanvil.MysqlOptions.toObject(e.mysql,t)),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.IncrementalTableConfig"},t}(),t.AssertionConfig=function(){function t(e){if(this.dependencyTargets=[],this.tags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.dataset="",t.prototype.project="",t.prototype.dependencyTargets=a.emptyArray,t.prototype.filename="",t.prototype.tags=a.emptyArray,t.prototype.disabled=!1,t.prototype.description="",t.prototype.hermetic=!1,t.prototype.dependOnDependencyAssertions=!1,t.prototype.reservation="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.dataset&&Object.hasOwnProperty.call(e,"dataset")&&t.uint32(18).string(e.dataset),null!=e.project&&Object.hasOwnProperty.call(e,"project")&&t.uint32(26).string(e.project),null!=e.dependencyTargets&&e.dependencyTargets.length)for(var n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.ActionConfig.Target.encode(e.dependencyTargets[n],t.uint32(34).fork()).ldelim();if(null!=e.filename&&Object.hasOwnProperty.call(e,"filename")&&t.uint32(42).string(e.filename),null!=e.tags&&e.tags.length)for(n=0;n<e.tags.length;++n)t.uint32(50).string(e.tags[n]);return null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(56).bool(e.disabled),null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(66).string(e.description),null!=e.hermetic&&Object.hasOwnProperty.call(e,"hermetic")&&t.uint32(72).bool(e.hermetic),null!=e.dependOnDependencyAssertions&&Object.hasOwnProperty.call(e,"dependOnDependencyAssertions")&&t.uint32(80).bool(e.dependOnDependencyAssertions),null!=e.reservation&&Object.hasOwnProperty.call(e,"reservation")&&t.uint32(90).string(e.reservation),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionConfig.AssertionConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.name=e.string();break;case 2:o.dataset=e.string();break;case 3:o.project=e.string();break;case 4:o.dependencyTargets&&o.dependencyTargets.length||(o.dependencyTargets=[]),o.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32()));break;case 5:o.filename=e.string();break;case 6:o.tags&&o.tags.length||(o.tags=[]),o.tags.push(e.string());break;case 7:o.disabled=e.bool();break;case 8:o.description=e.string();break;case 9:o.hermetic=e.bool();break;case 10:o.dependOnDependencyAssertions=e.bool();break;case 11:o.reservation=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.dataset&&e.hasOwnProperty("dataset")&&!a.isString(e.dataset))return"dataset: string expected";if(null!=e.project&&e.hasOwnProperty("project")&&!a.isString(e.project))return"project: string expected";if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var t=0;t<e.dependencyTargets.length;++t){var n=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[t]);if(n)return"dependencyTargets."+n}}if(null!=e.filename&&e.hasOwnProperty("filename")&&!a.isString(e.filename))return"filename: string expected";if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!a.isString(e.tags[t]))return"tags: string[] expected"}return null!=e.disabled&&e.hasOwnProperty("disabled")&&"boolean"!=typeof e.disabled?"disabled: boolean expected":null!=e.description&&e.hasOwnProperty("description")&&!a.isString(e.description)?"description: string expected":null!=e.hermetic&&e.hasOwnProperty("hermetic")&&"boolean"!=typeof e.hermetic?"hermetic: boolean expected":null!=e.dependOnDependencyAssertions&&e.hasOwnProperty("dependOnDependencyAssertions")&&"boolean"!=typeof e.dependOnDependencyAssertions?"dependOnDependencyAssertions: boolean expected":null!=e.reservation&&e.hasOwnProperty("reservation")&&!a.isString(e.reservation)?"reservation: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.AssertionConfig)return e;var t=new s.sqlanvil.ActionConfig.AssertionConfig;if(null!=e.name&&(t.name=String(e.name)),null!=e.dataset&&(t.dataset=String(e.dataset)),null!=e.project&&(t.project=String(e.project)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.AssertionConfig.dependencyTargets: array expected");t.dependencyTargets=[];for(var n=0;n<e.dependencyTargets.length;++n){if("object"!=typeof e.dependencyTargets[n])throw TypeError(".sqlanvil.ActionConfig.AssertionConfig.dependencyTargets: object expected");t.dependencyTargets[n]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[n])}}if(null!=e.filename&&(t.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.AssertionConfig.tags: array expected");for(t.tags=[],n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}return null!=e.disabled&&(t.disabled=Boolean(e.disabled)),null!=e.description&&(t.description=String(e.description)),null!=e.hermetic&&(t.hermetic=Boolean(e.hermetic)),null!=e.dependOnDependencyAssertions&&(t.dependOnDependencyAssertions=Boolean(e.dependOnDependencyAssertions)),null!=e.reservation&&(t.reservation=String(e.reservation)),t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.dependencyTargets=[],n.tags=[]),t.defaults&&(n.name="",n.dataset="",n.project="",n.filename="",n.disabled=!1,n.description="",n.hermetic=!1,n.dependOnDependencyAssertions=!1,n.reservation=""),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.dataset&&e.hasOwnProperty("dataset")&&(n.dataset=e.dataset),null!=e.project&&e.hasOwnProperty("project")&&(n.project=e.project),e.dependencyTargets&&e.dependencyTargets.length){n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r)n.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.toObject(e.dependencyTargets[r],t)}if(null!=e.filename&&e.hasOwnProperty("filename")&&(n.filename=e.filename),e.tags&&e.tags.length)for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=e.tags[r];return null!=e.disabled&&e.hasOwnProperty("disabled")&&(n.disabled=e.disabled),null!=e.description&&e.hasOwnProperty("description")&&(n.description=e.description),null!=e.hermetic&&e.hasOwnProperty("hermetic")&&(n.hermetic=e.hermetic),null!=e.dependOnDependencyAssertions&&e.hasOwnProperty("dependOnDependencyAssertions")&&(n.dependOnDependencyAssertions=e.dependOnDependencyAssertions),null!=e.reservation&&e.hasOwnProperty("reservation")&&(n.reservation=e.reservation),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.AssertionConfig"},t}(),t.OperationConfig=function(){function t(e){if(this.dependencyTargets=[],this.tags=[],this.columns=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.dataset="",t.prototype.project="",t.prototype.dependencyTargets=a.emptyArray,t.prototype.filename="",t.prototype.tags=a.emptyArray,t.prototype.disabled=!1,t.prototype.hasOutput=!1,t.prototype.description="",t.prototype.columns=a.emptyArray,t.prototype.dependOnDependencyAssertions=!1,t.prototype.hermetic=!1,t.prototype.reservation="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.dataset&&Object.hasOwnProperty.call(e,"dataset")&&t.uint32(18).string(e.dataset),null!=e.project&&Object.hasOwnProperty.call(e,"project")&&t.uint32(26).string(e.project),null!=e.dependencyTargets&&e.dependencyTargets.length)for(var n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.ActionConfig.Target.encode(e.dependencyTargets[n],t.uint32(34).fork()).ldelim();if(null!=e.filename&&Object.hasOwnProperty.call(e,"filename")&&t.uint32(42).string(e.filename),null!=e.tags&&e.tags.length)for(n=0;n<e.tags.length;++n)t.uint32(50).string(e.tags[n]);if(null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(56).bool(e.disabled),null!=e.hasOutput&&Object.hasOwnProperty.call(e,"hasOutput")&&t.uint32(64).bool(e.hasOutput),null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(74).string(e.description),null!=e.columns&&e.columns.length)for(n=0;n<e.columns.length;++n)s.sqlanvil.ActionConfig.ColumnDescriptor.encode(e.columns[n],t.uint32(82).fork()).ldelim();return null!=e.dependOnDependencyAssertions&&Object.hasOwnProperty.call(e,"dependOnDependencyAssertions")&&t.uint32(88).bool(e.dependOnDependencyAssertions),null!=e.hermetic&&Object.hasOwnProperty.call(e,"hermetic")&&t.uint32(96).bool(e.hermetic),null!=e.reservation&&Object.hasOwnProperty.call(e,"reservation")&&t.uint32(106).string(e.reservation),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionConfig.OperationConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.name=e.string();break;case 2:o.dataset=e.string();break;case 3:o.project=e.string();break;case 4:o.dependencyTargets&&o.dependencyTargets.length||(o.dependencyTargets=[]),o.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32()));break;case 5:o.filename=e.string();break;case 6:o.tags&&o.tags.length||(o.tags=[]),o.tags.push(e.string());break;case 7:o.disabled=e.bool();break;case 8:o.hasOutput=e.bool();break;case 9:o.description=e.string();break;case 10:o.columns&&o.columns.length||(o.columns=[]),o.columns.push(s.sqlanvil.ActionConfig.ColumnDescriptor.decode(e,e.uint32()));break;case 11:o.dependOnDependencyAssertions=e.bool();break;case 12:o.hermetic=e.bool();break;case 13:o.reservation=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.dataset&&e.hasOwnProperty("dataset")&&!a.isString(e.dataset))return"dataset: string expected";if(null!=e.project&&e.hasOwnProperty("project")&&!a.isString(e.project))return"project: string expected";if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var t=0;t<e.dependencyTargets.length;++t)if(n=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[t]))return"dependencyTargets."+n}if(null!=e.filename&&e.hasOwnProperty("filename")&&!a.isString(e.filename))return"filename: string expected";if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!a.isString(e.tags[t]))return"tags: string[] expected"}if(null!=e.disabled&&e.hasOwnProperty("disabled")&&"boolean"!=typeof e.disabled)return"disabled: boolean expected";if(null!=e.hasOutput&&e.hasOwnProperty("hasOutput")&&"boolean"!=typeof e.hasOutput)return"hasOutput: boolean expected";if(null!=e.description&&e.hasOwnProperty("description")&&!a.isString(e.description))return"description: string expected";if(null!=e.columns&&e.hasOwnProperty("columns")){if(!Array.isArray(e.columns))return"columns: array expected";for(t=0;t<e.columns.length;++t){var n;if(n=s.sqlanvil.ActionConfig.ColumnDescriptor.verify(e.columns[t]))return"columns."+n}}return null!=e.dependOnDependencyAssertions&&e.hasOwnProperty("dependOnDependencyAssertions")&&"boolean"!=typeof e.dependOnDependencyAssertions?"dependOnDependencyAssertions: boolean expected":null!=e.hermetic&&e.hasOwnProperty("hermetic")&&"boolean"!=typeof e.hermetic?"hermetic: boolean expected":null!=e.reservation&&e.hasOwnProperty("reservation")&&!a.isString(e.reservation)?"reservation: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.OperationConfig)return e;var t=new s.sqlanvil.ActionConfig.OperationConfig;if(null!=e.name&&(t.name=String(e.name)),null!=e.dataset&&(t.dataset=String(e.dataset)),null!=e.project&&(t.project=String(e.project)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.OperationConfig.dependencyTargets: array expected");t.dependencyTargets=[];for(var n=0;n<e.dependencyTargets.length;++n){if("object"!=typeof e.dependencyTargets[n])throw TypeError(".sqlanvil.ActionConfig.OperationConfig.dependencyTargets: object expected");t.dependencyTargets[n]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[n])}}if(null!=e.filename&&(t.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.OperationConfig.tags: array expected");for(t.tags=[],n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}if(null!=e.disabled&&(t.disabled=Boolean(e.disabled)),null!=e.hasOutput&&(t.hasOutput=Boolean(e.hasOutput)),null!=e.description&&(t.description=String(e.description)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.ActionConfig.OperationConfig.columns: array expected");for(t.columns=[],n=0;n<e.columns.length;++n){if("object"!=typeof e.columns[n])throw TypeError(".sqlanvil.ActionConfig.OperationConfig.columns: object expected");t.columns[n]=s.sqlanvil.ActionConfig.ColumnDescriptor.fromObject(e.columns[n])}}return null!=e.dependOnDependencyAssertions&&(t.dependOnDependencyAssertions=Boolean(e.dependOnDependencyAssertions)),null!=e.hermetic&&(t.hermetic=Boolean(e.hermetic)),null!=e.reservation&&(t.reservation=String(e.reservation)),t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.dependencyTargets=[],n.tags=[],n.columns=[]),t.defaults&&(n.name="",n.dataset="",n.project="",n.filename="",n.disabled=!1,n.hasOutput=!1,n.description="",n.dependOnDependencyAssertions=!1,n.hermetic=!1,n.reservation=""),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.dataset&&e.hasOwnProperty("dataset")&&(n.dataset=e.dataset),null!=e.project&&e.hasOwnProperty("project")&&(n.project=e.project),e.dependencyTargets&&e.dependencyTargets.length){n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r)n.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.toObject(e.dependencyTargets[r],t)}if(null!=e.filename&&e.hasOwnProperty("filename")&&(n.filename=e.filename),e.tags&&e.tags.length)for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=e.tags[r];if(null!=e.disabled&&e.hasOwnProperty("disabled")&&(n.disabled=e.disabled),null!=e.hasOutput&&e.hasOwnProperty("hasOutput")&&(n.hasOutput=e.hasOutput),null!=e.description&&e.hasOwnProperty("description")&&(n.description=e.description),e.columns&&e.columns.length)for(n.columns=[],r=0;r<e.columns.length;++r)n.columns[r]=s.sqlanvil.ActionConfig.ColumnDescriptor.toObject(e.columns[r],t);return null!=e.dependOnDependencyAssertions&&e.hasOwnProperty("dependOnDependencyAssertions")&&(n.dependOnDependencyAssertions=e.dependOnDependencyAssertions),null!=e.hermetic&&e.hasOwnProperty("hermetic")&&(n.hermetic=e.hermetic),null!=e.reservation&&e.hasOwnProperty("reservation")&&(n.reservation=e.reservation),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.OperationConfig"},t}(),t.DeclarationConfig=function(){function t(e){if(this.columns=[],this.tags=[],this.columnTypes={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.dataset="",t.prototype.project="",t.prototype.description="",t.prototype.columns=a.emptyArray,t.prototype.filename="",t.prototype.tags=a.emptyArray,t.prototype.connection="",t.prototype.columnTypes=a.emptyObject,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.dataset&&Object.hasOwnProperty.call(e,"dataset")&&t.uint32(18).string(e.dataset),null!=e.project&&Object.hasOwnProperty.call(e,"project")&&t.uint32(26).string(e.project),null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(34).string(e.description),null!=e.columns&&e.columns.length)for(var n=0;n<e.columns.length;++n)s.sqlanvil.ActionConfig.ColumnDescriptor.encode(e.columns[n],t.uint32(42).fork()).ldelim();if(null!=e.filename&&Object.hasOwnProperty.call(e,"filename")&&t.uint32(50).string(e.filename),null!=e.tags&&e.tags.length)for(n=0;n<e.tags.length;++n)t.uint32(58).string(e.tags[n]);if(null!=e.connection&&Object.hasOwnProperty.call(e,"connection")&&t.uint32(66).string(e.connection),null!=e.columnTypes&&Object.hasOwnProperty.call(e,"columnTypes")){var r=Object.keys(e.columnTypes);for(n=0;n<r.length;++n)t.uint32(74).fork().uint32(10).string(r[n]).uint32(18).string(e.columnTypes[r[n]]).ldelim()}return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r,o,l=void 0===t?e.len:e.pos+t,c=new s.sqlanvil.ActionConfig.DeclarationConfig;e.pos<l;){var u=e.uint32();if(u===n)break;switch(u>>>3){case 1:c.name=e.string();break;case 2:c.dataset=e.string();break;case 3:c.project=e.string();break;case 4:c.description=e.string();break;case 5:c.columns&&c.columns.length||(c.columns=[]),c.columns.push(s.sqlanvil.ActionConfig.ColumnDescriptor.decode(e,e.uint32()));break;case 6:c.filename=e.string();break;case 7:c.tags&&c.tags.length||(c.tags=[]),c.tags.push(e.string());break;case 8:c.connection=e.string();break;case 9:c.columnTypes===a.emptyObject&&(c.columnTypes={});var p=e.uint32()+e.pos;for(r="",o="";e.pos<p;){var f=e.uint32();switch(f>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}}c.columnTypes[r]=o;break;default:e.skipType(7&u)}}return c},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.dataset&&e.hasOwnProperty("dataset")&&!a.isString(e.dataset))return"dataset: string expected";if(null!=e.project&&e.hasOwnProperty("project")&&!a.isString(e.project))return"project: string expected";if(null!=e.description&&e.hasOwnProperty("description")&&!a.isString(e.description))return"description: string expected";if(null!=e.columns&&e.hasOwnProperty("columns")){if(!Array.isArray(e.columns))return"columns: array expected";for(var t=0;t<e.columns.length;++t){var n=s.sqlanvil.ActionConfig.ColumnDescriptor.verify(e.columns[t]);if(n)return"columns."+n}}if(null!=e.filename&&e.hasOwnProperty("filename")&&!a.isString(e.filename))return"filename: string expected";if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!a.isString(e.tags[t]))return"tags: string[] expected"}if(null!=e.connection&&e.hasOwnProperty("connection")&&!a.isString(e.connection))return"connection: string expected";if(null!=e.columnTypes&&e.hasOwnProperty("columnTypes")){if(!a.isObject(e.columnTypes))return"columnTypes: object expected";var r=Object.keys(e.columnTypes);for(t=0;t<r.length;++t)if(!a.isString(e.columnTypes[r[t]]))return"columnTypes: string{k:string} expected"}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.DeclarationConfig)return e;var t=new s.sqlanvil.ActionConfig.DeclarationConfig;if(null!=e.name&&(t.name=String(e.name)),null!=e.dataset&&(t.dataset=String(e.dataset)),null!=e.project&&(t.project=String(e.project)),null!=e.description&&(t.description=String(e.description)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.ActionConfig.DeclarationConfig.columns: array expected");t.columns=[];for(var n=0;n<e.columns.length;++n){if("object"!=typeof e.columns[n])throw TypeError(".sqlanvil.ActionConfig.DeclarationConfig.columns: object expected");t.columns[n]=s.sqlanvil.ActionConfig.ColumnDescriptor.fromObject(e.columns[n])}}if(null!=e.filename&&(t.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.DeclarationConfig.tags: array expected");for(t.tags=[],n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}if(null!=e.connection&&(t.connection=String(e.connection)),e.columnTypes){if("object"!=typeof e.columnTypes)throw TypeError(".sqlanvil.ActionConfig.DeclarationConfig.columnTypes: object expected");t.columnTypes={};var r=Object.keys(e.columnTypes);for(n=0;n<r.length;++n)t.columnTypes[r[n]]=String(e.columnTypes[r[n]])}return t},t.toObject=function(e,t){t||(t={});var n,r={};if((t.arrays||t.defaults)&&(r.columns=[],r.tags=[]),(t.objects||t.defaults)&&(r.columnTypes={}),t.defaults&&(r.name="",r.dataset="",r.project="",r.description="",r.filename="",r.connection=""),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),null!=e.dataset&&e.hasOwnProperty("dataset")&&(r.dataset=e.dataset),null!=e.project&&e.hasOwnProperty("project")&&(r.project=e.project),null!=e.description&&e.hasOwnProperty("description")&&(r.description=e.description),e.columns&&e.columns.length){r.columns=[];for(var i=0;i<e.columns.length;++i)r.columns[i]=s.sqlanvil.ActionConfig.ColumnDescriptor.toObject(e.columns[i],t)}if(null!=e.filename&&e.hasOwnProperty("filename")&&(r.filename=e.filename),e.tags&&e.tags.length)for(r.tags=[],i=0;i<e.tags.length;++i)r.tags[i]=e.tags[i];if(null!=e.connection&&e.hasOwnProperty("connection")&&(r.connection=e.connection),e.columnTypes&&(n=Object.keys(e.columnTypes)).length)for(r.columnTypes={},i=0;i<n.length;++i)r.columnTypes[n[i]]=e.columnTypes[n[i]];return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.DeclarationConfig"},t}(),t.NotebookConfig=function(){function t(e){if(this.dependencyTargets=[],this.tags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.location="",t.prototype.project="",t.prototype.dependencyTargets=a.emptyArray,t.prototype.filename="",t.prototype.tags=a.emptyArray,t.prototype.disabled=!1,t.prototype.description="",t.prototype.dependOnDependencyAssertions=!1,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.location&&Object.hasOwnProperty.call(e,"location")&&t.uint32(18).string(e.location),null!=e.project&&Object.hasOwnProperty.call(e,"project")&&t.uint32(26).string(e.project),null!=e.dependencyTargets&&e.dependencyTargets.length)for(var n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.ActionConfig.Target.encode(e.dependencyTargets[n],t.uint32(34).fork()).ldelim();if(null!=e.filename&&Object.hasOwnProperty.call(e,"filename")&&t.uint32(42).string(e.filename),null!=e.tags&&e.tags.length)for(n=0;n<e.tags.length;++n)t.uint32(50).string(e.tags[n]);return null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(56).bool(e.disabled),null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(66).string(e.description),null!=e.dependOnDependencyAssertions&&Object.hasOwnProperty.call(e,"dependOnDependencyAssertions")&&t.uint32(72).bool(e.dependOnDependencyAssertions),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionConfig.NotebookConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.name=e.string();break;case 2:o.location=e.string();break;case 3:o.project=e.string();break;case 4:o.dependencyTargets&&o.dependencyTargets.length||(o.dependencyTargets=[]),o.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32()));break;case 5:o.filename=e.string();break;case 6:o.tags&&o.tags.length||(o.tags=[]),o.tags.push(e.string());break;case 7:o.disabled=e.bool();break;case 8:o.description=e.string();break;case 9:o.dependOnDependencyAssertions=e.bool();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.location&&e.hasOwnProperty("location")&&!a.isString(e.location))return"location: string expected";if(null!=e.project&&e.hasOwnProperty("project")&&!a.isString(e.project))return"project: string expected";if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var t=0;t<e.dependencyTargets.length;++t){var n=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[t]);if(n)return"dependencyTargets."+n}}if(null!=e.filename&&e.hasOwnProperty("filename")&&!a.isString(e.filename))return"filename: string expected";if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!a.isString(e.tags[t]))return"tags: string[] expected"}return null!=e.disabled&&e.hasOwnProperty("disabled")&&"boolean"!=typeof e.disabled?"disabled: boolean expected":null!=e.description&&e.hasOwnProperty("description")&&!a.isString(e.description)?"description: string expected":null!=e.dependOnDependencyAssertions&&e.hasOwnProperty("dependOnDependencyAssertions")&&"boolean"!=typeof e.dependOnDependencyAssertions?"dependOnDependencyAssertions: boolean expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.NotebookConfig)return e;var t=new s.sqlanvil.ActionConfig.NotebookConfig;if(null!=e.name&&(t.name=String(e.name)),null!=e.location&&(t.location=String(e.location)),null!=e.project&&(t.project=String(e.project)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.NotebookConfig.dependencyTargets: array expected");t.dependencyTargets=[];for(var n=0;n<e.dependencyTargets.length;++n){if("object"!=typeof e.dependencyTargets[n])throw TypeError(".sqlanvil.ActionConfig.NotebookConfig.dependencyTargets: object expected");t.dependencyTargets[n]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[n])}}if(null!=e.filename&&(t.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.NotebookConfig.tags: array expected");for(t.tags=[],n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}return null!=e.disabled&&(t.disabled=Boolean(e.disabled)),null!=e.description&&(t.description=String(e.description)),null!=e.dependOnDependencyAssertions&&(t.dependOnDependencyAssertions=Boolean(e.dependOnDependencyAssertions)),t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.dependencyTargets=[],n.tags=[]),t.defaults&&(n.name="",n.location="",n.project="",n.filename="",n.disabled=!1,n.description="",n.dependOnDependencyAssertions=!1),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.location&&e.hasOwnProperty("location")&&(n.location=e.location),null!=e.project&&e.hasOwnProperty("project")&&(n.project=e.project),e.dependencyTargets&&e.dependencyTargets.length){n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r)n.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.toObject(e.dependencyTargets[r],t)}if(null!=e.filename&&e.hasOwnProperty("filename")&&(n.filename=e.filename),e.tags&&e.tags.length)for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=e.tags[r];return null!=e.disabled&&e.hasOwnProperty("disabled")&&(n.disabled=e.disabled),null!=e.description&&e.hasOwnProperty("description")&&(n.description=e.description),null!=e.dependOnDependencyAssertions&&e.hasOwnProperty("dependOnDependencyAssertions")&&(n.dependOnDependencyAssertions=e.dependOnDependencyAssertions),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.NotebookConfig"},t}(),t.DataPreparationConfig=function(){function t(e){if(this.dependencyTargets=[],this.tags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.dataset="",t.prototype.project="",t.prototype.dependencyTargets=a.emptyArray,t.prototype.filename="",t.prototype.tags=a.emptyArray,t.prototype.disabled=!1,t.prototype.description="",t.prototype.errorTable=null,t.prototype.loadMode=null,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.dependencyTargets&&e.dependencyTargets.length)for(var n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.ActionConfig.Target.encode(e.dependencyTargets[n],t.uint32(18).fork()).ldelim();if(null!=e.filename&&Object.hasOwnProperty.call(e,"filename")&&t.uint32(26).string(e.filename),null!=e.tags&&e.tags.length)for(n=0;n<e.tags.length;++n)t.uint32(34).string(e.tags[n]);return null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(56).bool(e.disabled),null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(66).string(e.description),null!=e.errorTable&&Object.hasOwnProperty.call(e,"errorTable")&&s.sqlanvil.ActionConfig.DataPreparationConfig.ErrorTableConfig.encode(e.errorTable,t.uint32(90).fork()).ldelim(),null!=e.loadMode&&Object.hasOwnProperty.call(e,"loadMode")&&s.sqlanvil.ActionConfig.LoadModeConfig.encode(e.loadMode,t.uint32(98).fork()).ldelim(),null!=e.dataset&&Object.hasOwnProperty.call(e,"dataset")&&t.uint32(106).string(e.dataset),null!=e.project&&Object.hasOwnProperty.call(e,"project")&&t.uint32(114).string(e.project),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionConfig.DataPreparationConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.name=e.string();break;case 13:o.dataset=e.string();break;case 14:o.project=e.string();break;case 2:o.dependencyTargets&&o.dependencyTargets.length||(o.dependencyTargets=[]),o.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32()));break;case 3:o.filename=e.string();break;case 4:o.tags&&o.tags.length||(o.tags=[]),o.tags.push(e.string());break;case 7:o.disabled=e.bool();break;case 8:o.description=e.string();break;case 11:o.errorTable=s.sqlanvil.ActionConfig.DataPreparationConfig.ErrorTableConfig.decode(e,e.uint32());break;case 12:o.loadMode=s.sqlanvil.ActionConfig.LoadModeConfig.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.dataset&&e.hasOwnProperty("dataset")&&!a.isString(e.dataset))return"dataset: string expected";if(null!=e.project&&e.hasOwnProperty("project")&&!a.isString(e.project))return"project: string expected";if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var t=0;t<e.dependencyTargets.length;++t)if(n=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[t]))return"dependencyTargets."+n}if(null!=e.filename&&e.hasOwnProperty("filename")&&!a.isString(e.filename))return"filename: string expected";if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!a.isString(e.tags[t]))return"tags: string[] expected"}return null!=e.disabled&&e.hasOwnProperty("disabled")&&"boolean"!=typeof e.disabled?"disabled: boolean expected":null!=e.description&&e.hasOwnProperty("description")&&!a.isString(e.description)?"description: string expected":null!=e.errorTable&&e.hasOwnProperty("errorTable")&&(n=s.sqlanvil.ActionConfig.DataPreparationConfig.ErrorTableConfig.verify(e.errorTable))?"errorTable."+n:null!=e.loadMode&&e.hasOwnProperty("loadMode")&&(n=s.sqlanvil.ActionConfig.LoadModeConfig.verify(e.loadMode))?"loadMode."+n:null;var n},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.DataPreparationConfig)return e;var t=new s.sqlanvil.ActionConfig.DataPreparationConfig;if(null!=e.name&&(t.name=String(e.name)),null!=e.dataset&&(t.dataset=String(e.dataset)),null!=e.project&&(t.project=String(e.project)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.DataPreparationConfig.dependencyTargets: array expected");t.dependencyTargets=[];for(var n=0;n<e.dependencyTargets.length;++n){if("object"!=typeof e.dependencyTargets[n])throw TypeError(".sqlanvil.ActionConfig.DataPreparationConfig.dependencyTargets: object expected");t.dependencyTargets[n]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[n])}}if(null!=e.filename&&(t.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.DataPreparationConfig.tags: array expected");for(t.tags=[],n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}if(null!=e.disabled&&(t.disabled=Boolean(e.disabled)),null!=e.description&&(t.description=String(e.description)),null!=e.errorTable){if("object"!=typeof e.errorTable)throw TypeError(".sqlanvil.ActionConfig.DataPreparationConfig.errorTable: object expected");t.errorTable=s.sqlanvil.ActionConfig.DataPreparationConfig.ErrorTableConfig.fromObject(e.errorTable)}if(null!=e.loadMode){if("object"!=typeof e.loadMode)throw TypeError(".sqlanvil.ActionConfig.DataPreparationConfig.loadMode: object expected");t.loadMode=s.sqlanvil.ActionConfig.LoadModeConfig.fromObject(e.loadMode)}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.dependencyTargets=[],n.tags=[]),t.defaults&&(n.name="",n.filename="",n.disabled=!1,n.description="",n.errorTable=null,n.loadMode=null,n.dataset="",n.project=""),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),e.dependencyTargets&&e.dependencyTargets.length){n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r)n.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.toObject(e.dependencyTargets[r],t)}if(null!=e.filename&&e.hasOwnProperty("filename")&&(n.filename=e.filename),e.tags&&e.tags.length)for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=e.tags[r];return null!=e.disabled&&e.hasOwnProperty("disabled")&&(n.disabled=e.disabled),null!=e.description&&e.hasOwnProperty("description")&&(n.description=e.description),null!=e.errorTable&&e.hasOwnProperty("errorTable")&&(n.errorTable=s.sqlanvil.ActionConfig.DataPreparationConfig.ErrorTableConfig.toObject(e.errorTable,t)),null!=e.loadMode&&e.hasOwnProperty("loadMode")&&(n.loadMode=s.sqlanvil.ActionConfig.LoadModeConfig.toObject(e.loadMode,t)),null!=e.dataset&&e.hasOwnProperty("dataset")&&(n.dataset=e.dataset),null!=e.project&&e.hasOwnProperty("project")&&(n.project=e.project),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.DataPreparationConfig"},t.ErrorTableConfig=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.dataset="",t.prototype.project="",t.prototype.retentionDays=0,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.dataset&&Object.hasOwnProperty.call(e,"dataset")&&t.uint32(18).string(e.dataset),null!=e.project&&Object.hasOwnProperty.call(e,"project")&&t.uint32(26).string(e.project),null!=e.retentionDays&&Object.hasOwnProperty.call(e,"retentionDays")&&t.uint32(32).int32(e.retentionDays),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionConfig.DataPreparationConfig.ErrorTableConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.name=e.string();break;case 2:o.dataset=e.string();break;case 3:o.project=e.string();break;case 4:o.retentionDays=e.int32();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name)?"name: string expected":null!=e.dataset&&e.hasOwnProperty("dataset")&&!a.isString(e.dataset)?"dataset: string expected":null!=e.project&&e.hasOwnProperty("project")&&!a.isString(e.project)?"project: string expected":null!=e.retentionDays&&e.hasOwnProperty("retentionDays")&&!a.isInteger(e.retentionDays)?"retentionDays: integer expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.DataPreparationConfig.ErrorTableConfig)return e;var t=new s.sqlanvil.ActionConfig.DataPreparationConfig.ErrorTableConfig;return null!=e.name&&(t.name=String(e.name)),null!=e.dataset&&(t.dataset=String(e.dataset)),null!=e.project&&(t.project=String(e.project)),null!=e.retentionDays&&(t.retentionDays=0|e.retentionDays),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.name="",n.dataset="",n.project="",n.retentionDays=0),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.dataset&&e.hasOwnProperty("dataset")&&(n.dataset=e.dataset),null!=e.project&&e.hasOwnProperty("project")&&(n.project=e.project),null!=e.retentionDays&&e.hasOwnProperty("retentionDays")&&(n.retentionDays=e.retentionDays),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.DataPreparationConfig.ErrorTableConfig"},t}(),t}(),t.RlsPolicyConfig=function(){function t(e){if(this.roles=[],this.dependencyTargets=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.table="",t.prototype.command="",t.prototype.roles=a.emptyArray,t.prototype.using="",t.prototype.withCheck="",t.prototype.filename="",t.prototype.dependencyTargets=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.table&&Object.hasOwnProperty.call(e,"table")&&t.uint32(18).string(e.table),null!=e.command&&Object.hasOwnProperty.call(e,"command")&&t.uint32(26).string(e.command),null!=e.roles&&e.roles.length)for(var n=0;n<e.roles.length;++n)t.uint32(34).string(e.roles[n]);if(null!=e.using&&Object.hasOwnProperty.call(e,"using")&&t.uint32(42).string(e.using),null!=e.withCheck&&Object.hasOwnProperty.call(e,"withCheck")&&t.uint32(50).string(e.withCheck),null!=e.filename&&Object.hasOwnProperty.call(e,"filename")&&t.uint32(58).string(e.filename),null!=e.dependencyTargets&&e.dependencyTargets.length)for(n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.ActionConfig.Target.encode(e.dependencyTargets[n],t.uint32(66).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionConfig.RlsPolicyConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.name=e.string();break;case 2:o.table=e.string();break;case 3:o.command=e.string();break;case 4:o.roles&&o.roles.length||(o.roles=[]),o.roles.push(e.string());break;case 5:o.using=e.string();break;case 6:o.withCheck=e.string();break;case 7:o.filename=e.string();break;case 8:o.dependencyTargets&&o.dependencyTargets.length||(o.dependencyTargets=[]),o.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.table&&e.hasOwnProperty("table")&&!a.isString(e.table))return"table: string expected";if(null!=e.command&&e.hasOwnProperty("command")&&!a.isString(e.command))return"command: string expected";if(null!=e.roles&&e.hasOwnProperty("roles")){if(!Array.isArray(e.roles))return"roles: array expected";for(var t=0;t<e.roles.length;++t)if(!a.isString(e.roles[t]))return"roles: string[] expected"}if(null!=e.using&&e.hasOwnProperty("using")&&!a.isString(e.using))return"using: string expected";if(null!=e.withCheck&&e.hasOwnProperty("withCheck")&&!a.isString(e.withCheck))return"withCheck: string expected";if(null!=e.filename&&e.hasOwnProperty("filename")&&!a.isString(e.filename))return"filename: string expected";if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(t=0;t<e.dependencyTargets.length;++t){var n=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[t]);if(n)return"dependencyTargets."+n}}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.RlsPolicyConfig)return e;var t=new s.sqlanvil.ActionConfig.RlsPolicyConfig;if(null!=e.name&&(t.name=String(e.name)),null!=e.table&&(t.table=String(e.table)),null!=e.command&&(t.command=String(e.command)),e.roles){if(!Array.isArray(e.roles))throw TypeError(".sqlanvil.ActionConfig.RlsPolicyConfig.roles: array expected");t.roles=[];for(var n=0;n<e.roles.length;++n)t.roles[n]=String(e.roles[n])}if(null!=e.using&&(t.using=String(e.using)),null!=e.withCheck&&(t.withCheck=String(e.withCheck)),null!=e.filename&&(t.filename=String(e.filename)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.RlsPolicyConfig.dependencyTargets: array expected");for(t.dependencyTargets=[],n=0;n<e.dependencyTargets.length;++n){if("object"!=typeof e.dependencyTargets[n])throw TypeError(".sqlanvil.ActionConfig.RlsPolicyConfig.dependencyTargets: object expected");t.dependencyTargets[n]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[n])}}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.roles=[],n.dependencyTargets=[]),t.defaults&&(n.name="",n.table="",n.command="",n.using="",n.withCheck="",n.filename=""),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.table&&e.hasOwnProperty("table")&&(n.table=e.table),null!=e.command&&e.hasOwnProperty("command")&&(n.command=e.command),e.roles&&e.roles.length){n.roles=[];for(var r=0;r<e.roles.length;++r)n.roles[r]=e.roles[r]}if(null!=e.using&&e.hasOwnProperty("using")&&(n.using=e.using),null!=e.withCheck&&e.hasOwnProperty("withCheck")&&(n.withCheck=e.withCheck),null!=e.filename&&e.hasOwnProperty("filename")&&(n.filename=e.filename),e.dependencyTargets&&e.dependencyTargets.length)for(n.dependencyTargets=[],r=0;r<e.dependencyTargets.length;++r)n.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.toObject(e.dependencyTargets[r],t);return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.RlsPolicyConfig"},t}(),t.RealtimePublicationConfig=function(){function t(e){if(this.events=[],this.dependencyTargets=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.table="",t.prototype.events=a.emptyArray,t.prototype.filename="",t.prototype.dependencyTargets=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.table&&Object.hasOwnProperty.call(e,"table")&&t.uint32(18).string(e.table),null!=e.events&&e.events.length)for(var n=0;n<e.events.length;++n)t.uint32(26).string(e.events[n]);if(null!=e.filename&&Object.hasOwnProperty.call(e,"filename")&&t.uint32(34).string(e.filename),null!=e.dependencyTargets&&e.dependencyTargets.length)for(n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.ActionConfig.Target.encode(e.dependencyTargets[n],t.uint32(42).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionConfig.RealtimePublicationConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.name=e.string();break;case 2:o.table=e.string();break;case 3:o.events&&o.events.length||(o.events=[]),o.events.push(e.string());break;case 4:o.filename=e.string();break;case 5:o.dependencyTargets&&o.dependencyTargets.length||(o.dependencyTargets=[]),o.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.table&&e.hasOwnProperty("table")&&!a.isString(e.table))return"table: string expected";if(null!=e.events&&e.hasOwnProperty("events")){if(!Array.isArray(e.events))return"events: array expected";for(var t=0;t<e.events.length;++t)if(!a.isString(e.events[t]))return"events: string[] expected"}if(null!=e.filename&&e.hasOwnProperty("filename")&&!a.isString(e.filename))return"filename: string expected";if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(t=0;t<e.dependencyTargets.length;++t){var n=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[t]);if(n)return"dependencyTargets."+n}}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.RealtimePublicationConfig)return e;var t=new s.sqlanvil.ActionConfig.RealtimePublicationConfig;if(null!=e.name&&(t.name=String(e.name)),null!=e.table&&(t.table=String(e.table)),e.events){if(!Array.isArray(e.events))throw TypeError(".sqlanvil.ActionConfig.RealtimePublicationConfig.events: array expected");t.events=[];for(var n=0;n<e.events.length;++n)t.events[n]=String(e.events[n])}if(null!=e.filename&&(t.filename=String(e.filename)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.RealtimePublicationConfig.dependencyTargets: array expected");for(t.dependencyTargets=[],n=0;n<e.dependencyTargets.length;++n){if("object"!=typeof e.dependencyTargets[n])throw TypeError(".sqlanvil.ActionConfig.RealtimePublicationConfig.dependencyTargets: object expected");t.dependencyTargets[n]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[n])}}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.events=[],n.dependencyTargets=[]),t.defaults&&(n.name="",n.table="",n.filename=""),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.table&&e.hasOwnProperty("table")&&(n.table=e.table),e.events&&e.events.length){n.events=[];for(var r=0;r<e.events.length;++r)n.events[r]=e.events[r]}if(null!=e.filename&&e.hasOwnProperty("filename")&&(n.filename=e.filename),e.dependencyTargets&&e.dependencyTargets.length)for(n.dependencyTargets=[],r=0;r<e.dependencyTargets.length;++r)n.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.toObject(e.dependencyTargets[r],t);return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.RealtimePublicationConfig"},t}(),t.ForeignWrapperConfig=function(){function t(e){if(this.options={},this.dependencyTargets=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.wrapper="",t.prototype.server="",t.prototype.options=a.emptyObject,t.prototype.filename="",t.prototype.dependencyTargets=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.wrapper&&Object.hasOwnProperty.call(e,"wrapper")&&t.uint32(18).string(e.wrapper),null!=e.server&&Object.hasOwnProperty.call(e,"server")&&t.uint32(26).string(e.server),null!=e.options&&Object.hasOwnProperty.call(e,"options"))for(var n=Object.keys(e.options),r=0;r<n.length;++r)t.uint32(34).fork().uint32(10).string(n[r]).uint32(18).string(e.options[n[r]]).ldelim();if(null!=e.filename&&Object.hasOwnProperty.call(e,"filename")&&t.uint32(42).string(e.filename),null!=e.dependencyTargets&&e.dependencyTargets.length)for(r=0;r<e.dependencyTargets.length;++r)s.sqlanvil.ActionConfig.Target.encode(e.dependencyTargets[r],t.uint32(50).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r,o,l=void 0===t?e.len:e.pos+t,c=new s.sqlanvil.ActionConfig.ForeignWrapperConfig;e.pos<l;){var u=e.uint32();if(u===n)break;switch(u>>>3){case 1:c.name=e.string();break;case 2:c.wrapper=e.string();break;case 3:c.server=e.string();break;case 4:c.options===a.emptyObject&&(c.options={});var p=e.uint32()+e.pos;for(r="",o="";e.pos<p;){var f=e.uint32();switch(f>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}}c.options[r]=o;break;case 5:c.filename=e.string();break;case 6:c.dependencyTargets&&c.dependencyTargets.length||(c.dependencyTargets=[]),c.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32()));break;default:e.skipType(7&u)}}return c},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.wrapper&&e.hasOwnProperty("wrapper")&&!a.isString(e.wrapper))return"wrapper: string expected";if(null!=e.server&&e.hasOwnProperty("server")&&!a.isString(e.server))return"server: string expected";if(null!=e.options&&e.hasOwnProperty("options")){if(!a.isObject(e.options))return"options: object expected";for(var t=Object.keys(e.options),n=0;n<t.length;++n)if(!a.isString(e.options[t[n]]))return"options: string{k:string} expected"}if(null!=e.filename&&e.hasOwnProperty("filename")&&!a.isString(e.filename))return"filename: string expected";if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(n=0;n<e.dependencyTargets.length;++n){var r=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[n]);if(r)return"dependencyTargets."+r}}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.ForeignWrapperConfig)return e;var t=new s.sqlanvil.ActionConfig.ForeignWrapperConfig;if(null!=e.name&&(t.name=String(e.name)),null!=e.wrapper&&(t.wrapper=String(e.wrapper)),null!=e.server&&(t.server=String(e.server)),e.options){if("object"!=typeof e.options)throw TypeError(".sqlanvil.ActionConfig.ForeignWrapperConfig.options: object expected");t.options={};for(var n=Object.keys(e.options),r=0;r<n.length;++r)t.options[n[r]]=String(e.options[n[r]])}if(null!=e.filename&&(t.filename=String(e.filename)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.ForeignWrapperConfig.dependencyTargets: array expected");for(t.dependencyTargets=[],r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.ActionConfig.ForeignWrapperConfig.dependencyTargets: object expected");t.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[r])}}return t},t.toObject=function(e,t){t||(t={});var n,r={};if((t.arrays||t.defaults)&&(r.dependencyTargets=[]),(t.objects||t.defaults)&&(r.options={}),t.defaults&&(r.name="",r.wrapper="",r.server="",r.filename=""),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),null!=e.wrapper&&e.hasOwnProperty("wrapper")&&(r.wrapper=e.wrapper),null!=e.server&&e.hasOwnProperty("server")&&(r.server=e.server),e.options&&(n=Object.keys(e.options)).length){r.options={};for(var i=0;i<n.length;++i)r.options[n[i]]=e.options[n[i]]}if(null!=e.filename&&e.hasOwnProperty("filename")&&(r.filename=e.filename),e.dependencyTargets&&e.dependencyTargets.length)for(r.dependencyTargets=[],i=0;i<e.dependencyTargets.length;++i)r.dependencyTargets[i]=s.sqlanvil.ActionConfig.Target.toObject(e.dependencyTargets[i],t);return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.ForeignWrapperConfig"},t}(),t.VectorIndexConfig=function(){function t(e){if(this.params={},this.dependencyTargets=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.table="",t.prototype.column="",t.prototype.dimensions=0,t.prototype.indexType="",t.prototype.params=a.emptyObject,t.prototype.filename="",t.prototype.dependencyTargets=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.table&&Object.hasOwnProperty.call(e,"table")&&t.uint32(18).string(e.table),null!=e.column&&Object.hasOwnProperty.call(e,"column")&&t.uint32(26).string(e.column),null!=e.dimensions&&Object.hasOwnProperty.call(e,"dimensions")&&t.uint32(32).uint32(e.dimensions),null!=e.indexType&&Object.hasOwnProperty.call(e,"indexType")&&t.uint32(42).string(e.indexType),null!=e.params&&Object.hasOwnProperty.call(e,"params"))for(var n=Object.keys(e.params),r=0;r<n.length;++r)t.uint32(50).fork().uint32(10).string(n[r]).uint32(18).string(e.params[n[r]]).ldelim();if(null!=e.filename&&Object.hasOwnProperty.call(e,"filename")&&t.uint32(58).string(e.filename),null!=e.dependencyTargets&&e.dependencyTargets.length)for(r=0;r<e.dependencyTargets.length;++r)s.sqlanvil.ActionConfig.Target.encode(e.dependencyTargets[r],t.uint32(66).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r,o,l=void 0===t?e.len:e.pos+t,c=new s.sqlanvil.ActionConfig.VectorIndexConfig;e.pos<l;){var u=e.uint32();if(u===n)break;switch(u>>>3){case 1:c.name=e.string();break;case 2:c.table=e.string();break;case 3:c.column=e.string();break;case 4:c.dimensions=e.uint32();break;case 5:c.indexType=e.string();break;case 6:c.params===a.emptyObject&&(c.params={});var p=e.uint32()+e.pos;for(r="",o="";e.pos<p;){var f=e.uint32();switch(f>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}}c.params[r]=o;break;case 7:c.filename=e.string();break;case 8:c.dependencyTargets&&c.dependencyTargets.length||(c.dependencyTargets=[]),c.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32()));break;default:e.skipType(7&u)}}return c},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.table&&e.hasOwnProperty("table")&&!a.isString(e.table))return"table: string expected";if(null!=e.column&&e.hasOwnProperty("column")&&!a.isString(e.column))return"column: string expected";if(null!=e.dimensions&&e.hasOwnProperty("dimensions")&&!a.isInteger(e.dimensions))return"dimensions: integer expected";if(null!=e.indexType&&e.hasOwnProperty("indexType")&&!a.isString(e.indexType))return"indexType: string expected";if(null!=e.params&&e.hasOwnProperty("params")){if(!a.isObject(e.params))return"params: object expected";for(var t=Object.keys(e.params),n=0;n<t.length;++n)if(!a.isString(e.params[t[n]]))return"params: string{k:string} expected"}if(null!=e.filename&&e.hasOwnProperty("filename")&&!a.isString(e.filename))return"filename: string expected";if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(n=0;n<e.dependencyTargets.length;++n){var r=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[n]);if(r)return"dependencyTargets."+r}}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.VectorIndexConfig)return e;var t=new s.sqlanvil.ActionConfig.VectorIndexConfig;if(null!=e.name&&(t.name=String(e.name)),null!=e.table&&(t.table=String(e.table)),null!=e.column&&(t.column=String(e.column)),null!=e.dimensions&&(t.dimensions=e.dimensions>>>0),null!=e.indexType&&(t.indexType=String(e.indexType)),e.params){if("object"!=typeof e.params)throw TypeError(".sqlanvil.ActionConfig.VectorIndexConfig.params: object expected");t.params={};for(var n=Object.keys(e.params),r=0;r<n.length;++r)t.params[n[r]]=String(e.params[n[r]])}if(null!=e.filename&&(t.filename=String(e.filename)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.VectorIndexConfig.dependencyTargets: array expected");for(t.dependencyTargets=[],r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.ActionConfig.VectorIndexConfig.dependencyTargets: object expected");t.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[r])}}return t},t.toObject=function(e,t){t||(t={});var n,r={};if((t.arrays||t.defaults)&&(r.dependencyTargets=[]),(t.objects||t.defaults)&&(r.params={}),t.defaults&&(r.name="",r.table="",r.column="",r.dimensions=0,r.indexType="",r.filename=""),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),null!=e.table&&e.hasOwnProperty("table")&&(r.table=e.table),null!=e.column&&e.hasOwnProperty("column")&&(r.column=e.column),null!=e.dimensions&&e.hasOwnProperty("dimensions")&&(r.dimensions=e.dimensions),null!=e.indexType&&e.hasOwnProperty("indexType")&&(r.indexType=e.indexType),e.params&&(n=Object.keys(e.params)).length){r.params={};for(var i=0;i<n.length;++i)r.params[n[i]]=e.params[n[i]]}if(null!=e.filename&&e.hasOwnProperty("filename")&&(r.filename=e.filename),e.dependencyTargets&&e.dependencyTargets.length)for(r.dependencyTargets=[],i=0;i<e.dependencyTargets.length;++i)r.dependencyTargets[i]=s.sqlanvil.ActionConfig.Target.toObject(e.dependencyTargets[i],t);return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.VectorIndexConfig"},t}(),t.LoadModeConfig=function(){function t(e){if(this.uniqueKey=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.mode=0,t.prototype.incrementalColumn="",t.prototype.uniqueKey=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.mode&&Object.hasOwnProperty.call(e,"mode")&&t.uint32(8).int32(e.mode),null!=e.incrementalColumn&&Object.hasOwnProperty.call(e,"incrementalColumn")&&t.uint32(18).string(e.incrementalColumn),null!=e.uniqueKey&&e.uniqueKey.length)for(var n=0;n<e.uniqueKey.length;++n)t.uint32(26).string(e.uniqueKey[n]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionConfig.LoadModeConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.mode=e.int32();break;case 2:o.incrementalColumn=e.string();break;case 3:o.uniqueKey&&o.uniqueKey.length||(o.uniqueKey=[]),o.uniqueKey.push(e.string());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.mode&&e.hasOwnProperty("mode"))switch(e.mode){default:return"mode: enum value expected";case 0:case 1:case 2:case 3:case 4:}if(null!=e.incrementalColumn&&e.hasOwnProperty("incrementalColumn")&&!a.isString(e.incrementalColumn))return"incrementalColumn: string expected";if(null!=e.uniqueKey&&e.hasOwnProperty("uniqueKey")){if(!Array.isArray(e.uniqueKey))return"uniqueKey: array expected";for(var t=0;t<e.uniqueKey.length;++t)if(!a.isString(e.uniqueKey[t]))return"uniqueKey: string[] expected"}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionConfig.LoadModeConfig)return e;var t=new s.sqlanvil.ActionConfig.LoadModeConfig;switch(e.mode){default:if("number"==typeof e.mode){t.mode=e.mode;break}break;case"REPLACE_TABLE":case 0:t.mode=0;break;case"APPEND":case 1:t.mode=1;break;case"MAXIMUM":case 2:t.mode=2;break;case"UNIQUE":case 3:t.mode=3;break;case"MERGE":case 4:t.mode=4}if(null!=e.incrementalColumn&&(t.incrementalColumn=String(e.incrementalColumn)),e.uniqueKey){if(!Array.isArray(e.uniqueKey))throw TypeError(".sqlanvil.ActionConfig.LoadModeConfig.uniqueKey: array expected");t.uniqueKey=[];for(var n=0;n<e.uniqueKey.length;++n)t.uniqueKey[n]=String(e.uniqueKey[n])}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.uniqueKey=[]),t.defaults&&(n.mode=t.enums===String?"REPLACE_TABLE":0,n.incrementalColumn=""),null!=e.mode&&e.hasOwnProperty("mode")&&(n.mode=t.enums===String?void 0===s.sqlanvil.ActionConfig.LoadMode[e.mode]?e.mode:s.sqlanvil.ActionConfig.LoadMode[e.mode]:e.mode),null!=e.incrementalColumn&&e.hasOwnProperty("incrementalColumn")&&(n.incrementalColumn=e.incrementalColumn),e.uniqueKey&&e.uniqueKey.length){n.uniqueKey=[];for(var r=0;r<e.uniqueKey.length;++r)n.uniqueKey[r]=e.uniqueKey[r]}return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionConfig.LoadModeConfig"},t}(),t.LoadMode=function(){var e={},t=Object.create(e);return t[e[0]="REPLACE_TABLE"]=0,t[e[1]="APPEND"]=1,t[e[2]="MAXIMUM"]=2,t[e[3]="UNIQUE"]=3,t[e[4]="MERGE"]=4,t}(),t}(),r.RepositorySnapshotDestinationConfig=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.repositorySnapshotUri="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.repositorySnapshotUri&&Object.hasOwnProperty.call(e,"repositorySnapshotUri")&&t.uint32(10).string(e.repositorySnapshotUri),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.RepositorySnapshotDestinationConfig;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?o.repositorySnapshotUri=e.string():e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.repositorySnapshotUri&&e.hasOwnProperty("repositorySnapshotUri")&&!a.isString(e.repositorySnapshotUri)?"repositorySnapshotUri: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.RepositorySnapshotDestinationConfig)return e;var t=new s.sqlanvil.RepositorySnapshotDestinationConfig;return null!=e.repositorySnapshotUri&&(t.repositorySnapshotUri=String(e.repositorySnapshotUri)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.repositorySnapshotUri=""),null!=e.repositorySnapshotUri&&e.hasOwnProperty("repositorySnapshotUri")&&(n.repositorySnapshotUri=e.repositorySnapshotUri),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.RepositorySnapshotDestinationConfig"},t}(),r.NotebookRuntimeOptionsConfig=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var n;return t.prototype.outputBucket=null,t.prototype.runtimeTemplateName="",t.prototype.repositorySnapshotDestination=null,Object.defineProperty(t.prototype,"outputSink",{get:a.oneOfGetter(n=["outputBucket"]),set:a.oneOfSetter(n)}),Object.defineProperty(t.prototype,"repositorySnapshotStorage",{get:a.oneOfGetter(n=["repositorySnapshotDestination"]),set:a.oneOfSetter(n)}),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.outputBucket&&Object.hasOwnProperty.call(e,"outputBucket")&&t.uint32(10).string(e.outputBucket),null!=e.runtimeTemplateName&&Object.hasOwnProperty.call(e,"runtimeTemplateName")&&t.uint32(18).string(e.runtimeTemplateName),null!=e.repositorySnapshotDestination&&Object.hasOwnProperty.call(e,"repositorySnapshotDestination")&&s.sqlanvil.RepositorySnapshotDestinationConfig.encode(e.repositorySnapshotDestination,t.uint32(26).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.NotebookRuntimeOptionsConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.outputBucket=e.string();break;case 2:o.runtimeTemplateName=e.string();break;case 3:o.repositorySnapshotDestination=s.sqlanvil.RepositorySnapshotDestinationConfig.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.outputBucket&&e.hasOwnProperty("outputBucket")&&(t.outputSink=1,!a.isString(e.outputBucket)))return"outputBucket: string expected";if(null!=e.runtimeTemplateName&&e.hasOwnProperty("runtimeTemplateName")&&!a.isString(e.runtimeTemplateName))return"runtimeTemplateName: string expected";if(null!=e.repositorySnapshotDestination&&e.hasOwnProperty("repositorySnapshotDestination")){t.repositorySnapshotStorage=1;var n=s.sqlanvil.RepositorySnapshotDestinationConfig.verify(e.repositorySnapshotDestination);if(n)return"repositorySnapshotDestination."+n}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.NotebookRuntimeOptionsConfig)return e;var t=new s.sqlanvil.NotebookRuntimeOptionsConfig;if(null!=e.outputBucket&&(t.outputBucket=String(e.outputBucket)),null!=e.runtimeTemplateName&&(t.runtimeTemplateName=String(e.runtimeTemplateName)),null!=e.repositorySnapshotDestination){if("object"!=typeof e.repositorySnapshotDestination)throw TypeError(".sqlanvil.NotebookRuntimeOptionsConfig.repositorySnapshotDestination: object expected");t.repositorySnapshotDestination=s.sqlanvil.RepositorySnapshotDestinationConfig.fromObject(e.repositorySnapshotDestination)}return t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.runtimeTemplateName=""),null!=e.outputBucket&&e.hasOwnProperty("outputBucket")&&(n.outputBucket=e.outputBucket,t.oneofs&&(n.outputSink="outputBucket")),null!=e.runtimeTemplateName&&e.hasOwnProperty("runtimeTemplateName")&&(n.runtimeTemplateName=e.runtimeTemplateName),null!=e.repositorySnapshotDestination&&e.hasOwnProperty("repositorySnapshotDestination")&&(n.repositorySnapshotDestination=s.sqlanvil.RepositorySnapshotDestinationConfig.toObject(e.repositorySnapshotDestination,t),t.oneofs&&(n.repositorySnapshotStorage="repositorySnapshotDestination")),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.NotebookRuntimeOptionsConfig"},t}(),r.PostgresOptions=function(){function t(e){if(this.indexes=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.tablespace="",t.prototype.fillfactor=0,t.prototype.unlogged=!1,t.prototype.partition=null,t.prototype.indexes=a.emptyArray,t.prototype.noData=!1,t.prototype.refreshPolicy="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.tablespace&&Object.hasOwnProperty.call(e,"tablespace")&&t.uint32(10).string(e.tablespace),null!=e.fillfactor&&Object.hasOwnProperty.call(e,"fillfactor")&&t.uint32(16).uint32(e.fillfactor),null!=e.unlogged&&Object.hasOwnProperty.call(e,"unlogged")&&t.uint32(24).bool(e.unlogged),null!=e.partition&&Object.hasOwnProperty.call(e,"partition")&&s.sqlanvil.PostgresOptions.Partition.encode(e.partition,t.uint32(34).fork()).ldelim(),null!=e.indexes&&e.indexes.length)for(var n=0;n<e.indexes.length;++n)s.sqlanvil.PostgresOptions.Index.encode(e.indexes[n],t.uint32(42).fork()).ldelim();return null!=e.noData&&Object.hasOwnProperty.call(e,"noData")&&t.uint32(48).bool(e.noData),null!=e.refreshPolicy&&Object.hasOwnProperty.call(e,"refreshPolicy")&&t.uint32(58).string(e.refreshPolicy),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.PostgresOptions;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.tablespace=e.string();break;case 2:o.fillfactor=e.uint32();break;case 3:o.unlogged=e.bool();break;case 4:o.partition=s.sqlanvil.PostgresOptions.Partition.decode(e,e.uint32());break;case 5:o.indexes&&o.indexes.length||(o.indexes=[]),o.indexes.push(s.sqlanvil.PostgresOptions.Index.decode(e,e.uint32()));break;case 6:o.noData=e.bool();break;case 7:o.refreshPolicy=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.tablespace&&e.hasOwnProperty("tablespace")&&!a.isString(e.tablespace))return"tablespace: string expected";if(null!=e.fillfactor&&e.hasOwnProperty("fillfactor")&&!a.isInteger(e.fillfactor))return"fillfactor: integer expected";if(null!=e.unlogged&&e.hasOwnProperty("unlogged")&&"boolean"!=typeof e.unlogged)return"unlogged: boolean expected";if(null!=e.partition&&e.hasOwnProperty("partition")&&(n=s.sqlanvil.PostgresOptions.Partition.verify(e.partition)))return"partition."+n;if(null!=e.indexes&&e.hasOwnProperty("indexes")){if(!Array.isArray(e.indexes))return"indexes: array expected";for(var t=0;t<e.indexes.length;++t){var n;if(n=s.sqlanvil.PostgresOptions.Index.verify(e.indexes[t]))return"indexes."+n}}return null!=e.noData&&e.hasOwnProperty("noData")&&"boolean"!=typeof e.noData?"noData: boolean expected":null!=e.refreshPolicy&&e.hasOwnProperty("refreshPolicy")&&!a.isString(e.refreshPolicy)?"refreshPolicy: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.PostgresOptions)return e;var t=new s.sqlanvil.PostgresOptions;if(null!=e.tablespace&&(t.tablespace=String(e.tablespace)),null!=e.fillfactor&&(t.fillfactor=e.fillfactor>>>0),null!=e.unlogged&&(t.unlogged=Boolean(e.unlogged)),null!=e.partition){if("object"!=typeof e.partition)throw TypeError(".sqlanvil.PostgresOptions.partition: object expected");t.partition=s.sqlanvil.PostgresOptions.Partition.fromObject(e.partition)}if(e.indexes){if(!Array.isArray(e.indexes))throw TypeError(".sqlanvil.PostgresOptions.indexes: array expected");t.indexes=[];for(var n=0;n<e.indexes.length;++n){if("object"!=typeof e.indexes[n])throw TypeError(".sqlanvil.PostgresOptions.indexes: object expected");t.indexes[n]=s.sqlanvil.PostgresOptions.Index.fromObject(e.indexes[n])}}return null!=e.noData&&(t.noData=Boolean(e.noData)),null!=e.refreshPolicy&&(t.refreshPolicy=String(e.refreshPolicy)),t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.indexes=[]),t.defaults&&(n.tablespace="",n.fillfactor=0,n.unlogged=!1,n.partition=null,n.noData=!1,n.refreshPolicy=""),null!=e.tablespace&&e.hasOwnProperty("tablespace")&&(n.tablespace=e.tablespace),null!=e.fillfactor&&e.hasOwnProperty("fillfactor")&&(n.fillfactor=e.fillfactor),null!=e.unlogged&&e.hasOwnProperty("unlogged")&&(n.unlogged=e.unlogged),null!=e.partition&&e.hasOwnProperty("partition")&&(n.partition=s.sqlanvil.PostgresOptions.Partition.toObject(e.partition,t)),e.indexes&&e.indexes.length){n.indexes=[];for(var r=0;r<e.indexes.length;++r)n.indexes[r]=s.sqlanvil.PostgresOptions.Index.toObject(e.indexes[r],t)}return null!=e.noData&&e.hasOwnProperty("noData")&&(n.noData=e.noData),null!=e.refreshPolicy&&e.hasOwnProperty("refreshPolicy")&&(n.refreshPolicy=e.refreshPolicy),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.PostgresOptions"},t.Partition=function(){function t(e){if(this.columns=[],this.partitions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var n,r;return t.prototype.kind=0,t.prototype.columns=a.emptyArray,t.prototype.partitions=a.emptyArray,t.prototype.includeDefault=!1,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.kind&&Object.hasOwnProperty.call(e,"kind")&&t.uint32(8).int32(e.kind),null!=e.columns&&e.columns.length)for(var n=0;n<e.columns.length;++n)t.uint32(18).string(e.columns[n]);if(null!=e.partitions&&e.partitions.length)for(n=0;n<e.partitions.length;++n)s.sqlanvil.PostgresOptions.Partition.Bound.encode(e.partitions[n],t.uint32(26).fork()).ldelim();return null!=e.includeDefault&&Object.hasOwnProperty.call(e,"includeDefault")&&t.uint32(32).bool(e.includeDefault),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.PostgresOptions.Partition;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.kind=e.int32();break;case 2:o.columns&&o.columns.length||(o.columns=[]),o.columns.push(e.string());break;case 3:o.partitions&&o.partitions.length||(o.partitions=[]),o.partitions.push(s.sqlanvil.PostgresOptions.Partition.Bound.decode(e,e.uint32()));break;case 4:o.includeDefault=e.bool();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.kind&&e.hasOwnProperty("kind"))switch(e.kind){default:return"kind: enum value expected";case 0:case 1:case 2:}if(null!=e.columns&&e.hasOwnProperty("columns")){if(!Array.isArray(e.columns))return"columns: array expected";for(var t=0;t<e.columns.length;++t)if(!a.isString(e.columns[t]))return"columns: string[] expected"}if(null!=e.partitions&&e.hasOwnProperty("partitions")){if(!Array.isArray(e.partitions))return"partitions: array expected";for(t=0;t<e.partitions.length;++t){var n=s.sqlanvil.PostgresOptions.Partition.Bound.verify(e.partitions[t]);if(n)return"partitions."+n}}return null!=e.includeDefault&&e.hasOwnProperty("includeDefault")&&"boolean"!=typeof e.includeDefault?"includeDefault: boolean expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.PostgresOptions.Partition)return e;var t=new s.sqlanvil.PostgresOptions.Partition;switch(e.kind){default:if("number"==typeof e.kind){t.kind=e.kind;break}break;case"RANGE":case 0:t.kind=0;break;case"LIST":case 1:t.kind=1;break;case"HASH":case 2:t.kind=2}if(e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.PostgresOptions.Partition.columns: array expected");t.columns=[];for(var n=0;n<e.columns.length;++n)t.columns[n]=String(e.columns[n])}if(e.partitions){if(!Array.isArray(e.partitions))throw TypeError(".sqlanvil.PostgresOptions.Partition.partitions: array expected");for(t.partitions=[],n=0;n<e.partitions.length;++n){if("object"!=typeof e.partitions[n])throw TypeError(".sqlanvil.PostgresOptions.Partition.partitions: object expected");t.partitions[n]=s.sqlanvil.PostgresOptions.Partition.Bound.fromObject(e.partitions[n])}}return null!=e.includeDefault&&(t.includeDefault=Boolean(e.includeDefault)),t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.columns=[],n.partitions=[]),t.defaults&&(n.kind=t.enums===String?"RANGE":0,n.includeDefault=!1),null!=e.kind&&e.hasOwnProperty("kind")&&(n.kind=t.enums===String?void 0===s.sqlanvil.PostgresOptions.Partition.Kind[e.kind]?e.kind:s.sqlanvil.PostgresOptions.Partition.Kind[e.kind]:e.kind),e.columns&&e.columns.length){n.columns=[];for(var r=0;r<e.columns.length;++r)n.columns[r]=e.columns[r]}if(e.partitions&&e.partitions.length)for(n.partitions=[],r=0;r<e.partitions.length;++r)n.partitions[r]=s.sqlanvil.PostgresOptions.Partition.Bound.toObject(e.partitions[r],t);return null!=e.includeDefault&&e.hasOwnProperty("includeDefault")&&(n.includeDefault=e.includeDefault),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.PostgresOptions.Partition"},t.Kind=(n={},(r=Object.create(n))[n[0]="RANGE"]=0,r[n[1]="LIST"]=1,r[n[2]="HASH"]=2,r),t.Bound=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.values="",t.prototype.subPartition=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.values&&Object.hasOwnProperty.call(e,"values")&&t.uint32(18).string(e.values),null!=e.subPartition&&Object.hasOwnProperty.call(e,"subPartition")&&s.sqlanvil.PostgresOptions.Partition.encode(e.subPartition,t.uint32(26).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.PostgresOptions.Partition.Bound;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.name=e.string();break;case 2:o.values=e.string();break;case 3:o.subPartition=s.sqlanvil.PostgresOptions.Partition.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.values&&e.hasOwnProperty("values")&&!a.isString(e.values))return"values: string expected";if(null!=e.subPartition&&e.hasOwnProperty("subPartition")){var t=s.sqlanvil.PostgresOptions.Partition.verify(e.subPartition);if(t)return"subPartition."+t}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.PostgresOptions.Partition.Bound)return e;var t=new s.sqlanvil.PostgresOptions.Partition.Bound;if(null!=e.name&&(t.name=String(e.name)),null!=e.values&&(t.values=String(e.values)),null!=e.subPartition){if("object"!=typeof e.subPartition)throw TypeError(".sqlanvil.PostgresOptions.Partition.Bound.subPartition: object expected");t.subPartition=s.sqlanvil.PostgresOptions.Partition.fromObject(e.subPartition)}return t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.name="",n.values="",n.subPartition=null),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.values&&e.hasOwnProperty("values")&&(n.values=e.values),null!=e.subPartition&&e.hasOwnProperty("subPartition")&&(n.subPartition=s.sqlanvil.PostgresOptions.Partition.toObject(e.subPartition,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.PostgresOptions.Partition.Bound"},t}(),t}(),t.Index=function(){function t(e){if(this.columns=[],this.include=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var n,r;return t.prototype.name="",t.prototype.columns=a.emptyArray,t.prototype.method=0,t.prototype.where="",t.prototype.unique=!1,t.prototype.include=a.emptyArray,t.prototype.opclass="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.columns&&e.columns.length)for(var n=0;n<e.columns.length;++n)t.uint32(18).string(e.columns[n]);if(null!=e.method&&Object.hasOwnProperty.call(e,"method")&&t.uint32(24).int32(e.method),null!=e.where&&Object.hasOwnProperty.call(e,"where")&&t.uint32(34).string(e.where),null!=e.unique&&Object.hasOwnProperty.call(e,"unique")&&t.uint32(40).bool(e.unique),null!=e.include&&e.include.length)for(n=0;n<e.include.length;++n)t.uint32(50).string(e.include[n]);return null!=e.opclass&&Object.hasOwnProperty.call(e,"opclass")&&t.uint32(58).string(e.opclass),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.PostgresOptions.Index;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.name=e.string();break;case 2:o.columns&&o.columns.length||(o.columns=[]),o.columns.push(e.string());break;case 3:o.method=e.int32();break;case 4:o.where=e.string();break;case 5:o.unique=e.bool();break;case 6:o.include&&o.include.length||(o.include=[]),o.include.push(e.string());break;case 7:o.opclass=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.columns&&e.hasOwnProperty("columns")){if(!Array.isArray(e.columns))return"columns: array expected";for(var t=0;t<e.columns.length;++t)if(!a.isString(e.columns[t]))return"columns: string[] expected"}if(null!=e.method&&e.hasOwnProperty("method"))switch(e.method){default:return"method: enum value expected";case 0:case 1:case 2:case 3:case 4:}if(null!=e.where&&e.hasOwnProperty("where")&&!a.isString(e.where))return"where: string expected";if(null!=e.unique&&e.hasOwnProperty("unique")&&"boolean"!=typeof e.unique)return"unique: boolean expected";if(null!=e.include&&e.hasOwnProperty("include")){if(!Array.isArray(e.include))return"include: array expected";for(t=0;t<e.include.length;++t)if(!a.isString(e.include[t]))return"include: string[] expected"}return null!=e.opclass&&e.hasOwnProperty("opclass")&&!a.isString(e.opclass)?"opclass: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.PostgresOptions.Index)return e;var t=new s.sqlanvil.PostgresOptions.Index;if(null!=e.name&&(t.name=String(e.name)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.PostgresOptions.Index.columns: array expected");t.columns=[];for(var n=0;n<e.columns.length;++n)t.columns[n]=String(e.columns[n])}switch(e.method){default:if("number"==typeof e.method){t.method=e.method;break}break;case"BTREE":case 0:t.method=0;break;case"HASH":case 1:t.method=1;break;case"GIN":case 2:t.method=2;break;case"GIST":case 3:t.method=3;break;case"BRIN":case 4:t.method=4}if(null!=e.where&&(t.where=String(e.where)),null!=e.unique&&(t.unique=Boolean(e.unique)),e.include){if(!Array.isArray(e.include))throw TypeError(".sqlanvil.PostgresOptions.Index.include: array expected");for(t.include=[],n=0;n<e.include.length;++n)t.include[n]=String(e.include[n])}return null!=e.opclass&&(t.opclass=String(e.opclass)),t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.columns=[],n.include=[]),t.defaults&&(n.name="",n.method=t.enums===String?"BTREE":0,n.where="",n.unique=!1,n.opclass=""),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),e.columns&&e.columns.length){n.columns=[];for(var r=0;r<e.columns.length;++r)n.columns[r]=e.columns[r]}if(null!=e.method&&e.hasOwnProperty("method")&&(n.method=t.enums===String?void 0===s.sqlanvil.PostgresOptions.Index.Method[e.method]?e.method:s.sqlanvil.PostgresOptions.Index.Method[e.method]:e.method),null!=e.where&&e.hasOwnProperty("where")&&(n.where=e.where),null!=e.unique&&e.hasOwnProperty("unique")&&(n.unique=e.unique),e.include&&e.include.length)for(n.include=[],r=0;r<e.include.length;++r)n.include[r]=e.include[r];return null!=e.opclass&&e.hasOwnProperty("opclass")&&(n.opclass=e.opclass),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.PostgresOptions.Index"},t.Method=(n={},(r=Object.create(n))[n[0]="BTREE"]=0,r[n[1]="HASH"]=1,r[n[2]="GIN"]=2,r[n[3]="GIST"]=3,r[n[4]="BRIN"]=4,r),t}(),t}(),r.MysqlOptions=function(){function t(e){if(this.indexes=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.engine="",t.prototype.charset="",t.prototype.collation="",t.prototype.indexes=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.engine&&Object.hasOwnProperty.call(e,"engine")&&t.uint32(10).string(e.engine),null!=e.charset&&Object.hasOwnProperty.call(e,"charset")&&t.uint32(18).string(e.charset),null!=e.collation&&Object.hasOwnProperty.call(e,"collation")&&t.uint32(26).string(e.collation),null!=e.indexes&&e.indexes.length)for(var n=0;n<e.indexes.length;++n)s.sqlanvil.MysqlOptions.Index.encode(e.indexes[n],t.uint32(34).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.MysqlOptions;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.engine=e.string();break;case 2:o.charset=e.string();break;case 3:o.collation=e.string();break;case 4:o.indexes&&o.indexes.length||(o.indexes=[]),o.indexes.push(s.sqlanvil.MysqlOptions.Index.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.engine&&e.hasOwnProperty("engine")&&!a.isString(e.engine))return"engine: string expected";if(null!=e.charset&&e.hasOwnProperty("charset")&&!a.isString(e.charset))return"charset: string expected";if(null!=e.collation&&e.hasOwnProperty("collation")&&!a.isString(e.collation))return"collation: string expected";if(null!=e.indexes&&e.hasOwnProperty("indexes")){if(!Array.isArray(e.indexes))return"indexes: array expected";for(var t=0;t<e.indexes.length;++t){var n=s.sqlanvil.MysqlOptions.Index.verify(e.indexes[t]);if(n)return"indexes."+n}}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.MysqlOptions)return e;var t=new s.sqlanvil.MysqlOptions;if(null!=e.engine&&(t.engine=String(e.engine)),null!=e.charset&&(t.charset=String(e.charset)),null!=e.collation&&(t.collation=String(e.collation)),e.indexes){if(!Array.isArray(e.indexes))throw TypeError(".sqlanvil.MysqlOptions.indexes: array expected");t.indexes=[];for(var n=0;n<e.indexes.length;++n){if("object"!=typeof e.indexes[n])throw TypeError(".sqlanvil.MysqlOptions.indexes: object expected");t.indexes[n]=s.sqlanvil.MysqlOptions.Index.fromObject(e.indexes[n])}}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.indexes=[]),t.defaults&&(n.engine="",n.charset="",n.collation=""),null!=e.engine&&e.hasOwnProperty("engine")&&(n.engine=e.engine),null!=e.charset&&e.hasOwnProperty("charset")&&(n.charset=e.charset),null!=e.collation&&e.hasOwnProperty("collation")&&(n.collation=e.collation),e.indexes&&e.indexes.length){n.indexes=[];for(var r=0;r<e.indexes.length;++r)n.indexes[r]=s.sqlanvil.MysqlOptions.Index.toObject(e.indexes[r],t)}return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.MysqlOptions"},t.Index=function(){function t(e){if(this.columns=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.columns=a.emptyArray,t.prototype.unique=!1,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.columns&&e.columns.length)for(var n=0;n<e.columns.length;++n)t.uint32(18).string(e.columns[n]);return null!=e.unique&&Object.hasOwnProperty.call(e,"unique")&&t.uint32(24).bool(e.unique),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.MysqlOptions.Index;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.name=e.string();break;case 2:o.columns&&o.columns.length||(o.columns=[]),o.columns.push(e.string());break;case 3:o.unique=e.bool();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.columns&&e.hasOwnProperty("columns")){if(!Array.isArray(e.columns))return"columns: array expected";for(var t=0;t<e.columns.length;++t)if(!a.isString(e.columns[t]))return"columns: string[] expected"}return null!=e.unique&&e.hasOwnProperty("unique")&&"boolean"!=typeof e.unique?"unique: boolean expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.MysqlOptions.Index)return e;var t=new s.sqlanvil.MysqlOptions.Index;if(null!=e.name&&(t.name=String(e.name)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.MysqlOptions.Index.columns: array expected");t.columns=[];for(var n=0;n<e.columns.length;++n)t.columns[n]=String(e.columns[n])}return null!=e.unique&&(t.unique=Boolean(e.unique)),t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.columns=[]),t.defaults&&(n.name="",n.unique=!1),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),e.columns&&e.columns.length){n.columns=[];for(var r=0;r<e.columns.length;++r)n.columns[r]=e.columns[r]}return null!=e.unique&&e.hasOwnProperty("unique")&&(n.unique=e.unique),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.MysqlOptions.Index"},t}(),t}(),r.SupabaseOptions=function(){function t(e){if(this.vectors=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.postgres=null,t.prototype.publishToRealtime=!1,t.prototype.enableRls=!1,t.prototype.ownerRole="",t.prototype.vectors=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.postgres&&Object.hasOwnProperty.call(e,"postgres")&&s.sqlanvil.PostgresOptions.encode(e.postgres,t.uint32(10).fork()).ldelim(),null!=e.publishToRealtime&&Object.hasOwnProperty.call(e,"publishToRealtime")&&t.uint32(16).bool(e.publishToRealtime),null!=e.enableRls&&Object.hasOwnProperty.call(e,"enableRls")&&t.uint32(24).bool(e.enableRls),null!=e.ownerRole&&Object.hasOwnProperty.call(e,"ownerRole")&&t.uint32(34).string(e.ownerRole),null!=e.vectors&&e.vectors.length)for(var n=0;n<e.vectors.length;++n)s.sqlanvil.SupabaseOptions.VectorConfig.encode(e.vectors[n],t.uint32(42).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.SupabaseOptions;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.postgres=s.sqlanvil.PostgresOptions.decode(e,e.uint32());break;case 2:o.publishToRealtime=e.bool();break;case 3:o.enableRls=e.bool();break;case 4:o.ownerRole=e.string();break;case 5:o.vectors&&o.vectors.length||(o.vectors=[]),o.vectors.push(s.sqlanvil.SupabaseOptions.VectorConfig.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.postgres&&e.hasOwnProperty("postgres")&&(n=s.sqlanvil.PostgresOptions.verify(e.postgres)))return"postgres."+n;if(null!=e.publishToRealtime&&e.hasOwnProperty("publishToRealtime")&&"boolean"!=typeof e.publishToRealtime)return"publishToRealtime: boolean expected";if(null!=e.enableRls&&e.hasOwnProperty("enableRls")&&"boolean"!=typeof e.enableRls)return"enableRls: boolean expected";if(null!=e.ownerRole&&e.hasOwnProperty("ownerRole")&&!a.isString(e.ownerRole))return"ownerRole: string expected";if(null!=e.vectors&&e.hasOwnProperty("vectors")){if(!Array.isArray(e.vectors))return"vectors: array expected";for(var t=0;t<e.vectors.length;++t){var n;if(n=s.sqlanvil.SupabaseOptions.VectorConfig.verify(e.vectors[t]))return"vectors."+n}}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.SupabaseOptions)return e;var t=new s.sqlanvil.SupabaseOptions;if(null!=e.postgres){if("object"!=typeof e.postgres)throw TypeError(".sqlanvil.SupabaseOptions.postgres: object expected");t.postgres=s.sqlanvil.PostgresOptions.fromObject(e.postgres)}if(null!=e.publishToRealtime&&(t.publishToRealtime=Boolean(e.publishToRealtime)),null!=e.enableRls&&(t.enableRls=Boolean(e.enableRls)),null!=e.ownerRole&&(t.ownerRole=String(e.ownerRole)),e.vectors){if(!Array.isArray(e.vectors))throw TypeError(".sqlanvil.SupabaseOptions.vectors: array expected");t.vectors=[];for(var n=0;n<e.vectors.length;++n){if("object"!=typeof e.vectors[n])throw TypeError(".sqlanvil.SupabaseOptions.vectors: object expected");t.vectors[n]=s.sqlanvil.SupabaseOptions.VectorConfig.fromObject(e.vectors[n])}}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.vectors=[]),t.defaults&&(n.postgres=null,n.publishToRealtime=!1,n.enableRls=!1,n.ownerRole=""),null!=e.postgres&&e.hasOwnProperty("postgres")&&(n.postgres=s.sqlanvil.PostgresOptions.toObject(e.postgres,t)),null!=e.publishToRealtime&&e.hasOwnProperty("publishToRealtime")&&(n.publishToRealtime=e.publishToRealtime),null!=e.enableRls&&e.hasOwnProperty("enableRls")&&(n.enableRls=e.enableRls),null!=e.ownerRole&&e.hasOwnProperty("ownerRole")&&(n.ownerRole=e.ownerRole),e.vectors&&e.vectors.length){n.vectors=[];for(var r=0;r<e.vectors.length;++r)n.vectors[r]=s.sqlanvil.SupabaseOptions.VectorConfig.toObject(e.vectors[r],t)}return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.SupabaseOptions"},t.VectorConfig=function(){function t(e){if(this.params={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var n,r;return t.prototype.column="",t.prototype.dimensions=0,t.prototype.indexType=0,t.prototype.params=a.emptyObject,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.column&&Object.hasOwnProperty.call(e,"column")&&t.uint32(10).string(e.column),null!=e.dimensions&&Object.hasOwnProperty.call(e,"dimensions")&&t.uint32(16).uint32(e.dimensions),null!=e.indexType&&Object.hasOwnProperty.call(e,"indexType")&&t.uint32(24).int32(e.indexType),null!=e.params&&Object.hasOwnProperty.call(e,"params"))for(var n=Object.keys(e.params),r=0;r<n.length;++r)t.uint32(34).fork().uint32(10).string(n[r]).uint32(18).string(e.params[n[r]]).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r,o,l=void 0===t?e.len:e.pos+t,c=new s.sqlanvil.SupabaseOptions.VectorConfig;e.pos<l;){var u=e.uint32();if(u===n)break;switch(u>>>3){case 1:c.column=e.string();break;case 2:c.dimensions=e.uint32();break;case 3:c.indexType=e.int32();break;case 4:c.params===a.emptyObject&&(c.params={});var p=e.uint32()+e.pos;for(r="",o="";e.pos<p;){var f=e.uint32();switch(f>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}}c.params[r]=o;break;default:e.skipType(7&u)}}return c},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.column&&e.hasOwnProperty("column")&&!a.isString(e.column))return"column: string expected";if(null!=e.dimensions&&e.hasOwnProperty("dimensions")&&!a.isInteger(e.dimensions))return"dimensions: integer expected";if(null!=e.indexType&&e.hasOwnProperty("indexType"))switch(e.indexType){default:return"indexType: enum value expected";case 0:case 1:}if(null!=e.params&&e.hasOwnProperty("params")){if(!a.isObject(e.params))return"params: object expected";for(var t=Object.keys(e.params),n=0;n<t.length;++n)if(!a.isString(e.params[t[n]]))return"params: string{k:string} expected"}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.SupabaseOptions.VectorConfig)return e;var t=new s.sqlanvil.SupabaseOptions.VectorConfig;switch(null!=e.column&&(t.column=String(e.column)),null!=e.dimensions&&(t.dimensions=e.dimensions>>>0),e.indexType){default:if("number"==typeof e.indexType){t.indexType=e.indexType;break}break;case"IVFFLAT":case 0:t.indexType=0;break;case"HNSW":case 1:t.indexType=1}if(e.params){if("object"!=typeof e.params)throw TypeError(".sqlanvil.SupabaseOptions.VectorConfig.params: object expected");t.params={};for(var n=Object.keys(e.params),r=0;r<n.length;++r)t.params[n[r]]=String(e.params[n[r]])}return t},t.toObject=function(e,t){t||(t={});var n,r={};if((t.objects||t.defaults)&&(r.params={}),t.defaults&&(r.column="",r.dimensions=0,r.indexType=t.enums===String?"IVFFLAT":0),null!=e.column&&e.hasOwnProperty("column")&&(r.column=e.column),null!=e.dimensions&&e.hasOwnProperty("dimensions")&&(r.dimensions=e.dimensions),null!=e.indexType&&e.hasOwnProperty("indexType")&&(r.indexType=t.enums===String?void 0===s.sqlanvil.SupabaseOptions.VectorConfig.IndexType[e.indexType]?e.indexType:s.sqlanvil.SupabaseOptions.VectorConfig.IndexType[e.indexType]:e.indexType),e.params&&(n=Object.keys(e.params)).length){r.params={};for(var i=0;i<n.length;++i)r.params[n[i]]=e.params[n[i]]}return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.SupabaseOptions.VectorConfig"},t.IndexType=(n={},(r=Object.create(n))[n[0]="IVFFLAT"]=0,r[n[1]="HNSW"]=1,r),t}(),t}(),r.BigQueryConnection=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.project="",t.prototype.location="",t.prototype.defaultDataset="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.project&&Object.hasOwnProperty.call(e,"project")&&t.uint32(10).string(e.project),null!=e.location&&Object.hasOwnProperty.call(e,"location")&&t.uint32(18).string(e.location),null!=e.defaultDataset&&Object.hasOwnProperty.call(e,"defaultDataset")&&t.uint32(26).string(e.defaultDataset),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.BigQueryConnection;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.project=e.string();break;case 2:o.location=e.string();break;case 3:o.defaultDataset=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.project&&e.hasOwnProperty("project")&&!a.isString(e.project)?"project: string expected":null!=e.location&&e.hasOwnProperty("location")&&!a.isString(e.location)?"location: string expected":null!=e.defaultDataset&&e.hasOwnProperty("defaultDataset")&&!a.isString(e.defaultDataset)?"defaultDataset: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.BigQueryConnection)return e;var t=new s.sqlanvil.BigQueryConnection;return null!=e.project&&(t.project=String(e.project)),null!=e.location&&(t.location=String(e.location)),null!=e.defaultDataset&&(t.defaultDataset=String(e.defaultDataset)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.project="",n.location="",n.defaultDataset=""),null!=e.project&&e.hasOwnProperty("project")&&(n.project=e.project),null!=e.location&&e.hasOwnProperty("location")&&(n.location=e.location),null!=e.defaultDataset&&e.hasOwnProperty("defaultDataset")&&(n.defaultDataset=e.defaultDataset),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.BigQueryConnection"},t}(),r.PostgresConnection=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.host="",t.prototype.port=0,t.prototype.database="",t.prototype.user="",t.prototype.password="",t.prototype.sslMode="",t.prototype.defaultSchema="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.host&&Object.hasOwnProperty.call(e,"host")&&t.uint32(10).string(e.host),null!=e.port&&Object.hasOwnProperty.call(e,"port")&&t.uint32(16).uint32(e.port),null!=e.database&&Object.hasOwnProperty.call(e,"database")&&t.uint32(26).string(e.database),null!=e.user&&Object.hasOwnProperty.call(e,"user")&&t.uint32(34).string(e.user),null!=e.password&&Object.hasOwnProperty.call(e,"password")&&t.uint32(42).string(e.password),null!=e.sslMode&&Object.hasOwnProperty.call(e,"sslMode")&&t.uint32(50).string(e.sslMode),null!=e.defaultSchema&&Object.hasOwnProperty.call(e,"defaultSchema")&&t.uint32(58).string(e.defaultSchema),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.PostgresConnection;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.host=e.string();break;case 2:o.port=e.uint32();break;case 3:o.database=e.string();break;case 4:o.user=e.string();break;case 5:o.password=e.string();break;case 6:o.sslMode=e.string();break;case 7:o.defaultSchema=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.host&&e.hasOwnProperty("host")&&!a.isString(e.host)?"host: string expected":null!=e.port&&e.hasOwnProperty("port")&&!a.isInteger(e.port)?"port: integer expected":null!=e.database&&e.hasOwnProperty("database")&&!a.isString(e.database)?"database: string expected":null!=e.user&&e.hasOwnProperty("user")&&!a.isString(e.user)?"user: string expected":null!=e.password&&e.hasOwnProperty("password")&&!a.isString(e.password)?"password: string expected":null!=e.sslMode&&e.hasOwnProperty("sslMode")&&!a.isString(e.sslMode)?"sslMode: string expected":null!=e.defaultSchema&&e.hasOwnProperty("defaultSchema")&&!a.isString(e.defaultSchema)?"defaultSchema: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.PostgresConnection)return e;var t=new s.sqlanvil.PostgresConnection;return null!=e.host&&(t.host=String(e.host)),null!=e.port&&(t.port=e.port>>>0),null!=e.database&&(t.database=String(e.database)),null!=e.user&&(t.user=String(e.user)),null!=e.password&&(t.password=String(e.password)),null!=e.sslMode&&(t.sslMode=String(e.sslMode)),null!=e.defaultSchema&&(t.defaultSchema=String(e.defaultSchema)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.host="",n.port=0,n.database="",n.user="",n.password="",n.sslMode="",n.defaultSchema=""),null!=e.host&&e.hasOwnProperty("host")&&(n.host=e.host),null!=e.port&&e.hasOwnProperty("port")&&(n.port=e.port),null!=e.database&&e.hasOwnProperty("database")&&(n.database=e.database),null!=e.user&&e.hasOwnProperty("user")&&(n.user=e.user),null!=e.password&&e.hasOwnProperty("password")&&(n.password=e.password),null!=e.sslMode&&e.hasOwnProperty("sslMode")&&(n.sslMode=e.sslMode),null!=e.defaultSchema&&e.hasOwnProperty("defaultSchema")&&(n.defaultSchema=e.defaultSchema),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.PostgresConnection"},t}(),r.SupabaseConnection=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.projectRef="",t.prototype.serviceRoleKey="",t.prototype.defaultSchema="",t.prototype.connectionString="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.projectRef&&Object.hasOwnProperty.call(e,"projectRef")&&t.uint32(10).string(e.projectRef),null!=e.serviceRoleKey&&Object.hasOwnProperty.call(e,"serviceRoleKey")&&t.uint32(18).string(e.serviceRoleKey),null!=e.defaultSchema&&Object.hasOwnProperty.call(e,"defaultSchema")&&t.uint32(26).string(e.defaultSchema),null!=e.connectionString&&Object.hasOwnProperty.call(e,"connectionString")&&t.uint32(34).string(e.connectionString),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.SupabaseConnection;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.projectRef=e.string();break;case 2:o.serviceRoleKey=e.string();break;case 3:o.defaultSchema=e.string();break;case 4:o.connectionString=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.projectRef&&e.hasOwnProperty("projectRef")&&!a.isString(e.projectRef)?"projectRef: string expected":null!=e.serviceRoleKey&&e.hasOwnProperty("serviceRoleKey")&&!a.isString(e.serviceRoleKey)?"serviceRoleKey: string expected":null!=e.defaultSchema&&e.hasOwnProperty("defaultSchema")&&!a.isString(e.defaultSchema)?"defaultSchema: string expected":null!=e.connectionString&&e.hasOwnProperty("connectionString")&&!a.isString(e.connectionString)?"connectionString: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.SupabaseConnection)return e;var t=new s.sqlanvil.SupabaseConnection;return null!=e.projectRef&&(t.projectRef=String(e.projectRef)),null!=e.serviceRoleKey&&(t.serviceRoleKey=String(e.serviceRoleKey)),null!=e.defaultSchema&&(t.defaultSchema=String(e.defaultSchema)),null!=e.connectionString&&(t.connectionString=String(e.connectionString)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.projectRef="",n.serviceRoleKey="",n.defaultSchema="",n.connectionString=""),null!=e.projectRef&&e.hasOwnProperty("projectRef")&&(n.projectRef=e.projectRef),null!=e.serviceRoleKey&&e.hasOwnProperty("serviceRoleKey")&&(n.serviceRoleKey=e.serviceRoleKey),null!=e.defaultSchema&&e.hasOwnProperty("defaultSchema")&&(n.defaultSchema=e.defaultSchema),null!=e.connectionString&&e.hasOwnProperty("connectionString")&&(n.connectionString=e.connectionString),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.SupabaseConnection"},t}(),r.MysqlConnection=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.host="",t.prototype.port=0,t.prototype.database="",t.prototype.user="",t.prototype.password="",t.prototype.sslMode="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.host&&Object.hasOwnProperty.call(e,"host")&&t.uint32(10).string(e.host),null!=e.port&&Object.hasOwnProperty.call(e,"port")&&t.uint32(16).uint32(e.port),null!=e.database&&Object.hasOwnProperty.call(e,"database")&&t.uint32(26).string(e.database),null!=e.user&&Object.hasOwnProperty.call(e,"user")&&t.uint32(34).string(e.user),null!=e.password&&Object.hasOwnProperty.call(e,"password")&&t.uint32(42).string(e.password),null!=e.sslMode&&Object.hasOwnProperty.call(e,"sslMode")&&t.uint32(50).string(e.sslMode),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.MysqlConnection;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.host=e.string();break;case 2:o.port=e.uint32();break;case 3:o.database=e.string();break;case 4:o.user=e.string();break;case 5:o.password=e.string();break;case 6:o.sslMode=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.host&&e.hasOwnProperty("host")&&!a.isString(e.host)?"host: string expected":null!=e.port&&e.hasOwnProperty("port")&&!a.isInteger(e.port)?"port: integer expected":null!=e.database&&e.hasOwnProperty("database")&&!a.isString(e.database)?"database: string expected":null!=e.user&&e.hasOwnProperty("user")&&!a.isString(e.user)?"user: string expected":null!=e.password&&e.hasOwnProperty("password")&&!a.isString(e.password)?"password: string expected":null!=e.sslMode&&e.hasOwnProperty("sslMode")&&!a.isString(e.sslMode)?"sslMode: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.MysqlConnection)return e;var t=new s.sqlanvil.MysqlConnection;return null!=e.host&&(t.host=String(e.host)),null!=e.port&&(t.port=e.port>>>0),null!=e.database&&(t.database=String(e.database)),null!=e.user&&(t.user=String(e.user)),null!=e.password&&(t.password=String(e.password)),null!=e.sslMode&&(t.sslMode=String(e.sslMode)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.host="",n.port=0,n.database="",n.user="",n.password="",n.sslMode=""),null!=e.host&&e.hasOwnProperty("host")&&(n.host=e.host),null!=e.port&&e.hasOwnProperty("port")&&(n.port=e.port),null!=e.database&&e.hasOwnProperty("database")&&(n.database=e.database),null!=e.user&&e.hasOwnProperty("user")&&(n.user=e.user),null!=e.password&&e.hasOwnProperty("password")&&(n.password=e.password),null!=e.sslMode&&e.hasOwnProperty("sslMode")&&(n.sslMode=e.sslMode),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.MysqlConnection"},t}(),r.WarehouseConfig=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var n;return t.prototype.bigquery=null,t.prototype.postgres=null,t.prototype.supabase=null,t.prototype.mysql=null,Object.defineProperty(t.prototype,"connection",{get:a.oneOfGetter(n=["bigquery","postgres","supabase","mysql"]),set:a.oneOfSetter(n)}),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.bigquery&&Object.hasOwnProperty.call(e,"bigquery")&&s.sqlanvil.BigQueryConnection.encode(e.bigquery,t.uint32(10).fork()).ldelim(),null!=e.postgres&&Object.hasOwnProperty.call(e,"postgres")&&s.sqlanvil.PostgresConnection.encode(e.postgres,t.uint32(18).fork()).ldelim(),null!=e.supabase&&Object.hasOwnProperty.call(e,"supabase")&&s.sqlanvil.SupabaseConnection.encode(e.supabase,t.uint32(26).fork()).ldelim(),null!=e.mysql&&Object.hasOwnProperty.call(e,"mysql")&&s.sqlanvil.MysqlConnection.encode(e.mysql,t.uint32(34).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.WarehouseConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.bigquery=s.sqlanvil.BigQueryConnection.decode(e,e.uint32());break;case 2:o.postgres=s.sqlanvil.PostgresConnection.decode(e,e.uint32());break;case 3:o.supabase=s.sqlanvil.SupabaseConnection.decode(e,e.uint32());break;case 4:o.mysql=s.sqlanvil.MysqlConnection.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.bigquery&&e.hasOwnProperty("bigquery")&&(t.connection=1,n=s.sqlanvil.BigQueryConnection.verify(e.bigquery)))return"bigquery."+n;if(null!=e.postgres&&e.hasOwnProperty("postgres")){if(1===t.connection)return"connection: multiple values";if(t.connection=1,n=s.sqlanvil.PostgresConnection.verify(e.postgres))return"postgres."+n}if(null!=e.supabase&&e.hasOwnProperty("supabase")){if(1===t.connection)return"connection: multiple values";if(t.connection=1,n=s.sqlanvil.SupabaseConnection.verify(e.supabase))return"supabase."+n}if(null!=e.mysql&&e.hasOwnProperty("mysql")){if(1===t.connection)return"connection: multiple values";var n;if(t.connection=1,n=s.sqlanvil.MysqlConnection.verify(e.mysql))return"mysql."+n}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.WarehouseConfig)return e;var t=new s.sqlanvil.WarehouseConfig;if(null!=e.bigquery){if("object"!=typeof e.bigquery)throw TypeError(".sqlanvil.WarehouseConfig.bigquery: object expected");t.bigquery=s.sqlanvil.BigQueryConnection.fromObject(e.bigquery)}if(null!=e.postgres){if("object"!=typeof e.postgres)throw TypeError(".sqlanvil.WarehouseConfig.postgres: object expected");t.postgres=s.sqlanvil.PostgresConnection.fromObject(e.postgres)}if(null!=e.supabase){if("object"!=typeof e.supabase)throw TypeError(".sqlanvil.WarehouseConfig.supabase: object expected");t.supabase=s.sqlanvil.SupabaseConnection.fromObject(e.supabase)}if(null!=e.mysql){if("object"!=typeof e.mysql)throw TypeError(".sqlanvil.WarehouseConfig.mysql: object expected");t.mysql=s.sqlanvil.MysqlConnection.fromObject(e.mysql)}return t},t.toObject=function(e,t){t||(t={});var n={};return null!=e.bigquery&&e.hasOwnProperty("bigquery")&&(n.bigquery=s.sqlanvil.BigQueryConnection.toObject(e.bigquery,t),t.oneofs&&(n.connection="bigquery")),null!=e.postgres&&e.hasOwnProperty("postgres")&&(n.postgres=s.sqlanvil.PostgresConnection.toObject(e.postgres,t),t.oneofs&&(n.connection="postgres")),null!=e.supabase&&e.hasOwnProperty("supabase")&&(n.supabase=s.sqlanvil.SupabaseConnection.toObject(e.supabase,t),t.oneofs&&(n.connection="supabase")),null!=e.mysql&&e.hasOwnProperty("mysql")&&(n.mysql=s.sqlanvil.MysqlConnection.toObject(e.mysql,t),t.oneofs&&(n.connection="mysql")),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.WarehouseConfig"},t}(),r.ExtensionCompilationMode=(t={},(n=Object.create(t))[t[0]="COMPILATION_MODE_UNSPECIFIED"]=0,n[t[1]="PROLOGUE"]=1,n[t[2]="APPLICATION_CODE"]=2,n),r.Extension=function(){function t(e){if(this.options={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.compilationMode=0,t.prototype.options=a.emptyObject,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.compilationMode&&Object.hasOwnProperty.call(e,"compilationMode")&&t.uint32(16).int32(e.compilationMode),null!=e.options&&Object.hasOwnProperty.call(e,"options"))for(var n=Object.keys(e.options),r=0;r<n.length;++r)t.uint32(26).fork().uint32(10).string(n[r]).uint32(18).string(e.options[n[r]]).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r,o,l=void 0===t?e.len:e.pos+t,c=new s.sqlanvil.Extension;e.pos<l;){var u=e.uint32();if(u===n)break;switch(u>>>3){case 1:c.name=e.string();break;case 2:c.compilationMode=e.int32();break;case 3:c.options===a.emptyObject&&(c.options={});var p=e.uint32()+e.pos;for(r="",o="";e.pos<p;){var f=e.uint32();switch(f>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}}c.options[r]=o;break;default:e.skipType(7&u)}}return c},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.compilationMode&&e.hasOwnProperty("compilationMode"))switch(e.compilationMode){default:return"compilationMode: enum value expected";case 0:case 1:case 2:}if(null!=e.options&&e.hasOwnProperty("options")){if(!a.isObject(e.options))return"options: object expected";for(var t=Object.keys(e.options),n=0;n<t.length;++n)if(!a.isString(e.options[t[n]]))return"options: string{k:string} expected"}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.Extension)return e;var t=new s.sqlanvil.Extension;switch(null!=e.name&&(t.name=String(e.name)),e.compilationMode){default:if("number"==typeof e.compilationMode){t.compilationMode=e.compilationMode;break}break;case"COMPILATION_MODE_UNSPECIFIED":case 0:t.compilationMode=0;break;case"PROLOGUE":case 1:t.compilationMode=1;break;case"APPLICATION_CODE":case 2:t.compilationMode=2}if(e.options){if("object"!=typeof e.options)throw TypeError(".sqlanvil.Extension.options: object expected");t.options={};for(var n=Object.keys(e.options),r=0;r<n.length;++r)t.options[n[r]]=String(e.options[n[r]])}return t},t.toObject=function(e,t){t||(t={});var n,r={};if((t.objects||t.defaults)&&(r.options={}),t.defaults&&(r.name="",r.compilationMode=t.enums===String?"COMPILATION_MODE_UNSPECIFIED":0),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),null!=e.compilationMode&&e.hasOwnProperty("compilationMode")&&(r.compilationMode=t.enums===String?void 0===s.sqlanvil.ExtensionCompilationMode[e.compilationMode]?e.compilationMode:s.sqlanvil.ExtensionCompilationMode[e.compilationMode]:e.compilationMode),e.options&&(n=Object.keys(e.options)).length){r.options={};for(var i=0;i<n.length;++i)r.options[n[i]]=e.options[n[i]]}return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.Extension"},t}(),r.ProjectConfig=function(){function t(e){if(this.vars={},this.connections={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.warehouse="",t.prototype.defaultDatabase="",t.prototype.defaultSchema="",t.prototype.defaultLocation="",t.prototype.assertionSchema="",t.prototype.vars=a.emptyObject,t.prototype.databaseSuffix="",t.prototype.schemaSuffix="",t.prototype.tablePrefix="",t.prototype.builtinAssertionNamePrefix="",t.prototype.defaultNotebookRuntimeOptions=null,t.prototype.defaultIcebergConfig=null,t.prototype.disableAssertions=!1,t.prototype.defaultReservation="",t.prototype.includeTestsInCompiledGraph=!1,t.prototype.connections=a.emptyObject,t.prototype.warehouseConnection="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.warehouse&&Object.hasOwnProperty.call(e,"warehouse")&&t.uint32(10).string(e.warehouse),null!=e.defaultSchema&&Object.hasOwnProperty.call(e,"defaultSchema")&&t.uint32(18).string(e.defaultSchema),null!=e.assertionSchema&&Object.hasOwnProperty.call(e,"assertionSchema")&&t.uint32(42).string(e.assertionSchema),null!=e.schemaSuffix&&Object.hasOwnProperty.call(e,"schemaSuffix")&&t.uint32(58).string(e.schemaSuffix),null!=e.defaultDatabase&&Object.hasOwnProperty.call(e,"defaultDatabase")&&t.uint32(74).string(e.defaultDatabase),null!=e.tablePrefix&&Object.hasOwnProperty.call(e,"tablePrefix")&&t.uint32(90).string(e.tablePrefix),null!=e.vars&&Object.hasOwnProperty.call(e,"vars"))for(var n=Object.keys(e.vars),r=0;r<n.length;++r)t.uint32(114).fork().uint32(10).string(n[r]).uint32(18).string(e.vars[n[r]]).ldelim();if(null!=e.databaseSuffix&&Object.hasOwnProperty.call(e,"databaseSuffix")&&t.uint32(122).string(e.databaseSuffix),null!=e.defaultLocation&&Object.hasOwnProperty.call(e,"defaultLocation")&&t.uint32(130).string(e.defaultLocation),null!=e.defaultNotebookRuntimeOptions&&Object.hasOwnProperty.call(e,"defaultNotebookRuntimeOptions")&&s.sqlanvil.NotebookRuntimeOptions.encode(e.defaultNotebookRuntimeOptions,t.uint32(138).fork()).ldelim(),null!=e.builtinAssertionNamePrefix&&Object.hasOwnProperty.call(e,"builtinAssertionNamePrefix")&&t.uint32(146).string(e.builtinAssertionNamePrefix),null!=e.defaultIcebergConfig&&Object.hasOwnProperty.call(e,"defaultIcebergConfig")&&s.sqlanvil.DefaultIcebergConfig.encode(e.defaultIcebergConfig,t.uint32(154).fork()).ldelim(),null!=e.disableAssertions&&Object.hasOwnProperty.call(e,"disableAssertions")&&t.uint32(160).bool(e.disableAssertions),null!=e.defaultReservation&&Object.hasOwnProperty.call(e,"defaultReservation")&&t.uint32(170).string(e.defaultReservation),null!=e.includeTestsInCompiledGraph&&Object.hasOwnProperty.call(e,"includeTestsInCompiledGraph")&&t.uint32(176).bool(e.includeTestsInCompiledGraph),null!=e.connections&&Object.hasOwnProperty.call(e,"connections"))for(n=Object.keys(e.connections),r=0;r<n.length;++r)t.uint32(186).fork().uint32(10).string(n[r]),s.sqlanvil.ConnectionConfig.encode(e.connections[n[r]],t.uint32(18).fork()).ldelim().ldelim();return null!=e.warehouseConnection&&Object.hasOwnProperty.call(e,"warehouseConnection")&&t.uint32(194).string(e.warehouseConnection),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r,o,l=void 0===t?e.len:e.pos+t,c=new s.sqlanvil.ProjectConfig;e.pos<l;){var u=e.uint32();if(u===n)break;switch(u>>>3){case 1:c.warehouse=e.string();break;case 9:c.defaultDatabase=e.string();break;case 2:c.defaultSchema=e.string();break;case 16:c.defaultLocation=e.string();break;case 5:c.assertionSchema=e.string();break;case 14:c.vars===a.emptyObject&&(c.vars={});var p=e.uint32()+e.pos;for(r="",o="";e.pos<p;)switch((f=e.uint32())>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}c.vars[r]=o;break;case 15:c.databaseSuffix=e.string();break;case 7:c.schemaSuffix=e.string();break;case 11:c.tablePrefix=e.string();break;case 18:c.builtinAssertionNamePrefix=e.string();break;case 17:c.defaultNotebookRuntimeOptions=s.sqlanvil.NotebookRuntimeOptions.decode(e,e.uint32());break;case 19:c.defaultIcebergConfig=s.sqlanvil.DefaultIcebergConfig.decode(e,e.uint32());break;case 20:c.disableAssertions=e.bool();break;case 21:c.defaultReservation=e.string();break;case 22:c.includeTestsInCompiledGraph=e.bool();break;case 23:for(c.connections===a.emptyObject&&(c.connections={}),p=e.uint32()+e.pos,r="",o=null;e.pos<p;){var f;switch((f=e.uint32())>>>3){case 1:r=e.string();break;case 2:o=s.sqlanvil.ConnectionConfig.decode(e,e.uint32());break;default:e.skipType(7&f)}}c.connections[r]=o;break;case 24:c.warehouseConnection=e.string();break;default:e.skipType(7&u)}}return c},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.warehouse&&e.hasOwnProperty("warehouse")&&!a.isString(e.warehouse))return"warehouse: string expected";if(null!=e.defaultDatabase&&e.hasOwnProperty("defaultDatabase")&&!a.isString(e.defaultDatabase))return"defaultDatabase: string expected";if(null!=e.defaultSchema&&e.hasOwnProperty("defaultSchema")&&!a.isString(e.defaultSchema))return"defaultSchema: string expected";if(null!=e.defaultLocation&&e.hasOwnProperty("defaultLocation")&&!a.isString(e.defaultLocation))return"defaultLocation: string expected";if(null!=e.assertionSchema&&e.hasOwnProperty("assertionSchema")&&!a.isString(e.assertionSchema))return"assertionSchema: string expected";if(null!=e.vars&&e.hasOwnProperty("vars")){if(!a.isObject(e.vars))return"vars: object expected";for(var t=Object.keys(e.vars),n=0;n<t.length;++n)if(!a.isString(e.vars[t[n]]))return"vars: string{k:string} expected"}if(null!=e.databaseSuffix&&e.hasOwnProperty("databaseSuffix")&&!a.isString(e.databaseSuffix))return"databaseSuffix: string expected";if(null!=e.schemaSuffix&&e.hasOwnProperty("schemaSuffix")&&!a.isString(e.schemaSuffix))return"schemaSuffix: string expected";if(null!=e.tablePrefix&&e.hasOwnProperty("tablePrefix")&&!a.isString(e.tablePrefix))return"tablePrefix: string expected";if(null!=e.builtinAssertionNamePrefix&&e.hasOwnProperty("builtinAssertionNamePrefix")&&!a.isString(e.builtinAssertionNamePrefix))return"builtinAssertionNamePrefix: string expected";if(null!=e.defaultNotebookRuntimeOptions&&e.hasOwnProperty("defaultNotebookRuntimeOptions")&&(r=s.sqlanvil.NotebookRuntimeOptions.verify(e.defaultNotebookRuntimeOptions)))return"defaultNotebookRuntimeOptions."+r;if(null!=e.defaultIcebergConfig&&e.hasOwnProperty("defaultIcebergConfig")&&(r=s.sqlanvil.DefaultIcebergConfig.verify(e.defaultIcebergConfig)))return"defaultIcebergConfig."+r;if(null!=e.disableAssertions&&e.hasOwnProperty("disableAssertions")&&"boolean"!=typeof e.disableAssertions)return"disableAssertions: boolean expected";if(null!=e.defaultReservation&&e.hasOwnProperty("defaultReservation")&&!a.isString(e.defaultReservation))return"defaultReservation: string expected";if(null!=e.includeTestsInCompiledGraph&&e.hasOwnProperty("includeTestsInCompiledGraph")&&"boolean"!=typeof e.includeTestsInCompiledGraph)return"includeTestsInCompiledGraph: boolean expected";if(null!=e.connections&&e.hasOwnProperty("connections")){if(!a.isObject(e.connections))return"connections: object expected";for(t=Object.keys(e.connections),n=0;n<t.length;++n){var r;if(r=s.sqlanvil.ConnectionConfig.verify(e.connections[t[n]]))return"connections."+r}}return null!=e.warehouseConnection&&e.hasOwnProperty("warehouseConnection")&&!a.isString(e.warehouseConnection)?"warehouseConnection: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ProjectConfig)return e;var t=new s.sqlanvil.ProjectConfig;if(null!=e.warehouse&&(t.warehouse=String(e.warehouse)),null!=e.defaultDatabase&&(t.defaultDatabase=String(e.defaultDatabase)),null!=e.defaultSchema&&(t.defaultSchema=String(e.defaultSchema)),null!=e.defaultLocation&&(t.defaultLocation=String(e.defaultLocation)),null!=e.assertionSchema&&(t.assertionSchema=String(e.assertionSchema)),e.vars){if("object"!=typeof e.vars)throw TypeError(".sqlanvil.ProjectConfig.vars: object expected");t.vars={};for(var n=Object.keys(e.vars),r=0;r<n.length;++r)t.vars[n[r]]=String(e.vars[n[r]])}if(null!=e.databaseSuffix&&(t.databaseSuffix=String(e.databaseSuffix)),null!=e.schemaSuffix&&(t.schemaSuffix=String(e.schemaSuffix)),null!=e.tablePrefix&&(t.tablePrefix=String(e.tablePrefix)),null!=e.builtinAssertionNamePrefix&&(t.builtinAssertionNamePrefix=String(e.builtinAssertionNamePrefix)),null!=e.defaultNotebookRuntimeOptions){if("object"!=typeof e.defaultNotebookRuntimeOptions)throw TypeError(".sqlanvil.ProjectConfig.defaultNotebookRuntimeOptions: object expected");t.defaultNotebookRuntimeOptions=s.sqlanvil.NotebookRuntimeOptions.fromObject(e.defaultNotebookRuntimeOptions)}if(null!=e.defaultIcebergConfig){if("object"!=typeof e.defaultIcebergConfig)throw TypeError(".sqlanvil.ProjectConfig.defaultIcebergConfig: object expected");t.defaultIcebergConfig=s.sqlanvil.DefaultIcebergConfig.fromObject(e.defaultIcebergConfig)}if(null!=e.disableAssertions&&(t.disableAssertions=Boolean(e.disableAssertions)),null!=e.defaultReservation&&(t.defaultReservation=String(e.defaultReservation)),null!=e.includeTestsInCompiledGraph&&(t.includeTestsInCompiledGraph=Boolean(e.includeTestsInCompiledGraph)),e.connections){if("object"!=typeof e.connections)throw TypeError(".sqlanvil.ProjectConfig.connections: object expected");for(t.connections={},n=Object.keys(e.connections),r=0;r<n.length;++r){if("object"!=typeof e.connections[n[r]])throw TypeError(".sqlanvil.ProjectConfig.connections: object expected");t.connections[n[r]]=s.sqlanvil.ConnectionConfig.fromObject(e.connections[n[r]])}}return null!=e.warehouseConnection&&(t.warehouseConnection=String(e.warehouseConnection)),t},t.toObject=function(e,t){t||(t={});var n,r={};if((t.objects||t.defaults)&&(r.vars={},r.connections={}),t.defaults&&(r.warehouse="",r.defaultSchema="",r.assertionSchema="",r.schemaSuffix="",r.defaultDatabase="",r.tablePrefix="",r.databaseSuffix="",r.defaultLocation="",r.defaultNotebookRuntimeOptions=null,r.builtinAssertionNamePrefix="",r.defaultIcebergConfig=null,r.disableAssertions=!1,r.defaultReservation="",r.includeTestsInCompiledGraph=!1,r.warehouseConnection=""),null!=e.warehouse&&e.hasOwnProperty("warehouse")&&(r.warehouse=e.warehouse),null!=e.defaultSchema&&e.hasOwnProperty("defaultSchema")&&(r.defaultSchema=e.defaultSchema),null!=e.assertionSchema&&e.hasOwnProperty("assertionSchema")&&(r.assertionSchema=e.assertionSchema),null!=e.schemaSuffix&&e.hasOwnProperty("schemaSuffix")&&(r.schemaSuffix=e.schemaSuffix),null!=e.defaultDatabase&&e.hasOwnProperty("defaultDatabase")&&(r.defaultDatabase=e.defaultDatabase),null!=e.tablePrefix&&e.hasOwnProperty("tablePrefix")&&(r.tablePrefix=e.tablePrefix),e.vars&&(n=Object.keys(e.vars)).length){r.vars={};for(var i=0;i<n.length;++i)r.vars[n[i]]=e.vars[n[i]]}if(null!=e.databaseSuffix&&e.hasOwnProperty("databaseSuffix")&&(r.databaseSuffix=e.databaseSuffix),null!=e.defaultLocation&&e.hasOwnProperty("defaultLocation")&&(r.defaultLocation=e.defaultLocation),null!=e.defaultNotebookRuntimeOptions&&e.hasOwnProperty("defaultNotebookRuntimeOptions")&&(r.defaultNotebookRuntimeOptions=s.sqlanvil.NotebookRuntimeOptions.toObject(e.defaultNotebookRuntimeOptions,t)),null!=e.builtinAssertionNamePrefix&&e.hasOwnProperty("builtinAssertionNamePrefix")&&(r.builtinAssertionNamePrefix=e.builtinAssertionNamePrefix),null!=e.defaultIcebergConfig&&e.hasOwnProperty("defaultIcebergConfig")&&(r.defaultIcebergConfig=s.sqlanvil.DefaultIcebergConfig.toObject(e.defaultIcebergConfig,t)),null!=e.disableAssertions&&e.hasOwnProperty("disableAssertions")&&(r.disableAssertions=e.disableAssertions),null!=e.defaultReservation&&e.hasOwnProperty("defaultReservation")&&(r.defaultReservation=e.defaultReservation),null!=e.includeTestsInCompiledGraph&&e.hasOwnProperty("includeTestsInCompiledGraph")&&(r.includeTestsInCompiledGraph=e.includeTestsInCompiledGraph),e.connections&&(n=Object.keys(e.connections)).length)for(r.connections={},i=0;i<n.length;++i)r.connections[n[i]]=s.sqlanvil.ConnectionConfig.toObject(e.connections[n[i]],t);return null!=e.warehouseConnection&&e.hasOwnProperty("warehouseConnection")&&(r.warehouseConnection=e.warehouseConnection),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ProjectConfig"},t}(),r.CompileConfig=function(){function t(e){if(this.filePaths=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.projectDir="",t.prototype.filePaths=a.emptyArray,t.prototype.projectConfigOverride=null,t.prototype.timeoutMillis=0,t.prototype.extension=null,t.prototype.verbose=!1,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.projectDir&&Object.hasOwnProperty.call(e,"projectDir")&&t.uint32(10).string(e.projectDir),null!=e.projectConfigOverride&&Object.hasOwnProperty.call(e,"projectConfigOverride")&&s.sqlanvil.ProjectConfig.encode(e.projectConfigOverride,t.uint32(26).fork()).ldelim(),null!=e.timeoutMillis&&Object.hasOwnProperty.call(e,"timeoutMillis")&&t.uint32(48).int32(e.timeoutMillis),null!=e.filePaths&&e.filePaths.length)for(var n=0;n<e.filePaths.length;++n)t.uint32(66).string(e.filePaths[n]);return null!=e.extension&&Object.hasOwnProperty.call(e,"extension")&&s.sqlanvil.Extension.encode(e.extension,t.uint32(82).fork()).ldelim(),null!=e.verbose&&Object.hasOwnProperty.call(e,"verbose")&&t.uint32(88).bool(e.verbose),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.CompileConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.projectDir=e.string();break;case 8:o.filePaths&&o.filePaths.length||(o.filePaths=[]),o.filePaths.push(e.string());break;case 3:o.projectConfigOverride=s.sqlanvil.ProjectConfig.decode(e,e.uint32());break;case 6:o.timeoutMillis=e.int32();break;case 10:o.extension=s.sqlanvil.Extension.decode(e,e.uint32());break;case 11:o.verbose=e.bool();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.projectDir&&e.hasOwnProperty("projectDir")&&!a.isString(e.projectDir))return"projectDir: string expected";if(null!=e.filePaths&&e.hasOwnProperty("filePaths")){if(!Array.isArray(e.filePaths))return"filePaths: array expected";for(var t=0;t<e.filePaths.length;++t)if(!a.isString(e.filePaths[t]))return"filePaths: string[] expected"}var n;return null!=e.projectConfigOverride&&e.hasOwnProperty("projectConfigOverride")&&(n=s.sqlanvil.ProjectConfig.verify(e.projectConfigOverride))?"projectConfigOverride."+n:null!=e.timeoutMillis&&e.hasOwnProperty("timeoutMillis")&&!a.isInteger(e.timeoutMillis)?"timeoutMillis: integer expected":null!=e.extension&&e.hasOwnProperty("extension")&&(n=s.sqlanvil.Extension.verify(e.extension))?"extension."+n:null!=e.verbose&&e.hasOwnProperty("verbose")&&"boolean"!=typeof e.verbose?"verbose: boolean expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.CompileConfig)return e;var t=new s.sqlanvil.CompileConfig;if(null!=e.projectDir&&(t.projectDir=String(e.projectDir)),e.filePaths){if(!Array.isArray(e.filePaths))throw TypeError(".sqlanvil.CompileConfig.filePaths: array expected");t.filePaths=[];for(var n=0;n<e.filePaths.length;++n)t.filePaths[n]=String(e.filePaths[n])}if(null!=e.projectConfigOverride){if("object"!=typeof e.projectConfigOverride)throw TypeError(".sqlanvil.CompileConfig.projectConfigOverride: object expected");t.projectConfigOverride=s.sqlanvil.ProjectConfig.fromObject(e.projectConfigOverride)}if(null!=e.timeoutMillis&&(t.timeoutMillis=0|e.timeoutMillis),null!=e.extension){if("object"!=typeof e.extension)throw TypeError(".sqlanvil.CompileConfig.extension: object expected");t.extension=s.sqlanvil.Extension.fromObject(e.extension)}return null!=e.verbose&&(t.verbose=Boolean(e.verbose)),t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.filePaths=[]),t.defaults&&(n.projectDir="",n.projectConfigOverride=null,n.timeoutMillis=0,n.extension=null,n.verbose=!1),null!=e.projectDir&&e.hasOwnProperty("projectDir")&&(n.projectDir=e.projectDir),null!=e.projectConfigOverride&&e.hasOwnProperty("projectConfigOverride")&&(n.projectConfigOverride=s.sqlanvil.ProjectConfig.toObject(e.projectConfigOverride,t)),null!=e.timeoutMillis&&e.hasOwnProperty("timeoutMillis")&&(n.timeoutMillis=e.timeoutMillis),e.filePaths&&e.filePaths.length){n.filePaths=[];for(var r=0;r<e.filePaths.length;++r)n.filePaths[r]=e.filePaths[r]}return null!=e.extension&&e.hasOwnProperty("extension")&&(n.extension=s.sqlanvil.Extension.toObject(e.extension,t)),null!=e.verbose&&e.hasOwnProperty("verbose")&&(n.verbose=e.verbose),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.CompileConfig"},t}(),r.Target=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.database="",t.prototype.schema="",t.prototype.name="",t.prototype.includeDependentAssertions=!1,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.schema&&Object.hasOwnProperty.call(e,"schema")&&t.uint32(10).string(e.schema),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(18).string(e.name),null!=e.database&&Object.hasOwnProperty.call(e,"database")&&t.uint32(26).string(e.database),null!=e.includeDependentAssertions&&Object.hasOwnProperty.call(e,"includeDependentAssertions")&&t.uint32(32).bool(e.includeDependentAssertions),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.Target;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 3:o.database=e.string();break;case 1:o.schema=e.string();break;case 2:o.name=e.string();break;case 4:o.includeDependentAssertions=e.bool();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.database&&e.hasOwnProperty("database")&&!a.isString(e.database)?"database: string expected":null!=e.schema&&e.hasOwnProperty("schema")&&!a.isString(e.schema)?"schema: string expected":null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name)?"name: string expected":null!=e.includeDependentAssertions&&e.hasOwnProperty("includeDependentAssertions")&&"boolean"!=typeof e.includeDependentAssertions?"includeDependentAssertions: boolean expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.Target)return e;var t=new s.sqlanvil.Target;return null!=e.database&&(t.database=String(e.database)),null!=e.schema&&(t.schema=String(e.schema)),null!=e.name&&(t.name=String(e.name)),null!=e.includeDependentAssertions&&(t.includeDependentAssertions=Boolean(e.includeDependentAssertions)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.schema="",n.name="",n.database="",n.includeDependentAssertions=!1),null!=e.schema&&e.hasOwnProperty("schema")&&(n.schema=e.schema),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.database&&e.hasOwnProperty("database")&&(n.database=e.database),null!=e.includeDependentAssertions&&e.hasOwnProperty("includeDependentAssertions")&&(n.includeDependentAssertions=e.includeDependentAssertions),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.Target"},t}(),r.FileFormat=function(){var e={},t=Object.create(e);return t[e[0]="FILE_FORMAT_UNSPECIFIED"]=0,t[e[1]="PARQUET"]=1,t}(),r.TableFormat=function(){var e={},t=Object.create(e);return t[e[0]="TABLE_FORMAT_UNSPECIFIED"]=0,t[e[1]="ICEBERG"]=1,t}(),r.BigQueryOptions=function(){function t(e){if(this.clusterBy=[],this.labels={},this.additionalOptions={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.partitionBy="",t.prototype.clusterBy=a.emptyArray,t.prototype.updatePartitionFilter="",t.prototype.labels=a.emptyObject,t.prototype.partitionExpirationDays=0,t.prototype.requirePartitionFilter=!1,t.prototype.additionalOptions=a.emptyObject,t.prototype.connection="",t.prototype.tableFormat=0,t.prototype.fileFormat=0,t.prototype.storageUri="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.partitionBy&&Object.hasOwnProperty.call(e,"partitionBy")&&t.uint32(10).string(e.partitionBy),null!=e.clusterBy&&e.clusterBy.length)for(var n=0;n<e.clusterBy.length;++n)t.uint32(18).string(e.clusterBy[n]);if(null!=e.updatePartitionFilter&&Object.hasOwnProperty.call(e,"updatePartitionFilter")&&t.uint32(26).string(e.updatePartitionFilter),null!=e.labels&&Object.hasOwnProperty.call(e,"labels")){var r=Object.keys(e.labels);for(n=0;n<r.length;++n)t.uint32(34).fork().uint32(10).string(r[n]).uint32(18).string(e.labels[r[n]]).ldelim()}if(null!=e.partitionExpirationDays&&Object.hasOwnProperty.call(e,"partitionExpirationDays")&&t.uint32(40).int32(e.partitionExpirationDays),null!=e.requirePartitionFilter&&Object.hasOwnProperty.call(e,"requirePartitionFilter")&&t.uint32(48).bool(e.requirePartitionFilter),null!=e.additionalOptions&&Object.hasOwnProperty.call(e,"additionalOptions"))for(r=Object.keys(e.additionalOptions),n=0;n<r.length;++n)t.uint32(58).fork().uint32(10).string(r[n]).uint32(18).string(e.additionalOptions[r[n]]).ldelim();return null!=e.connection&&Object.hasOwnProperty.call(e,"connection")&&t.uint32(66).string(e.connection),null!=e.tableFormat&&Object.hasOwnProperty.call(e,"tableFormat")&&t.uint32(72).int32(e.tableFormat),null!=e.fileFormat&&Object.hasOwnProperty.call(e,"fileFormat")&&t.uint32(80).int32(e.fileFormat),null!=e.storageUri&&Object.hasOwnProperty.call(e,"storageUri")&&t.uint32(90).string(e.storageUri),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r,o,l=void 0===t?e.len:e.pos+t,c=new s.sqlanvil.BigQueryOptions;e.pos<l;){var u=e.uint32();if(u===n)break;switch(u>>>3){case 1:c.partitionBy=e.string();break;case 2:c.clusterBy&&c.clusterBy.length||(c.clusterBy=[]),c.clusterBy.push(e.string());break;case 3:c.updatePartitionFilter=e.string();break;case 4:c.labels===a.emptyObject&&(c.labels={});var p=e.uint32()+e.pos;for(r="",o="";e.pos<p;)switch((f=e.uint32())>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}c.labels[r]=o;break;case 5:c.partitionExpirationDays=e.int32();break;case 6:c.requirePartitionFilter=e.bool();break;case 7:for(c.additionalOptions===a.emptyObject&&(c.additionalOptions={}),p=e.uint32()+e.pos,r="",o="";e.pos<p;){var f;switch((f=e.uint32())>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}}c.additionalOptions[r]=o;break;case 8:c.connection=e.string();break;case 9:c.tableFormat=e.int32();break;case 10:c.fileFormat=e.int32();break;case 11:c.storageUri=e.string();break;default:e.skipType(7&u)}}return c},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.partitionBy&&e.hasOwnProperty("partitionBy")&&!a.isString(e.partitionBy))return"partitionBy: string expected";if(null!=e.clusterBy&&e.hasOwnProperty("clusterBy")){if(!Array.isArray(e.clusterBy))return"clusterBy: array expected";for(var t=0;t<e.clusterBy.length;++t)if(!a.isString(e.clusterBy[t]))return"clusterBy: string[] expected"}if(null!=e.updatePartitionFilter&&e.hasOwnProperty("updatePartitionFilter")&&!a.isString(e.updatePartitionFilter))return"updatePartitionFilter: string expected";if(null!=e.labels&&e.hasOwnProperty("labels")){if(!a.isObject(e.labels))return"labels: object expected";var n=Object.keys(e.labels);for(t=0;t<n.length;++t)if(!a.isString(e.labels[n[t]]))return"labels: string{k:string} expected"}if(null!=e.partitionExpirationDays&&e.hasOwnProperty("partitionExpirationDays")&&!a.isInteger(e.partitionExpirationDays))return"partitionExpirationDays: integer expected";if(null!=e.requirePartitionFilter&&e.hasOwnProperty("requirePartitionFilter")&&"boolean"!=typeof e.requirePartitionFilter)return"requirePartitionFilter: boolean expected";if(null!=e.additionalOptions&&e.hasOwnProperty("additionalOptions")){if(!a.isObject(e.additionalOptions))return"additionalOptions: object expected";for(n=Object.keys(e.additionalOptions),t=0;t<n.length;++t)if(!a.isString(e.additionalOptions[n[t]]))return"additionalOptions: string{k:string} expected"}if(null!=e.connection&&e.hasOwnProperty("connection")&&!a.isString(e.connection))return"connection: string expected";if(null!=e.tableFormat&&e.hasOwnProperty("tableFormat"))switch(e.tableFormat){default:return"tableFormat: enum value expected";case 0:case 1:}if(null!=e.fileFormat&&e.hasOwnProperty("fileFormat"))switch(e.fileFormat){default:return"fileFormat: enum value expected";case 0:case 1:}return null!=e.storageUri&&e.hasOwnProperty("storageUri")&&!a.isString(e.storageUri)?"storageUri: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.BigQueryOptions)return e;var t=new s.sqlanvil.BigQueryOptions;if(null!=e.partitionBy&&(t.partitionBy=String(e.partitionBy)),e.clusterBy){if(!Array.isArray(e.clusterBy))throw TypeError(".sqlanvil.BigQueryOptions.clusterBy: array expected");t.clusterBy=[];for(var n=0;n<e.clusterBy.length;++n)t.clusterBy[n]=String(e.clusterBy[n])}if(null!=e.updatePartitionFilter&&(t.updatePartitionFilter=String(e.updatePartitionFilter)),e.labels){if("object"!=typeof e.labels)throw TypeError(".sqlanvil.BigQueryOptions.labels: object expected");t.labels={};var r=Object.keys(e.labels);for(n=0;n<r.length;++n)t.labels[r[n]]=String(e.labels[r[n]])}if(null!=e.partitionExpirationDays&&(t.partitionExpirationDays=0|e.partitionExpirationDays),null!=e.requirePartitionFilter&&(t.requirePartitionFilter=Boolean(e.requirePartitionFilter)),e.additionalOptions){if("object"!=typeof e.additionalOptions)throw TypeError(".sqlanvil.BigQueryOptions.additionalOptions: object expected");for(t.additionalOptions={},r=Object.keys(e.additionalOptions),n=0;n<r.length;++n)t.additionalOptions[r[n]]=String(e.additionalOptions[r[n]])}switch(null!=e.connection&&(t.connection=String(e.connection)),e.tableFormat){default:if("number"==typeof e.tableFormat){t.tableFormat=e.tableFormat;break}break;case"TABLE_FORMAT_UNSPECIFIED":case 0:t.tableFormat=0;break;case"ICEBERG":case 1:t.tableFormat=1}switch(e.fileFormat){default:if("number"==typeof e.fileFormat){t.fileFormat=e.fileFormat;break}break;case"FILE_FORMAT_UNSPECIFIED":case 0:t.fileFormat=0;break;case"PARQUET":case 1:t.fileFormat=1}return null!=e.storageUri&&(t.storageUri=String(e.storageUri)),t},t.toObject=function(e,t){t||(t={});var n,r={};if((t.arrays||t.defaults)&&(r.clusterBy=[]),(t.objects||t.defaults)&&(r.labels={},r.additionalOptions={}),t.defaults&&(r.partitionBy="",r.updatePartitionFilter="",r.partitionExpirationDays=0,r.requirePartitionFilter=!1,r.connection="",r.tableFormat=t.enums===String?"TABLE_FORMAT_UNSPECIFIED":0,r.fileFormat=t.enums===String?"FILE_FORMAT_UNSPECIFIED":0,r.storageUri=""),null!=e.partitionBy&&e.hasOwnProperty("partitionBy")&&(r.partitionBy=e.partitionBy),e.clusterBy&&e.clusterBy.length){r.clusterBy=[];for(var i=0;i<e.clusterBy.length;++i)r.clusterBy[i]=e.clusterBy[i]}if(null!=e.updatePartitionFilter&&e.hasOwnProperty("updatePartitionFilter")&&(r.updatePartitionFilter=e.updatePartitionFilter),e.labels&&(n=Object.keys(e.labels)).length)for(r.labels={},i=0;i<n.length;++i)r.labels[n[i]]=e.labels[n[i]];if(null!=e.partitionExpirationDays&&e.hasOwnProperty("partitionExpirationDays")&&(r.partitionExpirationDays=e.partitionExpirationDays),null!=e.requirePartitionFilter&&e.hasOwnProperty("requirePartitionFilter")&&(r.requirePartitionFilter=e.requirePartitionFilter),e.additionalOptions&&(n=Object.keys(e.additionalOptions)).length)for(r.additionalOptions={},i=0;i<n.length;++i)r.additionalOptions[n[i]]=e.additionalOptions[n[i]];return null!=e.connection&&e.hasOwnProperty("connection")&&(r.connection=e.connection),null!=e.tableFormat&&e.hasOwnProperty("tableFormat")&&(r.tableFormat=t.enums===String?void 0===s.sqlanvil.TableFormat[e.tableFormat]?e.tableFormat:s.sqlanvil.TableFormat[e.tableFormat]:e.tableFormat),null!=e.fileFormat&&e.hasOwnProperty("fileFormat")&&(r.fileFormat=t.enums===String?void 0===s.sqlanvil.FileFormat[e.fileFormat]?e.fileFormat:s.sqlanvil.FileFormat[e.fileFormat]:e.fileFormat),null!=e.storageUri&&e.hasOwnProperty("storageUri")&&(r.storageUri=e.storageUri),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.BigQueryOptions"},t}(),r.GraphErrors=function(){function t(e){if(this.compilationErrors=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.compilationErrors=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.compilationErrors&&e.compilationErrors.length)for(var n=0;n<e.compilationErrors.length;++n)s.sqlanvil.CompilationError.encode(e.compilationErrors[n],t.uint32(10).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.GraphErrors;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?(o.compilationErrors&&o.compilationErrors.length||(o.compilationErrors=[]),o.compilationErrors.push(s.sqlanvil.CompilationError.decode(e,e.uint32()))):e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.compilationErrors&&e.hasOwnProperty("compilationErrors")){if(!Array.isArray(e.compilationErrors))return"compilationErrors: array expected";for(var t=0;t<e.compilationErrors.length;++t){var n=s.sqlanvil.CompilationError.verify(e.compilationErrors[t]);if(n)return"compilationErrors."+n}}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.GraphErrors)return e;var t=new s.sqlanvil.GraphErrors;if(e.compilationErrors){if(!Array.isArray(e.compilationErrors))throw TypeError(".sqlanvil.GraphErrors.compilationErrors: array expected");t.compilationErrors=[];for(var n=0;n<e.compilationErrors.length;++n){if("object"!=typeof e.compilationErrors[n])throw TypeError(".sqlanvil.GraphErrors.compilationErrors: object expected");t.compilationErrors[n]=s.sqlanvil.CompilationError.fromObject(e.compilationErrors[n])}}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.compilationErrors=[]),e.compilationErrors&&e.compilationErrors.length){n.compilationErrors=[];for(var r=0;r<e.compilationErrors.length;++r)n.compilationErrors[r]=s.sqlanvil.CompilationError.toObject(e.compilationErrors[r],t)}return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.GraphErrors"},t}(),r.CompilationError=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.fileName="",t.prototype.actionName="",t.prototype.actionTarget=null,t.prototype.message="",t.prototype.stack="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(10).string(e.fileName),null!=e.message&&Object.hasOwnProperty.call(e,"message")&&t.uint32(18).string(e.message),null!=e.stack&&Object.hasOwnProperty.call(e,"stack")&&t.uint32(26).string(e.stack),null!=e.actionName&&Object.hasOwnProperty.call(e,"actionName")&&t.uint32(34).string(e.actionName),null!=e.actionTarget&&Object.hasOwnProperty.call(e,"actionTarget")&&s.sqlanvil.Target.encode(e.actionTarget,t.uint32(42).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.CompilationError;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.fileName=e.string();break;case 4:o.actionName=e.string();break;case 5:o.actionTarget=s.sqlanvil.Target.decode(e,e.uint32());break;case 2:o.message=e.string();break;case 3:o.stack=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.fileName&&e.hasOwnProperty("fileName")&&!a.isString(e.fileName))return"fileName: string expected";if(null!=e.actionName&&e.hasOwnProperty("actionName")&&!a.isString(e.actionName))return"actionName: string expected";if(null!=e.actionTarget&&e.hasOwnProperty("actionTarget")){var t=s.sqlanvil.Target.verify(e.actionTarget);if(t)return"actionTarget."+t}return null!=e.message&&e.hasOwnProperty("message")&&!a.isString(e.message)?"message: string expected":null!=e.stack&&e.hasOwnProperty("stack")&&!a.isString(e.stack)?"stack: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.CompilationError)return e;var t=new s.sqlanvil.CompilationError;if(null!=e.fileName&&(t.fileName=String(e.fileName)),null!=e.actionName&&(t.actionName=String(e.actionName)),null!=e.actionTarget){if("object"!=typeof e.actionTarget)throw TypeError(".sqlanvil.CompilationError.actionTarget: object expected");t.actionTarget=s.sqlanvil.Target.fromObject(e.actionTarget)}return null!=e.message&&(t.message=String(e.message)),null!=e.stack&&(t.stack=String(e.stack)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.fileName="",n.message="",n.stack="",n.actionName="",n.actionTarget=null),null!=e.fileName&&e.hasOwnProperty("fileName")&&(n.fileName=e.fileName),null!=e.message&&e.hasOwnProperty("message")&&(n.message=e.message),null!=e.stack&&e.hasOwnProperty("stack")&&(n.stack=e.stack),null!=e.actionName&&e.hasOwnProperty("actionName")&&(n.actionName=e.actionName),null!=e.actionTarget&&e.hasOwnProperty("actionTarget")&&(n.actionTarget=s.sqlanvil.Target.toObject(e.actionTarget,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.CompilationError"},t}(),r.ActionCompilationMode=function(){var e={},t=Object.create(e);return t[e[0]="ACTION_COMPILATION_MODE_UNSPECIFIED"]=0,t[e[1]="ACTION_COMPILATION_MODE_AOT"]=1,t[e[2]="ACTION_COMPILATION_MODE_JIT"]=2,t}(),r.ActionDescriptor=function(){function t(e){if(this.columns=[],this.bigqueryLabels={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.description="",t.prototype.columns=a.emptyArray,t.prototype.bigqueryLabels=a.emptyObject,t.prototype.metadata=null,t.prototype.compilationMode=0,t.prototype.reservation="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(10).string(e.description),null!=e.columns&&e.columns.length)for(var n=0;n<e.columns.length;++n)s.sqlanvil.ColumnDescriptor.encode(e.columns[n],t.uint32(18).fork()).ldelim();if(null!=e.bigqueryLabels&&Object.hasOwnProperty.call(e,"bigqueryLabels")){var r=Object.keys(e.bigqueryLabels);for(n=0;n<r.length;++n)t.uint32(26).fork().uint32(10).string(r[n]).uint32(18).string(e.bigqueryLabels[r[n]]).ldelim()}return null!=e.metadata&&Object.hasOwnProperty.call(e,"metadata")&&s.sqlanvil.Metadata.encode(e.metadata,t.uint32(34).fork()).ldelim(),null!=e.compilationMode&&Object.hasOwnProperty.call(e,"compilationMode")&&t.uint32(40).int32(e.compilationMode),null!=e.reservation&&Object.hasOwnProperty.call(e,"reservation")&&t.uint32(50).string(e.reservation),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r,o,l=void 0===t?e.len:e.pos+t,c=new s.sqlanvil.ActionDescriptor;e.pos<l;){var u=e.uint32();if(u===n)break;switch(u>>>3){case 1:c.description=e.string();break;case 2:c.columns&&c.columns.length||(c.columns=[]),c.columns.push(s.sqlanvil.ColumnDescriptor.decode(e,e.uint32()));break;case 3:c.bigqueryLabels===a.emptyObject&&(c.bigqueryLabels={});var p=e.uint32()+e.pos;for(r="",o="";e.pos<p;){var f=e.uint32();switch(f>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}}c.bigqueryLabels[r]=o;break;case 4:c.metadata=s.sqlanvil.Metadata.decode(e,e.uint32());break;case 5:c.compilationMode=e.int32();break;case 6:c.reservation=e.string();break;default:e.skipType(7&u)}}return c},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.description&&e.hasOwnProperty("description")&&!a.isString(e.description))return"description: string expected";if(null!=e.columns&&e.hasOwnProperty("columns")){if(!Array.isArray(e.columns))return"columns: array expected";for(var t=0;t<e.columns.length;++t)if(r=s.sqlanvil.ColumnDescriptor.verify(e.columns[t]))return"columns."+r}if(null!=e.bigqueryLabels&&e.hasOwnProperty("bigqueryLabels")){if(!a.isObject(e.bigqueryLabels))return"bigqueryLabels: object expected";var n=Object.keys(e.bigqueryLabels);for(t=0;t<n.length;++t)if(!a.isString(e.bigqueryLabels[n[t]]))return"bigqueryLabels: string{k:string} expected"}var r;if(null!=e.metadata&&e.hasOwnProperty("metadata")&&(r=s.sqlanvil.Metadata.verify(e.metadata)))return"metadata."+r;if(null!=e.compilationMode&&e.hasOwnProperty("compilationMode"))switch(e.compilationMode){default:return"compilationMode: enum value expected";case 0:case 1:case 2:}return null!=e.reservation&&e.hasOwnProperty("reservation")&&!a.isString(e.reservation)?"reservation: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionDescriptor)return e;var t=new s.sqlanvil.ActionDescriptor;if(null!=e.description&&(t.description=String(e.description)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.ActionDescriptor.columns: array expected");t.columns=[];for(var n=0;n<e.columns.length;++n){if("object"!=typeof e.columns[n])throw TypeError(".sqlanvil.ActionDescriptor.columns: object expected");t.columns[n]=s.sqlanvil.ColumnDescriptor.fromObject(e.columns[n])}}if(e.bigqueryLabels){if("object"!=typeof e.bigqueryLabels)throw TypeError(".sqlanvil.ActionDescriptor.bigqueryLabels: object expected");t.bigqueryLabels={};var r=Object.keys(e.bigqueryLabels);for(n=0;n<r.length;++n)t.bigqueryLabels[r[n]]=String(e.bigqueryLabels[r[n]])}if(null!=e.metadata){if("object"!=typeof e.metadata)throw TypeError(".sqlanvil.ActionDescriptor.metadata: object expected");t.metadata=s.sqlanvil.Metadata.fromObject(e.metadata)}switch(e.compilationMode){default:if("number"==typeof e.compilationMode){t.compilationMode=e.compilationMode;break}break;case"ACTION_COMPILATION_MODE_UNSPECIFIED":case 0:t.compilationMode=0;break;case"ACTION_COMPILATION_MODE_AOT":case 1:t.compilationMode=1;break;case"ACTION_COMPILATION_MODE_JIT":case 2:t.compilationMode=2}return null!=e.reservation&&(t.reservation=String(e.reservation)),t},t.toObject=function(e,t){t||(t={});var n,r={};if((t.arrays||t.defaults)&&(r.columns=[]),(t.objects||t.defaults)&&(r.bigqueryLabels={}),t.defaults&&(r.description="",r.metadata=null,r.compilationMode=t.enums===String?"ACTION_COMPILATION_MODE_UNSPECIFIED":0,r.reservation=""),null!=e.description&&e.hasOwnProperty("description")&&(r.description=e.description),e.columns&&e.columns.length){r.columns=[];for(var i=0;i<e.columns.length;++i)r.columns[i]=s.sqlanvil.ColumnDescriptor.toObject(e.columns[i],t)}if(e.bigqueryLabels&&(n=Object.keys(e.bigqueryLabels)).length)for(r.bigqueryLabels={},i=0;i<n.length;++i)r.bigqueryLabels[n[i]]=e.bigqueryLabels[n[i]];return null!=e.metadata&&e.hasOwnProperty("metadata")&&(r.metadata=s.sqlanvil.Metadata.toObject(e.metadata,t)),null!=e.compilationMode&&e.hasOwnProperty("compilationMode")&&(r.compilationMode=t.enums===String?void 0===s.sqlanvil.ActionCompilationMode[e.compilationMode]?e.compilationMode:s.sqlanvil.ActionCompilationMode[e.compilationMode]:e.compilationMode),null!=e.reservation&&e.hasOwnProperty("reservation")&&(r.reservation=e.reservation),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionDescriptor"},t}(),r.Metadata=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.overview="",t.prototype.extraProperties=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.overview&&Object.hasOwnProperty.call(e,"overview")&&t.uint32(10).string(e.overview),null!=e.extraProperties&&Object.hasOwnProperty.call(e,"extraProperties")&&s.google.protobuf.Struct.encode(e.extraProperties,t.uint32(18).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.Metadata;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.overview=e.string();break;case 2:o.extraProperties=s.google.protobuf.Struct.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.overview&&e.hasOwnProperty("overview")&&!a.isString(e.overview))return"overview: string expected";if(null!=e.extraProperties&&e.hasOwnProperty("extraProperties")){var t=s.google.protobuf.Struct.verify(e.extraProperties);if(t)return"extraProperties."+t}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.Metadata)return e;var t=new s.sqlanvil.Metadata;if(null!=e.overview&&(t.overview=String(e.overview)),null!=e.extraProperties){if("object"!=typeof e.extraProperties)throw TypeError(".sqlanvil.Metadata.extraProperties: object expected");t.extraProperties=s.google.protobuf.Struct.fromObject(e.extraProperties)}return t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.overview="",n.extraProperties=null),null!=e.overview&&e.hasOwnProperty("overview")&&(n.overview=e.overview),null!=e.extraProperties&&e.hasOwnProperty("extraProperties")&&(n.extraProperties=s.google.protobuf.Struct.toObject(e.extraProperties,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.Metadata"},t}(),r.ColumnDescriptor=function(){function t(e){if(this.path=[],this.tags=[],this.bigqueryPolicyTags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.description="",t.prototype.path=a.emptyArray,t.prototype.displayName="",t.prototype.tags=a.emptyArray,t.prototype.bigqueryPolicyTags=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(10).string(e.description),null!=e.path&&e.path.length)for(var n=0;n<e.path.length;++n)t.uint32(18).string(e.path[n]);if(null!=e.displayName&&Object.hasOwnProperty.call(e,"displayName")&&t.uint32(26).string(e.displayName),null!=e.tags&&e.tags.length)for(n=0;n<e.tags.length;++n)t.uint32(58).string(e.tags[n]);if(null!=e.bigqueryPolicyTags&&e.bigqueryPolicyTags.length)for(n=0;n<e.bigqueryPolicyTags.length;++n)t.uint32(66).string(e.bigqueryPolicyTags[n]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ColumnDescriptor;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.description=e.string();break;case 2:o.path&&o.path.length||(o.path=[]),o.path.push(e.string());break;case 3:o.displayName=e.string();break;case 7:o.tags&&o.tags.length||(o.tags=[]),o.tags.push(e.string());break;case 8:o.bigqueryPolicyTags&&o.bigqueryPolicyTags.length||(o.bigqueryPolicyTags=[]),o.bigqueryPolicyTags.push(e.string());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.description&&e.hasOwnProperty("description")&&!a.isString(e.description))return"description: string expected";if(null!=e.path&&e.hasOwnProperty("path")){if(!Array.isArray(e.path))return"path: array expected";for(var t=0;t<e.path.length;++t)if(!a.isString(e.path[t]))return"path: string[] expected"}if(null!=e.displayName&&e.hasOwnProperty("displayName")&&!a.isString(e.displayName))return"displayName: string expected";if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!a.isString(e.tags[t]))return"tags: string[] expected"}if(null!=e.bigqueryPolicyTags&&e.hasOwnProperty("bigqueryPolicyTags")){if(!Array.isArray(e.bigqueryPolicyTags))return"bigqueryPolicyTags: array expected";for(t=0;t<e.bigqueryPolicyTags.length;++t)if(!a.isString(e.bigqueryPolicyTags[t]))return"bigqueryPolicyTags: string[] expected"}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ColumnDescriptor)return e;var t=new s.sqlanvil.ColumnDescriptor;if(null!=e.description&&(t.description=String(e.description)),e.path){if(!Array.isArray(e.path))throw TypeError(".sqlanvil.ColumnDescriptor.path: array expected");t.path=[];for(var n=0;n<e.path.length;++n)t.path[n]=String(e.path[n])}if(null!=e.displayName&&(t.displayName=String(e.displayName)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ColumnDescriptor.tags: array expected");for(t.tags=[],n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}if(e.bigqueryPolicyTags){if(!Array.isArray(e.bigqueryPolicyTags))throw TypeError(".sqlanvil.ColumnDescriptor.bigqueryPolicyTags: array expected");for(t.bigqueryPolicyTags=[],n=0;n<e.bigqueryPolicyTags.length;++n)t.bigqueryPolicyTags[n]=String(e.bigqueryPolicyTags[n])}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.path=[],n.tags=[],n.bigqueryPolicyTags=[]),t.defaults&&(n.description="",n.displayName=""),null!=e.description&&e.hasOwnProperty("description")&&(n.description=e.description),e.path&&e.path.length){n.path=[];for(var r=0;r<e.path.length;++r)n.path[r]=e.path[r]}if(null!=e.displayName&&e.hasOwnProperty("displayName")&&(n.displayName=e.displayName),e.tags&&e.tags.length)for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=e.tags[r];if(e.bigqueryPolicyTags&&e.bigqueryPolicyTags.length)for(n.bigqueryPolicyTags=[],r=0;r<e.bigqueryPolicyTags.length;++r)n.bigqueryPolicyTags[r]=e.bigqueryPolicyTags[r];return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ColumnDescriptor"},t}(),r.TableType=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN_TYPE"]=0,t[e[1]="TABLE"]=1,t[e[2]="INCREMENTAL"]=2,t[e[3]="VIEW"]=3,t}(),r.OnSchemaChange=function(){var e={},t=Object.create(e);return t[e[0]="IGNORE"]=0,t[e[1]="FAIL"]=1,t[e[2]="EXTEND"]=2,t[e[3]="SYNCHRONIZE"]=3,t}(),r.Table=function(){function t(e){if(this.dependencyTargets=[],this.tags=[],this.uniqueKey=[],this.preOps=[],this.postOps=[],this.incrementalPreOps=[],this.incrementalPostOps=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.enumType=0,t.prototype.target=null,t.prototype.canonicalTarget=null,t.prototype.dependencyTargets=a.emptyArray,t.prototype.hermeticity=0,t.prototype.disabled=!1,t.prototype.type="",t.prototype.query="",t.prototype.protected=!1,t.prototype.materialized=!1,t.prototype.actionDescriptor=null,t.prototype.tags=a.emptyArray,t.prototype.where="",t.prototype.incrementalQuery="",t.prototype.uniqueKey=a.emptyArray,t.prototype.onSchemaChange=0,t.prototype.preOps=a.emptyArray,t.prototype.postOps=a.emptyArray,t.prototype.incrementalPreOps=a.emptyArray,t.prototype.incrementalPostOps=a.emptyArray,t.prototype.jitCode="",t.prototype.bigquery=null,t.prototype.postgres=null,t.prototype.supabase=null,t.prototype.mysql=null,t.prototype.fileName="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(26).string(e.type),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&s.sqlanvil.Target.encode(e.target,t.uint32(34).fork()).ldelim(),null!=e.query&&Object.hasOwnProperty.call(e,"query")&&t.uint32(42).string(e.query),null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(48).bool(e.disabled),null!=e.where&&Object.hasOwnProperty.call(e,"where")&&t.uint32(66).string(e.where),null!=e.protected&&Object.hasOwnProperty.call(e,"protected")&&t.uint32(72).bool(e.protected),null!=e.preOps&&e.preOps.length)for(var n=0;n<e.preOps.length;++n)t.uint32(106).string(e.preOps[n]);if(null!=e.postOps&&e.postOps.length)for(n=0;n<e.postOps.length;++n)t.uint32(114).string(e.postOps[n]);if(null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(146).string(e.fileName),null!=e.bigquery&&Object.hasOwnProperty.call(e,"bigquery")&&s.sqlanvil.BigQueryOptions.encode(e.bigquery,t.uint32(178).fork()).ldelim(),null!=e.tags&&e.tags.length)for(n=0;n<e.tags.length;++n)t.uint32(186).string(e.tags[n]);if(null!=e.actionDescriptor&&Object.hasOwnProperty.call(e,"actionDescriptor")&&s.sqlanvil.ActionDescriptor.encode(e.actionDescriptor,t.uint32(194).fork()).ldelim(),null!=e.incrementalQuery&&Object.hasOwnProperty.call(e,"incrementalQuery")&&t.uint32(210).string(e.incrementalQuery),null!=e.dependencyTargets&&e.dependencyTargets.length)for(n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.Target.encode(e.dependencyTargets[n],t.uint32(218).fork()).ldelim();if(null!=e.incrementalPreOps&&e.incrementalPreOps.length)for(n=0;n<e.incrementalPreOps.length;++n)t.uint32(226).string(e.incrementalPreOps[n]);if(null!=e.incrementalPostOps&&e.incrementalPostOps.length)for(n=0;n<e.incrementalPostOps.length;++n)t.uint32(234).string(e.incrementalPostOps[n]);if(null!=e.uniqueKey&&e.uniqueKey.length)for(n=0;n<e.uniqueKey.length;++n)t.uint32(242).string(e.uniqueKey[n]);return null!=e.hermeticity&&Object.hasOwnProperty.call(e,"hermeticity")&&t.uint32(248).int32(e.hermeticity),null!=e.canonicalTarget&&Object.hasOwnProperty.call(e,"canonicalTarget")&&s.sqlanvil.Target.encode(e.canonicalTarget,t.uint32(258).fork()).ldelim(),null!=e.materialized&&Object.hasOwnProperty.call(e,"materialized")&&t.uint32(280).bool(e.materialized),null!=e.enumType&&Object.hasOwnProperty.call(e,"enumType")&&t.uint32(288).int32(e.enumType),null!=e.onSchemaChange&&Object.hasOwnProperty.call(e,"onSchemaChange")&&t.uint32(296).int32(e.onSchemaChange),null!=e.jitCode&&Object.hasOwnProperty.call(e,"jitCode")&&t.uint32(306).string(e.jitCode),null!=e.postgres&&Object.hasOwnProperty.call(e,"postgres")&&s.sqlanvil.PostgresOptions.encode(e.postgres,t.uint32(314).fork()).ldelim(),null!=e.supabase&&Object.hasOwnProperty.call(e,"supabase")&&s.sqlanvil.SupabaseOptions.encode(e.supabase,t.uint32(322).fork()).ldelim(),null!=e.mysql&&Object.hasOwnProperty.call(e,"mysql")&&s.sqlanvil.MysqlOptions.encode(e.mysql,t.uint32(330).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.Table;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 36:o.enumType=e.int32();break;case 4:o.target=s.sqlanvil.Target.decode(e,e.uint32());break;case 32:o.canonicalTarget=s.sqlanvil.Target.decode(e,e.uint32());break;case 27:o.dependencyTargets&&o.dependencyTargets.length||(o.dependencyTargets=[]),o.dependencyTargets.push(s.sqlanvil.Target.decode(e,e.uint32()));break;case 31:o.hermeticity=e.int32();break;case 6:o.disabled=e.bool();break;case 3:o.type=e.string();break;case 5:o.query=e.string();break;case 9:o.protected=e.bool();break;case 35:o.materialized=e.bool();break;case 24:o.actionDescriptor=s.sqlanvil.ActionDescriptor.decode(e,e.uint32());break;case 23:o.tags&&o.tags.length||(o.tags=[]),o.tags.push(e.string());break;case 8:o.where=e.string();break;case 26:o.incrementalQuery=e.string();break;case 30:o.uniqueKey&&o.uniqueKey.length||(o.uniqueKey=[]),o.uniqueKey.push(e.string());break;case 37:o.onSchemaChange=e.int32();break;case 13:o.preOps&&o.preOps.length||(o.preOps=[]),o.preOps.push(e.string());break;case 14:o.postOps&&o.postOps.length||(o.postOps=[]),o.postOps.push(e.string());break;case 28:o.incrementalPreOps&&o.incrementalPreOps.length||(o.incrementalPreOps=[]),o.incrementalPreOps.push(e.string());break;case 29:o.incrementalPostOps&&o.incrementalPostOps.length||(o.incrementalPostOps=[]),o.incrementalPostOps.push(e.string());break;case 38:o.jitCode=e.string();break;case 22:o.bigquery=s.sqlanvil.BigQueryOptions.decode(e,e.uint32());break;case 39:o.postgres=s.sqlanvil.PostgresOptions.decode(e,e.uint32());break;case 40:o.supabase=s.sqlanvil.SupabaseOptions.decode(e,e.uint32());break;case 41:o.mysql=s.sqlanvil.MysqlOptions.decode(e,e.uint32());break;case 18:o.fileName=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.enumType&&e.hasOwnProperty("enumType"))switch(e.enumType){default:return"enumType: enum value expected";case 0:case 1:case 2:case 3:}if(null!=e.target&&e.hasOwnProperty("target")&&(n=s.sqlanvil.Target.verify(e.target)))return"target."+n;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(n=s.sqlanvil.Target.verify(e.canonicalTarget)))return"canonicalTarget."+n;if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var t=0;t<e.dependencyTargets.length;++t){var n;if(n=s.sqlanvil.Target.verify(e.dependencyTargets[t]))return"dependencyTargets."+n}}if(null!=e.hermeticity&&e.hasOwnProperty("hermeticity"))switch(e.hermeticity){default:return"hermeticity: enum value expected";case 0:case 1:case 2:}if(null!=e.disabled&&e.hasOwnProperty("disabled")&&"boolean"!=typeof e.disabled)return"disabled: boolean expected";if(null!=e.type&&e.hasOwnProperty("type")&&!a.isString(e.type))return"type: string expected";if(null!=e.query&&e.hasOwnProperty("query")&&!a.isString(e.query))return"query: string expected";if(null!=e.protected&&e.hasOwnProperty("protected")&&"boolean"!=typeof e.protected)return"protected: boolean expected";if(null!=e.materialized&&e.hasOwnProperty("materialized")&&"boolean"!=typeof e.materialized)return"materialized: boolean expected";if(null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(n=s.sqlanvil.ActionDescriptor.verify(e.actionDescriptor)))return"actionDescriptor."+n;if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!a.isString(e.tags[t]))return"tags: string[] expected"}if(null!=e.where&&e.hasOwnProperty("where")&&!a.isString(e.where))return"where: string expected";if(null!=e.incrementalQuery&&e.hasOwnProperty("incrementalQuery")&&!a.isString(e.incrementalQuery))return"incrementalQuery: string expected";if(null!=e.uniqueKey&&e.hasOwnProperty("uniqueKey")){if(!Array.isArray(e.uniqueKey))return"uniqueKey: array expected";for(t=0;t<e.uniqueKey.length;++t)if(!a.isString(e.uniqueKey[t]))return"uniqueKey: string[] expected"}if(null!=e.onSchemaChange&&e.hasOwnProperty("onSchemaChange"))switch(e.onSchemaChange){default:return"onSchemaChange: enum value expected";case 0:case 1:case 2:case 3:}if(null!=e.preOps&&e.hasOwnProperty("preOps")){if(!Array.isArray(e.preOps))return"preOps: array expected";for(t=0;t<e.preOps.length;++t)if(!a.isString(e.preOps[t]))return"preOps: string[] expected"}if(null!=e.postOps&&e.hasOwnProperty("postOps")){if(!Array.isArray(e.postOps))return"postOps: array expected";for(t=0;t<e.postOps.length;++t)if(!a.isString(e.postOps[t]))return"postOps: string[] expected"}if(null!=e.incrementalPreOps&&e.hasOwnProperty("incrementalPreOps")){if(!Array.isArray(e.incrementalPreOps))return"incrementalPreOps: array expected";for(t=0;t<e.incrementalPreOps.length;++t)if(!a.isString(e.incrementalPreOps[t]))return"incrementalPreOps: string[] expected"}if(null!=e.incrementalPostOps&&e.hasOwnProperty("incrementalPostOps")){if(!Array.isArray(e.incrementalPostOps))return"incrementalPostOps: array expected";for(t=0;t<e.incrementalPostOps.length;++t)if(!a.isString(e.incrementalPostOps[t]))return"incrementalPostOps: string[] expected"}return null!=e.jitCode&&e.hasOwnProperty("jitCode")&&!a.isString(e.jitCode)?"jitCode: string expected":null!=e.bigquery&&e.hasOwnProperty("bigquery")&&(n=s.sqlanvil.BigQueryOptions.verify(e.bigquery))?"bigquery."+n:null!=e.postgres&&e.hasOwnProperty("postgres")&&(n=s.sqlanvil.PostgresOptions.verify(e.postgres))?"postgres."+n:null!=e.supabase&&e.hasOwnProperty("supabase")&&(n=s.sqlanvil.SupabaseOptions.verify(e.supabase))?"supabase."+n:null!=e.mysql&&e.hasOwnProperty("mysql")&&(n=s.sqlanvil.MysqlOptions.verify(e.mysql))?"mysql."+n:null!=e.fileName&&e.hasOwnProperty("fileName")&&!a.isString(e.fileName)?"fileName: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.Table)return e;var t=new s.sqlanvil.Table;switch(e.enumType){default:if("number"==typeof e.enumType){t.enumType=e.enumType;break}break;case"UNKNOWN_TYPE":case 0:t.enumType=0;break;case"TABLE":case 1:t.enumType=1;break;case"INCREMENTAL":case 2:t.enumType=2;break;case"VIEW":case 3:t.enumType=3}if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.Table.target: object expected");t.target=s.sqlanvil.Target.fromObject(e.target)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".sqlanvil.Table.canonicalTarget: object expected");t.canonicalTarget=s.sqlanvil.Target.fromObject(e.canonicalTarget)}if(e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.Table.dependencyTargets: array expected");t.dependencyTargets=[];for(var n=0;n<e.dependencyTargets.length;++n){if("object"!=typeof e.dependencyTargets[n])throw TypeError(".sqlanvil.Table.dependencyTargets: object expected");t.dependencyTargets[n]=s.sqlanvil.Target.fromObject(e.dependencyTargets[n])}}switch(e.hermeticity){default:if("number"==typeof e.hermeticity){t.hermeticity=e.hermeticity;break}break;case"UNKNOWN":case 0:t.hermeticity=0;break;case"HERMETIC":case 1:t.hermeticity=1;break;case"NON_HERMETIC":case 2:t.hermeticity=2}if(null!=e.disabled&&(t.disabled=Boolean(e.disabled)),null!=e.type&&(t.type=String(e.type)),null!=e.query&&(t.query=String(e.query)),null!=e.protected&&(t.protected=Boolean(e.protected)),null!=e.materialized&&(t.materialized=Boolean(e.materialized)),null!=e.actionDescriptor){if("object"!=typeof e.actionDescriptor)throw TypeError(".sqlanvil.Table.actionDescriptor: object expected");t.actionDescriptor=s.sqlanvil.ActionDescriptor.fromObject(e.actionDescriptor)}if(e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.Table.tags: array expected");for(t.tags=[],n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}if(null!=e.where&&(t.where=String(e.where)),null!=e.incrementalQuery&&(t.incrementalQuery=String(e.incrementalQuery)),e.uniqueKey){if(!Array.isArray(e.uniqueKey))throw TypeError(".sqlanvil.Table.uniqueKey: array expected");for(t.uniqueKey=[],n=0;n<e.uniqueKey.length;++n)t.uniqueKey[n]=String(e.uniqueKey[n])}switch(e.onSchemaChange){default:if("number"==typeof e.onSchemaChange){t.onSchemaChange=e.onSchemaChange;break}break;case"IGNORE":case 0:t.onSchemaChange=0;break;case"FAIL":case 1:t.onSchemaChange=1;break;case"EXTEND":case 2:t.onSchemaChange=2;break;case"SYNCHRONIZE":case 3:t.onSchemaChange=3}if(e.preOps){if(!Array.isArray(e.preOps))throw TypeError(".sqlanvil.Table.preOps: array expected");for(t.preOps=[],n=0;n<e.preOps.length;++n)t.preOps[n]=String(e.preOps[n])}if(e.postOps){if(!Array.isArray(e.postOps))throw TypeError(".sqlanvil.Table.postOps: array expected");for(t.postOps=[],n=0;n<e.postOps.length;++n)t.postOps[n]=String(e.postOps[n])}if(e.incrementalPreOps){if(!Array.isArray(e.incrementalPreOps))throw TypeError(".sqlanvil.Table.incrementalPreOps: array expected");for(t.incrementalPreOps=[],n=0;n<e.incrementalPreOps.length;++n)t.incrementalPreOps[n]=String(e.incrementalPreOps[n])}if(e.incrementalPostOps){if(!Array.isArray(e.incrementalPostOps))throw TypeError(".sqlanvil.Table.incrementalPostOps: array expected");for(t.incrementalPostOps=[],n=0;n<e.incrementalPostOps.length;++n)t.incrementalPostOps[n]=String(e.incrementalPostOps[n])}if(null!=e.jitCode&&(t.jitCode=String(e.jitCode)),null!=e.bigquery){if("object"!=typeof e.bigquery)throw TypeError(".sqlanvil.Table.bigquery: object expected");t.bigquery=s.sqlanvil.BigQueryOptions.fromObject(e.bigquery)}if(null!=e.postgres){if("object"!=typeof e.postgres)throw TypeError(".sqlanvil.Table.postgres: object expected");t.postgres=s.sqlanvil.PostgresOptions.fromObject(e.postgres)}if(null!=e.supabase){if("object"!=typeof e.supabase)throw TypeError(".sqlanvil.Table.supabase: object expected");t.supabase=s.sqlanvil.SupabaseOptions.fromObject(e.supabase)}if(null!=e.mysql){if("object"!=typeof e.mysql)throw TypeError(".sqlanvil.Table.mysql: object expected");t.mysql=s.sqlanvil.MysqlOptions.fromObject(e.mysql)}return null!=e.fileName&&(t.fileName=String(e.fileName)),t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.preOps=[],n.postOps=[],n.tags=[],n.dependencyTargets=[],n.incrementalPreOps=[],n.incrementalPostOps=[],n.uniqueKey=[]),t.defaults&&(n.type="",n.target=null,n.query="",n.disabled=!1,n.where="",n.protected=!1,n.fileName="",n.bigquery=null,n.actionDescriptor=null,n.incrementalQuery="",n.hermeticity=t.enums===String?"UNKNOWN":0,n.canonicalTarget=null,n.materialized=!1,n.enumType=t.enums===String?"UNKNOWN_TYPE":0,n.onSchemaChange=t.enums===String?"IGNORE":0,n.jitCode="",n.postgres=null,n.supabase=null,n.mysql=null),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.target&&e.hasOwnProperty("target")&&(n.target=s.sqlanvil.Target.toObject(e.target,t)),null!=e.query&&e.hasOwnProperty("query")&&(n.query=e.query),null!=e.disabled&&e.hasOwnProperty("disabled")&&(n.disabled=e.disabled),null!=e.where&&e.hasOwnProperty("where")&&(n.where=e.where),null!=e.protected&&e.hasOwnProperty("protected")&&(n.protected=e.protected),e.preOps&&e.preOps.length){n.preOps=[];for(var r=0;r<e.preOps.length;++r)n.preOps[r]=e.preOps[r]}if(e.postOps&&e.postOps.length)for(n.postOps=[],r=0;r<e.postOps.length;++r)n.postOps[r]=e.postOps[r];if(null!=e.fileName&&e.hasOwnProperty("fileName")&&(n.fileName=e.fileName),null!=e.bigquery&&e.hasOwnProperty("bigquery")&&(n.bigquery=s.sqlanvil.BigQueryOptions.toObject(e.bigquery,t)),e.tags&&e.tags.length)for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=e.tags[r];if(null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(n.actionDescriptor=s.sqlanvil.ActionDescriptor.toObject(e.actionDescriptor,t)),null!=e.incrementalQuery&&e.hasOwnProperty("incrementalQuery")&&(n.incrementalQuery=e.incrementalQuery),e.dependencyTargets&&e.dependencyTargets.length)for(n.dependencyTargets=[],r=0;r<e.dependencyTargets.length;++r)n.dependencyTargets[r]=s.sqlanvil.Target.toObject(e.dependencyTargets[r],t);if(e.incrementalPreOps&&e.incrementalPreOps.length)for(n.incrementalPreOps=[],r=0;r<e.incrementalPreOps.length;++r)n.incrementalPreOps[r]=e.incrementalPreOps[r];if(e.incrementalPostOps&&e.incrementalPostOps.length)for(n.incrementalPostOps=[],r=0;r<e.incrementalPostOps.length;++r)n.incrementalPostOps[r]=e.incrementalPostOps[r];if(e.uniqueKey&&e.uniqueKey.length)for(n.uniqueKey=[],r=0;r<e.uniqueKey.length;++r)n.uniqueKey[r]=e.uniqueKey[r];return null!=e.hermeticity&&e.hasOwnProperty("hermeticity")&&(n.hermeticity=t.enums===String?void 0===s.sqlanvil.ActionHermeticity[e.hermeticity]?e.hermeticity:s.sqlanvil.ActionHermeticity[e.hermeticity]:e.hermeticity),null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(n.canonicalTarget=s.sqlanvil.Target.toObject(e.canonicalTarget,t)),null!=e.materialized&&e.hasOwnProperty("materialized")&&(n.materialized=e.materialized),null!=e.enumType&&e.hasOwnProperty("enumType")&&(n.enumType=t.enums===String?void 0===s.sqlanvil.TableType[e.enumType]?e.enumType:s.sqlanvil.TableType[e.enumType]:e.enumType),null!=e.onSchemaChange&&e.hasOwnProperty("onSchemaChange")&&(n.onSchemaChange=t.enums===String?void 0===s.sqlanvil.OnSchemaChange[e.onSchemaChange]?e.onSchemaChange:s.sqlanvil.OnSchemaChange[e.onSchemaChange]:e.onSchemaChange),null!=e.jitCode&&e.hasOwnProperty("jitCode")&&(n.jitCode=e.jitCode),null!=e.postgres&&e.hasOwnProperty("postgres")&&(n.postgres=s.sqlanvil.PostgresOptions.toObject(e.postgres,t)),null!=e.supabase&&e.hasOwnProperty("supabase")&&(n.supabase=s.sqlanvil.SupabaseOptions.toObject(e.supabase,t)),null!=e.mysql&&e.hasOwnProperty("mysql")&&(n.mysql=s.sqlanvil.MysqlOptions.toObject(e.mysql,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.Table"},t}(),r.Operation=function(){function t(e){if(this.dependencyTargets=[],this.queries=[],this.tags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.target=null,t.prototype.canonicalTarget=null,t.prototype.dependencyTargets=a.emptyArray,t.prototype.hermeticity=0,t.prototype.disabled=!1,t.prototype.queries=a.emptyArray,t.prototype.jitCode="",t.prototype.hasOutput=!1,t.prototype.tags=a.emptyArray,t.prototype.actionDescriptor=null,t.prototype.fileName="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&s.sqlanvil.Target.encode(e.target,t.uint32(26).fork()).ldelim(),null!=e.queries&&e.queries.length)for(var n=0;n<e.queries.length;++n)t.uint32(50).string(e.queries[n]);if(null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(58).string(e.fileName),null!=e.hasOutput&&Object.hasOwnProperty.call(e,"hasOutput")&&t.uint32(64).bool(e.hasOutput),null!=e.tags&&e.tags.length)for(n=0;n<e.tags.length;++n)t.uint32(74).string(e.tags[n]);if(null!=e.actionDescriptor&&Object.hasOwnProperty.call(e,"actionDescriptor")&&s.sqlanvil.ActionDescriptor.encode(e.actionDescriptor,t.uint32(82).fork()).ldelim(),null!=e.dependencyTargets&&e.dependencyTargets.length)for(n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.Target.encode(e.dependencyTargets[n],t.uint32(90).fork()).ldelim();return null!=e.hermeticity&&Object.hasOwnProperty.call(e,"hermeticity")&&t.uint32(96).int32(e.hermeticity),null!=e.canonicalTarget&&Object.hasOwnProperty.call(e,"canonicalTarget")&&s.sqlanvil.Target.encode(e.canonicalTarget,t.uint32(106).fork()).ldelim(),null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(112).bool(e.disabled),null!=e.jitCode&&Object.hasOwnProperty.call(e,"jitCode")&&t.uint32(122).string(e.jitCode),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.Operation;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 3:o.target=s.sqlanvil.Target.decode(e,e.uint32());break;case 13:o.canonicalTarget=s.sqlanvil.Target.decode(e,e.uint32());break;case 11:o.dependencyTargets&&o.dependencyTargets.length||(o.dependencyTargets=[]),o.dependencyTargets.push(s.sqlanvil.Target.decode(e,e.uint32()));break;case 12:o.hermeticity=e.int32();break;case 14:o.disabled=e.bool();break;case 6:o.queries&&o.queries.length||(o.queries=[]),o.queries.push(e.string());break;case 15:o.jitCode=e.string();break;case 8:o.hasOutput=e.bool();break;case 9:o.tags&&o.tags.length||(o.tags=[]),o.tags.push(e.string());break;case 10:o.actionDescriptor=s.sqlanvil.ActionDescriptor.decode(e,e.uint32());break;case 7:o.fileName=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.target&&e.hasOwnProperty("target")&&(n=s.sqlanvil.Target.verify(e.target)))return"target."+n;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(n=s.sqlanvil.Target.verify(e.canonicalTarget)))return"canonicalTarget."+n;if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var t=0;t<e.dependencyTargets.length;++t){var n;if(n=s.sqlanvil.Target.verify(e.dependencyTargets[t]))return"dependencyTargets."+n}}if(null!=e.hermeticity&&e.hasOwnProperty("hermeticity"))switch(e.hermeticity){default:return"hermeticity: enum value expected";case 0:case 1:case 2:}if(null!=e.disabled&&e.hasOwnProperty("disabled")&&"boolean"!=typeof e.disabled)return"disabled: boolean expected";if(null!=e.queries&&e.hasOwnProperty("queries")){if(!Array.isArray(e.queries))return"queries: array expected";for(t=0;t<e.queries.length;++t)if(!a.isString(e.queries[t]))return"queries: string[] expected"}if(null!=e.jitCode&&e.hasOwnProperty("jitCode")&&!a.isString(e.jitCode))return"jitCode: string expected";if(null!=e.hasOutput&&e.hasOwnProperty("hasOutput")&&"boolean"!=typeof e.hasOutput)return"hasOutput: boolean expected";if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!a.isString(e.tags[t]))return"tags: string[] expected"}return null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(n=s.sqlanvil.ActionDescriptor.verify(e.actionDescriptor))?"actionDescriptor."+n:null!=e.fileName&&e.hasOwnProperty("fileName")&&!a.isString(e.fileName)?"fileName: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.Operation)return e;var t=new s.sqlanvil.Operation;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.Operation.target: object expected");t.target=s.sqlanvil.Target.fromObject(e.target)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".sqlanvil.Operation.canonicalTarget: object expected");t.canonicalTarget=s.sqlanvil.Target.fromObject(e.canonicalTarget)}if(e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.Operation.dependencyTargets: array expected");t.dependencyTargets=[];for(var n=0;n<e.dependencyTargets.length;++n){if("object"!=typeof e.dependencyTargets[n])throw TypeError(".sqlanvil.Operation.dependencyTargets: object expected");t.dependencyTargets[n]=s.sqlanvil.Target.fromObject(e.dependencyTargets[n])}}switch(e.hermeticity){default:if("number"==typeof e.hermeticity){t.hermeticity=e.hermeticity;break}break;case"UNKNOWN":case 0:t.hermeticity=0;break;case"HERMETIC":case 1:t.hermeticity=1;break;case"NON_HERMETIC":case 2:t.hermeticity=2}if(null!=e.disabled&&(t.disabled=Boolean(e.disabled)),e.queries){if(!Array.isArray(e.queries))throw TypeError(".sqlanvil.Operation.queries: array expected");for(t.queries=[],n=0;n<e.queries.length;++n)t.queries[n]=String(e.queries[n])}if(null!=e.jitCode&&(t.jitCode=String(e.jitCode)),null!=e.hasOutput&&(t.hasOutput=Boolean(e.hasOutput)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.Operation.tags: array expected");for(t.tags=[],n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}if(null!=e.actionDescriptor){if("object"!=typeof e.actionDescriptor)throw TypeError(".sqlanvil.Operation.actionDescriptor: object expected");t.actionDescriptor=s.sqlanvil.ActionDescriptor.fromObject(e.actionDescriptor)}return null!=e.fileName&&(t.fileName=String(e.fileName)),t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.queries=[],n.tags=[],n.dependencyTargets=[]),t.defaults&&(n.target=null,n.fileName="",n.hasOutput=!1,n.actionDescriptor=null,n.hermeticity=t.enums===String?"UNKNOWN":0,n.canonicalTarget=null,n.disabled=!1,n.jitCode=""),null!=e.target&&e.hasOwnProperty("target")&&(n.target=s.sqlanvil.Target.toObject(e.target,t)),e.queries&&e.queries.length){n.queries=[];for(var r=0;r<e.queries.length;++r)n.queries[r]=e.queries[r]}if(null!=e.fileName&&e.hasOwnProperty("fileName")&&(n.fileName=e.fileName),null!=e.hasOutput&&e.hasOwnProperty("hasOutput")&&(n.hasOutput=e.hasOutput),e.tags&&e.tags.length)for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=e.tags[r];if(null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(n.actionDescriptor=s.sqlanvil.ActionDescriptor.toObject(e.actionDescriptor,t)),e.dependencyTargets&&e.dependencyTargets.length)for(n.dependencyTargets=[],r=0;r<e.dependencyTargets.length;++r)n.dependencyTargets[r]=s.sqlanvil.Target.toObject(e.dependencyTargets[r],t);return null!=e.hermeticity&&e.hasOwnProperty("hermeticity")&&(n.hermeticity=t.enums===String?void 0===s.sqlanvil.ActionHermeticity[e.hermeticity]?e.hermeticity:s.sqlanvil.ActionHermeticity[e.hermeticity]:e.hermeticity),null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(n.canonicalTarget=s.sqlanvil.Target.toObject(e.canonicalTarget,t)),null!=e.disabled&&e.hasOwnProperty("disabled")&&(n.disabled=e.disabled),null!=e.jitCode&&e.hasOwnProperty("jitCode")&&(n.jitCode=e.jitCode),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.Operation"},t}(),r.Assertion=function(){function t(e){if(this.dependencyTargets=[],this.tags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.target=null,t.prototype.canonicalTarget=null,t.prototype.dependencyTargets=a.emptyArray,t.prototype.hermeticity=0,t.prototype.disabled=!1,t.prototype.query="",t.prototype.tags=a.emptyArray,t.prototype.actionDescriptor=null,t.prototype.parentAction=null,t.prototype.jitCode="",t.prototype.fileName="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.query&&Object.hasOwnProperty.call(e,"query")&&t.uint32(26).string(e.query),null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(58).string(e.fileName),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&s.sqlanvil.Target.encode(e.target,t.uint32(66).fork()).ldelim(),null!=e.tags&&e.tags.length)for(var n=0;n<e.tags.length;++n)t.uint32(74).string(e.tags[n]);if(null!=e.actionDescriptor&&Object.hasOwnProperty.call(e,"actionDescriptor")&&s.sqlanvil.ActionDescriptor.encode(e.actionDescriptor,t.uint32(82).fork()).ldelim(),null!=e.dependencyTargets&&e.dependencyTargets.length)for(n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.Target.encode(e.dependencyTargets[n],t.uint32(90).fork()).ldelim();return null!=e.hermeticity&&Object.hasOwnProperty.call(e,"hermeticity")&&t.uint32(96).int32(e.hermeticity),null!=e.canonicalTarget&&Object.hasOwnProperty.call(e,"canonicalTarget")&&s.sqlanvil.Target.encode(e.canonicalTarget,t.uint32(106).fork()).ldelim(),null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(112).bool(e.disabled),null!=e.parentAction&&Object.hasOwnProperty.call(e,"parentAction")&&s.sqlanvil.Target.encode(e.parentAction,t.uint32(122).fork()).ldelim(),null!=e.jitCode&&Object.hasOwnProperty.call(e,"jitCode")&&t.uint32(130).string(e.jitCode),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.Assertion;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 8:o.target=s.sqlanvil.Target.decode(e,e.uint32());break;case 13:o.canonicalTarget=s.sqlanvil.Target.decode(e,e.uint32());break;case 11:o.dependencyTargets&&o.dependencyTargets.length||(o.dependencyTargets=[]),o.dependencyTargets.push(s.sqlanvil.Target.decode(e,e.uint32()));break;case 12:o.hermeticity=e.int32();break;case 14:o.disabled=e.bool();break;case 3:o.query=e.string();break;case 9:o.tags&&o.tags.length||(o.tags=[]),o.tags.push(e.string());break;case 10:o.actionDescriptor=s.sqlanvil.ActionDescriptor.decode(e,e.uint32());break;case 15:o.parentAction=s.sqlanvil.Target.decode(e,e.uint32());break;case 16:o.jitCode=e.string();break;case 7:o.fileName=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.target&&e.hasOwnProperty("target")&&(n=s.sqlanvil.Target.verify(e.target)))return"target."+n;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(n=s.sqlanvil.Target.verify(e.canonicalTarget)))return"canonicalTarget."+n;if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var t=0;t<e.dependencyTargets.length;++t){var n;if(n=s.sqlanvil.Target.verify(e.dependencyTargets[t]))return"dependencyTargets."+n}}if(null!=e.hermeticity&&e.hasOwnProperty("hermeticity"))switch(e.hermeticity){default:return"hermeticity: enum value expected";case 0:case 1:case 2:}if(null!=e.disabled&&e.hasOwnProperty("disabled")&&"boolean"!=typeof e.disabled)return"disabled: boolean expected";if(null!=e.query&&e.hasOwnProperty("query")&&!a.isString(e.query))return"query: string expected";if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!a.isString(e.tags[t]))return"tags: string[] expected"}return null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(n=s.sqlanvil.ActionDescriptor.verify(e.actionDescriptor))?"actionDescriptor."+n:null!=e.parentAction&&e.hasOwnProperty("parentAction")&&(n=s.sqlanvil.Target.verify(e.parentAction))?"parentAction."+n:null!=e.jitCode&&e.hasOwnProperty("jitCode")&&!a.isString(e.jitCode)?"jitCode: string expected":null!=e.fileName&&e.hasOwnProperty("fileName")&&!a.isString(e.fileName)?"fileName: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.Assertion)return e;var t=new s.sqlanvil.Assertion;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.Assertion.target: object expected");t.target=s.sqlanvil.Target.fromObject(e.target)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".sqlanvil.Assertion.canonicalTarget: object expected");t.canonicalTarget=s.sqlanvil.Target.fromObject(e.canonicalTarget)}if(e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.Assertion.dependencyTargets: array expected");t.dependencyTargets=[];for(var n=0;n<e.dependencyTargets.length;++n){if("object"!=typeof e.dependencyTargets[n])throw TypeError(".sqlanvil.Assertion.dependencyTargets: object expected");t.dependencyTargets[n]=s.sqlanvil.Target.fromObject(e.dependencyTargets[n])}}switch(e.hermeticity){default:if("number"==typeof e.hermeticity){t.hermeticity=e.hermeticity;break}break;case"UNKNOWN":case 0:t.hermeticity=0;break;case"HERMETIC":case 1:t.hermeticity=1;break;case"NON_HERMETIC":case 2:t.hermeticity=2}if(null!=e.disabled&&(t.disabled=Boolean(e.disabled)),null!=e.query&&(t.query=String(e.query)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.Assertion.tags: array expected");for(t.tags=[],n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}if(null!=e.actionDescriptor){if("object"!=typeof e.actionDescriptor)throw TypeError(".sqlanvil.Assertion.actionDescriptor: object expected");t.actionDescriptor=s.sqlanvil.ActionDescriptor.fromObject(e.actionDescriptor)}if(null!=e.parentAction){if("object"!=typeof e.parentAction)throw TypeError(".sqlanvil.Assertion.parentAction: object expected");t.parentAction=s.sqlanvil.Target.fromObject(e.parentAction)}return null!=e.jitCode&&(t.jitCode=String(e.jitCode)),null!=e.fileName&&(t.fileName=String(e.fileName)),t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.tags=[],n.dependencyTargets=[]),t.defaults&&(n.query="",n.fileName="",n.target=null,n.actionDescriptor=null,n.hermeticity=t.enums===String?"UNKNOWN":0,n.canonicalTarget=null,n.disabled=!1,n.parentAction=null,n.jitCode=""),null!=e.query&&e.hasOwnProperty("query")&&(n.query=e.query),null!=e.fileName&&e.hasOwnProperty("fileName")&&(n.fileName=e.fileName),null!=e.target&&e.hasOwnProperty("target")&&(n.target=s.sqlanvil.Target.toObject(e.target,t)),e.tags&&e.tags.length){n.tags=[];for(var r=0;r<e.tags.length;++r)n.tags[r]=e.tags[r]}if(null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(n.actionDescriptor=s.sqlanvil.ActionDescriptor.toObject(e.actionDescriptor,t)),e.dependencyTargets&&e.dependencyTargets.length)for(n.dependencyTargets=[],r=0;r<e.dependencyTargets.length;++r)n.dependencyTargets[r]=s.sqlanvil.Target.toObject(e.dependencyTargets[r],t);return null!=e.hermeticity&&e.hasOwnProperty("hermeticity")&&(n.hermeticity=t.enums===String?void 0===s.sqlanvil.ActionHermeticity[e.hermeticity]?e.hermeticity:s.sqlanvil.ActionHermeticity[e.hermeticity]:e.hermeticity),null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(n.canonicalTarget=s.sqlanvil.Target.toObject(e.canonicalTarget,t)),null!=e.disabled&&e.hasOwnProperty("disabled")&&(n.disabled=e.disabled),null!=e.parentAction&&e.hasOwnProperty("parentAction")&&(n.parentAction=s.sqlanvil.Target.toObject(e.parentAction,t)),null!=e.jitCode&&e.hasOwnProperty("jitCode")&&(n.jitCode=e.jitCode),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.Assertion"},t}(),r.ActionHermeticity=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN"]=0,t[e[1]="HERMETIC"]=1,t[e[2]="NON_HERMETIC"]=2,t}(),r.Declaration=function(){function t(e){if(this.tags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.target=null,t.prototype.canonicalTarget=null,t.prototype.actionDescriptor=null,t.prototype.fileName="",t.prototype.tags=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&s.sqlanvil.Target.encode(e.target,t.uint32(18).fork()).ldelim(),null!=e.actionDescriptor&&Object.hasOwnProperty.call(e,"actionDescriptor")&&s.sqlanvil.ActionDescriptor.encode(e.actionDescriptor,t.uint32(26).fork()).ldelim(),null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(34).string(e.fileName),null!=e.canonicalTarget&&Object.hasOwnProperty.call(e,"canonicalTarget")&&s.sqlanvil.Target.encode(e.canonicalTarget,t.uint32(42).fork()).ldelim(),null!=e.tags&&e.tags.length)for(var n=0;n<e.tags.length;++n)t.uint32(50).string(e.tags[n]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.Declaration;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 2:o.target=s.sqlanvil.Target.decode(e,e.uint32());break;case 5:o.canonicalTarget=s.sqlanvil.Target.decode(e,e.uint32());break;case 3:o.actionDescriptor=s.sqlanvil.ActionDescriptor.decode(e,e.uint32());break;case 4:o.fileName=e.string();break;case 6:o.tags&&o.tags.length||(o.tags=[]),o.tags.push(e.string());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t;if(null!=e.target&&e.hasOwnProperty("target")&&(t=s.sqlanvil.Target.verify(e.target)))return"target."+t;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(t=s.sqlanvil.Target.verify(e.canonicalTarget)))return"canonicalTarget."+t;if(null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(t=s.sqlanvil.ActionDescriptor.verify(e.actionDescriptor)))return"actionDescriptor."+t;if(null!=e.fileName&&e.hasOwnProperty("fileName")&&!a.isString(e.fileName))return"fileName: string expected";if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(var n=0;n<e.tags.length;++n)if(!a.isString(e.tags[n]))return"tags: string[] expected"}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.Declaration)return e;var t=new s.sqlanvil.Declaration;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.Declaration.target: object expected");t.target=s.sqlanvil.Target.fromObject(e.target)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".sqlanvil.Declaration.canonicalTarget: object expected");t.canonicalTarget=s.sqlanvil.Target.fromObject(e.canonicalTarget)}if(null!=e.actionDescriptor){if("object"!=typeof e.actionDescriptor)throw TypeError(".sqlanvil.Declaration.actionDescriptor: object expected");t.actionDescriptor=s.sqlanvil.ActionDescriptor.fromObject(e.actionDescriptor)}if(null!=e.fileName&&(t.fileName=String(e.fileName)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.Declaration.tags: array expected");t.tags=[];for(var n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.tags=[]),t.defaults&&(n.target=null,n.actionDescriptor=null,n.fileName="",n.canonicalTarget=null),null!=e.target&&e.hasOwnProperty("target")&&(n.target=s.sqlanvil.Target.toObject(e.target,t)),null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(n.actionDescriptor=s.sqlanvil.ActionDescriptor.toObject(e.actionDescriptor,t)),null!=e.fileName&&e.hasOwnProperty("fileName")&&(n.fileName=e.fileName),null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(n.canonicalTarget=s.sqlanvil.Target.toObject(e.canonicalTarget,t)),e.tags&&e.tags.length){n.tags=[];for(var r=0;r<e.tags.length;++r)n.tags[r]=e.tags[r]}return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.Declaration"},t}(),r.Test=function(){function t(e){if(this.tags=[],this.dependencyTargets=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.testQuery="",t.prototype.expectedOutputQuery="",t.prototype.jitCode="",t.prototype.fileName="",t.prototype.disabled=!1,t.prototype.tags=a.emptyArray,t.prototype.target=null,t.prototype.canonicalTarget=null,t.prototype.dependencyTargets=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.testQuery&&Object.hasOwnProperty.call(e,"testQuery")&&t.uint32(18).string(e.testQuery),null!=e.expectedOutputQuery&&Object.hasOwnProperty.call(e,"expectedOutputQuery")&&t.uint32(26).string(e.expectedOutputQuery),null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(34).string(e.fileName),null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(40).bool(e.disabled),null!=e.tags&&e.tags.length)for(var n=0;n<e.tags.length;++n)t.uint32(50).string(e.tags[n]);if(null!=e.target&&Object.hasOwnProperty.call(e,"target")&&s.sqlanvil.Target.encode(e.target,t.uint32(58).fork()).ldelim(),null!=e.canonicalTarget&&Object.hasOwnProperty.call(e,"canonicalTarget")&&s.sqlanvil.Target.encode(e.canonicalTarget,t.uint32(66).fork()).ldelim(),null!=e.dependencyTargets&&e.dependencyTargets.length)for(n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.Target.encode(e.dependencyTargets[n],t.uint32(74).fork()).ldelim();return null!=e.jitCode&&Object.hasOwnProperty.call(e,"jitCode")&&t.uint32(82).string(e.jitCode),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.Test;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.name=e.string();break;case 2:o.testQuery=e.string();break;case 3:o.expectedOutputQuery=e.string();break;case 10:o.jitCode=e.string();break;case 4:o.fileName=e.string();break;case 5:o.disabled=e.bool();break;case 6:o.tags&&o.tags.length||(o.tags=[]),o.tags.push(e.string());break;case 7:o.target=s.sqlanvil.Target.decode(e,e.uint32());break;case 8:o.canonicalTarget=s.sqlanvil.Target.decode(e,e.uint32());break;case 9:o.dependencyTargets&&o.dependencyTargets.length||(o.dependencyTargets=[]),o.dependencyTargets.push(s.sqlanvil.Target.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.testQuery&&e.hasOwnProperty("testQuery")&&!a.isString(e.testQuery))return"testQuery: string expected";if(null!=e.expectedOutputQuery&&e.hasOwnProperty("expectedOutputQuery")&&!a.isString(e.expectedOutputQuery))return"expectedOutputQuery: string expected";if(null!=e.jitCode&&e.hasOwnProperty("jitCode")&&!a.isString(e.jitCode))return"jitCode: string expected";if(null!=e.fileName&&e.hasOwnProperty("fileName")&&!a.isString(e.fileName))return"fileName: string expected";if(null!=e.disabled&&e.hasOwnProperty("disabled")&&"boolean"!=typeof e.disabled)return"disabled: boolean expected";if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(var t=0;t<e.tags.length;++t)if(!a.isString(e.tags[t]))return"tags: string[] expected"}if(null!=e.target&&e.hasOwnProperty("target")&&(n=s.sqlanvil.Target.verify(e.target)))return"target."+n;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(n=s.sqlanvil.Target.verify(e.canonicalTarget)))return"canonicalTarget."+n;if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(t=0;t<e.dependencyTargets.length;++t){var n;if(n=s.sqlanvil.Target.verify(e.dependencyTargets[t]))return"dependencyTargets."+n}}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.Test)return e;var t=new s.sqlanvil.Test;if(null!=e.name&&(t.name=String(e.name)),null!=e.testQuery&&(t.testQuery=String(e.testQuery)),null!=e.expectedOutputQuery&&(t.expectedOutputQuery=String(e.expectedOutputQuery)),null!=e.jitCode&&(t.jitCode=String(e.jitCode)),null!=e.fileName&&(t.fileName=String(e.fileName)),null!=e.disabled&&(t.disabled=Boolean(e.disabled)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.Test.tags: array expected");t.tags=[];for(var n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.Test.target: object expected");t.target=s.sqlanvil.Target.fromObject(e.target)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".sqlanvil.Test.canonicalTarget: object expected");t.canonicalTarget=s.sqlanvil.Target.fromObject(e.canonicalTarget)}if(e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.Test.dependencyTargets: array expected");for(t.dependencyTargets=[],n=0;n<e.dependencyTargets.length;++n){if("object"!=typeof e.dependencyTargets[n])throw TypeError(".sqlanvil.Test.dependencyTargets: object expected");t.dependencyTargets[n]=s.sqlanvil.Target.fromObject(e.dependencyTargets[n])}}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.tags=[],n.dependencyTargets=[]),t.defaults&&(n.name="",n.testQuery="",n.expectedOutputQuery="",n.fileName="",n.disabled=!1,n.target=null,n.canonicalTarget=null,n.jitCode=""),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.testQuery&&e.hasOwnProperty("testQuery")&&(n.testQuery=e.testQuery),null!=e.expectedOutputQuery&&e.hasOwnProperty("expectedOutputQuery")&&(n.expectedOutputQuery=e.expectedOutputQuery),null!=e.fileName&&e.hasOwnProperty("fileName")&&(n.fileName=e.fileName),null!=e.disabled&&e.hasOwnProperty("disabled")&&(n.disabled=e.disabled),e.tags&&e.tags.length){n.tags=[];for(var r=0;r<e.tags.length;++r)n.tags[r]=e.tags[r]}if(null!=e.target&&e.hasOwnProperty("target")&&(n.target=s.sqlanvil.Target.toObject(e.target,t)),null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(n.canonicalTarget=s.sqlanvil.Target.toObject(e.canonicalTarget,t)),e.dependencyTargets&&e.dependencyTargets.length)for(n.dependencyTargets=[],r=0;r<e.dependencyTargets.length;++r)n.dependencyTargets[r]=s.sqlanvil.Target.toObject(e.dependencyTargets[r],t);return null!=e.jitCode&&e.hasOwnProperty("jitCode")&&(n.jitCode=e.jitCode),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.Test"},t}(),r.Notebook=function(){function t(e){if(this.tags=[],this.dependencyTargets=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.target=null,t.prototype.canonicalTarget=null,t.prototype.tags=a.emptyArray,t.prototype.dependencyTargets=a.emptyArray,t.prototype.fileName="",t.prototype.disabled=!1,t.prototype.notebookContents="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&s.sqlanvil.Target.encode(e.target,t.uint32(10).fork()).ldelim(),null!=e.canonicalTarget&&Object.hasOwnProperty.call(e,"canonicalTarget")&&s.sqlanvil.Target.encode(e.canonicalTarget,t.uint32(18).fork()).ldelim(),null!=e.tags&&e.tags.length)for(var n=0;n<e.tags.length;++n)t.uint32(26).string(e.tags[n]);if(null!=e.dependencyTargets&&e.dependencyTargets.length)for(n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.Target.encode(e.dependencyTargets[n],t.uint32(34).fork()).ldelim();return null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(42).string(e.fileName),null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(48).bool(e.disabled),null!=e.notebookContents&&Object.hasOwnProperty.call(e,"notebookContents")&&t.uint32(58).string(e.notebookContents),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.Notebook;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.target=s.sqlanvil.Target.decode(e,e.uint32());break;case 2:o.canonicalTarget=s.sqlanvil.Target.decode(e,e.uint32());break;case 3:o.tags&&o.tags.length||(o.tags=[]),o.tags.push(e.string());break;case 4:o.dependencyTargets&&o.dependencyTargets.length||(o.dependencyTargets=[]),o.dependencyTargets.push(s.sqlanvil.Target.decode(e,e.uint32()));break;case 5:o.fileName=e.string();break;case 6:o.disabled=e.bool();break;case 7:o.notebookContents=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.target&&e.hasOwnProperty("target")&&(n=s.sqlanvil.Target.verify(e.target)))return"target."+n;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(n=s.sqlanvil.Target.verify(e.canonicalTarget)))return"canonicalTarget."+n;if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(var t=0;t<e.tags.length;++t)if(!a.isString(e.tags[t]))return"tags: string[] expected"}if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(t=0;t<e.dependencyTargets.length;++t){var n;if(n=s.sqlanvil.Target.verify(e.dependencyTargets[t]))return"dependencyTargets."+n}}return null!=e.fileName&&e.hasOwnProperty("fileName")&&!a.isString(e.fileName)?"fileName: string expected":null!=e.disabled&&e.hasOwnProperty("disabled")&&"boolean"!=typeof e.disabled?"disabled: boolean expected":null!=e.notebookContents&&e.hasOwnProperty("notebookContents")&&!a.isString(e.notebookContents)?"notebookContents: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.Notebook)return e;var t=new s.sqlanvil.Notebook;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.Notebook.target: object expected");t.target=s.sqlanvil.Target.fromObject(e.target)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".sqlanvil.Notebook.canonicalTarget: object expected");t.canonicalTarget=s.sqlanvil.Target.fromObject(e.canonicalTarget)}if(e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.Notebook.tags: array expected");t.tags=[];for(var n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}if(e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.Notebook.dependencyTargets: array expected");for(t.dependencyTargets=[],n=0;n<e.dependencyTargets.length;++n){if("object"!=typeof e.dependencyTargets[n])throw TypeError(".sqlanvil.Notebook.dependencyTargets: object expected");t.dependencyTargets[n]=s.sqlanvil.Target.fromObject(e.dependencyTargets[n])}}return null!=e.fileName&&(t.fileName=String(e.fileName)),null!=e.disabled&&(t.disabled=Boolean(e.disabled)),null!=e.notebookContents&&(t.notebookContents=String(e.notebookContents)),t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.tags=[],n.dependencyTargets=[]),t.defaults&&(n.target=null,n.canonicalTarget=null,n.fileName="",n.disabled=!1,n.notebookContents=""),null!=e.target&&e.hasOwnProperty("target")&&(n.target=s.sqlanvil.Target.toObject(e.target,t)),null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(n.canonicalTarget=s.sqlanvil.Target.toObject(e.canonicalTarget,t)),e.tags&&e.tags.length){n.tags=[];for(var r=0;r<e.tags.length;++r)n.tags[r]=e.tags[r]}if(e.dependencyTargets&&e.dependencyTargets.length)for(n.dependencyTargets=[],r=0;r<e.dependencyTargets.length;++r)n.dependencyTargets[r]=s.sqlanvil.Target.toObject(e.dependencyTargets[r],t);return null!=e.fileName&&e.hasOwnProperty("fileName")&&(n.fileName=e.fileName),null!=e.disabled&&e.hasOwnProperty("disabled")&&(n.disabled=e.disabled),null!=e.notebookContents&&e.hasOwnProperty("notebookContents")&&(n.notebookContents=e.notebookContents),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.Notebook"},t}(),r.RepositorySnapshotDestination=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.repositorySnapshotUri="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.repositorySnapshotUri&&Object.hasOwnProperty.call(e,"repositorySnapshotUri")&&t.uint32(10).string(e.repositorySnapshotUri),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.RepositorySnapshotDestination;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?o.repositorySnapshotUri=e.string():e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.repositorySnapshotUri&&e.hasOwnProperty("repositorySnapshotUri")&&!a.isString(e.repositorySnapshotUri)?"repositorySnapshotUri: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.RepositorySnapshotDestination)return e;var t=new s.sqlanvil.RepositorySnapshotDestination;return null!=e.repositorySnapshotUri&&(t.repositorySnapshotUri=String(e.repositorySnapshotUri)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.repositorySnapshotUri=""),null!=e.repositorySnapshotUri&&e.hasOwnProperty("repositorySnapshotUri")&&(n.repositorySnapshotUri=e.repositorySnapshotUri),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.RepositorySnapshotDestination"},t}(),r.NotebookRuntimeOptions=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var n;return t.prototype.outputBucket=null,t.prototype.runtimeTemplateName="",t.prototype.repositorySnapshotDestination=null,Object.defineProperty(t.prototype,"outputSink",{get:a.oneOfGetter(n=["outputBucket"]),set:a.oneOfSetter(n)}),Object.defineProperty(t.prototype,"repositorySnapshotStorage",{get:a.oneOfGetter(n=["repositorySnapshotDestination"]),set:a.oneOfSetter(n)}),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.outputBucket&&Object.hasOwnProperty.call(e,"outputBucket")&&t.uint32(10).string(e.outputBucket),null!=e.runtimeTemplateName&&Object.hasOwnProperty.call(e,"runtimeTemplateName")&&t.uint32(18).string(e.runtimeTemplateName),null!=e.repositorySnapshotDestination&&Object.hasOwnProperty.call(e,"repositorySnapshotDestination")&&s.sqlanvil.RepositorySnapshotDestination.encode(e.repositorySnapshotDestination,t.uint32(26).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.NotebookRuntimeOptions;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.outputBucket=e.string();break;case 2:o.runtimeTemplateName=e.string();break;case 3:o.repositorySnapshotDestination=s.sqlanvil.RepositorySnapshotDestination.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.outputBucket&&e.hasOwnProperty("outputBucket")&&(t.outputSink=1,!a.isString(e.outputBucket)))return"outputBucket: string expected";if(null!=e.runtimeTemplateName&&e.hasOwnProperty("runtimeTemplateName")&&!a.isString(e.runtimeTemplateName))return"runtimeTemplateName: string expected";if(null!=e.repositorySnapshotDestination&&e.hasOwnProperty("repositorySnapshotDestination")){t.repositorySnapshotStorage=1;var n=s.sqlanvil.RepositorySnapshotDestination.verify(e.repositorySnapshotDestination);if(n)return"repositorySnapshotDestination."+n}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.NotebookRuntimeOptions)return e;var t=new s.sqlanvil.NotebookRuntimeOptions;if(null!=e.outputBucket&&(t.outputBucket=String(e.outputBucket)),null!=e.runtimeTemplateName&&(t.runtimeTemplateName=String(e.runtimeTemplateName)),null!=e.repositorySnapshotDestination){if("object"!=typeof e.repositorySnapshotDestination)throw TypeError(".sqlanvil.NotebookRuntimeOptions.repositorySnapshotDestination: object expected");t.repositorySnapshotDestination=s.sqlanvil.RepositorySnapshotDestination.fromObject(e.repositorySnapshotDestination)}return t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.runtimeTemplateName=""),null!=e.outputBucket&&e.hasOwnProperty("outputBucket")&&(n.outputBucket=e.outputBucket,t.oneofs&&(n.outputSink="outputBucket")),null!=e.runtimeTemplateName&&e.hasOwnProperty("runtimeTemplateName")&&(n.runtimeTemplateName=e.runtimeTemplateName),null!=e.repositorySnapshotDestination&&e.hasOwnProperty("repositorySnapshotDestination")&&(n.repositorySnapshotDestination=s.sqlanvil.RepositorySnapshotDestination.toObject(e.repositorySnapshotDestination,t),t.oneofs&&(n.repositorySnapshotStorage="repositorySnapshotDestination")),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.NotebookRuntimeOptions"},t}(),r.DataPreparation=function(){function t(e){if(this.targets=[],this.canonicalTargets=[],this.tags=[],this.dependencyTargets=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var n;return t.prototype.target=null,t.prototype.canonicalTarget=null,t.prototype.targets=a.emptyArray,t.prototype.canonicalTargets=a.emptyArray,t.prototype.tags=a.emptyArray,t.prototype.dependencyTargets=a.emptyArray,t.prototype.fileName="",t.prototype.disabled=!1,t.prototype.dataPreparationYaml=null,t.prototype.query=null,t.prototype.errorTable=null,t.prototype.errorTableRetentionDays=0,t.prototype.load=null,Object.defineProperty(t.prototype,"definition",{get:a.oneOfGetter(n=["dataPreparationYaml","query"]),set:a.oneOfSetter(n)}),t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.targets&&e.targets.length)for(var n=0;n<e.targets.length;++n)s.sqlanvil.Target.encode(e.targets[n],t.uint32(10).fork()).ldelim();if(null!=e.canonicalTargets&&e.canonicalTargets.length)for(n=0;n<e.canonicalTargets.length;++n)s.sqlanvil.Target.encode(e.canonicalTargets[n],t.uint32(18).fork()).ldelim();if(null!=e.tags&&e.tags.length)for(n=0;n<e.tags.length;++n)t.uint32(26).string(e.tags[n]);if(null!=e.dependencyTargets&&e.dependencyTargets.length)for(n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.Target.encode(e.dependencyTargets[n],t.uint32(34).fork()).ldelim();return null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(42).string(e.fileName),null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(48).bool(e.disabled),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&s.sqlanvil.Target.encode(e.target,t.uint32(66).fork()).ldelim(),null!=e.canonicalTarget&&Object.hasOwnProperty.call(e,"canonicalTarget")&&s.sqlanvil.Target.encode(e.canonicalTarget,t.uint32(74).fork()).ldelim(),null!=e.dataPreparationYaml&&Object.hasOwnProperty.call(e,"dataPreparationYaml")&&t.uint32(90).string(e.dataPreparationYaml),null!=e.errorTable&&Object.hasOwnProperty.call(e,"errorTable")&&s.sqlanvil.Target.encode(e.errorTable,t.uint32(98).fork()).ldelim(),null!=e.errorTableRetentionDays&&Object.hasOwnProperty.call(e,"errorTableRetentionDays")&&t.uint32(104).int32(e.errorTableRetentionDays),null!=e.query&&Object.hasOwnProperty.call(e,"query")&&t.uint32(122).string(e.query),null!=e.load&&Object.hasOwnProperty.call(e,"load")&&s.sqlanvil.LoadConfiguration.encode(e.load,t.uint32(130).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.DataPreparation;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 8:o.target=s.sqlanvil.Target.decode(e,e.uint32());break;case 9:o.canonicalTarget=s.sqlanvil.Target.decode(e,e.uint32());break;case 1:o.targets&&o.targets.length||(o.targets=[]),o.targets.push(s.sqlanvil.Target.decode(e,e.uint32()));break;case 2:o.canonicalTargets&&o.canonicalTargets.length||(o.canonicalTargets=[]),o.canonicalTargets.push(s.sqlanvil.Target.decode(e,e.uint32()));break;case 3:o.tags&&o.tags.length||(o.tags=[]),o.tags.push(e.string());break;case 4:o.dependencyTargets&&o.dependencyTargets.length||(o.dependencyTargets=[]),o.dependencyTargets.push(s.sqlanvil.Target.decode(e,e.uint32()));break;case 5:o.fileName=e.string();break;case 6:o.disabled=e.bool();break;case 11:o.dataPreparationYaml=e.string();break;case 15:o.query=e.string();break;case 12:o.errorTable=s.sqlanvil.Target.decode(e,e.uint32());break;case 13:o.errorTableRetentionDays=e.int32();break;case 16:o.load=s.sqlanvil.LoadConfiguration.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.target&&e.hasOwnProperty("target")&&(r=s.sqlanvil.Target.verify(e.target)))return"target."+r;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(r=s.sqlanvil.Target.verify(e.canonicalTarget)))return"canonicalTarget."+r;if(null!=e.targets&&e.hasOwnProperty("targets")){if(!Array.isArray(e.targets))return"targets: array expected";for(var n=0;n<e.targets.length;++n)if(r=s.sqlanvil.Target.verify(e.targets[n]))return"targets."+r}if(null!=e.canonicalTargets&&e.hasOwnProperty("canonicalTargets")){if(!Array.isArray(e.canonicalTargets))return"canonicalTargets: array expected";for(n=0;n<e.canonicalTargets.length;++n)if(r=s.sqlanvil.Target.verify(e.canonicalTargets[n]))return"canonicalTargets."+r}if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(n=0;n<e.tags.length;++n)if(!a.isString(e.tags[n]))return"tags: string[] expected"}if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(n=0;n<e.dependencyTargets.length;++n){var r;if(r=s.sqlanvil.Target.verify(e.dependencyTargets[n]))return"dependencyTargets."+r}}if(null!=e.fileName&&e.hasOwnProperty("fileName")&&!a.isString(e.fileName))return"fileName: string expected";if(null!=e.disabled&&e.hasOwnProperty("disabled")&&"boolean"!=typeof e.disabled)return"disabled: boolean expected";if(null!=e.dataPreparationYaml&&e.hasOwnProperty("dataPreparationYaml")&&(t.definition=1,!a.isString(e.dataPreparationYaml)))return"dataPreparationYaml: string expected";if(null!=e.query&&e.hasOwnProperty("query")){if(1===t.definition)return"definition: multiple values";if(t.definition=1,!a.isString(e.query))return"query: string expected"}return null!=e.errorTable&&e.hasOwnProperty("errorTable")&&(r=s.sqlanvil.Target.verify(e.errorTable))?"errorTable."+r:null!=e.errorTableRetentionDays&&e.hasOwnProperty("errorTableRetentionDays")&&!a.isInteger(e.errorTableRetentionDays)?"errorTableRetentionDays: integer expected":null!=e.load&&e.hasOwnProperty("load")&&(r=s.sqlanvil.LoadConfiguration.verify(e.load))?"load."+r:null},t.fromObject=function(e){if(e instanceof s.sqlanvil.DataPreparation)return e;var t=new s.sqlanvil.DataPreparation;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.DataPreparation.target: object expected");t.target=s.sqlanvil.Target.fromObject(e.target)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".sqlanvil.DataPreparation.canonicalTarget: object expected");t.canonicalTarget=s.sqlanvil.Target.fromObject(e.canonicalTarget)}if(e.targets){if(!Array.isArray(e.targets))throw TypeError(".sqlanvil.DataPreparation.targets: array expected");t.targets=[];for(var n=0;n<e.targets.length;++n){if("object"!=typeof e.targets[n])throw TypeError(".sqlanvil.DataPreparation.targets: object expected");t.targets[n]=s.sqlanvil.Target.fromObject(e.targets[n])}}if(e.canonicalTargets){if(!Array.isArray(e.canonicalTargets))throw TypeError(".sqlanvil.DataPreparation.canonicalTargets: array expected");for(t.canonicalTargets=[],n=0;n<e.canonicalTargets.length;++n){if("object"!=typeof e.canonicalTargets[n])throw TypeError(".sqlanvil.DataPreparation.canonicalTargets: object expected");t.canonicalTargets[n]=s.sqlanvil.Target.fromObject(e.canonicalTargets[n])}}if(e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.DataPreparation.tags: array expected");for(t.tags=[],n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}if(e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.DataPreparation.dependencyTargets: array expected");for(t.dependencyTargets=[],n=0;n<e.dependencyTargets.length;++n){if("object"!=typeof e.dependencyTargets[n])throw TypeError(".sqlanvil.DataPreparation.dependencyTargets: object expected");t.dependencyTargets[n]=s.sqlanvil.Target.fromObject(e.dependencyTargets[n])}}if(null!=e.fileName&&(t.fileName=String(e.fileName)),null!=e.disabled&&(t.disabled=Boolean(e.disabled)),null!=e.dataPreparationYaml&&(t.dataPreparationYaml=String(e.dataPreparationYaml)),null!=e.query&&(t.query=String(e.query)),null!=e.errorTable){if("object"!=typeof e.errorTable)throw TypeError(".sqlanvil.DataPreparation.errorTable: object expected");t.errorTable=s.sqlanvil.Target.fromObject(e.errorTable)}if(null!=e.errorTableRetentionDays&&(t.errorTableRetentionDays=0|e.errorTableRetentionDays),null!=e.load){if("object"!=typeof e.load)throw TypeError(".sqlanvil.DataPreparation.load: object expected");t.load=s.sqlanvil.LoadConfiguration.fromObject(e.load)}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.targets=[],n.canonicalTargets=[],n.tags=[],n.dependencyTargets=[]),t.defaults&&(n.fileName="",n.disabled=!1,n.target=null,n.canonicalTarget=null,n.errorTable=null,n.errorTableRetentionDays=0,n.load=null),e.targets&&e.targets.length){n.targets=[];for(var r=0;r<e.targets.length;++r)n.targets[r]=s.sqlanvil.Target.toObject(e.targets[r],t)}if(e.canonicalTargets&&e.canonicalTargets.length)for(n.canonicalTargets=[],r=0;r<e.canonicalTargets.length;++r)n.canonicalTargets[r]=s.sqlanvil.Target.toObject(e.canonicalTargets[r],t);if(e.tags&&e.tags.length)for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=e.tags[r];if(e.dependencyTargets&&e.dependencyTargets.length)for(n.dependencyTargets=[],r=0;r<e.dependencyTargets.length;++r)n.dependencyTargets[r]=s.sqlanvil.Target.toObject(e.dependencyTargets[r],t);return null!=e.fileName&&e.hasOwnProperty("fileName")&&(n.fileName=e.fileName),null!=e.disabled&&e.hasOwnProperty("disabled")&&(n.disabled=e.disabled),null!=e.target&&e.hasOwnProperty("target")&&(n.target=s.sqlanvil.Target.toObject(e.target,t)),null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(n.canonicalTarget=s.sqlanvil.Target.toObject(e.canonicalTarget,t)),null!=e.dataPreparationYaml&&e.hasOwnProperty("dataPreparationYaml")&&(n.dataPreparationYaml=e.dataPreparationYaml,t.oneofs&&(n.definition="dataPreparationYaml")),null!=e.errorTable&&e.hasOwnProperty("errorTable")&&(n.errorTable=s.sqlanvil.Target.toObject(e.errorTable,t)),null!=e.errorTableRetentionDays&&e.hasOwnProperty("errorTableRetentionDays")&&(n.errorTableRetentionDays=e.errorTableRetentionDays),null!=e.query&&e.hasOwnProperty("query")&&(n.query=e.query,t.oneofs&&(n.definition="query")),null!=e.load&&e.hasOwnProperty("load")&&(n.load=s.sqlanvil.LoadConfiguration.toObject(e.load,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.DataPreparation"},t}(),r.LoadConfiguration=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var n;return t.prototype.replace=null,t.prototype.append=null,t.prototype.maximum=null,t.prototype.unique=null,t.prototype.automatic=null,t.prototype.merge=null,Object.defineProperty(t.prototype,"mode",{get:a.oneOfGetter(n=["replace","append","maximum","unique","automatic","merge"]),set:a.oneOfSetter(n)}),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.replace&&Object.hasOwnProperty.call(e,"replace")&&s.sqlanvil.SimpleLoadMode.encode(e.replace,t.uint32(10).fork()).ldelim(),null!=e.append&&Object.hasOwnProperty.call(e,"append")&&s.sqlanvil.SimpleLoadMode.encode(e.append,t.uint32(18).fork()).ldelim(),null!=e.maximum&&Object.hasOwnProperty.call(e,"maximum")&&s.sqlanvil.IncrementalLoadMode.encode(e.maximum,t.uint32(26).fork()).ldelim(),null!=e.unique&&Object.hasOwnProperty.call(e,"unique")&&s.sqlanvil.IncrementalLoadMode.encode(e.unique,t.uint32(34).fork()).ldelim(),null!=e.automatic&&Object.hasOwnProperty.call(e,"automatic")&&s.sqlanvil.IncrementalLoadMode.encode(e.automatic,t.uint32(42).fork()).ldelim(),null!=e.merge&&Object.hasOwnProperty.call(e,"merge")&&s.sqlanvil.MergeLoadMode.encode(e.merge,t.uint32(50).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.LoadConfiguration;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.replace=s.sqlanvil.SimpleLoadMode.decode(e,e.uint32());break;case 2:o.append=s.sqlanvil.SimpleLoadMode.decode(e,e.uint32());break;case 3:o.maximum=s.sqlanvil.IncrementalLoadMode.decode(e,e.uint32());break;case 4:o.unique=s.sqlanvil.IncrementalLoadMode.decode(e,e.uint32());break;case 5:o.automatic=s.sqlanvil.IncrementalLoadMode.decode(e,e.uint32());break;case 6:o.merge=s.sqlanvil.MergeLoadMode.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.replace&&e.hasOwnProperty("replace")&&(t.mode=1,n=s.sqlanvil.SimpleLoadMode.verify(e.replace)))return"replace."+n;if(null!=e.append&&e.hasOwnProperty("append")){if(1===t.mode)return"mode: multiple values";if(t.mode=1,n=s.sqlanvil.SimpleLoadMode.verify(e.append))return"append."+n}if(null!=e.maximum&&e.hasOwnProperty("maximum")){if(1===t.mode)return"mode: multiple values";if(t.mode=1,n=s.sqlanvil.IncrementalLoadMode.verify(e.maximum))return"maximum."+n}if(null!=e.unique&&e.hasOwnProperty("unique")){if(1===t.mode)return"mode: multiple values";if(t.mode=1,n=s.sqlanvil.IncrementalLoadMode.verify(e.unique))return"unique."+n}if(null!=e.automatic&&e.hasOwnProperty("automatic")){if(1===t.mode)return"mode: multiple values";if(t.mode=1,n=s.sqlanvil.IncrementalLoadMode.verify(e.automatic))return"automatic."+n}if(null!=e.merge&&e.hasOwnProperty("merge")){if(1===t.mode)return"mode: multiple values";var n;if(t.mode=1,n=s.sqlanvil.MergeLoadMode.verify(e.merge))return"merge."+n}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.LoadConfiguration)return e;var t=new s.sqlanvil.LoadConfiguration;if(null!=e.replace){if("object"!=typeof e.replace)throw TypeError(".sqlanvil.LoadConfiguration.replace: object expected");t.replace=s.sqlanvil.SimpleLoadMode.fromObject(e.replace)}if(null!=e.append){if("object"!=typeof e.append)throw TypeError(".sqlanvil.LoadConfiguration.append: object expected");t.append=s.sqlanvil.SimpleLoadMode.fromObject(e.append)}if(null!=e.maximum){if("object"!=typeof e.maximum)throw TypeError(".sqlanvil.LoadConfiguration.maximum: object expected");t.maximum=s.sqlanvil.IncrementalLoadMode.fromObject(e.maximum)}if(null!=e.unique){if("object"!=typeof e.unique)throw TypeError(".sqlanvil.LoadConfiguration.unique: object expected");t.unique=s.sqlanvil.IncrementalLoadMode.fromObject(e.unique)}if(null!=e.automatic){if("object"!=typeof e.automatic)throw TypeError(".sqlanvil.LoadConfiguration.automatic: object expected");t.automatic=s.sqlanvil.IncrementalLoadMode.fromObject(e.automatic)}if(null!=e.merge){if("object"!=typeof e.merge)throw TypeError(".sqlanvil.LoadConfiguration.merge: object expected");t.merge=s.sqlanvil.MergeLoadMode.fromObject(e.merge)}return t},t.toObject=function(e,t){t||(t={});var n={};return null!=e.replace&&e.hasOwnProperty("replace")&&(n.replace=s.sqlanvil.SimpleLoadMode.toObject(e.replace,t),t.oneofs&&(n.mode="replace")),null!=e.append&&e.hasOwnProperty("append")&&(n.append=s.sqlanvil.SimpleLoadMode.toObject(e.append,t),t.oneofs&&(n.mode="append")),null!=e.maximum&&e.hasOwnProperty("maximum")&&(n.maximum=s.sqlanvil.IncrementalLoadMode.toObject(e.maximum,t),t.oneofs&&(n.mode="maximum")),null!=e.unique&&e.hasOwnProperty("unique")&&(n.unique=s.sqlanvil.IncrementalLoadMode.toObject(e.unique,t),t.oneofs&&(n.mode="unique")),null!=e.automatic&&e.hasOwnProperty("automatic")&&(n.automatic=s.sqlanvil.IncrementalLoadMode.toObject(e.automatic,t),t.oneofs&&(n.mode="automatic")),null!=e.merge&&e.hasOwnProperty("merge")&&(n.merge=s.sqlanvil.MergeLoadMode.toObject(e.merge,t),t.oneofs&&(n.mode="merge")),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.LoadConfiguration"},t}(),r.SimpleLoadMode=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.SimpleLoadMode;e.pos<r;){var a=e.uint32();if(a===n)break;e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null},t.fromObject=function(e){return e instanceof s.sqlanvil.SimpleLoadMode?e:new s.sqlanvil.SimpleLoadMode},t.toObject=function(){return{}},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.SimpleLoadMode"},t}(),r.IncrementalLoadMode=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.columnName="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.columnName&&Object.hasOwnProperty.call(e,"columnName")&&t.uint32(10).string(e.columnName),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.IncrementalLoadMode;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?o.columnName=e.string():e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.columnName&&e.hasOwnProperty("columnName")&&!a.isString(e.columnName)?"columnName: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.IncrementalLoadMode)return e;var t=new s.sqlanvil.IncrementalLoadMode;return null!=e.columnName&&(t.columnName=String(e.columnName)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.columnName=""),null!=e.columnName&&e.hasOwnProperty("columnName")&&(n.columnName=e.columnName),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.IncrementalLoadMode"},t}(),r.MergeLoadMode=function(){function t(e){if(this.uniqueKey=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.uniqueKey=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.uniqueKey&&e.uniqueKey.length)for(var n=0;n<e.uniqueKey.length;++n)t.uint32(10).string(e.uniqueKey[n]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.MergeLoadMode;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?(o.uniqueKey&&o.uniqueKey.length||(o.uniqueKey=[]),o.uniqueKey.push(e.string())):e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.uniqueKey&&e.hasOwnProperty("uniqueKey")){if(!Array.isArray(e.uniqueKey))return"uniqueKey: array expected";for(var t=0;t<e.uniqueKey.length;++t)if(!a.isString(e.uniqueKey[t]))return"uniqueKey: string[] expected"}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.MergeLoadMode)return e;var t=new s.sqlanvil.MergeLoadMode;if(e.uniqueKey){if(!Array.isArray(e.uniqueKey))throw TypeError(".sqlanvil.MergeLoadMode.uniqueKey: array expected");t.uniqueKey=[];for(var n=0;n<e.uniqueKey.length;++n)t.uniqueKey[n]=String(e.uniqueKey[n])}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.uniqueKey=[]),e.uniqueKey&&e.uniqueKey.length){n.uniqueKey=[];for(var r=0;r<e.uniqueKey.length;++r)n.uniqueKey[r]=e.uniqueKey[r]}return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.MergeLoadMode"},t}(),r.CompiledGraph=function(){function t(e){if(this.tables=[],this.operations=[],this.assertions=[],this.declarations=[],this.tests=[],this.notebooks=[],this.dataPreparations=[],this.targets=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.projectConfig=null,t.prototype.tables=a.emptyArray,t.prototype.operations=a.emptyArray,t.prototype.assertions=a.emptyArray,t.prototype.declarations=a.emptyArray,t.prototype.tests=a.emptyArray,t.prototype.notebooks=a.emptyArray,t.prototype.dataPreparations=a.emptyArray,t.prototype.graphErrors=null,t.prototype.sqlanvilCoreVersion="",t.prototype.targets=a.emptyArray,t.prototype.jitData=null,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.tables&&e.tables.length)for(var n=0;n<e.tables.length;++n)s.sqlanvil.Table.encode(e.tables[n],t.uint32(10).fork()).ldelim();if(null!=e.operations&&e.operations.length)for(n=0;n<e.operations.length;++n)s.sqlanvil.Operation.encode(e.operations[n],t.uint32(18).fork()).ldelim();if(null!=e.assertions&&e.assertions.length)for(n=0;n<e.assertions.length;++n)s.sqlanvil.Assertion.encode(e.assertions[n],t.uint32(26).fork()).ldelim();if(null!=e.projectConfig&&Object.hasOwnProperty.call(e,"projectConfig")&&s.sqlanvil.ProjectConfig.encode(e.projectConfig,t.uint32(34).fork()).ldelim(),null!=e.graphErrors&&Object.hasOwnProperty.call(e,"graphErrors")&&s.sqlanvil.GraphErrors.encode(e.graphErrors,t.uint32(58).fork()).ldelim(),null!=e.tests&&e.tests.length)for(n=0;n<e.tests.length;++n)s.sqlanvil.Test.encode(e.tests[n],t.uint32(66).fork()).ldelim();if(null!=e.declarations&&e.declarations.length)for(n=0;n<e.declarations.length;++n)s.sqlanvil.Declaration.encode(e.declarations[n],t.uint32(74).fork()).ldelim();if(null!=e.sqlanvilCoreVersion&&Object.hasOwnProperty.call(e,"sqlanvilCoreVersion")&&t.uint32(82).string(e.sqlanvilCoreVersion),null!=e.targets&&e.targets.length)for(n=0;n<e.targets.length;++n)s.sqlanvil.Target.encode(e.targets[n],t.uint32(90).fork()).ldelim();if(null!=e.notebooks&&e.notebooks.length)for(n=0;n<e.notebooks.length;++n)s.sqlanvil.Notebook.encode(e.notebooks[n],t.uint32(98).fork()).ldelim();if(null!=e.dataPreparations&&e.dataPreparations.length)for(n=0;n<e.dataPreparations.length;++n)s.sqlanvil.DataPreparation.encode(e.dataPreparations[n],t.uint32(106).fork()).ldelim();return null!=e.jitData&&Object.hasOwnProperty.call(e,"jitData")&&s.google.protobuf.Struct.encode(e.jitData,t.uint32(122).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.CompiledGraph;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 4:o.projectConfig=s.sqlanvil.ProjectConfig.decode(e,e.uint32());break;case 1:o.tables&&o.tables.length||(o.tables=[]),o.tables.push(s.sqlanvil.Table.decode(e,e.uint32()));break;case 2:o.operations&&o.operations.length||(o.operations=[]),o.operations.push(s.sqlanvil.Operation.decode(e,e.uint32()));break;case 3:o.assertions&&o.assertions.length||(o.assertions=[]),o.assertions.push(s.sqlanvil.Assertion.decode(e,e.uint32()));break;case 9:o.declarations&&o.declarations.length||(o.declarations=[]),o.declarations.push(s.sqlanvil.Declaration.decode(e,e.uint32()));break;case 8:o.tests&&o.tests.length||(o.tests=[]),o.tests.push(s.sqlanvil.Test.decode(e,e.uint32()));break;case 12:o.notebooks&&o.notebooks.length||(o.notebooks=[]),o.notebooks.push(s.sqlanvil.Notebook.decode(e,e.uint32()));break;case 13:o.dataPreparations&&o.dataPreparations.length||(o.dataPreparations=[]),o.dataPreparations.push(s.sqlanvil.DataPreparation.decode(e,e.uint32()));break;case 7:o.graphErrors=s.sqlanvil.GraphErrors.decode(e,e.uint32());break;case 10:o.sqlanvilCoreVersion=e.string();break;case 11:o.targets&&o.targets.length||(o.targets=[]),o.targets.push(s.sqlanvil.Target.decode(e,e.uint32()));break;case 15:o.jitData=s.google.protobuf.Struct.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.projectConfig&&e.hasOwnProperty("projectConfig")&&(n=s.sqlanvil.ProjectConfig.verify(e.projectConfig)))return"projectConfig."+n;if(null!=e.tables&&e.hasOwnProperty("tables")){if(!Array.isArray(e.tables))return"tables: array expected";for(var t=0;t<e.tables.length;++t)if(n=s.sqlanvil.Table.verify(e.tables[t]))return"tables."+n}if(null!=e.operations&&e.hasOwnProperty("operations")){if(!Array.isArray(e.operations))return"operations: array expected";for(t=0;t<e.operations.length;++t)if(n=s.sqlanvil.Operation.verify(e.operations[t]))return"operations."+n}if(null!=e.assertions&&e.hasOwnProperty("assertions")){if(!Array.isArray(e.assertions))return"assertions: array expected";for(t=0;t<e.assertions.length;++t)if(n=s.sqlanvil.Assertion.verify(e.assertions[t]))return"assertions."+n}if(null!=e.declarations&&e.hasOwnProperty("declarations")){if(!Array.isArray(e.declarations))return"declarations: array expected";for(t=0;t<e.declarations.length;++t)if(n=s.sqlanvil.Declaration.verify(e.declarations[t]))return"declarations."+n}if(null!=e.tests&&e.hasOwnProperty("tests")){if(!Array.isArray(e.tests))return"tests: array expected";for(t=0;t<e.tests.length;++t)if(n=s.sqlanvil.Test.verify(e.tests[t]))return"tests."+n}if(null!=e.notebooks&&e.hasOwnProperty("notebooks")){if(!Array.isArray(e.notebooks))return"notebooks: array expected";for(t=0;t<e.notebooks.length;++t)if(n=s.sqlanvil.Notebook.verify(e.notebooks[t]))return"notebooks."+n}if(null!=e.dataPreparations&&e.hasOwnProperty("dataPreparations")){if(!Array.isArray(e.dataPreparations))return"dataPreparations: array expected";for(t=0;t<e.dataPreparations.length;++t)if(n=s.sqlanvil.DataPreparation.verify(e.dataPreparations[t]))return"dataPreparations."+n}if(null!=e.graphErrors&&e.hasOwnProperty("graphErrors")&&(n=s.sqlanvil.GraphErrors.verify(e.graphErrors)))return"graphErrors."+n;if(null!=e.sqlanvilCoreVersion&&e.hasOwnProperty("sqlanvilCoreVersion")&&!a.isString(e.sqlanvilCoreVersion))return"sqlanvilCoreVersion: string expected";if(null!=e.targets&&e.hasOwnProperty("targets")){if(!Array.isArray(e.targets))return"targets: array expected";for(t=0;t<e.targets.length;++t){var n;if(n=s.sqlanvil.Target.verify(e.targets[t]))return"targets."+n}}return null!=e.jitData&&e.hasOwnProperty("jitData")&&(n=s.google.protobuf.Struct.verify(e.jitData))?"jitData."+n:null},t.fromObject=function(e){if(e instanceof s.sqlanvil.CompiledGraph)return e;var t=new s.sqlanvil.CompiledGraph;if(null!=e.projectConfig){if("object"!=typeof e.projectConfig)throw TypeError(".sqlanvil.CompiledGraph.projectConfig: object expected");t.projectConfig=s.sqlanvil.ProjectConfig.fromObject(e.projectConfig)}if(e.tables){if(!Array.isArray(e.tables))throw TypeError(".sqlanvil.CompiledGraph.tables: array expected");t.tables=[];for(var n=0;n<e.tables.length;++n){if("object"!=typeof e.tables[n])throw TypeError(".sqlanvil.CompiledGraph.tables: object expected");t.tables[n]=s.sqlanvil.Table.fromObject(e.tables[n])}}if(e.operations){if(!Array.isArray(e.operations))throw TypeError(".sqlanvil.CompiledGraph.operations: array expected");for(t.operations=[],n=0;n<e.operations.length;++n){if("object"!=typeof e.operations[n])throw TypeError(".sqlanvil.CompiledGraph.operations: object expected");t.operations[n]=s.sqlanvil.Operation.fromObject(e.operations[n])}}if(e.assertions){if(!Array.isArray(e.assertions))throw TypeError(".sqlanvil.CompiledGraph.assertions: array expected");for(t.assertions=[],n=0;n<e.assertions.length;++n){if("object"!=typeof e.assertions[n])throw TypeError(".sqlanvil.CompiledGraph.assertions: object expected");t.assertions[n]=s.sqlanvil.Assertion.fromObject(e.assertions[n])}}if(e.declarations){if(!Array.isArray(e.declarations))throw TypeError(".sqlanvil.CompiledGraph.declarations: array expected");for(t.declarations=[],n=0;n<e.declarations.length;++n){if("object"!=typeof e.declarations[n])throw TypeError(".sqlanvil.CompiledGraph.declarations: object expected");t.declarations[n]=s.sqlanvil.Declaration.fromObject(e.declarations[n])}}if(e.tests){if(!Array.isArray(e.tests))throw TypeError(".sqlanvil.CompiledGraph.tests: array expected");for(t.tests=[],n=0;n<e.tests.length;++n){if("object"!=typeof e.tests[n])throw TypeError(".sqlanvil.CompiledGraph.tests: object expected");t.tests[n]=s.sqlanvil.Test.fromObject(e.tests[n])}}if(e.notebooks){if(!Array.isArray(e.notebooks))throw TypeError(".sqlanvil.CompiledGraph.notebooks: array expected");for(t.notebooks=[],n=0;n<e.notebooks.length;++n){if("object"!=typeof e.notebooks[n])throw TypeError(".sqlanvil.CompiledGraph.notebooks: object expected");t.notebooks[n]=s.sqlanvil.Notebook.fromObject(e.notebooks[n])}}if(e.dataPreparations){if(!Array.isArray(e.dataPreparations))throw TypeError(".sqlanvil.CompiledGraph.dataPreparations: array expected");for(t.dataPreparations=[],n=0;n<e.dataPreparations.length;++n){if("object"!=typeof e.dataPreparations[n])throw TypeError(".sqlanvil.CompiledGraph.dataPreparations: object expected");t.dataPreparations[n]=s.sqlanvil.DataPreparation.fromObject(e.dataPreparations[n])}}if(null!=e.graphErrors){if("object"!=typeof e.graphErrors)throw TypeError(".sqlanvil.CompiledGraph.graphErrors: object expected");t.graphErrors=s.sqlanvil.GraphErrors.fromObject(e.graphErrors)}if(null!=e.sqlanvilCoreVersion&&(t.sqlanvilCoreVersion=String(e.sqlanvilCoreVersion)),e.targets){if(!Array.isArray(e.targets))throw TypeError(".sqlanvil.CompiledGraph.targets: array expected");for(t.targets=[],n=0;n<e.targets.length;++n){if("object"!=typeof e.targets[n])throw TypeError(".sqlanvil.CompiledGraph.targets: object expected");t.targets[n]=s.sqlanvil.Target.fromObject(e.targets[n])}}if(null!=e.jitData){if("object"!=typeof e.jitData)throw TypeError(".sqlanvil.CompiledGraph.jitData: object expected");t.jitData=s.google.protobuf.Struct.fromObject(e.jitData)}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.tables=[],n.operations=[],n.assertions=[],n.tests=[],n.declarations=[],n.targets=[],n.notebooks=[],n.dataPreparations=[]),t.defaults&&(n.projectConfig=null,n.graphErrors=null,n.sqlanvilCoreVersion="",n.jitData=null),e.tables&&e.tables.length){n.tables=[];for(var r=0;r<e.tables.length;++r)n.tables[r]=s.sqlanvil.Table.toObject(e.tables[r],t)}if(e.operations&&e.operations.length)for(n.operations=[],r=0;r<e.operations.length;++r)n.operations[r]=s.sqlanvil.Operation.toObject(e.operations[r],t);if(e.assertions&&e.assertions.length)for(n.assertions=[],r=0;r<e.assertions.length;++r)n.assertions[r]=s.sqlanvil.Assertion.toObject(e.assertions[r],t);if(null!=e.projectConfig&&e.hasOwnProperty("projectConfig")&&(n.projectConfig=s.sqlanvil.ProjectConfig.toObject(e.projectConfig,t)),null!=e.graphErrors&&e.hasOwnProperty("graphErrors")&&(n.graphErrors=s.sqlanvil.GraphErrors.toObject(e.graphErrors,t)),e.tests&&e.tests.length)for(n.tests=[],r=0;r<e.tests.length;++r)n.tests[r]=s.sqlanvil.Test.toObject(e.tests[r],t);if(e.declarations&&e.declarations.length)for(n.declarations=[],r=0;r<e.declarations.length;++r)n.declarations[r]=s.sqlanvil.Declaration.toObject(e.declarations[r],t);if(null!=e.sqlanvilCoreVersion&&e.hasOwnProperty("sqlanvilCoreVersion")&&(n.sqlanvilCoreVersion=e.sqlanvilCoreVersion),e.targets&&e.targets.length)for(n.targets=[],r=0;r<e.targets.length;++r)n.targets[r]=s.sqlanvil.Target.toObject(e.targets[r],t);if(e.notebooks&&e.notebooks.length)for(n.notebooks=[],r=0;r<e.notebooks.length;++r)n.notebooks[r]=s.sqlanvil.Notebook.toObject(e.notebooks[r],t);if(e.dataPreparations&&e.dataPreparations.length)for(n.dataPreparations=[],r=0;r<e.dataPreparations.length;++r)n.dataPreparations[r]=s.sqlanvil.DataPreparation.toObject(e.dataPreparations[r],t);return null!=e.jitData&&e.hasOwnProperty("jitData")&&(n.jitData=s.google.protobuf.Struct.toObject(e.jitData,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.CompiledGraph"},t}(),r.CoreExecutionRequest=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var n;return t.prototype.compile=null,Object.defineProperty(t.prototype,"request",{get:a.oneOfGetter(n=["compile"]),set:a.oneOfSetter(n)}),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.compile&&Object.hasOwnProperty.call(e,"compile")&&s.sqlanvil.CompileExecutionRequest.encode(e.compile,t.uint32(10).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.CoreExecutionRequest;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?o.compile=s.sqlanvil.CompileExecutionRequest.decode(e,e.uint32()):e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.compile&&e.hasOwnProperty("compile")){var t=s.sqlanvil.CompileExecutionRequest.verify(e.compile);if(t)return"compile."+t}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.CoreExecutionRequest)return e;var t=new s.sqlanvil.CoreExecutionRequest;if(null!=e.compile){if("object"!=typeof e.compile)throw TypeError(".sqlanvil.CoreExecutionRequest.compile: object expected");t.compile=s.sqlanvil.CompileExecutionRequest.fromObject(e.compile)}return t},t.toObject=function(e,t){t||(t={});var n={};return null!=e.compile&&e.hasOwnProperty("compile")&&(n.compile=s.sqlanvil.CompileExecutionRequest.toObject(e.compile,t),t.oneofs&&(n.request="compile")),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.CoreExecutionRequest"},t}(),r.CoreExecutionResponse=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var n;return t.prototype.compile=null,Object.defineProperty(t.prototype,"response",{get:a.oneOfGetter(n=["compile"]),set:a.oneOfSetter(n)}),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.compile&&Object.hasOwnProperty.call(e,"compile")&&s.sqlanvil.CompileExecutionResponse.encode(e.compile,t.uint32(10).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.CoreExecutionResponse;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?o.compile=s.sqlanvil.CompileExecutionResponse.decode(e,e.uint32()):e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.compile&&e.hasOwnProperty("compile")){var t=s.sqlanvil.CompileExecutionResponse.verify(e.compile);if(t)return"compile."+t}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.CoreExecutionResponse)return e;var t=new s.sqlanvil.CoreExecutionResponse;if(null!=e.compile){if("object"!=typeof e.compile)throw TypeError(".sqlanvil.CoreExecutionResponse.compile: object expected");t.compile=s.sqlanvil.CompileExecutionResponse.fromObject(e.compile)}return t},t.toObject=function(e,t){t||(t={});var n={};return null!=e.compile&&e.hasOwnProperty("compile")&&(n.compile=s.sqlanvil.CompileExecutionResponse.toObject(e.compile,t),t.oneofs&&(n.response="compile")),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.CoreExecutionResponse"},t}(),r.CompileExecutionRequest=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.compileConfig=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.compileConfig&&Object.hasOwnProperty.call(e,"compileConfig")&&s.sqlanvil.CompileConfig.encode(e.compileConfig,t.uint32(10).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.CompileExecutionRequest;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?o.compileConfig=s.sqlanvil.CompileConfig.decode(e,e.uint32()):e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.compileConfig&&e.hasOwnProperty("compileConfig")){var t=s.sqlanvil.CompileConfig.verify(e.compileConfig);if(t)return"compileConfig."+t}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.CompileExecutionRequest)return e;var t=new s.sqlanvil.CompileExecutionRequest;if(null!=e.compileConfig){if("object"!=typeof e.compileConfig)throw TypeError(".sqlanvil.CompileExecutionRequest.compileConfig: object expected");t.compileConfig=s.sqlanvil.CompileConfig.fromObject(e.compileConfig)}return t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.compileConfig=null),null!=e.compileConfig&&e.hasOwnProperty("compileConfig")&&(n.compileConfig=s.sqlanvil.CompileConfig.toObject(e.compileConfig,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.CompileExecutionRequest"},t}(),r.CompileExecutionResponse=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.compiledGraph=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.compiledGraph&&Object.hasOwnProperty.call(e,"compiledGraph")&&s.sqlanvil.CompiledGraph.encode(e.compiledGraph,t.uint32(10).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.CompileExecutionResponse;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?o.compiledGraph=s.sqlanvil.CompiledGraph.decode(e,e.uint32()):e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.compiledGraph&&e.hasOwnProperty("compiledGraph")){var t=s.sqlanvil.CompiledGraph.verify(e.compiledGraph);if(t)return"compiledGraph."+t}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.CompileExecutionResponse)return e;var t=new s.sqlanvil.CompileExecutionResponse;if(null!=e.compiledGraph){if("object"!=typeof e.compiledGraph)throw TypeError(".sqlanvil.CompileExecutionResponse.compiledGraph: object expected");t.compiledGraph=s.sqlanvil.CompiledGraph.fromObject(e.compiledGraph)}return t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.compiledGraph=null),null!=e.compiledGraph&&e.hasOwnProperty("compiledGraph")&&(n.compiledGraph=s.sqlanvil.CompiledGraph.toObject(e.compiledGraph,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.CompileExecutionResponse"},t}(),r.SupportedFeatures=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN_FEATURE"]=0,t[e[1]="ARRAY_BUFFER_IPC"]=1,t}(),r.Field=function(){function t(e){if(this.flags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var n;return t.prototype.name="",t.prototype.flags=a.emptyArray,t.prototype.primitive=null,t.prototype.struct=null,t.prototype.description="",Object.defineProperty(t.prototype,"type",{get:a.oneOfGetter(n=["primitive","struct"]),set:a.oneOfSetter(n)}),t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.struct&&Object.hasOwnProperty.call(e,"struct")&&s.sqlanvil.Fields.encode(e.struct,t.uint32(26).fork()).ldelim(),null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(42).string(e.description),null!=e.flags&&e.flags.length){t.uint32(50).fork();for(var n=0;n<e.flags.length;++n)t.int32(e.flags[n]);t.ldelim()}return null!=e.primitive&&Object.hasOwnProperty.call(e,"primitive")&&t.uint32(56).int32(e.primitive),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.Field;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.name=e.string();break;case 6:if(o.flags&&o.flags.length||(o.flags=[]),2==(7&a))for(var l=e.uint32()+e.pos;e.pos<l;)o.flags.push(e.int32());else o.flags.push(e.int32());break;case 7:o.primitive=e.int32();break;case 3:o.struct=s.sqlanvil.Fields.decode(e,e.uint32());break;case 5:o.description=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.flags&&e.hasOwnProperty("flags")){if(!Array.isArray(e.flags))return"flags: array expected";for(var n=0;n<e.flags.length;++n)switch(e.flags[n]){default:return"flags: enum value[] expected";case 0:case 1:}}if(null!=e.primitive&&e.hasOwnProperty("primitive"))switch(t.type=1,e.primitive){default:return"primitive: enum value expected";case 0:case 1:case 2:case 5:case 3:case 4:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:}if(null!=e.struct&&e.hasOwnProperty("struct")){if(1===t.type)return"type: multiple values";t.type=1;var r=s.sqlanvil.Fields.verify(e.struct);if(r)return"struct."+r}return null!=e.description&&e.hasOwnProperty("description")&&!a.isString(e.description)?"description: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.Field)return e;var t=new s.sqlanvil.Field;if(null!=e.name&&(t.name=String(e.name)),e.flags){if(!Array.isArray(e.flags))throw TypeError(".sqlanvil.Field.flags: array expected");t.flags=[];for(var n=0;n<e.flags.length;++n)switch(e.flags[n]){default:if("number"==typeof e.flags[n]){t.flags[n]=e.flags[n];break}case"UNKNOWN_FLAG":case 0:t.flags[n]=0;break;case"REPEATED":case 1:t.flags[n]=1}}switch(e.primitive){default:if("number"==typeof e.primitive){t.primitive=e.primitive;break}break;case"UNKNOWN":case 0:t.primitive=0;break;case"INTEGER":case 1:t.primitive=1;break;case"FLOAT":case 2:t.primitive=2;break;case"NUMERIC":case 5:t.primitive=5;break;case"BOOLEAN":case 3:t.primitive=3;break;case"STRING":case 4:t.primitive=4;break;case"DATE":case 6:t.primitive=6;break;case"DATETIME":case 7:t.primitive=7;break;case"TIMESTAMP":case 8:t.primitive=8;break;case"TIME":case 9:t.primitive=9;break;case"BYTES":case 10:t.primitive=10;break;case"ANY":case 11:t.primitive=11;break;case"GEOGRAPHY":case 12:t.primitive=12;break;case"BIGNUMERIC":case 13:t.primitive=13;break;case"JSON":case 14:t.primitive=14;break;case"INTERVAL":case 15:t.primitive=15}if(null!=e.struct){if("object"!=typeof e.struct)throw TypeError(".sqlanvil.Field.struct: object expected");t.struct=s.sqlanvil.Fields.fromObject(e.struct)}return null!=e.description&&(t.description=String(e.description)),t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.flags=[]),t.defaults&&(n.name="",n.description=""),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.struct&&e.hasOwnProperty("struct")&&(n.struct=s.sqlanvil.Fields.toObject(e.struct,t),t.oneofs&&(n.type="struct")),null!=e.description&&e.hasOwnProperty("description")&&(n.description=e.description),e.flags&&e.flags.length){n.flags=[];for(var r=0;r<e.flags.length;++r)n.flags[r]=t.enums===String?void 0===s.sqlanvil.Field.Flag[e.flags[r]]?e.flags[r]:s.sqlanvil.Field.Flag[e.flags[r]]:e.flags[r]}return null!=e.primitive&&e.hasOwnProperty("primitive")&&(n.primitive=t.enums===String?void 0===s.sqlanvil.Field.Primitive[e.primitive]?e.primitive:s.sqlanvil.Field.Primitive[e.primitive]:e.primitive,t.oneofs&&(n.type="primitive")),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.Field"},t.Primitive=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN"]=0,t[e[1]="INTEGER"]=1,t[e[2]="FLOAT"]=2,t[e[5]="NUMERIC"]=5,t[e[3]="BOOLEAN"]=3,t[e[4]="STRING"]=4,t[e[6]="DATE"]=6,t[e[7]="DATETIME"]=7,t[e[8]="TIMESTAMP"]=8,t[e[9]="TIME"]=9,t[e[10]="BYTES"]=10,t[e[11]="ANY"]=11,t[e[12]="GEOGRAPHY"]=12,t[e[13]="BIGNUMERIC"]=13,t[e[14]="JSON"]=14,t[e[15]="INTERVAL"]=15,t}(),t.Flag=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN_FLAG"]=0,t[e[1]="REPEATED"]=1,t}(),t}(),r.Fields=function(){function t(e){if(this.fields=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.fields=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.fields&&e.fields.length)for(var n=0;n<e.fields.length;++n)s.sqlanvil.Field.encode(e.fields[n],t.uint32(10).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.Fields;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?(o.fields&&o.fields.length||(o.fields=[]),o.fields.push(s.sqlanvil.Field.decode(e,e.uint32()))):e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.fields&&e.hasOwnProperty("fields")){if(!Array.isArray(e.fields))return"fields: array expected";for(var t=0;t<e.fields.length;++t){var n=s.sqlanvil.Field.verify(e.fields[t]);if(n)return"fields."+n}}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.Fields)return e;var t=new s.sqlanvil.Fields;if(e.fields){if(!Array.isArray(e.fields))throw TypeError(".sqlanvil.Fields.fields: array expected");t.fields=[];for(var n=0;n<e.fields.length;++n){if("object"!=typeof e.fields[n])throw TypeError(".sqlanvil.Fields.fields: object expected");t.fields[n]=s.sqlanvil.Field.fromObject(e.fields[n])}}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.fields=[]),e.fields&&e.fields.length){n.fields=[];for(var r=0;r<e.fields.length;++r)n.fields[r]=s.sqlanvil.Field.toObject(e.fields[r],t)}return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.Fields"},t}(),r.TableMetadata=function(){function t(e){if(this.fields=[],this.labels={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.target=null,t.prototype.type=0,t.prototype.fields=a.emptyArray,t.prototype.description="",t.prototype.labels=a.emptyObject,t.prototype.lastUpdatedMillis=0,t.prototype.bigquery=null,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&s.sqlanvil.Target.encode(e.target,t.uint32(10).fork()).ldelim(),null!=e.fields&&e.fields.length)for(var n=0;n<e.fields.length;++n)s.sqlanvil.Field.encode(e.fields[n],t.uint32(26).fork()).ldelim();if(null!=e.lastUpdatedMillis&&Object.hasOwnProperty.call(e,"lastUpdatedMillis")&&t.uint32(32).int64(e.lastUpdatedMillis),null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(42).string(e.description),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(48).int32(e.type),null!=e.labels&&Object.hasOwnProperty.call(e,"labels")){var r=Object.keys(e.labels);for(n=0;n<r.length;++n)t.uint32(58).fork().uint32(10).string(r[n]).uint32(18).string(e.labels[r[n]]).ldelim()}return null!=e.bigquery&&Object.hasOwnProperty.call(e,"bigquery")&&s.sqlanvil.TableMetadata.BigQuery.encode(e.bigquery,t.uint32(66).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r,o,l=void 0===t?e.len:e.pos+t,c=new s.sqlanvil.TableMetadata;e.pos<l;){var u=e.uint32();if(u===n)break;switch(u>>>3){case 1:c.target=s.sqlanvil.Target.decode(e,e.uint32());break;case 6:c.type=e.int32();break;case 3:c.fields&&c.fields.length||(c.fields=[]),c.fields.push(s.sqlanvil.Field.decode(e,e.uint32()));break;case 5:c.description=e.string();break;case 7:c.labels===a.emptyObject&&(c.labels={});var p=e.uint32()+e.pos;for(r="",o="";e.pos<p;){var f=e.uint32();switch(f>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}}c.labels[r]=o;break;case 4:c.lastUpdatedMillis=e.int64();break;case 8:c.bigquery=s.sqlanvil.TableMetadata.BigQuery.decode(e,e.uint32());break;default:e.skipType(7&u)}}return c},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.target&&e.hasOwnProperty("target")&&(n=s.sqlanvil.Target.verify(e.target)))return"target."+n;if(null!=e.type&&e.hasOwnProperty("type"))switch(e.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:}if(null!=e.fields&&e.hasOwnProperty("fields")){if(!Array.isArray(e.fields))return"fields: array expected";for(var t=0;t<e.fields.length;++t){var n;if(n=s.sqlanvil.Field.verify(e.fields[t]))return"fields."+n}}if(null!=e.description&&e.hasOwnProperty("description")&&!a.isString(e.description))return"description: string expected";if(null!=e.labels&&e.hasOwnProperty("labels")){if(!a.isObject(e.labels))return"labels: object expected";var r=Object.keys(e.labels);for(t=0;t<r.length;++t)if(!a.isString(e.labels[r[t]]))return"labels: string{k:string} expected"}return null!=e.lastUpdatedMillis&&e.hasOwnProperty("lastUpdatedMillis")&&!(a.isInteger(e.lastUpdatedMillis)||e.lastUpdatedMillis&&a.isInteger(e.lastUpdatedMillis.low)&&a.isInteger(e.lastUpdatedMillis.high))?"lastUpdatedMillis: integer|Long expected":null!=e.bigquery&&e.hasOwnProperty("bigquery")&&(n=s.sqlanvil.TableMetadata.BigQuery.verify(e.bigquery))?"bigquery."+n:null},t.fromObject=function(e){if(e instanceof s.sqlanvil.TableMetadata)return e;var t=new s.sqlanvil.TableMetadata;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.TableMetadata.target: object expected");t.target=s.sqlanvil.Target.fromObject(e.target)}switch(e.type){default:if("number"==typeof e.type){t.type=e.type;break}break;case"UNKNOWN":case 0:t.type=0;break;case"TABLE":case 1:t.type=1;break;case"VIEW":case 2:t.type=2;break;case"MATERIALIZED_VIEW":case 3:t.type=3}if(e.fields){if(!Array.isArray(e.fields))throw TypeError(".sqlanvil.TableMetadata.fields: array expected");t.fields=[];for(var n=0;n<e.fields.length;++n){if("object"!=typeof e.fields[n])throw TypeError(".sqlanvil.TableMetadata.fields: object expected");t.fields[n]=s.sqlanvil.Field.fromObject(e.fields[n])}}if(null!=e.description&&(t.description=String(e.description)),e.labels){if("object"!=typeof e.labels)throw TypeError(".sqlanvil.TableMetadata.labels: object expected");t.labels={};var r=Object.keys(e.labels);for(n=0;n<r.length;++n)t.labels[r[n]]=String(e.labels[r[n]])}if(null!=e.lastUpdatedMillis&&(a.Long?(t.lastUpdatedMillis=a.Long.fromValue(e.lastUpdatedMillis)).unsigned=!1:"string"==typeof e.lastUpdatedMillis?t.lastUpdatedMillis=parseInt(e.lastUpdatedMillis,10):"number"==typeof e.lastUpdatedMillis?t.lastUpdatedMillis=e.lastUpdatedMillis:"object"==typeof e.lastUpdatedMillis&&(t.lastUpdatedMillis=new a.LongBits(e.lastUpdatedMillis.low>>>0,e.lastUpdatedMillis.high>>>0).toNumber())),null!=e.bigquery){if("object"!=typeof e.bigquery)throw TypeError(".sqlanvil.TableMetadata.bigquery: object expected");t.bigquery=s.sqlanvil.TableMetadata.BigQuery.fromObject(e.bigquery)}return t},t.toObject=function(e,t){t||(t={});var n,r={};if((t.arrays||t.defaults)&&(r.fields=[]),(t.objects||t.defaults)&&(r.labels={}),t.defaults&&(r.target=null,r.lastUpdatedMillis=0,r.description="",r.type=t.enums===String?"UNKNOWN":0,r.bigquery=null),null!=e.target&&e.hasOwnProperty("target")&&(r.target=s.sqlanvil.Target.toObject(e.target,t)),e.fields&&e.fields.length){r.fields=[];for(var i=0;i<e.fields.length;++i)r.fields[i]=s.sqlanvil.Field.toObject(e.fields[i],t)}if(null!=e.lastUpdatedMillis&&e.hasOwnProperty("lastUpdatedMillis")&&("number"==typeof e.lastUpdatedMillis?r.lastUpdatedMillis=t.longs===String?String(e.lastUpdatedMillis):e.lastUpdatedMillis:r.lastUpdatedMillis=t.longs===String?a.Long.prototype.toString.call(e.lastUpdatedMillis):t.longs===Number?new a.LongBits(e.lastUpdatedMillis.low>>>0,e.lastUpdatedMillis.high>>>0).toNumber():e.lastUpdatedMillis),null!=e.description&&e.hasOwnProperty("description")&&(r.description=e.description),null!=e.type&&e.hasOwnProperty("type")&&(r.type=t.enums===String?void 0===s.sqlanvil.TableMetadata.Type[e.type]?e.type:s.sqlanvil.TableMetadata.Type[e.type]:e.type),e.labels&&(n=Object.keys(e.labels)).length)for(r.labels={},i=0;i<n.length;++i)r.labels[n[i]]=e.labels[n[i]];return null!=e.bigquery&&e.hasOwnProperty("bigquery")&&(r.bigquery=s.sqlanvil.TableMetadata.BigQuery.toObject(e.bigquery,t)),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.TableMetadata"},t.Type=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN"]=0,t[e[1]="TABLE"]=1,t[e[2]="VIEW"]=2,t[e[3]="MATERIALIZED_VIEW"]=3,t}(),t.BigQuery=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.hasStreamingBuffer=!1,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.hasStreamingBuffer&&Object.hasOwnProperty.call(e,"hasStreamingBuffer")&&t.uint32(8).bool(e.hasStreamingBuffer),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.TableMetadata.BigQuery;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?o.hasStreamingBuffer=e.bool():e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.hasStreamingBuffer&&e.hasOwnProperty("hasStreamingBuffer")&&"boolean"!=typeof e.hasStreamingBuffer?"hasStreamingBuffer: boolean expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.TableMetadata.BigQuery)return e;var t=new s.sqlanvil.TableMetadata.BigQuery;return null!=e.hasStreamingBuffer&&(t.hasStreamingBuffer=Boolean(e.hasStreamingBuffer)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.hasStreamingBuffer=!1),null!=e.hasStreamingBuffer&&e.hasOwnProperty("hasStreamingBuffer")&&(n.hasStreamingBuffer=e.hasStreamingBuffer),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.TableMetadata.BigQuery"},t}(),t}(),r.ExecutionMetadata=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.bigquery=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.bigquery&&Object.hasOwnProperty.call(e,"bigquery")&&s.sqlanvil.ExecutionMetadata.BigqueryMetadata.encode(e.bigquery,t.uint32(10).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ExecutionMetadata;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?o.bigquery=s.sqlanvil.ExecutionMetadata.BigqueryMetadata.decode(e,e.uint32()):e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.bigquery&&e.hasOwnProperty("bigquery")){var t=s.sqlanvil.ExecutionMetadata.BigqueryMetadata.verify(e.bigquery);if(t)return"bigquery."+t}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ExecutionMetadata)return e;var t=new s.sqlanvil.ExecutionMetadata;if(null!=e.bigquery){if("object"!=typeof e.bigquery)throw TypeError(".sqlanvil.ExecutionMetadata.bigquery: object expected");t.bigquery=s.sqlanvil.ExecutionMetadata.BigqueryMetadata.fromObject(e.bigquery)}return t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.bigquery=null),null!=e.bigquery&&e.hasOwnProperty("bigquery")&&(n.bigquery=s.sqlanvil.ExecutionMetadata.BigqueryMetadata.toObject(e.bigquery,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ExecutionMetadata"},t.BigqueryMetadata=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.jobId="",t.prototype.totalBytesProcessed=0,t.prototype.totalBytesBilled=0,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.jobId&&Object.hasOwnProperty.call(e,"jobId")&&t.uint32(10).string(e.jobId),null!=e.totalBytesProcessed&&Object.hasOwnProperty.call(e,"totalBytesProcessed")&&t.uint32(16).int64(e.totalBytesProcessed),null!=e.totalBytesBilled&&Object.hasOwnProperty.call(e,"totalBytesBilled")&&t.uint32(24).int64(e.totalBytesBilled),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ExecutionMetadata.BigqueryMetadata;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.jobId=e.string();break;case 2:o.totalBytesProcessed=e.int64();break;case 3:o.totalBytesBilled=e.int64();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.jobId&&e.hasOwnProperty("jobId")&&!a.isString(e.jobId)?"jobId: string expected":null!=e.totalBytesProcessed&&e.hasOwnProperty("totalBytesProcessed")&&!(a.isInteger(e.totalBytesProcessed)||e.totalBytesProcessed&&a.isInteger(e.totalBytesProcessed.low)&&a.isInteger(e.totalBytesProcessed.high))?"totalBytesProcessed: integer|Long expected":null!=e.totalBytesBilled&&e.hasOwnProperty("totalBytesBilled")&&!(a.isInteger(e.totalBytesBilled)||e.totalBytesBilled&&a.isInteger(e.totalBytesBilled.low)&&a.isInteger(e.totalBytesBilled.high))?"totalBytesBilled: integer|Long expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ExecutionMetadata.BigqueryMetadata)return e;var t=new s.sqlanvil.ExecutionMetadata.BigqueryMetadata;return null!=e.jobId&&(t.jobId=String(e.jobId)),null!=e.totalBytesProcessed&&(a.Long?(t.totalBytesProcessed=a.Long.fromValue(e.totalBytesProcessed)).unsigned=!1:"string"==typeof e.totalBytesProcessed?t.totalBytesProcessed=parseInt(e.totalBytesProcessed,10):"number"==typeof e.totalBytesProcessed?t.totalBytesProcessed=e.totalBytesProcessed:"object"==typeof e.totalBytesProcessed&&(t.totalBytesProcessed=new a.LongBits(e.totalBytesProcessed.low>>>0,e.totalBytesProcessed.high>>>0).toNumber())),null!=e.totalBytesBilled&&(a.Long?(t.totalBytesBilled=a.Long.fromValue(e.totalBytesBilled)).unsigned=!1:"string"==typeof e.totalBytesBilled?t.totalBytesBilled=parseInt(e.totalBytesBilled,10):"number"==typeof e.totalBytesBilled?t.totalBytesBilled=e.totalBytesBilled:"object"==typeof e.totalBytesBilled&&(t.totalBytesBilled=new a.LongBits(e.totalBytesBilled.low>>>0,e.totalBytesBilled.high>>>0).toNumber())),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.jobId="",n.totalBytesProcessed=0,n.totalBytesBilled=0),null!=e.jobId&&e.hasOwnProperty("jobId")&&(n.jobId=e.jobId),null!=e.totalBytesProcessed&&e.hasOwnProperty("totalBytesProcessed")&&("number"==typeof e.totalBytesProcessed?n.totalBytesProcessed=t.longs===String?String(e.totalBytesProcessed):e.totalBytesProcessed:n.totalBytesProcessed=t.longs===String?a.Long.prototype.toString.call(e.totalBytesProcessed):t.longs===Number?new a.LongBits(e.totalBytesProcessed.low>>>0,e.totalBytesProcessed.high>>>0).toNumber():e.totalBytesProcessed),null!=e.totalBytesBilled&&e.hasOwnProperty("totalBytesBilled")&&("number"==typeof e.totalBytesBilled?n.totalBytesBilled=t.longs===String?String(e.totalBytesBilled):e.totalBytesBilled:n.totalBytesBilled=t.longs===String?a.Long.prototype.toString.call(e.totalBytesBilled):t.longs===Number?new a.LongBits(e.totalBytesBilled.low>>>0,e.totalBytesBilled.high>>>0).toNumber():e.totalBytesBilled),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ExecutionMetadata.BigqueryMetadata"},t}(),t}(),r.QueryEvaluationError=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.message="",t.prototype.errorLocation=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.message&&Object.hasOwnProperty.call(e,"message")&&t.uint32(10).string(e.message),null!=e.errorLocation&&Object.hasOwnProperty.call(e,"errorLocation")&&s.sqlanvil.QueryEvaluationError.ErrorLocation.encode(e.errorLocation,t.uint32(18).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.QueryEvaluationError;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.message=e.string();break;case 2:o.errorLocation=s.sqlanvil.QueryEvaluationError.ErrorLocation.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.message&&e.hasOwnProperty("message")&&!a.isString(e.message))return"message: string expected";if(null!=e.errorLocation&&e.hasOwnProperty("errorLocation")){var t=s.sqlanvil.QueryEvaluationError.ErrorLocation.verify(e.errorLocation);if(t)return"errorLocation."+t}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.QueryEvaluationError)return e;var t=new s.sqlanvil.QueryEvaluationError;if(null!=e.message&&(t.message=String(e.message)),null!=e.errorLocation){if("object"!=typeof e.errorLocation)throw TypeError(".sqlanvil.QueryEvaluationError.errorLocation: object expected");t.errorLocation=s.sqlanvil.QueryEvaluationError.ErrorLocation.fromObject(e.errorLocation)}return t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.message="",n.errorLocation=null),null!=e.message&&e.hasOwnProperty("message")&&(n.message=e.message),null!=e.errorLocation&&e.hasOwnProperty("errorLocation")&&(n.errorLocation=s.sqlanvil.QueryEvaluationError.ErrorLocation.toObject(e.errorLocation,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.QueryEvaluationError"},t.ErrorLocation=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.line=0,t.prototype.column=0,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.line&&Object.hasOwnProperty.call(e,"line")&&t.uint32(8).int32(e.line),null!=e.column&&Object.hasOwnProperty.call(e,"column")&&t.uint32(16).int32(e.column),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.QueryEvaluationError.ErrorLocation;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.line=e.int32();break;case 2:o.column=e.int32();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.line&&e.hasOwnProperty("line")&&!a.isInteger(e.line)?"line: integer expected":null!=e.column&&e.hasOwnProperty("column")&&!a.isInteger(e.column)?"column: integer expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.QueryEvaluationError.ErrorLocation)return e;var t=new s.sqlanvil.QueryEvaluationError.ErrorLocation;return null!=e.line&&(t.line=0|e.line),null!=e.column&&(t.column=0|e.column),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.line=0,n.column=0),null!=e.line&&e.hasOwnProperty("line")&&(n.line=e.line),null!=e.column&&e.hasOwnProperty("column")&&(n.column=e.column),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.QueryEvaluationError.ErrorLocation"},t}(),t}(),r.QueryEvaluation=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.status=0,t.prototype.error=null,t.prototype.incremental=!1,t.prototype.query="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.status&&Object.hasOwnProperty.call(e,"status")&&t.uint32(8).int32(e.status),null!=e.error&&Object.hasOwnProperty.call(e,"error")&&s.sqlanvil.QueryEvaluationError.encode(e.error,t.uint32(18).fork()).ldelim(),null!=e.incremental&&Object.hasOwnProperty.call(e,"incremental")&&t.uint32(24).bool(e.incremental),null!=e.query&&Object.hasOwnProperty.call(e,"query")&&t.uint32(34).string(e.query),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.QueryEvaluation;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.status=e.int32();break;case 2:o.error=s.sqlanvil.QueryEvaluationError.decode(e,e.uint32());break;case 3:o.incremental=e.bool();break;case 4:o.query=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.status&&e.hasOwnProperty("status"))switch(e.status){default:return"status: enum value expected";case 0:case 1:}if(null!=e.error&&e.hasOwnProperty("error")){var t=s.sqlanvil.QueryEvaluationError.verify(e.error);if(t)return"error."+t}return null!=e.incremental&&e.hasOwnProperty("incremental")&&"boolean"!=typeof e.incremental?"incremental: boolean expected":null!=e.query&&e.hasOwnProperty("query")&&!a.isString(e.query)?"query: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.QueryEvaluation)return e;var t=new s.sqlanvil.QueryEvaluation;switch(e.status){default:if("number"==typeof e.status){t.status=e.status;break}break;case"SUCCESS":case 0:t.status=0;break;case"FAILURE":case 1:t.status=1}if(null!=e.error){if("object"!=typeof e.error)throw TypeError(".sqlanvil.QueryEvaluation.error: object expected");t.error=s.sqlanvil.QueryEvaluationError.fromObject(e.error)}return null!=e.incremental&&(t.incremental=Boolean(e.incremental)),null!=e.query&&(t.query=String(e.query)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.status=t.enums===String?"SUCCESS":0,n.error=null,n.incremental=!1,n.query=""),null!=e.status&&e.hasOwnProperty("status")&&(n.status=t.enums===String?void 0===s.sqlanvil.QueryEvaluation.QueryEvaluationStatus[e.status]?e.status:s.sqlanvil.QueryEvaluation.QueryEvaluationStatus[e.status]:e.status),null!=e.error&&e.hasOwnProperty("error")&&(n.error=s.sqlanvil.QueryEvaluationError.toObject(e.error,t)),null!=e.incremental&&e.hasOwnProperty("incremental")&&(n.incremental=e.incremental),null!=e.query&&e.hasOwnProperty("query")&&(n.query=e.query),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.QueryEvaluation"},t.QueryEvaluationStatus=function(){var e={},t=Object.create(e);return t[e[0]="SUCCESS"]=0,t[e[1]="FAILURE"]=1,t}(),t}(),r.RunConfig=function(){function t(e){if(this.actions=[],this.tags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.actions=a.emptyArray,t.prototype.tags=a.emptyArray,t.prototype.includeDependencies=!1,t.prototype.includeDependents=!1,t.prototype.fullRefresh=!1,t.prototype.timeoutMillis=0,t.prototype.disableSetMetadata=!1,t.prototype.useRunCache=!1,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.actions&&e.actions.length)for(var n=0;n<e.actions.length;++n)t.uint32(10).string(e.actions[n]);if(null!=e.fullRefresh&&Object.hasOwnProperty.call(e,"fullRefresh")&&t.uint32(16).bool(e.fullRefresh),null!=e.includeDependencies&&Object.hasOwnProperty.call(e,"includeDependencies")&&t.uint32(24).bool(e.includeDependencies),null!=e.tags&&e.tags.length)for(n=0;n<e.tags.length;++n)t.uint32(42).string(e.tags[n]);return null!=e.timeoutMillis&&Object.hasOwnProperty.call(e,"timeoutMillis")&&t.uint32(56).int32(e.timeoutMillis),null!=e.useRunCache&&Object.hasOwnProperty.call(e,"useRunCache")&&t.uint32(64).bool(e.useRunCache),null!=e.disableSetMetadata&&Object.hasOwnProperty.call(e,"disableSetMetadata")&&t.uint32(72).bool(e.disableSetMetadata),null!=e.includeDependents&&Object.hasOwnProperty.call(e,"includeDependents")&&t.uint32(88).bool(e.includeDependents),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.RunConfig;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.actions&&o.actions.length||(o.actions=[]),o.actions.push(e.string());break;case 5:o.tags&&o.tags.length||(o.tags=[]),o.tags.push(e.string());break;case 3:o.includeDependencies=e.bool();break;case 11:o.includeDependents=e.bool();break;case 2:o.fullRefresh=e.bool();break;case 7:o.timeoutMillis=e.int32();break;case 9:o.disableSetMetadata=e.bool();break;case 8:o.useRunCache=e.bool();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.actions&&e.hasOwnProperty("actions")){if(!Array.isArray(e.actions))return"actions: array expected";for(var t=0;t<e.actions.length;++t)if(!a.isString(e.actions[t]))return"actions: string[] expected"}if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!a.isString(e.tags[t]))return"tags: string[] expected"}return null!=e.includeDependencies&&e.hasOwnProperty("includeDependencies")&&"boolean"!=typeof e.includeDependencies?"includeDependencies: boolean expected":null!=e.includeDependents&&e.hasOwnProperty("includeDependents")&&"boolean"!=typeof e.includeDependents?"includeDependents: boolean expected":null!=e.fullRefresh&&e.hasOwnProperty("fullRefresh")&&"boolean"!=typeof e.fullRefresh?"fullRefresh: boolean expected":null!=e.timeoutMillis&&e.hasOwnProperty("timeoutMillis")&&!a.isInteger(e.timeoutMillis)?"timeoutMillis: integer expected":null!=e.disableSetMetadata&&e.hasOwnProperty("disableSetMetadata")&&"boolean"!=typeof e.disableSetMetadata?"disableSetMetadata: boolean expected":null!=e.useRunCache&&e.hasOwnProperty("useRunCache")&&"boolean"!=typeof e.useRunCache?"useRunCache: boolean expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.RunConfig)return e;var t=new s.sqlanvil.RunConfig;if(e.actions){if(!Array.isArray(e.actions))throw TypeError(".sqlanvil.RunConfig.actions: array expected");t.actions=[];for(var n=0;n<e.actions.length;++n)t.actions[n]=String(e.actions[n])}if(e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.RunConfig.tags: array expected");for(t.tags=[],n=0;n<e.tags.length;++n)t.tags[n]=String(e.tags[n])}return null!=e.includeDependencies&&(t.includeDependencies=Boolean(e.includeDependencies)),null!=e.includeDependents&&(t.includeDependents=Boolean(e.includeDependents)),null!=e.fullRefresh&&(t.fullRefresh=Boolean(e.fullRefresh)),null!=e.timeoutMillis&&(t.timeoutMillis=0|e.timeoutMillis),null!=e.disableSetMetadata&&(t.disableSetMetadata=Boolean(e.disableSetMetadata)),null!=e.useRunCache&&(t.useRunCache=Boolean(e.useRunCache)),t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.actions=[],n.tags=[]),t.defaults&&(n.fullRefresh=!1,n.includeDependencies=!1,n.timeoutMillis=0,n.useRunCache=!1,n.disableSetMetadata=!1,n.includeDependents=!1),e.actions&&e.actions.length){n.actions=[];for(var r=0;r<e.actions.length;++r)n.actions[r]=e.actions[r]}if(null!=e.fullRefresh&&e.hasOwnProperty("fullRefresh")&&(n.fullRefresh=e.fullRefresh),null!=e.includeDependencies&&e.hasOwnProperty("includeDependencies")&&(n.includeDependencies=e.includeDependencies),e.tags&&e.tags.length)for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=e.tags[r];return null!=e.timeoutMillis&&e.hasOwnProperty("timeoutMillis")&&(n.timeoutMillis=e.timeoutMillis),null!=e.useRunCache&&e.hasOwnProperty("useRunCache")&&(n.useRunCache=e.useRunCache),null!=e.disableSetMetadata&&e.hasOwnProperty("disableSetMetadata")&&(n.disableSetMetadata=e.disableSetMetadata),null!=e.includeDependents&&e.hasOwnProperty("includeDependents")&&(n.includeDependents=e.includeDependents),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.RunConfig"},t}(),r.ExecutionTask=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.type="",t.prototype.statement="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(10).string(e.type),null!=e.statement&&Object.hasOwnProperty.call(e,"statement")&&t.uint32(18).string(e.statement),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ExecutionTask;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.type=e.string();break;case 2:o.statement=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.type&&e.hasOwnProperty("type")&&!a.isString(e.type)?"type: string expected":null!=e.statement&&e.hasOwnProperty("statement")&&!a.isString(e.statement)?"statement: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ExecutionTask)return e;var t=new s.sqlanvil.ExecutionTask;return null!=e.type&&(t.type=String(e.type)),null!=e.statement&&(t.statement=String(e.statement)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.type="",n.statement=""),null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.statement&&e.hasOwnProperty("statement")&&(n.statement=e.statement),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ExecutionTask"},t}(),r.ExecutionAction=function(){function t(e){if(this.dependencyTargets=[],this.tasks=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.target=null,t.prototype.fileName="",t.prototype.type="",t.prototype.tableType="",t.prototype.dependencyTargets=a.emptyArray,t.prototype.hermeticity=0,t.prototype.tasks=a.emptyArray,t.prototype.actionDescriptor=null,t.prototype.jitCode="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.tasks&&e.tasks.length)for(var n=0;n<e.tasks.length;++n)s.sqlanvil.ExecutionTask.encode(e.tasks[n],t.uint32(18).fork()).ldelim();if(null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(34).string(e.type),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&s.sqlanvil.Target.encode(e.target,t.uint32(42).fork()).ldelim(),null!=e.tableType&&Object.hasOwnProperty.call(e,"tableType")&&t.uint32(50).string(e.tableType),null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(66).string(e.fileName),null!=e.actionDescriptor&&Object.hasOwnProperty.call(e,"actionDescriptor")&&s.sqlanvil.ActionDescriptor.encode(e.actionDescriptor,t.uint32(74).fork()).ldelim(),null!=e.hermeticity&&Object.hasOwnProperty.call(e,"hermeticity")&&t.uint32(80).int32(e.hermeticity),null!=e.dependencyTargets&&e.dependencyTargets.length)for(n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.Target.encode(e.dependencyTargets[n],t.uint32(90).fork()).ldelim();return null!=e.jitCode&&Object.hasOwnProperty.call(e,"jitCode")&&t.uint32(98).string(e.jitCode),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ExecutionAction;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 5:o.target=s.sqlanvil.Target.decode(e,e.uint32());break;case 8:o.fileName=e.string();break;case 4:o.type=e.string();break;case 6:o.tableType=e.string();break;case 11:o.dependencyTargets&&o.dependencyTargets.length||(o.dependencyTargets=[]),o.dependencyTargets.push(s.sqlanvil.Target.decode(e,e.uint32()));break;case 10:o.hermeticity=e.int32();break;case 2:o.tasks&&o.tasks.length||(o.tasks=[]),o.tasks.push(s.sqlanvil.ExecutionTask.decode(e,e.uint32()));break;case 9:o.actionDescriptor=s.sqlanvil.ActionDescriptor.decode(e,e.uint32());break;case 12:o.jitCode=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.target&&e.hasOwnProperty("target")&&(n=s.sqlanvil.Target.verify(e.target)))return"target."+n;if(null!=e.fileName&&e.hasOwnProperty("fileName")&&!a.isString(e.fileName))return"fileName: string expected";if(null!=e.type&&e.hasOwnProperty("type")&&!a.isString(e.type))return"type: string expected";if(null!=e.tableType&&e.hasOwnProperty("tableType")&&!a.isString(e.tableType))return"tableType: string expected";if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var t=0;t<e.dependencyTargets.length;++t)if(n=s.sqlanvil.Target.verify(e.dependencyTargets[t]))return"dependencyTargets."+n}if(null!=e.hermeticity&&e.hasOwnProperty("hermeticity"))switch(e.hermeticity){default:return"hermeticity: enum value expected";case 0:case 1:case 2:}if(null!=e.tasks&&e.hasOwnProperty("tasks")){if(!Array.isArray(e.tasks))return"tasks: array expected";for(t=0;t<e.tasks.length;++t){var n;if(n=s.sqlanvil.ExecutionTask.verify(e.tasks[t]))return"tasks."+n}}return null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(n=s.sqlanvil.ActionDescriptor.verify(e.actionDescriptor))?"actionDescriptor."+n:null!=e.jitCode&&e.hasOwnProperty("jitCode")&&!a.isString(e.jitCode)?"jitCode: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ExecutionAction)return e;var t=new s.sqlanvil.ExecutionAction;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.ExecutionAction.target: object expected");t.target=s.sqlanvil.Target.fromObject(e.target)}if(null!=e.fileName&&(t.fileName=String(e.fileName)),null!=e.type&&(t.type=String(e.type)),null!=e.tableType&&(t.tableType=String(e.tableType)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ExecutionAction.dependencyTargets: array expected");t.dependencyTargets=[];for(var n=0;n<e.dependencyTargets.length;++n){if("object"!=typeof e.dependencyTargets[n])throw TypeError(".sqlanvil.ExecutionAction.dependencyTargets: object expected");t.dependencyTargets[n]=s.sqlanvil.Target.fromObject(e.dependencyTargets[n])}}switch(e.hermeticity){default:if("number"==typeof e.hermeticity){t.hermeticity=e.hermeticity;break}break;case"UNKNOWN":case 0:t.hermeticity=0;break;case"HERMETIC":case 1:t.hermeticity=1;break;case"NON_HERMETIC":case 2:t.hermeticity=2}if(e.tasks){if(!Array.isArray(e.tasks))throw TypeError(".sqlanvil.ExecutionAction.tasks: array expected");for(t.tasks=[],n=0;n<e.tasks.length;++n){if("object"!=typeof e.tasks[n])throw TypeError(".sqlanvil.ExecutionAction.tasks: object expected");t.tasks[n]=s.sqlanvil.ExecutionTask.fromObject(e.tasks[n])}}if(null!=e.actionDescriptor){if("object"!=typeof e.actionDescriptor)throw TypeError(".sqlanvil.ExecutionAction.actionDescriptor: object expected");t.actionDescriptor=s.sqlanvil.ActionDescriptor.fromObject(e.actionDescriptor)}return null!=e.jitCode&&(t.jitCode=String(e.jitCode)),t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.tasks=[],n.dependencyTargets=[]),t.defaults&&(n.type="",n.target=null,n.tableType="",n.fileName="",n.actionDescriptor=null,n.hermeticity=t.enums===String?"UNKNOWN":0,n.jitCode=""),e.tasks&&e.tasks.length){n.tasks=[];for(var r=0;r<e.tasks.length;++r)n.tasks[r]=s.sqlanvil.ExecutionTask.toObject(e.tasks[r],t)}if(null!=e.type&&e.hasOwnProperty("type")&&(n.type=e.type),null!=e.target&&e.hasOwnProperty("target")&&(n.target=s.sqlanvil.Target.toObject(e.target,t)),null!=e.tableType&&e.hasOwnProperty("tableType")&&(n.tableType=e.tableType),null!=e.fileName&&e.hasOwnProperty("fileName")&&(n.fileName=e.fileName),null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(n.actionDescriptor=s.sqlanvil.ActionDescriptor.toObject(e.actionDescriptor,t)),null!=e.hermeticity&&e.hasOwnProperty("hermeticity")&&(n.hermeticity=t.enums===String?void 0===s.sqlanvil.ActionHermeticity[e.hermeticity]?e.hermeticity:s.sqlanvil.ActionHermeticity[e.hermeticity]:e.hermeticity),e.dependencyTargets&&e.dependencyTargets.length)for(n.dependencyTargets=[],r=0;r<e.dependencyTargets.length;++r)n.dependencyTargets[r]=s.sqlanvil.Target.toObject(e.dependencyTargets[r],t);return null!=e.jitCode&&e.hasOwnProperty("jitCode")&&(n.jitCode=e.jitCode),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ExecutionAction"},t}(),r.WarehouseState=function(){function t(e){if(this.tables=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.tables=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.tables&&e.tables.length)for(var n=0;n<e.tables.length;++n)s.sqlanvil.TableMetadata.encode(e.tables[n],t.uint32(10).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.WarehouseState;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?(o.tables&&o.tables.length||(o.tables=[]),o.tables.push(s.sqlanvil.TableMetadata.decode(e,e.uint32()))):e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.tables&&e.hasOwnProperty("tables")){if(!Array.isArray(e.tables))return"tables: array expected";for(var t=0;t<e.tables.length;++t){var n=s.sqlanvil.TableMetadata.verify(e.tables[t]);if(n)return"tables."+n}}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.WarehouseState)return e;var t=new s.sqlanvil.WarehouseState;if(e.tables){if(!Array.isArray(e.tables))throw TypeError(".sqlanvil.WarehouseState.tables: array expected");t.tables=[];for(var n=0;n<e.tables.length;++n){if("object"!=typeof e.tables[n])throw TypeError(".sqlanvil.WarehouseState.tables: object expected");t.tables[n]=s.sqlanvil.TableMetadata.fromObject(e.tables[n])}}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.tables=[]),e.tables&&e.tables.length){n.tables=[];for(var r=0;r<e.tables.length;++r)n.tables[r]=s.sqlanvil.TableMetadata.toObject(e.tables[r],t)}return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.WarehouseState"},t}(),r.ExecutionGraph=function(){function t(e){if(this.declarationTargets=[],this.actions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.projectConfig=null,t.prototype.runConfig=null,t.prototype.warehouseState=null,t.prototype.declarationTargets=a.emptyArray,t.prototype.actions=a.emptyArray,t.prototype.jitData=null,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.projectConfig&&Object.hasOwnProperty.call(e,"projectConfig")&&s.sqlanvil.ProjectConfig.encode(e.projectConfig,t.uint32(10).fork()).ldelim(),null!=e.runConfig&&Object.hasOwnProperty.call(e,"runConfig")&&s.sqlanvil.RunConfig.encode(e.runConfig,t.uint32(18).fork()).ldelim(),null!=e.actions&&e.actions.length)for(var n=0;n<e.actions.length;++n)s.sqlanvil.ExecutionAction.encode(e.actions[n],t.uint32(26).fork()).ldelim();if(null!=e.warehouseState&&Object.hasOwnProperty.call(e,"warehouseState")&&s.sqlanvil.WarehouseState.encode(e.warehouseState,t.uint32(34).fork()).ldelim(),null!=e.declarationTargets&&e.declarationTargets.length)for(n=0;n<e.declarationTargets.length;++n)s.sqlanvil.Target.encode(e.declarationTargets[n],t.uint32(42).fork()).ldelim();return null!=e.jitData&&Object.hasOwnProperty.call(e,"jitData")&&s.google.protobuf.Struct.encode(e.jitData,t.uint32(58).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ExecutionGraph;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.projectConfig=s.sqlanvil.ProjectConfig.decode(e,e.uint32());break;case 2:o.runConfig=s.sqlanvil.RunConfig.decode(e,e.uint32());break;case 4:o.warehouseState=s.sqlanvil.WarehouseState.decode(e,e.uint32());break;case 5:o.declarationTargets&&o.declarationTargets.length||(o.declarationTargets=[]),o.declarationTargets.push(s.sqlanvil.Target.decode(e,e.uint32()));break;case 3:o.actions&&o.actions.length||(o.actions=[]),o.actions.push(s.sqlanvil.ExecutionAction.decode(e,e.uint32()));break;case 7:o.jitData=s.google.protobuf.Struct.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.projectConfig&&e.hasOwnProperty("projectConfig")&&(n=s.sqlanvil.ProjectConfig.verify(e.projectConfig)))return"projectConfig."+n;if(null!=e.runConfig&&e.hasOwnProperty("runConfig")&&(n=s.sqlanvil.RunConfig.verify(e.runConfig)))return"runConfig."+n;if(null!=e.warehouseState&&e.hasOwnProperty("warehouseState")&&(n=s.sqlanvil.WarehouseState.verify(e.warehouseState)))return"warehouseState."+n;if(null!=e.declarationTargets&&e.hasOwnProperty("declarationTargets")){if(!Array.isArray(e.declarationTargets))return"declarationTargets: array expected";for(var t=0;t<e.declarationTargets.length;++t)if(n=s.sqlanvil.Target.verify(e.declarationTargets[t]))return"declarationTargets."+n}if(null!=e.actions&&e.hasOwnProperty("actions")){if(!Array.isArray(e.actions))return"actions: array expected";for(t=0;t<e.actions.length;++t){var n;if(n=s.sqlanvil.ExecutionAction.verify(e.actions[t]))return"actions."+n}}return null!=e.jitData&&e.hasOwnProperty("jitData")&&(n=s.google.protobuf.Struct.verify(e.jitData))?"jitData."+n:null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ExecutionGraph)return e;var t=new s.sqlanvil.ExecutionGraph;if(null!=e.projectConfig){if("object"!=typeof e.projectConfig)throw TypeError(".sqlanvil.ExecutionGraph.projectConfig: object expected");t.projectConfig=s.sqlanvil.ProjectConfig.fromObject(e.projectConfig)}if(null!=e.runConfig){if("object"!=typeof e.runConfig)throw TypeError(".sqlanvil.ExecutionGraph.runConfig: object expected");t.runConfig=s.sqlanvil.RunConfig.fromObject(e.runConfig)}if(null!=e.warehouseState){if("object"!=typeof e.warehouseState)throw TypeError(".sqlanvil.ExecutionGraph.warehouseState: object expected");t.warehouseState=s.sqlanvil.WarehouseState.fromObject(e.warehouseState)}if(e.declarationTargets){if(!Array.isArray(e.declarationTargets))throw TypeError(".sqlanvil.ExecutionGraph.declarationTargets: array expected");t.declarationTargets=[];for(var n=0;n<e.declarationTargets.length;++n){if("object"!=typeof e.declarationTargets[n])throw TypeError(".sqlanvil.ExecutionGraph.declarationTargets: object expected");t.declarationTargets[n]=s.sqlanvil.Target.fromObject(e.declarationTargets[n])}}if(e.actions){if(!Array.isArray(e.actions))throw TypeError(".sqlanvil.ExecutionGraph.actions: array expected");for(t.actions=[],n=0;n<e.actions.length;++n){if("object"!=typeof e.actions[n])throw TypeError(".sqlanvil.ExecutionGraph.actions: object expected");t.actions[n]=s.sqlanvil.ExecutionAction.fromObject(e.actions[n])}}if(null!=e.jitData){if("object"!=typeof e.jitData)throw TypeError(".sqlanvil.ExecutionGraph.jitData: object expected");t.jitData=s.google.protobuf.Struct.fromObject(e.jitData)}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.actions=[],n.declarationTargets=[]),t.defaults&&(n.projectConfig=null,n.runConfig=null,n.warehouseState=null,n.jitData=null),null!=e.projectConfig&&e.hasOwnProperty("projectConfig")&&(n.projectConfig=s.sqlanvil.ProjectConfig.toObject(e.projectConfig,t)),null!=e.runConfig&&e.hasOwnProperty("runConfig")&&(n.runConfig=s.sqlanvil.RunConfig.toObject(e.runConfig,t)),e.actions&&e.actions.length){n.actions=[];for(var r=0;r<e.actions.length;++r)n.actions[r]=s.sqlanvil.ExecutionAction.toObject(e.actions[r],t)}if(null!=e.warehouseState&&e.hasOwnProperty("warehouseState")&&(n.warehouseState=s.sqlanvil.WarehouseState.toObject(e.warehouseState,t)),e.declarationTargets&&e.declarationTargets.length)for(n.declarationTargets=[],r=0;r<e.declarationTargets.length;++r)n.declarationTargets[r]=s.sqlanvil.Target.toObject(e.declarationTargets[r],t);return null!=e.jitData&&e.hasOwnProperty("jitData")&&(n.jitData=s.google.protobuf.Struct.toObject(e.jitData,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ExecutionGraph"},t}(),r.Timing=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.startTimeMillis=0,t.prototype.endTimeMillis=0,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.startTimeMillis&&Object.hasOwnProperty.call(e,"startTimeMillis")&&t.uint32(8).int64(e.startTimeMillis),null!=e.endTimeMillis&&Object.hasOwnProperty.call(e,"endTimeMillis")&&t.uint32(16).int64(e.endTimeMillis),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.Timing;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.startTimeMillis=e.int64();break;case 2:o.endTimeMillis=e.int64();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.startTimeMillis&&e.hasOwnProperty("startTimeMillis")&&!(a.isInteger(e.startTimeMillis)||e.startTimeMillis&&a.isInteger(e.startTimeMillis.low)&&a.isInteger(e.startTimeMillis.high))?"startTimeMillis: integer|Long expected":null!=e.endTimeMillis&&e.hasOwnProperty("endTimeMillis")&&!(a.isInteger(e.endTimeMillis)||e.endTimeMillis&&a.isInteger(e.endTimeMillis.low)&&a.isInteger(e.endTimeMillis.high))?"endTimeMillis: integer|Long expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.Timing)return e;var t=new s.sqlanvil.Timing;return null!=e.startTimeMillis&&(a.Long?(t.startTimeMillis=a.Long.fromValue(e.startTimeMillis)).unsigned=!1:"string"==typeof e.startTimeMillis?t.startTimeMillis=parseInt(e.startTimeMillis,10):"number"==typeof e.startTimeMillis?t.startTimeMillis=e.startTimeMillis:"object"==typeof e.startTimeMillis&&(t.startTimeMillis=new a.LongBits(e.startTimeMillis.low>>>0,e.startTimeMillis.high>>>0).toNumber())),null!=e.endTimeMillis&&(a.Long?(t.endTimeMillis=a.Long.fromValue(e.endTimeMillis)).unsigned=!1:"string"==typeof e.endTimeMillis?t.endTimeMillis=parseInt(e.endTimeMillis,10):"number"==typeof e.endTimeMillis?t.endTimeMillis=e.endTimeMillis:"object"==typeof e.endTimeMillis&&(t.endTimeMillis=new a.LongBits(e.endTimeMillis.low>>>0,e.endTimeMillis.high>>>0).toNumber())),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.startTimeMillis=0,n.endTimeMillis=0),null!=e.startTimeMillis&&e.hasOwnProperty("startTimeMillis")&&("number"==typeof e.startTimeMillis?n.startTimeMillis=t.longs===String?String(e.startTimeMillis):e.startTimeMillis:n.startTimeMillis=t.longs===String?a.Long.prototype.toString.call(e.startTimeMillis):t.longs===Number?new a.LongBits(e.startTimeMillis.low>>>0,e.startTimeMillis.high>>>0).toNumber():e.startTimeMillis),null!=e.endTimeMillis&&e.hasOwnProperty("endTimeMillis")&&("number"==typeof e.endTimeMillis?n.endTimeMillis=t.longs===String?String(e.endTimeMillis):e.endTimeMillis:n.endTimeMillis=t.longs===String?a.Long.prototype.toString.call(e.endTimeMillis):t.longs===Number?new a.LongBits(e.endTimeMillis.low>>>0,e.endTimeMillis.high>>>0).toNumber():e.endTimeMillis),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.Timing"},t}(),r.RunResult=function(){function t(e){if(this.actions=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.status=0,t.prototype.actions=a.emptyArray,t.prototype.timing=null,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.status&&Object.hasOwnProperty.call(e,"status")&&t.uint32(8).int32(e.status),null!=e.actions&&e.actions.length)for(var n=0;n<e.actions.length;++n)s.sqlanvil.ActionResult.encode(e.actions[n],t.uint32(18).fork()).ldelim();return null!=e.timing&&Object.hasOwnProperty.call(e,"timing")&&s.sqlanvil.Timing.encode(e.timing,t.uint32(26).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.RunResult;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.status=e.int32();break;case 2:o.actions&&o.actions.length||(o.actions=[]),o.actions.push(s.sqlanvil.ActionResult.decode(e,e.uint32()));break;case 3:o.timing=s.sqlanvil.Timing.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.status&&e.hasOwnProperty("status"))switch(e.status){default:return"status: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:}if(null!=e.actions&&e.hasOwnProperty("actions")){if(!Array.isArray(e.actions))return"actions: array expected";for(var t=0;t<e.actions.length;++t)if(n=s.sqlanvil.ActionResult.verify(e.actions[t]))return"actions."+n}var n;return null!=e.timing&&e.hasOwnProperty("timing")&&(n=s.sqlanvil.Timing.verify(e.timing))?"timing."+n:null},t.fromObject=function(e){if(e instanceof s.sqlanvil.RunResult)return e;var t=new s.sqlanvil.RunResult;switch(e.status){default:if("number"==typeof e.status){t.status=e.status;break}break;case"UNKNOWN":case 0:t.status=0;break;case"RUNNING":case 1:t.status=1;break;case"SUCCESSFUL":case 2:t.status=2;break;case"FAILED":case 3:t.status=3;break;case"CANCELLED":case 4:t.status=4;break;case"TIMED_OUT":case 5:t.status=5}if(e.actions){if(!Array.isArray(e.actions))throw TypeError(".sqlanvil.RunResult.actions: array expected");t.actions=[];for(var n=0;n<e.actions.length;++n){if("object"!=typeof e.actions[n])throw TypeError(".sqlanvil.RunResult.actions: object expected");t.actions[n]=s.sqlanvil.ActionResult.fromObject(e.actions[n])}}if(null!=e.timing){if("object"!=typeof e.timing)throw TypeError(".sqlanvil.RunResult.timing: object expected");t.timing=s.sqlanvil.Timing.fromObject(e.timing)}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.actions=[]),t.defaults&&(n.status=t.enums===String?"UNKNOWN":0,n.timing=null),null!=e.status&&e.hasOwnProperty("status")&&(n.status=t.enums===String?void 0===s.sqlanvil.RunResult.ExecutionStatus[e.status]?e.status:s.sqlanvil.RunResult.ExecutionStatus[e.status]:e.status),e.actions&&e.actions.length){n.actions=[];for(var r=0;r<e.actions.length;++r)n.actions[r]=s.sqlanvil.ActionResult.toObject(e.actions[r],t)}return null!=e.timing&&e.hasOwnProperty("timing")&&(n.timing=s.sqlanvil.Timing.toObject(e.timing,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.RunResult"},t.ExecutionStatus=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN"]=0,t[e[1]="RUNNING"]=1,t[e[2]="SUCCESSFUL"]=2,t[e[3]="FAILED"]=3,t[e[4]="CANCELLED"]=4,t[e[5]="TIMED_OUT"]=5,t}(),t}(),r.ActionResult=function(){function t(e){if(this.tasks=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.target=null,t.prototype.status=0,t.prototype.tasks=a.emptyArray,t.prototype.timing=null,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.status&&Object.hasOwnProperty.call(e,"status")&&t.uint32(16).int32(e.status),null!=e.tasks&&e.tasks.length)for(var n=0;n<e.tasks.length;++n)s.sqlanvil.TaskResult.encode(e.tasks[n],t.uint32(26).fork()).ldelim();return null!=e.timing&&Object.hasOwnProperty.call(e,"timing")&&s.sqlanvil.Timing.encode(e.timing,t.uint32(34).fork()).ldelim(),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&s.sqlanvil.Target.encode(e.target,t.uint32(42).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ActionResult;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 5:o.target=s.sqlanvil.Target.decode(e,e.uint32());break;case 2:o.status=e.int32();break;case 3:o.tasks&&o.tasks.length||(o.tasks=[]),o.tasks.push(s.sqlanvil.TaskResult.decode(e,e.uint32()));break;case 4:o.timing=s.sqlanvil.Timing.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.target&&e.hasOwnProperty("target")&&(n=s.sqlanvil.Target.verify(e.target)))return"target."+n;if(null!=e.status&&e.hasOwnProperty("status"))switch(e.status){default:return"status: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:}if(null!=e.tasks&&e.hasOwnProperty("tasks")){if(!Array.isArray(e.tasks))return"tasks: array expected";for(var t=0;t<e.tasks.length;++t){var n;if(n=s.sqlanvil.TaskResult.verify(e.tasks[t]))return"tasks."+n}}return null!=e.timing&&e.hasOwnProperty("timing")&&(n=s.sqlanvil.Timing.verify(e.timing))?"timing."+n:null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ActionResult)return e;var t=new s.sqlanvil.ActionResult;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.ActionResult.target: object expected");t.target=s.sqlanvil.Target.fromObject(e.target)}switch(e.status){default:if("number"==typeof e.status){t.status=e.status;break}break;case"UNKNOWN":case 0:t.status=0;break;case"RUNNING":case 1:t.status=1;break;case"SUCCESSFUL":case 2:t.status=2;break;case"FAILED":case 3:t.status=3;break;case"SKIPPED":case 4:t.status=4;break;case"DISABLED":case 5:t.status=5;break;case"CANCELLED":case 6:t.status=6}if(e.tasks){if(!Array.isArray(e.tasks))throw TypeError(".sqlanvil.ActionResult.tasks: array expected");t.tasks=[];for(var n=0;n<e.tasks.length;++n){if("object"!=typeof e.tasks[n])throw TypeError(".sqlanvil.ActionResult.tasks: object expected");t.tasks[n]=s.sqlanvil.TaskResult.fromObject(e.tasks[n])}}if(null!=e.timing){if("object"!=typeof e.timing)throw TypeError(".sqlanvil.ActionResult.timing: object expected");t.timing=s.sqlanvil.Timing.fromObject(e.timing)}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.tasks=[]),t.defaults&&(n.status=t.enums===String?"UNKNOWN":0,n.timing=null,n.target=null),null!=e.status&&e.hasOwnProperty("status")&&(n.status=t.enums===String?void 0===s.sqlanvil.ActionResult.ExecutionStatus[e.status]?e.status:s.sqlanvil.ActionResult.ExecutionStatus[e.status]:e.status),e.tasks&&e.tasks.length){n.tasks=[];for(var r=0;r<e.tasks.length;++r)n.tasks[r]=s.sqlanvil.TaskResult.toObject(e.tasks[r],t)}return null!=e.timing&&e.hasOwnProperty("timing")&&(n.timing=s.sqlanvil.Timing.toObject(e.timing,t)),null!=e.target&&e.hasOwnProperty("target")&&(n.target=s.sqlanvil.Target.toObject(e.target,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ActionResult"},t.ExecutionStatus=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN"]=0,t[e[1]="RUNNING"]=1,t[e[2]="SUCCESSFUL"]=2,t[e[3]="FAILED"]=3,t[e[4]="SKIPPED"]=4,t[e[5]="DISABLED"]=5,t[e[6]="CANCELLED"]=6,t}(),t}(),r.TaskResult=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.status=0,t.prototype.errorMessage="",t.prototype.timing=null,t.prototype.metadata=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.status&&Object.hasOwnProperty.call(e,"status")&&t.uint32(8).int32(e.status),null!=e.errorMessage&&Object.hasOwnProperty.call(e,"errorMessage")&&t.uint32(18).string(e.errorMessage),null!=e.timing&&Object.hasOwnProperty.call(e,"timing")&&s.sqlanvil.Timing.encode(e.timing,t.uint32(26).fork()).ldelim(),null!=e.metadata&&Object.hasOwnProperty.call(e,"metadata")&&s.sqlanvil.ExecutionMetadata.encode(e.metadata,t.uint32(34).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.TaskResult;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.status=e.int32();break;case 2:o.errorMessage=e.string();break;case 3:o.timing=s.sqlanvil.Timing.decode(e,e.uint32());break;case 4:o.metadata=s.sqlanvil.ExecutionMetadata.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.status&&e.hasOwnProperty("status"))switch(e.status){default:return"status: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:}return null!=e.errorMessage&&e.hasOwnProperty("errorMessage")&&!a.isString(e.errorMessage)?"errorMessage: string expected":null!=e.timing&&e.hasOwnProperty("timing")&&(t=s.sqlanvil.Timing.verify(e.timing))?"timing."+t:null!=e.metadata&&e.hasOwnProperty("metadata")&&(t=s.sqlanvil.ExecutionMetadata.verify(e.metadata))?"metadata."+t:null;var t},t.fromObject=function(e){if(e instanceof s.sqlanvil.TaskResult)return e;var t=new s.sqlanvil.TaskResult;switch(e.status){default:if("number"==typeof e.status){t.status=e.status;break}break;case"UNKNOWN":case 0:t.status=0;break;case"RUNNING":case 1:t.status=1;break;case"SUCCESSFUL":case 2:t.status=2;break;case"FAILED":case 3:t.status=3;break;case"SKIPPED":case 4:t.status=4;break;case"CANCELLED":case 5:t.status=5}if(null!=e.errorMessage&&(t.errorMessage=String(e.errorMessage)),null!=e.timing){if("object"!=typeof e.timing)throw TypeError(".sqlanvil.TaskResult.timing: object expected");t.timing=s.sqlanvil.Timing.fromObject(e.timing)}if(null!=e.metadata){if("object"!=typeof e.metadata)throw TypeError(".sqlanvil.TaskResult.metadata: object expected");t.metadata=s.sqlanvil.ExecutionMetadata.fromObject(e.metadata)}return t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.status=t.enums===String?"UNKNOWN":0,n.errorMessage="",n.timing=null,n.metadata=null),null!=e.status&&e.hasOwnProperty("status")&&(n.status=t.enums===String?void 0===s.sqlanvil.TaskResult.ExecutionStatus[e.status]?e.status:s.sqlanvil.TaskResult.ExecutionStatus[e.status]:e.status),null!=e.errorMessage&&e.hasOwnProperty("errorMessage")&&(n.errorMessage=e.errorMessage),null!=e.timing&&e.hasOwnProperty("timing")&&(n.timing=s.sqlanvil.Timing.toObject(e.timing,t)),null!=e.metadata&&e.hasOwnProperty("metadata")&&(n.metadata=s.sqlanvil.ExecutionMetadata.toObject(e.metadata,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.TaskResult"},t.ExecutionStatus=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN"]=0,t[e[1]="RUNNING"]=1,t[e[2]="SUCCESSFUL"]=2,t[e[3]="FAILED"]=3,t[e[4]="SKIPPED"]=4,t[e[5]="CANCELLED"]=5,t}(),t}(),r.TestResult=function(){function t(e){if(this.messages=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.name="",t.prototype.successful=!1,t.prototype.messages=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.successful&&Object.hasOwnProperty.call(e,"successful")&&t.uint32(16).bool(e.successful),null!=e.messages&&e.messages.length)for(var n=0;n<e.messages.length;++n)t.uint32(26).string(e.messages[n]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.TestResult;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.name=e.string();break;case 2:o.successful=e.bool();break;case 3:o.messages&&o.messages.length||(o.messages=[]),o.messages.push(e.string());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(null!=e.successful&&e.hasOwnProperty("successful")&&"boolean"!=typeof e.successful)return"successful: boolean expected";if(null!=e.messages&&e.hasOwnProperty("messages")){if(!Array.isArray(e.messages))return"messages: array expected";for(var t=0;t<e.messages.length;++t)if(!a.isString(e.messages[t]))return"messages: string[] expected"}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.TestResult)return e;var t=new s.sqlanvil.TestResult;if(null!=e.name&&(t.name=String(e.name)),null!=e.successful&&(t.successful=Boolean(e.successful)),e.messages){if(!Array.isArray(e.messages))throw TypeError(".sqlanvil.TestResult.messages: array expected");t.messages=[];for(var n=0;n<e.messages.length;++n)t.messages[n]=String(e.messages[n])}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.messages=[]),t.defaults&&(n.name="",n.successful=!1),null!=e.name&&e.hasOwnProperty("name")&&(n.name=e.name),null!=e.successful&&e.hasOwnProperty("successful")&&(n.successful=e.successful),e.messages&&e.messages.length){n.messages=[];for(var r=0;r<e.messages.length;++r)n.messages[r]=e.messages[r]}return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.TestResult"},t}(),r.DbAdapter=function(){function t(t,n,r){e.rpc.Service.call(this,t,n,r)}return(t.prototype=Object.create(e.rpc.Service.prototype)).constructor=t,t.create=function(e,t,n){return new this(e,t,n)},Object.defineProperty(t.prototype.execute=function e(t,n){return this.rpcCall(e,s.sqlanvil.ExecuteRequest,s.sqlanvil.ExecuteResponse,t,n)},"name",{value:"Execute"}),Object.defineProperty(t.prototype.listTables=function e(t,n){return this.rpcCall(e,s.sqlanvil.ListTablesRequest,s.sqlanvil.ListTablesResponse,t,n)},"name",{value:"ListTables"}),Object.defineProperty(t.prototype.getTable=function e(t,n){return this.rpcCall(e,s.sqlanvil.GetTableRequest,s.sqlanvil.TableMetadata,t,n)},"name",{value:"GetTable"}),Object.defineProperty(t.prototype.deleteTable=function e(t,n){return this.rpcCall(e,s.sqlanvil.DeleteTableRequest,s.google.protobuf.Empty,t,n)},"name",{value:"DeleteTable"}),t}(),r.ExecuteRequest=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.statement="",t.prototype.rowLimit=0,t.prototype.byteLimit=0,t.prototype.fetchResults=!1,t.prototype.bigQueryOptions=null,t.prototype.params=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.statement&&Object.hasOwnProperty.call(e,"statement")&&t.uint32(10).string(e.statement),null!=e.rowLimit&&Object.hasOwnProperty.call(e,"rowLimit")&&t.uint32(16).int64(e.rowLimit),null!=e.byteLimit&&Object.hasOwnProperty.call(e,"byteLimit")&&t.uint32(24).int64(e.byteLimit),null!=e.fetchResults&&Object.hasOwnProperty.call(e,"fetchResults")&&t.uint32(32).bool(e.fetchResults),null!=e.bigQueryOptions&&Object.hasOwnProperty.call(e,"bigQueryOptions")&&s.sqlanvil.BigQueryExecuteOptions.encode(e.bigQueryOptions,t.uint32(42).fork()).ldelim(),null!=e.params&&Object.hasOwnProperty.call(e,"params")&&s.google.protobuf.Struct.encode(e.params,t.uint32(50).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ExecuteRequest;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.statement=e.string();break;case 2:o.rowLimit=e.int64();break;case 3:o.byteLimit=e.int64();break;case 4:o.fetchResults=e.bool();break;case 5:o.bigQueryOptions=s.sqlanvil.BigQueryExecuteOptions.decode(e,e.uint32());break;case 6:o.params=s.google.protobuf.Struct.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.statement&&e.hasOwnProperty("statement")&&!a.isString(e.statement)?"statement: string expected":null!=e.rowLimit&&e.hasOwnProperty("rowLimit")&&!(a.isInteger(e.rowLimit)||e.rowLimit&&a.isInteger(e.rowLimit.low)&&a.isInteger(e.rowLimit.high))?"rowLimit: integer|Long expected":null!=e.byteLimit&&e.hasOwnProperty("byteLimit")&&!(a.isInteger(e.byteLimit)||e.byteLimit&&a.isInteger(e.byteLimit.low)&&a.isInteger(e.byteLimit.high))?"byteLimit: integer|Long expected":null!=e.fetchResults&&e.hasOwnProperty("fetchResults")&&"boolean"!=typeof e.fetchResults?"fetchResults: boolean expected":null!=e.bigQueryOptions&&e.hasOwnProperty("bigQueryOptions")&&(t=s.sqlanvil.BigQueryExecuteOptions.verify(e.bigQueryOptions))?"bigQueryOptions."+t:null!=e.params&&e.hasOwnProperty("params")&&(t=s.google.protobuf.Struct.verify(e.params))?"params."+t:null;var t},t.fromObject=function(e){if(e instanceof s.sqlanvil.ExecuteRequest)return e;var t=new s.sqlanvil.ExecuteRequest;if(null!=e.statement&&(t.statement=String(e.statement)),null!=e.rowLimit&&(a.Long?(t.rowLimit=a.Long.fromValue(e.rowLimit)).unsigned=!1:"string"==typeof e.rowLimit?t.rowLimit=parseInt(e.rowLimit,10):"number"==typeof e.rowLimit?t.rowLimit=e.rowLimit:"object"==typeof e.rowLimit&&(t.rowLimit=new a.LongBits(e.rowLimit.low>>>0,e.rowLimit.high>>>0).toNumber())),null!=e.byteLimit&&(a.Long?(t.byteLimit=a.Long.fromValue(e.byteLimit)).unsigned=!1:"string"==typeof e.byteLimit?t.byteLimit=parseInt(e.byteLimit,10):"number"==typeof e.byteLimit?t.byteLimit=e.byteLimit:"object"==typeof e.byteLimit&&(t.byteLimit=new a.LongBits(e.byteLimit.low>>>0,e.byteLimit.high>>>0).toNumber())),null!=e.fetchResults&&(t.fetchResults=Boolean(e.fetchResults)),null!=e.bigQueryOptions){if("object"!=typeof e.bigQueryOptions)throw TypeError(".sqlanvil.ExecuteRequest.bigQueryOptions: object expected");t.bigQueryOptions=s.sqlanvil.BigQueryExecuteOptions.fromObject(e.bigQueryOptions)}if(null!=e.params){if("object"!=typeof e.params)throw TypeError(".sqlanvil.ExecuteRequest.params: object expected");t.params=s.google.protobuf.Struct.fromObject(e.params)}return t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.statement="",n.rowLimit=0,n.byteLimit=0,n.fetchResults=!1,n.bigQueryOptions=null,n.params=null),null!=e.statement&&e.hasOwnProperty("statement")&&(n.statement=e.statement),null!=e.rowLimit&&e.hasOwnProperty("rowLimit")&&("number"==typeof e.rowLimit?n.rowLimit=t.longs===String?String(e.rowLimit):e.rowLimit:n.rowLimit=t.longs===String?a.Long.prototype.toString.call(e.rowLimit):t.longs===Number?new a.LongBits(e.rowLimit.low>>>0,e.rowLimit.high>>>0).toNumber():e.rowLimit),null!=e.byteLimit&&e.hasOwnProperty("byteLimit")&&("number"==typeof e.byteLimit?n.byteLimit=t.longs===String?String(e.byteLimit):e.byteLimit:n.byteLimit=t.longs===String?a.Long.prototype.toString.call(e.byteLimit):t.longs===Number?new a.LongBits(e.byteLimit.low>>>0,e.byteLimit.high>>>0).toNumber():e.byteLimit),null!=e.fetchResults&&e.hasOwnProperty("fetchResults")&&(n.fetchResults=e.fetchResults),null!=e.bigQueryOptions&&e.hasOwnProperty("bigQueryOptions")&&(n.bigQueryOptions=s.sqlanvil.BigQueryExecuteOptions.toObject(e.bigQueryOptions,t)),null!=e.params&&e.hasOwnProperty("params")&&(n.params=s.google.protobuf.Struct.toObject(e.params,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ExecuteRequest"},t}(),r.BigQueryExecuteOptions=function(){function t(e){if(this.labels={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.interactive=!1,t.prototype.useLegacySql=!1,t.prototype.labels=a.emptyObject,t.prototype.location="",t.prototype.jobPrefix="",t.prototype.dryRun=!1,t.prototype.reservation="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.interactive&&Object.hasOwnProperty.call(e,"interactive")&&t.uint32(8).bool(e.interactive),null!=e.useLegacySql&&Object.hasOwnProperty.call(e,"useLegacySql")&&t.uint32(16).bool(e.useLegacySql),null!=e.labels&&Object.hasOwnProperty.call(e,"labels"))for(var n=Object.keys(e.labels),r=0;r<n.length;++r)t.uint32(26).fork().uint32(10).string(n[r]).uint32(18).string(e.labels[n[r]]).ldelim();return null!=e.location&&Object.hasOwnProperty.call(e,"location")&&t.uint32(34).string(e.location),null!=e.jobPrefix&&Object.hasOwnProperty.call(e,"jobPrefix")&&t.uint32(42).string(e.jobPrefix),null!=e.dryRun&&Object.hasOwnProperty.call(e,"dryRun")&&t.uint32(48).bool(e.dryRun),null!=e.reservation&&Object.hasOwnProperty.call(e,"reservation")&&t.uint32(58).string(e.reservation),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r,o,l=void 0===t?e.len:e.pos+t,c=new s.sqlanvil.BigQueryExecuteOptions;e.pos<l;){var u=e.uint32();if(u===n)break;switch(u>>>3){case 1:c.interactive=e.bool();break;case 2:c.useLegacySql=e.bool();break;case 3:c.labels===a.emptyObject&&(c.labels={});var p=e.uint32()+e.pos;for(r="",o="";e.pos<p;){var f=e.uint32();switch(f>>>3){case 1:r=e.string();break;case 2:o=e.string();break;default:e.skipType(7&f)}}c.labels[r]=o;break;case 4:c.location=e.string();break;case 5:c.jobPrefix=e.string();break;case 6:c.dryRun=e.bool();break;case 7:c.reservation=e.string();break;default:e.skipType(7&u)}}return c},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.interactive&&e.hasOwnProperty("interactive")&&"boolean"!=typeof e.interactive)return"interactive: boolean expected";if(null!=e.useLegacySql&&e.hasOwnProperty("useLegacySql")&&"boolean"!=typeof e.useLegacySql)return"useLegacySql: boolean expected";if(null!=e.labels&&e.hasOwnProperty("labels")){if(!a.isObject(e.labels))return"labels: object expected";for(var t=Object.keys(e.labels),n=0;n<t.length;++n)if(!a.isString(e.labels[t[n]]))return"labels: string{k:string} expected"}return null!=e.location&&e.hasOwnProperty("location")&&!a.isString(e.location)?"location: string expected":null!=e.jobPrefix&&e.hasOwnProperty("jobPrefix")&&!a.isString(e.jobPrefix)?"jobPrefix: string expected":null!=e.dryRun&&e.hasOwnProperty("dryRun")&&"boolean"!=typeof e.dryRun?"dryRun: boolean expected":null!=e.reservation&&e.hasOwnProperty("reservation")&&!a.isString(e.reservation)?"reservation: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.BigQueryExecuteOptions)return e;var t=new s.sqlanvil.BigQueryExecuteOptions;if(null!=e.interactive&&(t.interactive=Boolean(e.interactive)),null!=e.useLegacySql&&(t.useLegacySql=Boolean(e.useLegacySql)),e.labels){if("object"!=typeof e.labels)throw TypeError(".sqlanvil.BigQueryExecuteOptions.labels: object expected");t.labels={};for(var n=Object.keys(e.labels),r=0;r<n.length;++r)t.labels[n[r]]=String(e.labels[n[r]])}return null!=e.location&&(t.location=String(e.location)),null!=e.jobPrefix&&(t.jobPrefix=String(e.jobPrefix)),null!=e.dryRun&&(t.dryRun=Boolean(e.dryRun)),null!=e.reservation&&(t.reservation=String(e.reservation)),t},t.toObject=function(e,t){t||(t={});var n,r={};if((t.objects||t.defaults)&&(r.labels={}),t.defaults&&(r.interactive=!1,r.useLegacySql=!1,r.location="",r.jobPrefix="",r.dryRun=!1,r.reservation=""),null!=e.interactive&&e.hasOwnProperty("interactive")&&(r.interactive=e.interactive),null!=e.useLegacySql&&e.hasOwnProperty("useLegacySql")&&(r.useLegacySql=e.useLegacySql),e.labels&&(n=Object.keys(e.labels)).length){r.labels={};for(var i=0;i<n.length;++i)r.labels[n[i]]=e.labels[n[i]]}return null!=e.location&&e.hasOwnProperty("location")&&(r.location=e.location),null!=e.jobPrefix&&e.hasOwnProperty("jobPrefix")&&(r.jobPrefix=e.jobPrefix),null!=e.dryRun&&e.hasOwnProperty("dryRun")&&(r.dryRun=e.dryRun),null!=e.reservation&&e.hasOwnProperty("reservation")&&(r.reservation=e.reservation),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.BigQueryExecuteOptions"},t}(),r.ExecuteResponse=function(){function t(e){if(this.rows=[],this.errors=[],this.schemaFields=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.executionMetadata=null,t.prototype.rows=a.emptyArray,t.prototype.errors=a.emptyArray,t.prototype.schemaFields=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.executionMetadata&&Object.hasOwnProperty.call(e,"executionMetadata")&&s.sqlanvil.ExecutionMetadata.encode(e.executionMetadata,t.uint32(10).fork()).ldelim(),null!=e.rows&&e.rows.length)for(var n=0;n<e.rows.length;++n)s.google.protobuf.Struct.encode(e.rows[n],t.uint32(18).fork()).ldelim();if(null!=e.errors&&e.errors.length)for(n=0;n<e.errors.length;++n)t.uint32(26).string(e.errors[n]);if(null!=e.schemaFields&&e.schemaFields.length)for(n=0;n<e.schemaFields.length;++n)s.sqlanvil.Field.encode(e.schemaFields[n],t.uint32(34).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ExecuteResponse;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.executionMetadata=s.sqlanvil.ExecutionMetadata.decode(e,e.uint32());break;case 2:o.rows&&o.rows.length||(o.rows=[]),o.rows.push(s.google.protobuf.Struct.decode(e,e.uint32()));break;case 3:o.errors&&o.errors.length||(o.errors=[]),o.errors.push(e.string());break;case 4:o.schemaFields&&o.schemaFields.length||(o.schemaFields=[]),o.schemaFields.push(s.sqlanvil.Field.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.executionMetadata&&e.hasOwnProperty("executionMetadata")&&(n=s.sqlanvil.ExecutionMetadata.verify(e.executionMetadata)))return"executionMetadata."+n;if(null!=e.rows&&e.hasOwnProperty("rows")){if(!Array.isArray(e.rows))return"rows: array expected";for(var t=0;t<e.rows.length;++t)if(n=s.google.protobuf.Struct.verify(e.rows[t]))return"rows."+n}if(null!=e.errors&&e.hasOwnProperty("errors")){if(!Array.isArray(e.errors))return"errors: array expected";for(t=0;t<e.errors.length;++t)if(!a.isString(e.errors[t]))return"errors: string[] expected"}if(null!=e.schemaFields&&e.hasOwnProperty("schemaFields")){if(!Array.isArray(e.schemaFields))return"schemaFields: array expected";for(t=0;t<e.schemaFields.length;++t){var n;if(n=s.sqlanvil.Field.verify(e.schemaFields[t]))return"schemaFields."+n}}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ExecuteResponse)return e;var t=new s.sqlanvil.ExecuteResponse;if(null!=e.executionMetadata){if("object"!=typeof e.executionMetadata)throw TypeError(".sqlanvil.ExecuteResponse.executionMetadata: object expected");t.executionMetadata=s.sqlanvil.ExecutionMetadata.fromObject(e.executionMetadata)}if(e.rows){if(!Array.isArray(e.rows))throw TypeError(".sqlanvil.ExecuteResponse.rows: array expected");t.rows=[];for(var n=0;n<e.rows.length;++n){if("object"!=typeof e.rows[n])throw TypeError(".sqlanvil.ExecuteResponse.rows: object expected");t.rows[n]=s.google.protobuf.Struct.fromObject(e.rows[n])}}if(e.errors){if(!Array.isArray(e.errors))throw TypeError(".sqlanvil.ExecuteResponse.errors: array expected");for(t.errors=[],n=0;n<e.errors.length;++n)t.errors[n]=String(e.errors[n])}if(e.schemaFields){if(!Array.isArray(e.schemaFields))throw TypeError(".sqlanvil.ExecuteResponse.schemaFields: array expected");for(t.schemaFields=[],n=0;n<e.schemaFields.length;++n){if("object"!=typeof e.schemaFields[n])throw TypeError(".sqlanvil.ExecuteResponse.schemaFields: object expected");t.schemaFields[n]=s.sqlanvil.Field.fromObject(e.schemaFields[n])}}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.rows=[],n.errors=[],n.schemaFields=[]),t.defaults&&(n.executionMetadata=null),null!=e.executionMetadata&&e.hasOwnProperty("executionMetadata")&&(n.executionMetadata=s.sqlanvil.ExecutionMetadata.toObject(e.executionMetadata,t)),e.rows&&e.rows.length){n.rows=[];for(var r=0;r<e.rows.length;++r)n.rows[r]=s.google.protobuf.Struct.toObject(e.rows[r],t)}if(e.errors&&e.errors.length)for(n.errors=[],r=0;r<e.errors.length;++r)n.errors[r]=e.errors[r];if(e.schemaFields&&e.schemaFields.length)for(n.schemaFields=[],r=0;r<e.schemaFields.length;++r)n.schemaFields[r]=s.sqlanvil.Field.toObject(e.schemaFields[r],t);return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ExecuteResponse"},t}(),r.ListTablesRequest=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.database="",t.prototype.schema="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.database&&Object.hasOwnProperty.call(e,"database")&&t.uint32(10).string(e.database),null!=e.schema&&Object.hasOwnProperty.call(e,"schema")&&t.uint32(18).string(e.schema),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ListTablesRequest;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.database=e.string();break;case 2:o.schema=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.database&&e.hasOwnProperty("database")&&!a.isString(e.database)?"database: string expected":null!=e.schema&&e.hasOwnProperty("schema")&&!a.isString(e.schema)?"schema: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ListTablesRequest)return e;var t=new s.sqlanvil.ListTablesRequest;return null!=e.database&&(t.database=String(e.database)),null!=e.schema&&(t.schema=String(e.schema)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.database="",n.schema=""),null!=e.database&&e.hasOwnProperty("database")&&(n.database=e.database),null!=e.schema&&e.hasOwnProperty("schema")&&(n.schema=e.schema),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ListTablesRequest"},t}(),r.ListTablesResponse=function(){function t(e){if(this.tables=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.tables=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.tables&&e.tables.length)for(var n=0;n<e.tables.length;++n)s.sqlanvil.TableMetadata.encode(e.tables[n],t.uint32(10).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.ListTablesResponse;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?(o.tables&&o.tables.length||(o.tables=[]),o.tables.push(s.sqlanvil.TableMetadata.decode(e,e.uint32()))):e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.tables&&e.hasOwnProperty("tables")){if(!Array.isArray(e.tables))return"tables: array expected";for(var t=0;t<e.tables.length;++t){var n=s.sqlanvil.TableMetadata.verify(e.tables[t]);if(n)return"tables."+n}}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.ListTablesResponse)return e;var t=new s.sqlanvil.ListTablesResponse;if(e.tables){if(!Array.isArray(e.tables))throw TypeError(".sqlanvil.ListTablesResponse.tables: array expected");t.tables=[];for(var n=0;n<e.tables.length;++n){if("object"!=typeof e.tables[n])throw TypeError(".sqlanvil.ListTablesResponse.tables: object expected");t.tables[n]=s.sqlanvil.TableMetadata.fromObject(e.tables[n])}}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.tables=[]),e.tables&&e.tables.length){n.tables=[];for(var r=0;r<e.tables.length;++r)n.tables[r]=s.sqlanvil.TableMetadata.toObject(e.tables[r],t)}return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.ListTablesResponse"},t}(),r.GetTableRequest=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.target=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&s.sqlanvil.Target.encode(e.target,t.uint32(10).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.GetTableRequest;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?o.target=s.sqlanvil.Target.decode(e,e.uint32()):e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.target&&e.hasOwnProperty("target")){var t=s.sqlanvil.Target.verify(e.target);if(t)return"target."+t}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.GetTableRequest)return e;var t=new s.sqlanvil.GetTableRequest;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.GetTableRequest.target: object expected");t.target=s.sqlanvil.Target.fromObject(e.target)}return t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.target=null),null!=e.target&&e.hasOwnProperty("target")&&(n.target=s.sqlanvil.Target.toObject(e.target,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.GetTableRequest"},t}(),r.DeleteTableRequest=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.target=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&s.sqlanvil.Target.encode(e.target,t.uint32(10).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.DeleteTableRequest;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?o.target=s.sqlanvil.Target.decode(e,e.uint32()):e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.target&&e.hasOwnProperty("target")){var t=s.sqlanvil.Target.verify(e.target);if(t)return"target."+t}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.DeleteTableRequest)return e;var t=new s.sqlanvil.DeleteTableRequest;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.DeleteTableRequest.target: object expected");t.target=s.sqlanvil.Target.fromObject(e.target)}return t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.target=null),null!=e.target&&e.hasOwnProperty("target")&&(n.target=s.sqlanvil.Target.toObject(e.target,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.DeleteTableRequest"},t}(),r.RunningExecutionData=function(){function t(e){if(this.runTargets=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.runTargets=a.emptyArray,t.prototype.executionId="",t.prototype.executionStartTime=null,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.runTargets&&e.runTargets.length)for(var n=0;n<e.runTargets.length;++n)s.sqlanvil.Target.encode(e.runTargets[n],t.uint32(10).fork()).ldelim();return null!=e.executionId&&Object.hasOwnProperty.call(e,"executionId")&&t.uint32(18).string(e.executionId),null!=e.executionStartTime&&Object.hasOwnProperty.call(e,"executionStartTime")&&s.google.protobuf.Timestamp.encode(e.executionStartTime,t.uint32(26).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.RunningExecutionData;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.runTargets&&o.runTargets.length||(o.runTargets=[]),o.runTargets.push(s.sqlanvil.Target.decode(e,e.uint32()));break;case 2:o.executionId=e.string();break;case 3:o.executionStartTime=s.google.protobuf.Timestamp.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.runTargets&&e.hasOwnProperty("runTargets")){if(!Array.isArray(e.runTargets))return"runTargets: array expected";for(var t=0;t<e.runTargets.length;++t)if(n=s.sqlanvil.Target.verify(e.runTargets[t]))return"runTargets."+n}return null!=e.executionId&&e.hasOwnProperty("executionId")&&!a.isString(e.executionId)?"executionId: string expected":null!=e.executionStartTime&&e.hasOwnProperty("executionStartTime")&&(n=s.google.protobuf.Timestamp.verify(e.executionStartTime))?"executionStartTime."+n:null;var n},t.fromObject=function(e){if(e instanceof s.sqlanvil.RunningExecutionData)return e;var t=new s.sqlanvil.RunningExecutionData;if(e.runTargets){if(!Array.isArray(e.runTargets))throw TypeError(".sqlanvil.RunningExecutionData.runTargets: array expected");t.runTargets=[];for(var n=0;n<e.runTargets.length;++n){if("object"!=typeof e.runTargets[n])throw TypeError(".sqlanvil.RunningExecutionData.runTargets: object expected");t.runTargets[n]=s.sqlanvil.Target.fromObject(e.runTargets[n])}}if(null!=e.executionId&&(t.executionId=String(e.executionId)),null!=e.executionStartTime){if("object"!=typeof e.executionStartTime)throw TypeError(".sqlanvil.RunningExecutionData.executionStartTime: object expected");t.executionStartTime=s.google.protobuf.Timestamp.fromObject(e.executionStartTime)}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.runTargets=[]),t.defaults&&(n.executionId="",n.executionStartTime=null),e.runTargets&&e.runTargets.length){n.runTargets=[];for(var r=0;r<e.runTargets.length;++r)n.runTargets[r]=s.sqlanvil.Target.toObject(e.runTargets[r],t)}return null!=e.executionId&&e.hasOwnProperty("executionId")&&(n.executionId=e.executionId),null!=e.executionStartTime&&e.hasOwnProperty("executionStartTime")&&(n.executionStartTime=s.google.protobuf.Timestamp.toObject(e.executionStartTime,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.RunningExecutionData"},t}(),r.JitCompilationTargetType=function(){var e={},t=Object.create(e);return t[e[0]="JIT_COMPILATION_TARGET_TYPE_UNSPECIFIED"]=0,t[e[1]="JIT_COMPILATION_TARGET_TYPE_TABLE"]=1,t[e[2]="JIT_COMPILATION_TARGET_TYPE_OPERATION"]=2,t[e[3]="JIT_COMPILATION_TARGET_TYPE_INCREMENTAL_TABLE"]=3,t[e[4]="JIT_COMPILATION_TARGET_TYPE_ASSERTION"]=4,t}(),r.JitCompilationRequest=function(){function t(e){if(this.dependencies=[],this.filePaths=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.target=null,t.prototype.dependencies=a.emptyArray,t.prototype.jitCode="",t.prototype.jitData=null,t.prototype.compilationTargetType=0,t.prototype.filePaths=a.emptyArray,t.prototype.executionData=null,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&s.sqlanvil.Target.encode(e.target,t.uint32(10).fork()).ldelim(),null!=e.dependencies&&e.dependencies.length)for(var n=0;n<e.dependencies.length;++n)s.sqlanvil.Target.encode(e.dependencies[n],t.uint32(18).fork()).ldelim();if(null!=e.jitCode&&Object.hasOwnProperty.call(e,"jitCode")&&t.uint32(26).string(e.jitCode),null!=e.jitData&&Object.hasOwnProperty.call(e,"jitData")&&s.google.protobuf.Struct.encode(e.jitData,t.uint32(34).fork()).ldelim(),null!=e.compilationTargetType&&Object.hasOwnProperty.call(e,"compilationTargetType")&&t.uint32(40).int32(e.compilationTargetType),null!=e.filePaths&&e.filePaths.length)for(n=0;n<e.filePaths.length;++n)t.uint32(50).string(e.filePaths[n]);return null!=e.executionData&&Object.hasOwnProperty.call(e,"executionData")&&s.sqlanvil.RunningExecutionData.encode(e.executionData,t.uint32(58).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.JitCompilationRequest;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.target=s.sqlanvil.Target.decode(e,e.uint32());break;case 2:o.dependencies&&o.dependencies.length||(o.dependencies=[]),o.dependencies.push(s.sqlanvil.Target.decode(e,e.uint32()));break;case 3:o.jitCode=e.string();break;case 4:o.jitData=s.google.protobuf.Struct.decode(e,e.uint32());break;case 5:o.compilationTargetType=e.int32();break;case 6:o.filePaths&&o.filePaths.length||(o.filePaths=[]),o.filePaths.push(e.string());break;case 7:o.executionData=s.sqlanvil.RunningExecutionData.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.target&&e.hasOwnProperty("target")&&(n=s.sqlanvil.Target.verify(e.target)))return"target."+n;if(null!=e.dependencies&&e.hasOwnProperty("dependencies")){if(!Array.isArray(e.dependencies))return"dependencies: array expected";for(var t=0;t<e.dependencies.length;++t){var n;if(n=s.sqlanvil.Target.verify(e.dependencies[t]))return"dependencies."+n}}if(null!=e.jitCode&&e.hasOwnProperty("jitCode")&&!a.isString(e.jitCode))return"jitCode: string expected";if(null!=e.jitData&&e.hasOwnProperty("jitData")&&(n=s.google.protobuf.Struct.verify(e.jitData)))return"jitData."+n;if(null!=e.compilationTargetType&&e.hasOwnProperty("compilationTargetType"))switch(e.compilationTargetType){default:return"compilationTargetType: enum value expected";case 0:case 1:case 2:case 3:case 4:}if(null!=e.filePaths&&e.hasOwnProperty("filePaths")){if(!Array.isArray(e.filePaths))return"filePaths: array expected";for(t=0;t<e.filePaths.length;++t)if(!a.isString(e.filePaths[t]))return"filePaths: string[] expected"}return null!=e.executionData&&e.hasOwnProperty("executionData")&&(n=s.sqlanvil.RunningExecutionData.verify(e.executionData))?"executionData."+n:null},t.fromObject=function(e){if(e instanceof s.sqlanvil.JitCompilationRequest)return e;var t=new s.sqlanvil.JitCompilationRequest;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.JitCompilationRequest.target: object expected");t.target=s.sqlanvil.Target.fromObject(e.target)}if(e.dependencies){if(!Array.isArray(e.dependencies))throw TypeError(".sqlanvil.JitCompilationRequest.dependencies: array expected");t.dependencies=[];for(var n=0;n<e.dependencies.length;++n){if("object"!=typeof e.dependencies[n])throw TypeError(".sqlanvil.JitCompilationRequest.dependencies: object expected");t.dependencies[n]=s.sqlanvil.Target.fromObject(e.dependencies[n])}}if(null!=e.jitCode&&(t.jitCode=String(e.jitCode)),null!=e.jitData){if("object"!=typeof e.jitData)throw TypeError(".sqlanvil.JitCompilationRequest.jitData: object expected");t.jitData=s.google.protobuf.Struct.fromObject(e.jitData)}switch(e.compilationTargetType){default:if("number"==typeof e.compilationTargetType){t.compilationTargetType=e.compilationTargetType;break}break;case"JIT_COMPILATION_TARGET_TYPE_UNSPECIFIED":case 0:t.compilationTargetType=0;break;case"JIT_COMPILATION_TARGET_TYPE_TABLE":case 1:t.compilationTargetType=1;break;case"JIT_COMPILATION_TARGET_TYPE_OPERATION":case 2:t.compilationTargetType=2;break;case"JIT_COMPILATION_TARGET_TYPE_INCREMENTAL_TABLE":case 3:t.compilationTargetType=3;break;case"JIT_COMPILATION_TARGET_TYPE_ASSERTION":case 4:t.compilationTargetType=4}if(e.filePaths){if(!Array.isArray(e.filePaths))throw TypeError(".sqlanvil.JitCompilationRequest.filePaths: array expected");for(t.filePaths=[],n=0;n<e.filePaths.length;++n)t.filePaths[n]=String(e.filePaths[n])}if(null!=e.executionData){if("object"!=typeof e.executionData)throw TypeError(".sqlanvil.JitCompilationRequest.executionData: object expected");t.executionData=s.sqlanvil.RunningExecutionData.fromObject(e.executionData)}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.dependencies=[],n.filePaths=[]),t.defaults&&(n.target=null,n.jitCode="",n.jitData=null,n.compilationTargetType=t.enums===String?"JIT_COMPILATION_TARGET_TYPE_UNSPECIFIED":0,n.executionData=null),null!=e.target&&e.hasOwnProperty("target")&&(n.target=s.sqlanvil.Target.toObject(e.target,t)),e.dependencies&&e.dependencies.length){n.dependencies=[];for(var r=0;r<e.dependencies.length;++r)n.dependencies[r]=s.sqlanvil.Target.toObject(e.dependencies[r],t)}if(null!=e.jitCode&&e.hasOwnProperty("jitCode")&&(n.jitCode=e.jitCode),null!=e.jitData&&e.hasOwnProperty("jitData")&&(n.jitData=s.google.protobuf.Struct.toObject(e.jitData,t)),null!=e.compilationTargetType&&e.hasOwnProperty("compilationTargetType")&&(n.compilationTargetType=t.enums===String?void 0===s.sqlanvil.JitCompilationTargetType[e.compilationTargetType]?e.compilationTargetType:s.sqlanvil.JitCompilationTargetType[e.compilationTargetType]:e.compilationTargetType),e.filePaths&&e.filePaths.length)for(n.filePaths=[],r=0;r<e.filePaths.length;++r)n.filePaths[r]=e.filePaths[r];return null!=e.executionData&&e.hasOwnProperty("executionData")&&(n.executionData=s.sqlanvil.RunningExecutionData.toObject(e.executionData,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.JitCompilationRequest"},t}(),r.JitCompilationResponse=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var n;return t.prototype.table=null,t.prototype.operation=null,t.prototype.incrementalTable=null,t.prototype.assertion=null,Object.defineProperty(t.prototype,"response",{get:a.oneOfGetter(n=["table","operation","incrementalTable","assertion"]),set:a.oneOfSetter(n)}),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.table&&Object.hasOwnProperty.call(e,"table")&&s.sqlanvil.JitTableResult.encode(e.table,t.uint32(10).fork()).ldelim(),null!=e.operation&&Object.hasOwnProperty.call(e,"operation")&&s.sqlanvil.JitOperationResult.encode(e.operation,t.uint32(18).fork()).ldelim(),null!=e.incrementalTable&&Object.hasOwnProperty.call(e,"incrementalTable")&&s.sqlanvil.JitIncrementalTableResult.encode(e.incrementalTable,t.uint32(26).fork()).ldelim(),null!=e.assertion&&Object.hasOwnProperty.call(e,"assertion")&&s.sqlanvil.JitAssertionResult.encode(e.assertion,t.uint32(34).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.JitCompilationResponse;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.table=s.sqlanvil.JitTableResult.decode(e,e.uint32());break;case 2:o.operation=s.sqlanvil.JitOperationResult.decode(e,e.uint32());break;case 3:o.incrementalTable=s.sqlanvil.JitIncrementalTableResult.decode(e,e.uint32());break;case 4:o.assertion=s.sqlanvil.JitAssertionResult.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.table&&e.hasOwnProperty("table")&&(t.response=1,n=s.sqlanvil.JitTableResult.verify(e.table)))return"table."+n;if(null!=e.operation&&e.hasOwnProperty("operation")){if(1===t.response)return"response: multiple values";if(t.response=1,n=s.sqlanvil.JitOperationResult.verify(e.operation))return"operation."+n}if(null!=e.incrementalTable&&e.hasOwnProperty("incrementalTable")){if(1===t.response)return"response: multiple values";if(t.response=1,n=s.sqlanvil.JitIncrementalTableResult.verify(e.incrementalTable))return"incrementalTable."+n}if(null!=e.assertion&&e.hasOwnProperty("assertion")){if(1===t.response)return"response: multiple values";var n;if(t.response=1,n=s.sqlanvil.JitAssertionResult.verify(e.assertion))return"assertion."+n}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.JitCompilationResponse)return e;var t=new s.sqlanvil.JitCompilationResponse;if(null!=e.table){if("object"!=typeof e.table)throw TypeError(".sqlanvil.JitCompilationResponse.table: object expected");t.table=s.sqlanvil.JitTableResult.fromObject(e.table)}if(null!=e.operation){if("object"!=typeof e.operation)throw TypeError(".sqlanvil.JitCompilationResponse.operation: object expected");t.operation=s.sqlanvil.JitOperationResult.fromObject(e.operation)}if(null!=e.incrementalTable){if("object"!=typeof e.incrementalTable)throw TypeError(".sqlanvil.JitCompilationResponse.incrementalTable: object expected");t.incrementalTable=s.sqlanvil.JitIncrementalTableResult.fromObject(e.incrementalTable)}if(null!=e.assertion){if("object"!=typeof e.assertion)throw TypeError(".sqlanvil.JitCompilationResponse.assertion: object expected");t.assertion=s.sqlanvil.JitAssertionResult.fromObject(e.assertion)}return t},t.toObject=function(e,t){t||(t={});var n={};return null!=e.table&&e.hasOwnProperty("table")&&(n.table=s.sqlanvil.JitTableResult.toObject(e.table,t),t.oneofs&&(n.response="table")),null!=e.operation&&e.hasOwnProperty("operation")&&(n.operation=s.sqlanvil.JitOperationResult.toObject(e.operation,t),t.oneofs&&(n.response="operation")),null!=e.incrementalTable&&e.hasOwnProperty("incrementalTable")&&(n.incrementalTable=s.sqlanvil.JitIncrementalTableResult.toObject(e.incrementalTable,t),t.oneofs&&(n.response="incrementalTable")),null!=e.assertion&&e.hasOwnProperty("assertion")&&(n.assertion=s.sqlanvil.JitAssertionResult.toObject(e.assertion,t),t.oneofs&&(n.response="assertion")),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.JitCompilationResponse"},t}(),r.JitTableResult=function(){function t(e){if(this.preOps=[],this.postOps=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.query="",t.prototype.preOps=a.emptyArray,t.prototype.postOps=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.query&&Object.hasOwnProperty.call(e,"query")&&t.uint32(10).string(e.query),null!=e.preOps&&e.preOps.length)for(var n=0;n<e.preOps.length;++n)t.uint32(26).string(e.preOps[n]);if(null!=e.postOps&&e.postOps.length)for(n=0;n<e.postOps.length;++n)t.uint32(34).string(e.postOps[n]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.JitTableResult;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.query=e.string();break;case 3:o.preOps&&o.preOps.length||(o.preOps=[]),o.preOps.push(e.string());break;case 4:o.postOps&&o.postOps.length||(o.postOps=[]),o.postOps.push(e.string());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.query&&e.hasOwnProperty("query")&&!a.isString(e.query))return"query: string expected";if(null!=e.preOps&&e.hasOwnProperty("preOps")){if(!Array.isArray(e.preOps))return"preOps: array expected";for(var t=0;t<e.preOps.length;++t)if(!a.isString(e.preOps[t]))return"preOps: string[] expected"}if(null!=e.postOps&&e.hasOwnProperty("postOps")){if(!Array.isArray(e.postOps))return"postOps: array expected";for(t=0;t<e.postOps.length;++t)if(!a.isString(e.postOps[t]))return"postOps: string[] expected"}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.JitTableResult)return e;var t=new s.sqlanvil.JitTableResult;if(null!=e.query&&(t.query=String(e.query)),e.preOps){if(!Array.isArray(e.preOps))throw TypeError(".sqlanvil.JitTableResult.preOps: array expected");t.preOps=[];for(var n=0;n<e.preOps.length;++n)t.preOps[n]=String(e.preOps[n])}if(e.postOps){if(!Array.isArray(e.postOps))throw TypeError(".sqlanvil.JitTableResult.postOps: array expected");for(t.postOps=[],n=0;n<e.postOps.length;++n)t.postOps[n]=String(e.postOps[n])}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.preOps=[],n.postOps=[]),t.defaults&&(n.query=""),null!=e.query&&e.hasOwnProperty("query")&&(n.query=e.query),e.preOps&&e.preOps.length){n.preOps=[];for(var r=0;r<e.preOps.length;++r)n.preOps[r]=e.preOps[r]}if(e.postOps&&e.postOps.length)for(n.postOps=[],r=0;r<e.postOps.length;++r)n.postOps[r]=e.postOps[r];return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.JitTableResult"},t}(),r.JitIncrementalTableResult=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.regular=null,t.prototype.incremental=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.regular&&Object.hasOwnProperty.call(e,"regular")&&s.sqlanvil.JitTableResult.encode(e.regular,t.uint32(10).fork()).ldelim(),null!=e.incremental&&Object.hasOwnProperty.call(e,"incremental")&&s.sqlanvil.JitTableResult.encode(e.incremental,t.uint32(18).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.JitIncrementalTableResult;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.regular=s.sqlanvil.JitTableResult.decode(e,e.uint32());break;case 2:o.incremental=s.sqlanvil.JitTableResult.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.regular&&e.hasOwnProperty("regular")&&(t=s.sqlanvil.JitTableResult.verify(e.regular))?"regular."+t:null!=e.incremental&&e.hasOwnProperty("incremental")&&(t=s.sqlanvil.JitTableResult.verify(e.incremental))?"incremental."+t:null;var t},t.fromObject=function(e){if(e instanceof s.sqlanvil.JitIncrementalTableResult)return e;var t=new s.sqlanvil.JitIncrementalTableResult;if(null!=e.regular){if("object"!=typeof e.regular)throw TypeError(".sqlanvil.JitIncrementalTableResult.regular: object expected");t.regular=s.sqlanvil.JitTableResult.fromObject(e.regular)}if(null!=e.incremental){if("object"!=typeof e.incremental)throw TypeError(".sqlanvil.JitIncrementalTableResult.incremental: object expected");t.incremental=s.sqlanvil.JitTableResult.fromObject(e.incremental)}return t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.regular=null,n.incremental=null),null!=e.regular&&e.hasOwnProperty("regular")&&(n.regular=s.sqlanvil.JitTableResult.toObject(e.regular,t)),null!=e.incremental&&e.hasOwnProperty("incremental")&&(n.incremental=s.sqlanvil.JitTableResult.toObject(e.incremental,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.JitIncrementalTableResult"},t}(),r.JitOperationResult=function(){function t(e){if(this.queries=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.queries=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.queries&&e.queries.length)for(var n=0;n<e.queries.length;++n)t.uint32(10).string(e.queries[n]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.JitOperationResult;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?(o.queries&&o.queries.length||(o.queries=[]),o.queries.push(e.string())):e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.queries&&e.hasOwnProperty("queries")){if(!Array.isArray(e.queries))return"queries: array expected";for(var t=0;t<e.queries.length;++t)if(!a.isString(e.queries[t]))return"queries: string[] expected"}return null},t.fromObject=function(e){if(e instanceof s.sqlanvil.JitOperationResult)return e;var t=new s.sqlanvil.JitOperationResult;if(e.queries){if(!Array.isArray(e.queries))throw TypeError(".sqlanvil.JitOperationResult.queries: array expected");t.queries=[];for(var n=0;n<e.queries.length;++n)t.queries[n]=String(e.queries[n])}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.queries=[]),e.queries&&e.queries.length){n.queries=[];for(var r=0;r<e.queries.length;++r)n.queries[r]=e.queries[r]}return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.JitOperationResult"},t}(),r.JitAssertionResult=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.query="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.query&&Object.hasOwnProperty.call(e,"query")&&t.uint32(10).string(e.query),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.JitAssertionResult;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?o.query=e.string():e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.query&&e.hasOwnProperty("query")&&!a.isString(e.query)?"query: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.JitAssertionResult)return e;var t=new s.sqlanvil.JitAssertionResult;return null!=e.query&&(t.query=String(e.query)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.query=""),null!=e.query&&e.hasOwnProperty("query")&&(n.query=e.query),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.JitAssertionResult"},t}(),r.BigQuery=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.projectId="",t.prototype.credentials="",t.prototype.location="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.projectId&&Object.hasOwnProperty.call(e,"projectId")&&t.uint32(10).string(e.projectId),null!=e.credentials&&Object.hasOwnProperty.call(e,"credentials")&&t.uint32(26).string(e.credentials),null!=e.location&&Object.hasOwnProperty.call(e,"location")&&t.uint32(34).string(e.location),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.sqlanvil.BigQuery;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.projectId=e.string();break;case 3:o.credentials=e.string();break;case 4:o.location=e.string();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.projectId&&e.hasOwnProperty("projectId")&&!a.isString(e.projectId)?"projectId: string expected":null!=e.credentials&&e.hasOwnProperty("credentials")&&!a.isString(e.credentials)?"credentials: string expected":null!=e.location&&e.hasOwnProperty("location")&&!a.isString(e.location)?"location: string expected":null},t.fromObject=function(e){if(e instanceof s.sqlanvil.BigQuery)return e;var t=new s.sqlanvil.BigQuery;return null!=e.projectId&&(t.projectId=String(e.projectId)),null!=e.credentials&&(t.credentials=String(e.credentials)),null!=e.location&&(t.location=String(e.location)),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.projectId="",n.credentials="",n.location=""),null!=e.projectId&&e.hasOwnProperty("projectId")&&(n.projectId=e.projectId),null!=e.credentials&&e.hasOwnProperty("credentials")&&(n.credentials=e.credentials),null!=e.location&&e.hasOwnProperty("location")&&(n.location=e.location),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/sqlanvil.BigQuery"},t}(),r),s.google=function(){var t,n,r,l={};return l.protobuf=((r={}).Struct=function(){function t(e){if(this.fields={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.fields=a.emptyObject,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.fields&&Object.hasOwnProperty.call(e,"fields"))for(var n=Object.keys(e.fields),r=0;r<n.length;++r)t.uint32(10).fork().uint32(10).string(n[r]),s.google.protobuf.Value.encode(e.fields[n[r]],t.uint32(18).fork()).ldelim().ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r,o,l=void 0===t?e.len:e.pos+t,c=new s.google.protobuf.Struct;e.pos<l;){var u=e.uint32();if(u===n)break;if(u>>>3==1){c.fields===a.emptyObject&&(c.fields={});var p=e.uint32()+e.pos;for(r="",o=null;e.pos<p;){var f=e.uint32();switch(f>>>3){case 1:r=e.string();break;case 2:o=s.google.protobuf.Value.decode(e,e.uint32());break;default:e.skipType(7&f)}}c.fields[r]=o}else e.skipType(7&u)}return c},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.fields&&e.hasOwnProperty("fields")){if(!a.isObject(e.fields))return"fields: object expected";for(var t=Object.keys(e.fields),n=0;n<t.length;++n){var r=s.google.protobuf.Value.verify(e.fields[t[n]]);if(r)return"fields."+r}}return null},t.fromObject=function(e){if(e instanceof s.google.protobuf.Struct)return e;var t=new s.google.protobuf.Struct;if(e.fields){if("object"!=typeof e.fields)throw TypeError(".google.protobuf.Struct.fields: object expected");t.fields={};for(var n=Object.keys(e.fields),r=0;r<n.length;++r){if("object"!=typeof e.fields[n[r]])throw TypeError(".google.protobuf.Struct.fields: object expected");t.fields[n[r]]=s.google.protobuf.Value.fromObject(e.fields[n[r]])}}return t},t.toObject=function(e,t){t||(t={});var n,r={};if((t.objects||t.defaults)&&(r.fields={}),e.fields&&(n=Object.keys(e.fields)).length){r.fields={};for(var i=0;i<n.length;++i)r.fields[n[i]]=s.google.protobuf.Value.toObject(e.fields[n[i]],t)}return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/google.protobuf.Struct"},t}(),r.Value=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var n;return t.prototype.nullValue=null,t.prototype.numberValue=null,t.prototype.stringValue=null,t.prototype.boolValue=null,t.prototype.structValue=null,t.prototype.listValue=null,Object.defineProperty(t.prototype,"kind",{get:a.oneOfGetter(n=["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]),set:a.oneOfSetter(n)}),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.nullValue&&Object.hasOwnProperty.call(e,"nullValue")&&t.uint32(8).int32(e.nullValue),null!=e.numberValue&&Object.hasOwnProperty.call(e,"numberValue")&&t.uint32(17).double(e.numberValue),null!=e.stringValue&&Object.hasOwnProperty.call(e,"stringValue")&&t.uint32(26).string(e.stringValue),null!=e.boolValue&&Object.hasOwnProperty.call(e,"boolValue")&&t.uint32(32).bool(e.boolValue),null!=e.structValue&&Object.hasOwnProperty.call(e,"structValue")&&s.google.protobuf.Struct.encode(e.structValue,t.uint32(42).fork()).ldelim(),null!=e.listValue&&Object.hasOwnProperty.call(e,"listValue")&&s.google.protobuf.ListValue.encode(e.listValue,t.uint32(50).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.google.protobuf.Value;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.nullValue=e.int32();break;case 2:o.numberValue=e.double();break;case 3:o.stringValue=e.string();break;case 4:o.boolValue=e.bool();break;case 5:o.structValue=s.google.protobuf.Struct.decode(e,e.uint32());break;case 6:o.listValue=s.google.protobuf.ListValue.decode(e,e.uint32());break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.nullValue&&e.hasOwnProperty("nullValue")&&(t.kind=1,0!==e.nullValue))return"nullValue: enum value expected";if(null!=e.numberValue&&e.hasOwnProperty("numberValue")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,"number"!=typeof e.numberValue)return"numberValue: number expected"}if(null!=e.stringValue&&e.hasOwnProperty("stringValue")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,!a.isString(e.stringValue))return"stringValue: string expected"}if(null!=e.boolValue&&e.hasOwnProperty("boolValue")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,"boolean"!=typeof e.boolValue)return"boolValue: boolean expected"}if(null!=e.structValue&&e.hasOwnProperty("structValue")){if(1===t.kind)return"kind: multiple values";if(t.kind=1,n=s.google.protobuf.Struct.verify(e.structValue))return"structValue."+n}if(null!=e.listValue&&e.hasOwnProperty("listValue")){if(1===t.kind)return"kind: multiple values";var n;if(t.kind=1,n=s.google.protobuf.ListValue.verify(e.listValue))return"listValue."+n}return null},t.fromObject=function(e){if(e instanceof s.google.protobuf.Value)return e;var t=new s.google.protobuf.Value;switch(e.nullValue){default:if("number"==typeof e.nullValue){t.nullValue=e.nullValue;break}break;case"NULL_VALUE":case 0:t.nullValue=0}if(null!=e.numberValue&&(t.numberValue=Number(e.numberValue)),null!=e.stringValue&&(t.stringValue=String(e.stringValue)),null!=e.boolValue&&(t.boolValue=Boolean(e.boolValue)),null!=e.structValue){if("object"!=typeof e.structValue)throw TypeError(".google.protobuf.Value.structValue: object expected");t.structValue=s.google.protobuf.Struct.fromObject(e.structValue)}if(null!=e.listValue){if("object"!=typeof e.listValue)throw TypeError(".google.protobuf.Value.listValue: object expected");t.listValue=s.google.protobuf.ListValue.fromObject(e.listValue)}return t},t.toObject=function(e,t){t||(t={});var n={};return null!=e.nullValue&&e.hasOwnProperty("nullValue")&&(n.nullValue=t.enums===String?void 0===s.google.protobuf.NullValue[e.nullValue]?e.nullValue:s.google.protobuf.NullValue[e.nullValue]:e.nullValue,t.oneofs&&(n.kind="nullValue")),null!=e.numberValue&&e.hasOwnProperty("numberValue")&&(n.numberValue=t.json&&!isFinite(e.numberValue)?String(e.numberValue):e.numberValue,t.oneofs&&(n.kind="numberValue")),null!=e.stringValue&&e.hasOwnProperty("stringValue")&&(n.stringValue=e.stringValue,t.oneofs&&(n.kind="stringValue")),null!=e.boolValue&&e.hasOwnProperty("boolValue")&&(n.boolValue=e.boolValue,t.oneofs&&(n.kind="boolValue")),null!=e.structValue&&e.hasOwnProperty("structValue")&&(n.structValue=s.google.protobuf.Struct.toObject(e.structValue,t),t.oneofs&&(n.kind="structValue")),null!=e.listValue&&e.hasOwnProperty("listValue")&&(n.listValue=s.google.protobuf.ListValue.toObject(e.listValue,t),t.oneofs&&(n.kind="listValue")),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/google.protobuf.Value"},t}(),r.NullValue=(t={},(n=Object.create(t))[t[0]="NULL_VALUE"]=0,n),r.ListValue=function(){function t(e){if(this.values=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.values=a.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=o.create()),null!=e.values&&e.values.length)for(var n=0;n<e.values.length;++n)s.google.protobuf.Value.encode(e.values[n],t.uint32(10).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.google.protobuf.ListValue;e.pos<r;){var a=e.uint32();if(a===n)break;a>>>3==1?(o.values&&o.values.length||(o.values=[]),o.values.push(s.google.protobuf.Value.decode(e,e.uint32()))):e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.values&&e.hasOwnProperty("values")){if(!Array.isArray(e.values))return"values: array expected";for(var t=0;t<e.values.length;++t){var n=s.google.protobuf.Value.verify(e.values[t]);if(n)return"values."+n}}return null},t.fromObject=function(e){if(e instanceof s.google.protobuf.ListValue)return e;var t=new s.google.protobuf.ListValue;if(e.values){if(!Array.isArray(e.values))throw TypeError(".google.protobuf.ListValue.values: array expected");t.values=[];for(var n=0;n<e.values.length;++n){if("object"!=typeof e.values[n])throw TypeError(".google.protobuf.ListValue.values: object expected");t.values[n]=s.google.protobuf.Value.fromObject(e.values[n])}}return t},t.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.values=[]),e.values&&e.values.length){n.values=[];for(var r=0;r<e.values.length;++r)n.values[r]=s.google.protobuf.Value.toObject(e.values[r],t)}return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/google.protobuf.ListValue"},t}(),r.Empty=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.google.protobuf.Empty;e.pos<r;){var a=e.uint32();if(a===n)break;e.skipType(7&a)}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null},t.fromObject=function(e){return e instanceof s.google.protobuf.Empty?e:new s.google.protobuf.Empty},t.toObject=function(){return{}},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/google.protobuf.Empty"},t}(),r.Timestamp=function(){function t(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return t.prototype.seconds=0,t.prototype.nanos=0,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=o.create()),null!=e.seconds&&Object.hasOwnProperty.call(e,"seconds")&&t.uint32(8).int64(e.seconds),null!=e.nanos&&Object.hasOwnProperty.call(e,"nanos")&&t.uint32(16).int32(e.nanos),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n){e instanceof i||(e=i.create(e));for(var r=void 0===t?e.len:e.pos+t,o=new s.google.protobuf.Timestamp;e.pos<r;){var a=e.uint32();if(a===n)break;switch(a>>>3){case 1:o.seconds=e.int64();break;case 2:o.nanos=e.int32();break;default:e.skipType(7&a)}}return o},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.seconds&&e.hasOwnProperty("seconds")&&!(a.isInteger(e.seconds)||e.seconds&&a.isInteger(e.seconds.low)&&a.isInteger(e.seconds.high))?"seconds: integer|Long expected":null!=e.nanos&&e.hasOwnProperty("nanos")&&!a.isInteger(e.nanos)?"nanos: integer expected":null},t.fromObject=function(e){if(e instanceof s.google.protobuf.Timestamp)return e;var t=new s.google.protobuf.Timestamp;return null!=e.seconds&&(a.Long?(t.seconds=a.Long.fromValue(e.seconds)).unsigned=!1:"string"==typeof e.seconds?t.seconds=parseInt(e.seconds,10):"number"==typeof e.seconds?t.seconds=e.seconds:"object"==typeof e.seconds&&(t.seconds=new a.LongBits(e.seconds.low>>>0,e.seconds.high>>>0).toNumber())),null!=e.nanos&&(t.nanos=0|e.nanos),t},t.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.seconds=0,n.nanos=0),null!=e.seconds&&e.hasOwnProperty("seconds")&&("number"==typeof e.seconds?n.seconds=t.longs===String?String(e.seconds):e.seconds:n.seconds=t.longs===String?a.Long.prototype.toString.call(e.seconds):t.longs===Number?new a.LongBits(e.seconds.low>>>0,e.seconds.high>>>0).toNumber():e.seconds),null!=e.nanos&&e.hasOwnProperty("nanos")&&(n.nanos=e.nanos),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/google.protobuf.Timestamp"},t}(),r),l}(),s})?r.apply(t,i):r)||(e.exports=o)},5388(e,t,n){"use strict";var r=n(1231),i=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],o=["scalar","sequence","mapping"];e.exports=function(e,t){var n,a;if(t=t||{},Object.keys(t).forEach((function(t){if(-1===i.indexOf(t))throw new r('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=(n=t.styleAliases||null,a={},null!==n&&Object.keys(n).forEach((function(e){n[e].forEach((function(t){a[String(t)]=e}))})),a),-1===o.indexOf(this.kind))throw new r('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}},5436(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5379);var i=n(3560);t.RlsPolicy=i.RlsPolicy;var o=n(8390);t.RealtimePublication=o.RealtimePublication;var a=n(7287);t.Wrapper=a.Wrapper;var s=n(6515);t.ForeignTable=s.ForeignTable;var l=n(8202);t.VectorIndex=l.VectorIndex;var c=n(8771);t.ActionBuilder=c.ActionBuilder,t.checkConfigAdditionalOptionsOverlap=function(e,t){const n=r.sqlanvil.Target.create({database:e.project,schema:e.dataset,name:e.name});e.partitionExpirationDays&&e.additionalOptions.partition_expiration_days&&t.compileError("partitionExpirationDays has been declared twice",e.filename,n),e.requirePartitionFilter&&e.additionalOptions.require_partition_filter&&t.compileError("requirePartitionFilter has been declared twice",e.filename,n)},t.TableType=["table","view","incremental"],t.LegacyConfigConverter=class{static legacyConvertBigQueryOptions(e){let t={};return Object.entries(e).forEach((([e,n])=>{Array.isArray(n)&&0===n.length||"object"==typeof n&&0===Object.entries(n).length||n&&(t=Object.assign(Object.assign({},t),{[e]:n}))})),t}static insertLegacyInlineAssertionsToConfigProto(e){var t,n,i;const o=e;return(null==o?void 0:o.assertions)&&("string"==typeof(null===(t=o.assertions)||void 0===t?void 0:t.uniqueKey)&&(o.assertions.uniqueKey=[o.assertions.uniqueKey]),(null===(i=null===(n=o.assertions.uniqueKeys)||void 0===n?void 0:n[0])||void 0===i?void 0:i.length)>0&&(o.assertions.uniqueKeys=o.assertions.uniqueKeys.map((e=>r.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey.create({uniqueKey:e})))),"string"==typeof o.assertions.nonNull&&(o.assertions.nonNull=[o.assertions.nonNull])),o}static insertLegacyBigQueryOptionsToConfigProto(e){const t=e;return(null==t?void 0:t.bigquery)?(t.bigquery.partitionBy&&(t.partitionBy=t.bigquery.partitionBy,delete t.bigquery.partitionBy),t.bigquery.clusterBy&&(t.clusterBy=t.bigquery.clusterBy,delete t.bigquery.clusterBy),t.bigquery.updatePartitionFilter&&(t.updatePartitionFilter=t.bigquery.updatePartitionFilter,delete t.bigquery.updatePartitionFilter),t.bigquery.labels&&(t.labels=t.bigquery.labels,delete t.bigquery.labels),t.bigquery.partitionExpirationDays&&(t.partitionExpirationDays=t.bigquery.partitionExpirationDays,delete t.bigquery.partitionExpirationDays),t.bigquery.requirePartitionFilter&&(t.requirePartitionFilter=t.bigquery.requirePartitionFilter,delete t.bigquery.requirePartitionFilter),t.bigquery.additionalOptions&&(t.additionalOptions=t.bigquery.additionalOptions,delete t.bigquery.additionalOptions),t.bigquery.iceberg&&(t.iceberg=t.bigquery.iceberg,delete t.bigquery.iceberg),0===Object.keys(t.bigquery).length&&delete t.bigquery,t):t}}},5489(e,t,n){"use strict";e.exports=n(1769).extend({implicit:[n(127),n(1851)],explicit:[n(9342),n(6946),n(6942),n(6663)]})},5643(e,t,n){"use strict";e.exports=a;var r=n(7209);((a.prototype=Object.create(r.prototype)).constructor=a).className="Enum";var i=n(8923),o=n(3262);function a(e,t,n,i,o,a){if(r.call(this,e,n),t&&"object"!=typeof t)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=i,this.comments=o||{},this.valuesOptions=a,this._valuesFeatures={},this.reserved=void 0,t)for(var s=Object.keys(t),l=0;l<s.length;++l)"number"==typeof t[s[l]]&&(this.valuesById[this.values[s[l]]=t[s[l]]]=s[l])}a.prototype._resolveFeatures=function(e){return e=this._edition||e,r.prototype._resolveFeatures.call(this,e),Object.keys(this.values).forEach((e=>{var t=Object.assign({},this._features);this._valuesFeatures[e]=Object.assign(t,this.valuesOptions&&this.valuesOptions[e]&&this.valuesOptions[e].features)})),this},a.fromJSON=function(e,t){var n=new a(e,t.values,t.options,t.comment,t.comments);return n.reserved=t.reserved,t.edition&&(n._edition=t.edition),n._defaultEdition="proto3",n},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["edition",this._editionToJSON(),"options",this.options,"valuesOptions",this.valuesOptions,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},a.prototype.add=function(e,t,n,r){if(!o.isString(e))throw TypeError("name must be a string");if(!o.isInteger(t))throw TypeError("id must be an integer");if(void 0!==this.values[e])throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(void 0!==this.valuesById[t]){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return r&&(void 0===this.valuesOptions&&(this.valuesOptions={}),this.valuesOptions[e]=r||null),this.comments[e]=n||null,this},a.prototype.remove=function(e){if(!o.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(null==t)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this.valuesOptions&&delete this.valuesOptions[e],this},a.prototype.isReservedId=function(e){return i.isReservedId(this.reserved,e)},a.prototype.isReservedName=function(e){return i.isReservedName(this.reserved,e)}},6184(e,t,n){"use strict";e.exports=n(7759).extend({implicit:[n(9198),n(6199),n(4466),n(1461)]})},6199(e,t,n){"use strict";var r=n(5388);e.exports=new r("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},6237(e,t,n){"use strict";e.exports=l;var r,i=n(3610),o=i.LongBits,a=i.utf8;function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function l(e){this.buf=e,this.pos=0,this.len=e.length}var c,u="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new l(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new l(e);throw Error("illegal buffer")},p=function(){return i.Buffer?function(e){return(l.create=function(e){return i.Buffer.isBuffer(e)?new r(e):u(e)})(e)}:u};function f(){var e=new o(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw s(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw s(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function d(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function g(){if(this.pos+8>this.len)throw s(this,8);return new o(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}l.create=p(),l.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,l.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return c;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return c}),l.prototype.int32=function(){return 0|this.uint32()},l.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},l.prototype.bool=function(){return 0!==this.uint32()},l.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return d(this.buf,this.pos+=4)},l.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|d(this.buf,this.pos+=4)},l.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},l.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},l.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw s(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,n);if(t===n){var r=i.Buffer;return r?r.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,n)},l.prototype.string=function(){var e=this.bytes();return a.read(e,0,e.length)},l.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw s(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},l.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},l._configure=function(e){r=e,l.create=p(),r._configure();var t=i.Long?"toLong":"toNumber";i.merge(l.prototype,{int64:function(){return f.call(this)[t](!1)},uint64:function(){return f.call(this)[t](!0)},sint64:function(){return f.call(this).zzDecode()[t](!1)},fixed64:function(){return g.call(this)[t](!0)},sfixed64:function(){return g.call(this)[t](!1)}})}},6434(e,t,n){"use strict";var r=t,i=n(2551);r[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),n=this.lookup(t);if(n){var r="."===e["@type"].charAt(0)?e["@type"].slice(1):e["@type"];return-1===r.indexOf("/")&&(r="/"+r),this.create({type_url:r,value:n.encode(n.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){var n="",r="";if(t&&t.json&&e.type_url&&e.value){r=e.type_url.substring(e.type_url.lastIndexOf("/")+1),n=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var o=this.lookup(r);o&&(e=o.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof i){var a=e.$type.toObject(e,t);return""===n&&(n="type.googleapis.com/"),r=n+("."===e.$type.fullName[0]?e.$type.fullName.slice(1):e.$type.fullName),a["@type"]=r,a}return this.toObject(e,t)}}},6515(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8512),i=n(8771),o=n(5379);class a extends i.ActionBuilder{constructor(e,t){super(e),this.proto=o.sqlanvil.Operation.create(),this.session=e,this.config=t;const n=o.sqlanvil.Target.create({name:t.name,schema:t.schema});this.proto.target=this.applySessionToTarget(n,e.projectConfig,t.filename,{validateTarget:!0}),this.proto.canonicalTarget=this.applySessionToTarget(n,e.canonicalProjectConfig),this.proto.fileName=t.filename||"",this.proto.hasOutput=!0,this.proto.dependencyTargets=[o.sqlanvil.Target.create({name:t.dependsOn})]}getFileName(){return this.proto.fileName}getTarget(){return o.sqlanvil.Target.create(this.proto.target)}compile(){const e=this.config.schema?`"${this.config.schema}"."${this.config.name}"`:`"${this.config.name}"`,t=Object.entries(this.config.columns||{}).map((([e,t])=>`"${e}" ${t}`)),n=t.length>0?` (${t.join(", ")})`:"",i=Object.entries(this.config.options||{}).map((([e,t])=>`${e} '${String(t).replace(/'/g,"''")}'`)),a=i.length>0?` options (${i.join(", ")})`:"";return this.proto.queries=[`drop foreign table if exists ${e}`,`create foreign table ${e}${n} server "${this.config.server}"${a}`],r.verifyObjectMatchesProto(o.sqlanvil.Operation,this.proto,r.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM)}}t.ForeignTable=a},6660(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8512),i=n(5436),o=n(8545),a=n(2545),s=n(5379);class l extends i.ActionBuilder{constructor(e,t,n){var r;if(super(e),this.proto=s.sqlanvil.Declaration.create(),this.session=e,!t)return;const i=this.verifyConfig(t);if(!i.name)throw Error("Declarations must have a populated 'name' field.");const o=a.actionConfigToCompiledGraphTarget(i);return this.proto.target=this.applySessionToTarget(o,e.projectConfig,i.filename||n),this.proto.canonicalTarget=this.applySessionToTarget(o,e.canonicalProjectConfig),i.description&&this.description(i.description),(null===(r=i.columns)||void 0===r?void 0:r.length)&&this.columns(i.columns.map((e=>s.sqlanvil.ActionConfig.ColumnDescriptor.create(e)))),this.proto.fileName=i.filename||n,this.proto.tags=i.tags||[],this}description(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.description=e,this}columns(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.columns=o.ColumnDescriptors.mapConfigProtoToCompilationProto(e),this}getFileName(){return this.proto.fileName}getTarget(){return s.sqlanvil.Target.create(this.proto.target)}compile(){return r.verifyObjectMatchesProto(s.sqlanvil.Declaration,this.proto,r.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM)}verifyConfig(e){return e.database&&(e.project=e.database,delete e.database),e.schema&&(e.dataset=e.schema,delete e.schema),e.columns&&(e.columns=o.ColumnDescriptors.mapLegacyObjectToConfigProto(e.columns)),e.type&&delete e.type,r.verifyObjectMatchesProto(s.sqlanvil.ActionConfig.DeclarationConfig,e,r.VerifyProtoErrorBehaviour.SHOW_DOCS_LINK)}}t.Declaration=l},6663(e,t,n){"use strict";var r=n(5388),i=Object.prototype.hasOwnProperty;e.exports=new r("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var t,n=e;for(t in n)if(i.call(n,t)&&null!==n[t])return!1;return!0},construct:function(e){return null!==e?e:{}}})},6899(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8043),i=n(5379);function o(e){return t=>new Function("jctx",`const mainAsync = ${e};\nreturn mainAsync(jctx);`)(t)}function a(e){let t={};return"string"==typeof e?t.query=e:t=e,i.sqlanvil.JitTableResult.create(t)}function s(e,t){const n=i.sqlanvil.DbAdapter.create(((e,n,r)=>{t(e.name,n,r)}));switch(e.compilationTargetType){case i.sqlanvil.JitCompilationTargetType.JIT_COMPILATION_TARGET_TYPE_OPERATION:return function(e,t){return o(e.jitCode)(new r.SqlActionJitContext(t,e)).then((e=>{let t=[];return"string"==typeof e?t.push(e):Array.isArray(e)?t.push(...e):t=e.queries,i.sqlanvil.JitOperationResult.create({queries:t})}))}(e,n).then((e=>i.sqlanvil.JitCompilationResponse.create({operation:e})));case i.sqlanvil.JitCompilationTargetType.JIT_COMPILATION_TARGET_TYPE_TABLE:return function(e,t){return o(e.jitCode)(new r.TableJitContext(t,e)).then(a)}(e,n).then((e=>i.sqlanvil.JitCompilationResponse.create({table:e})));case i.sqlanvil.JitCompilationTargetType.JIT_COMPILATION_TARGET_TYPE_INCREMENTAL_TABLE:return function(e,t){const n=o(e.jitCode),s=new r.IncrementalTableJitContext(t,e,!0),l=new r.IncrementalTableJitContext(t,e,!1);return Promise.all([n(s),n(l)]).then((([e,t])=>i.sqlanvil.JitIncrementalTableResult.create({incremental:a(e),regular:a(t)})))}(e,n).then((e=>i.sqlanvil.JitCompilationResponse.create({incrementalTable:e})));case i.sqlanvil.JitCompilationTargetType.JIT_COMPILATION_TARGET_TYPE_ASSERTION:return function(e,t){return o(e.jitCode)(new r.SqlActionJitContext(t,e)).then((e=>i.sqlanvil.JitAssertionResult.create({query:e})))}(e,n).then((e=>i.sqlanvil.JitCompilationResponse.create({assertion:e})));default:throw new Error(`Unrecognized compilation target type: ${e.compilationTargetType}`)}}t.jitCompile=s,t.jitCompiler=function(e){return{compile:t=>s(i.sqlanvil.JitCompilationRequest.decode(t),e).then((e=>i.sqlanvil.JitCompilationResponse.encode(e).finish()))}}},6942(e,t,n){"use strict";var r=n(5388),i=Object.prototype.toString;e.exports=new r("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,o,a,s=e;for(a=new Array(s.length),t=0,n=s.length;t<n;t+=1){if(r=s[t],"[object Object]"!==i.call(r))return!1;if(1!==(o=Object.keys(r)).length)return!1;a[t]=[o[0],r[o[0]]]}return!0},construct:function(e){if(null===e)return[];var t,n,r,i,o,a=e;for(o=new Array(a.length),t=0,n=a.length;t<n;t+=1)r=a[t],i=Object.keys(r),o[t]=[i[0],r[i[0]]];return o}})},6946(e,t,n){"use strict";var r=n(5388),i=Object.prototype.hasOwnProperty,o=Object.prototype.toString;e.exports=new r("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,a,s,l=[],c=e;for(t=0,n=c.length;t<n;t+=1){if(r=c[t],s=!1,"[object Object]"!==o.call(r))return!1;for(a in r)if(i.call(r,a)){if(s)return!1;s=!0}if(!s)return!1;if(-1!==l.indexOf(a))return!1;l.push(a)}return!0},construct:function(e){return null!==e?e:[]}})},7180(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(9364)),a=n(8512),s=n(5436),l=n(7848),c=n(3788),u=n(6660),p=n(1299),f=n(2795),d=n(9293),g=n(2008),h=n(4098),y=n(8995),m=n(1287),b=n(3162),v=i(n(2545)),O=n(2545),T=n(2628),w=n(5379),j={defaultSchema:"sqlanvil",assertionSchema:"sqlanvil_assertions"};function q(e){return"view"===e||"table"===e||"incremental"===e}t.Session=class{constructor(e,t,n){this.actionAssertionMap=new O.ResolvableMap,this.init(e,t,n)}init(e,t,n){this.rootDir=e,this.projectConfig=w.sqlanvil.ProjectConfig.create(t||j),this.canonicalProjectConfig=function(e){return w.sqlanvil.ProjectConfig.create({warehouse:e.warehouse,defaultSchema:e.defaultSchema,defaultDatabase:e.defaultDatabase,assertionSchema:e.assertionSchema})}(w.sqlanvil.ProjectConfig.create(n||t||j)),this.actions=[],this.foreignServers=new Set,this.tests=[],this.graphErrors={compilationErrors:[]},this.jitContextData=new w.google.protobuf.Struct}compilationSql(){return new m.CompilationSql(this.projectConfig,T.version)}sqlxAction(e){const{sqlxConfig:t}=e,n=t.hasOwnProperty("type")?t.type:"operations";switch(e.sqlStatementCount>1&&"operations"!==n&&this.compileError("Actions may only contain more than one SQL statement if they are of type 'operations'."),t.hasOwnProperty("protected")&&"incremental"!==n&&this.compileError("Actions may only specify 'protected: true' if they are of type 'incremental'."),e.incrementalWhereContextable&&"incremental"!==n&&this.compileError("Actions may only include incremental_where if they are of type 'incremental'."),e.inputContextables.length>0&&"test"!==n&&this.compileError("Actions may only include input blocks if they are of type 'test'."),e.preOperationsContextable&&!q(n)&&this.compileError("Actions may only include pre_operations if they create a dataset."),e.postOperationsContextable&&!q(n)&&this.compileError("Actions may only include post_operations if they create a dataset."),t.filename||(t.filename=v.getCallerFile(this.rootDir)),n){case"view":const n=new y.View(this,t).query((t=>e.sqlContextable(t)[0]));e.incrementalWhereContextable&&n.where(e.incrementalWhereContextable),e.preOperationsContextable&&n.preOps(e.preOperationsContextable),e.postOperationsContextable&&n.postOps(e.postOperationsContextable),this.actions.push(n);break;case"incremental":const r=new p.IncrementalTable(this,t).query((t=>e.sqlContextable(t)[0]));e.incrementalWhereContextable&&r.where(e.incrementalWhereContextable),e.preOperationsContextable&&r.preOps(e.preOperationsContextable),e.postOperationsContextable&&r.postOps(e.postOperationsContextable),this.actions.push(r);break;case"table":const i=new g.Table(this,t).query((t=>e.sqlContextable(t)[0]));e.incrementalWhereContextable&&i.where(e.incrementalWhereContextable),e.preOperationsContextable&&i.preOps(e.preOperationsContextable),e.postOperationsContextable&&i.postOps(e.postOperationsContextable),this.actions.push(i);break;case"assertion":this.actions.push(new l.Assertion(this,t).query((t=>e.sqlContextable(t)[0])));break;case"dataPreparation":const o=new c.DataPreparation(this,t).query((t=>e.sqlContextable(t)[0]));this.actions.push(o);break;case"operations":this.actions.push(new d.Operation(this,t).queries(e.sqlContextable));break;case"declaration":this.declare(t);break;case"test":const a=this.test(t.name).config(t).expect((t=>e.sqlContextable(t)[0]));e.inputContextables.forEach((({refName:e,contextable:t})=>{a.input(e,t)}));break;default:throw new Error(`Unrecognized action type: ${t.type}`)}}findActions(e){const t=this.indexedActions.find(e);if(t.length<=1)return t;let n=t;if(!e.database&&this.projectConfig.defaultDatabase){const e=n.filter((e=>e.getTarget().database===this.projectConfig.defaultDatabase));e.length>0&&(n=e)}if(!e.schema&&this.projectConfig.defaultSchema){const e=n.filter((e=>e.getTarget().schema===this.projectConfig.defaultSchema));e.length>0&&(n=e)}return 1===n.length?n:t}resolve(e,...t){e=O.toResolvable(e,t);const n=this.findActions(v.resolvableAsTarget(e));if(n.length>1)return this.compileError(new Error(v.ambiguousActionNameMsg(e,n))),"";const r=n.length>0?n[0]:void 0;return r&&r instanceof d.Operation&&!r.getHasOutput()?(this.compileError(new Error("Actions cannot resolve operations which do not produce output.")),""):r?r instanceof u.Declaration?this.compilationSql().resolveTarget(r.getTarget()):this.compilationSql().resolveTarget(Object.assign(Object.assign({},r.getTarget()),{database:r.getTarget().database&&this.finalizeDatabase(r.getTarget().database),schema:this.finalizeSchema(r.getTarget().schema),name:this.finalizeName(r.getTarget().name)})):(this.compileError(new Error(`Could not resolve ${JSON.stringify(e)}`)),"")}operate(e,t){const n=v.getCallerFile(this.rootDir);let r;return t&&"object"==typeof t?r=new d.Operation(this,Object.assign({name:e,filename:n},t)):(r=new d.Operation(this,{name:e,filename:n}),t&&r.queries(t)),this.actions.push(r),r}rlsPolicy(e){const t=v.getCallerFile(this.rootDir),n=new s.RlsPolicy(this,Object.assign({filename:t},e));return this.actions.push(n),n}realtimePublication(e){const t=v.getCallerFile(this.rootDir),n=new s.RealtimePublication(this,Object.assign({filename:t},e));return this.actions.push(n),n}wrapper(e){const t=v.getCallerFile(this.rootDir),n=new s.Wrapper(this,Object.assign({filename:t},e));return this.actions.push(n),(e.foreignTables||[]).forEach((n=>{const r=new s.ForeignTable(this,{filename:t,name:n.name,schema:n.schema,server:e.server,options:n.options,columns:n.columns,dependsOn:e.name});this.actions.push(r)})),n}vectorIndex(e){const t=v.getCallerFile(this.rootDir),n=new s.VectorIndex(this,Object.assign({filename:t},e));return this.actions.push(n),n}publish(e,t){const n=v.getCallerFile(this.rootDir);let r=new y.View(this,{type:"view",name:e,filename:n});if(t)if("object"==typeof t)if("view"===(null==t?void 0:t.type)||void 0===t.type)r=new y.View(this,Object.assign({type:"view",name:e,filename:n},t));else if("incremental"===(null==t?void 0:t.type))r=new p.IncrementalTable(this,Object.assign({type:"incremental",name:e,filename:n},t));else{if("table"!==(null==t?void 0:t.type))throw Error(`Unrecognized table type: ${t.type}`);r=new g.Table(this,Object.assign({type:"table",name:e,filename:n},t))}else r.query(t);return this.actions.push(r),r}assert(e,t){const n=v.getCallerFile(this.rootDir);let r;return t&&"object"==typeof t?r=new l.Assertion(this,Object.assign({name:e,filename:n},t)):(r=new l.Assertion(this,{name:e,filename:n}),t&&r.query(t)),this.actions.push(r),r}declare(e){const t=e.filename||v.getCallerFile(this.rootDir),n=e.connection,r=this.projectConfig.warehouseConnection;if(!n||n===r){const n=new u.Declaration(this,e,t);return this.actions.push(n),n}const i=(this.projectConfig.connections||{})[n],o=new u.Declaration(this,e,t);if(!i)return this.compileError(new Error(`Unknown connection "${n}" on declaration "${e.name}".`),t,o.getTarget()),this.actions.push(o),o;const a=e.columnTypes||{};if(0===Object.keys(a).length)return this.compileError(new Error(`Declaration "${e.name}" on connection "${n}" requires \`columnTypes\`; run \`sqlanvil introspect ${n} ${e.schema||""}.${e.name}\`.`),t,o.getTarget()),this.actions.push(o),o;if("postgres"!==this.projectConfig.warehouse&&"supabase"!==this.projectConfig.warehouse)return this.compileError(new Error(`Reading connection "${n}" from a ${this.projectConfig.warehouse} warehouse is not yet supported.`),t,o.getTarget()),this.actions.push(o),o;const l=`${n}_srv`,c=`${n}_ext`;this.foreignServers.has(n)||(this.foreignServers.add(n),"bigquery"===i.platform?this.actions.push(new s.Wrapper(this,{filename:t,name:l,provider:"bigquery",server:l,serverOptions:{project_id:i.project,dataset_id:i.dataset},credential:{saKeyId:i.saKeyId}})):this.actions.push(new s.Wrapper(this,{filename:t,name:l,provider:"postgres_fdw",server:l,serverOptions:{host:i.host,port:String(i.port||5432),dbname:i.database},userMappingConnection:n})));const p="bigquery"===i.platform?{table:e.name}:{schema_name:e.schema||i.defaultSchema||"public",table_name:e.name};return this.actions.push(new s.ForeignTable(this,{filename:t,name:e.name,schema:c,server:l,options:p,columns:e.columnTypes,dependsOn:l})),o}test(e){const t=new h.Test(this,{name:e});return t.session=this,t.setFilename(v.getCallerFile(this.rootDir)),this.tests.push(t),t}notebook(e){const t=v.getCallerFile(this.rootDir),n=new f.Notebook(this,e,t);return this.actions.push(n),n}jitData(e,t){if(void 0!==this.jitContextData.fields[e])throw new Error(`JiT context data with key ${e} already exists.`);this.jitContextData.fields[e]=a.unknownToValue(t)}compileError(e,t,n){const r=t||v.getCallerFile(this.rootDir)||__filename,i=w.sqlanvil.CompilationError.create({fileName:r,actionName:n?b.targetAsReadableString(n):void 0,actionTarget:n});"string"==typeof e?i.message=e:(i.message=e.message,i.stack=e.stack),this.graphErrors.compilationErrors.push(i)}compile(){if(this.actions.push(...this.tests),this.indexedActions=new O.ResolvableMap(this.actions.map((e=>({actionTarget:e.getTarget(),value:e})))),this.projectConfig.vars&&!Object.values(this.projectConfig.vars).every((e=>"string"==typeof e)))throw new Error("Custom variables defined in workflow settings can only be strings.");const e=w.sqlanvil.CompiledGraph.create({projectConfig:this.projectConfig,tables:this.compileGraphChunk(this.actions.filter((e=>e instanceof g.Table||e instanceof y.View||e instanceof p.IncrementalTable))),operations:this.compileGraphChunk(this.actions.filter((e=>e instanceof d.Operation||e instanceof s.RlsPolicy||e instanceof s.RealtimePublication||e instanceof s.Wrapper||e instanceof s.ForeignTable||e instanceof s.VectorIndex))),assertions:this.compileGraphChunk(this.actions.filter((e=>e instanceof l.Assertion))),declarations:this.compileGraphChunk(this.actions.filter((e=>e instanceof u.Declaration))),tests:this.compileGraphChunk(this.actions.filter((e=>e instanceof h.Test))),notebooks:this.compileGraphChunk(this.actions.filter((e=>e instanceof f.Notebook))),dataPreparations:this.compileGraphChunk(this.actions.filter((e=>e instanceof c.DataPreparation))),graphErrors:this.graphErrors,sqlanvilCoreVersion:T.version,targets:this.actions.map((e=>e.getTarget())),jitData:this.jitContextData});return this.projectConfig.includeTestsInCompiledGraph&&this.addTestsToCompiledGraph(this.actions),this.fullyQualifyDependencies([].concat(e.tables,e.assertions,e.operations,e.notebooks,e.dataPreparations,e.tests)),this.alterActionName([].concat(e.tables,e.assertions,e.operations,e.notebooks,e.dataPreparations,e.tests),[].concat(e.declarations.map((e=>e.target)))),this.removeNonUniqueActionsFromCompiledGraph(e),this.checkTestNameUniqueness(e.tests),this.checkCircularity([].concat(e.tables,e.assertions,e.operations,e.notebooks,e.dataPreparations,e.tests)),a.verifyObjectMatchesProto(w.sqlanvil.CompiledGraph,e,a.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM),e}compileToBase64(){return a.encode64(w.sqlanvil.CompiledGraph,this.compile())}finalizeDatabase(e){return`${e}${this.getDatabaseSuffixWithUnderscore()}`}finalizeSchema(e){return`${e}${this.getSchemaSuffixWithUnderscore()}`}finalizeName(e){return`${this.getTablePrefixWithUnderscore()}${e}`}getDatabaseSuffixWithUnderscore(){return this.projectConfig.databaseSuffix?`_${this.projectConfig.databaseSuffix}`:""}getSchemaSuffixWithUnderscore(){return this.projectConfig.schemaSuffix?`_${this.projectConfig.schemaSuffix}`:""}getTablePrefixWithUnderscore(){return this.projectConfig.tablePrefix?`${this.projectConfig.tablePrefix}_`:""}compileGraphChunk(e){const t=[];return e.forEach((e=>{try{const n=e.compile();t.push(n)}catch(t){this.compileError(t,e.getFileName(),e.getTarget())}})),t}fullyQualifyDependencies(e){e.forEach((e=>{const t={};if(!(e instanceof w.sqlanvil.Declaration)&&e.dependencyTargets){for(const n of e.dependencyTargets){const r=this.findActions(n);if(0===r.length)this.compileError(new Error(`Missing dependency detected: Action "${b.targetAsReadableString(e.target)}" depends on "${v.stringifyResolvable(n)}" which does not exist`),e.fileName,e.target);else if(1===r.length){const e=r[0].getTarget();t[b.targetAsReadableString(e)]=e,n.includeDependentAssertions&&this.actionAssertionMap.find(n).forEach((e=>t[b.targetAsReadableString(e.getTarget())]=e.getTarget()))}else this.compileError(new Error(v.ambiguousActionNameMsg(n,r)),e.fileName,e.target)}e.dependencyTargets=Object.values(t)}}))}alterActionName(e,t){const{tablePrefix:n,schemaSuffix:r,databaseSuffix:i}=this.projectConfig;if(!n&&!r&&!i)return;const o=new Map;t.forEach((e=>o.set(b.targetStringifier.stringify(e),e))),e.forEach((e=>{o.set(b.targetStringifier.stringify(e.target),Object.assign(Object.assign({},e.target),{database:e.target.database&&`${e.target.database}${this.getDatabaseSuffixWithUnderscore()}`,schema:`${e.target.schema}${this.getSchemaSuffixWithUnderscore()}`,name:`${this.getTablePrefixWithUnderscore()}${e.target.name}`})),e.target=o.get(b.targetStringifier.stringify(e.target))}));const a=e=>o.has(b.targetStringifier.stringify(e))?o.get(b.targetStringifier.stringify(e)):e;e.forEach((e=>{e instanceof w.sqlanvil.Declaration||(e.dependencyTargets=(e.dependencyTargets||[]).map(a)),e instanceof w.sqlanvil.Assertion&&e.parentAction&&(e.parentAction=a(e.parentAction))}))}checkTestNameUniqueness(e){const t=[];e.forEach((e=>{t.includes(e.name)&&this.compileError(new Error(`Duplicate test name detected: "${e.name}"`),e.fileName),t.push(e.name)}))}checkCircularity(e){const t=new Map(e.map((e=>[b.targetStringifier.stringify(e.target),e]))),n=new o.default;e.forEach((e=>{const r=(e instanceof w.sqlanvil.Declaration||!e.dependencyTargets?[]:e.dependencyTargets).filter((e=>!!t.get(b.targetStringifier.stringify(e))));n.add(b.targetStringifier.stringify(e.target),r.map((e=>b.targetStringifier.stringify(e))))})),n.getCycles().forEach((e=>{const n=t.get(e[0].name),r=`Circular dependency detected in chain: [${e.map((e=>e.name)).join(" > ")} > ${b.targetAsReadableString(n.target)}]`;this.compileError(new Error(r),n.fileName,n.target)}))}addTestsToCompiledGraph(e){e.filter((e=>e instanceof h.Test)).map((e=>e)).forEach((e=>{const t=this.indexedActions.find(e.getTestTarget());t.forEach((e=>{e instanceof g.Table||e instanceof y.View||this.compileError(new Error(`Tests are only supported for Tables and Views. Action "${b.targetAsReadableString(e.getTarget())}" is not a table or view".`),e.getFileName(),e.getTarget())})),t.map((e=>e)).forEach((t=>t.dependencies(v.resolvableAsTarget(e.getTarget()))))}))}removeNonUniqueActionsFromCompiledGraph(e){function t(e){const t=new Set,n=new Set;return e.forEach((e=>{t.has(b.targetStringifier.stringify(e))&&n.add(b.targetStringifier.stringify(e)),t.add(b.targetStringifier.stringify(e))})),n}const n=[].concat(e.tables,e.assertions,e.operations,e.declarations,e.notebooks,e.dataPreparations),r=t(n.map((e=>e.target))),i=t(n.map((e=>e.canonicalTarget))),o=e=>{const t=r.has(b.targetStringifier.stringify(e.target)),n=i.has(b.targetStringifier.stringify(e.canonicalTarget));return t&&this.compileError(new Error(`Duplicate action name detected. Names within a schema must be unique across tables, declarations, assertions, and operations:\n"${JSON.stringify(e.target)}"`),e.fileName,e.target),n&&this.compileError(new Error(`Duplicate canonical target detected. Canonical targets must be unique across tables, declarations, assertions, and operations:\n"${JSON.stringify(e.canonicalTarget)}"`),e.fileName,e.target),!t&&!n};e.tables=e.tables.filter(o),e.operations=e.operations.filter(o),e.declarations=e.declarations.filter(o),e.assertions=e.assertions.filter(o),e.notebooks=e.notebooks.filter(o),e.dataPreparations=e.dataPreparations.filter(o)}}},7209(e,t,n){"use strict";e.exports=c,c.className="ReflectionObject";const r=n(1457);var i,o=n(3262),a={enum_type:"OPEN",field_presence:"EXPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"},s={enum_type:"CLOSED",field_presence:"EXPLICIT",json_format:"LEGACY_BEST_EFFORT",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"EXPANDED",utf8_validation:"NONE"},l={enum_type:"OPEN",field_presence:"IMPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY"};function c(e,t){if(!o.isString(e))throw TypeError("name must be a string");if(t&&!o.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this._edition=null,this._defaultEdition="proto2",this._features={},this._featuresResolved=!1,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(c.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),c.prototype.toJSON=function(){throw Error()},c.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof i&&t._handleAdd(this)},c.prototype.onRemove=function(e){var t=e.root;t instanceof i&&t._handleRemove(this),this.parent=null,this.resolved=!1},c.prototype.resolve=function(){return this.resolved||this.root instanceof i&&(this.resolved=!0),this},c.prototype._resolveFeaturesRecursive=function(e){return this._resolveFeatures(this._edition||e)},c.prototype._resolveFeatures=function(e){if(!this._featuresResolved){var t={};if(!e)throw new Error("Unknown edition for "+this.fullName);var n=Object.assign(this.options?Object.assign({},this.options.features):{},this._inferLegacyProtoFeatures(e));if(this._edition){if("proto2"===e)t=Object.assign({},s);else if("proto3"===e)t=Object.assign({},l);else{if("2023"!==e)throw new Error("Unknown edition: "+e);t=Object.assign({},a)}return this._features=Object.assign(t,n||{}),void(this._featuresResolved=!0)}if(this.partOf instanceof r){var i=Object.assign({},this.partOf._features);this._features=Object.assign(i,n||{})}else if(this.declaringField);else{if(!this.parent)throw new Error("Unable to find a parent for "+this.fullName);var o=Object.assign({},this.parent._features);this._features=Object.assign(o,n||{})}this.extensionField&&(this.extensionField._features=this._features),this._featuresResolved=!0}},c.prototype._inferLegacyProtoFeatures=function(){return{}},c.prototype.getOption=function(e){if(this.options)return this.options[e]},c.prototype.setOption=function(e,t,n){return this.options||(this.options={}),/^features\./.test(e)?o.setProperty(this.options,e,t,n):n&&void 0!==this.options[e]||(this.getOption(e)!==t&&(this.resolved=!1),this.options[e]=t),this},c.prototype.setParsedOption=function(e,t,n){this.parsedOptions||(this.parsedOptions=[]);var r=this.parsedOptions;if(n){var i=r.find((function(t){return Object.prototype.hasOwnProperty.call(t,e)}));if(i){var a=i[e];o.setProperty(a,n,t)}else(i={})[e]=o.setProperty({},n,t),r.push(i)}else{var s={};s[e]=t,r.push(s)}return this},c.prototype.setOptions=function(e,t){if(e)for(var n=Object.keys(e),r=0;r<n.length;++r)this.setOption(n[r],e[n[r]],t);return this},c.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},c.prototype._editionToJSON=function(){if(this._edition&&"proto3"!==this._edition)return this._edition},c._configure=function(e){i=e}},7210(e,t,n){"use strict";var r=n(9243),i=n(4781);function o(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}e.exports.Type=n(5388),e.exports.Schema=n(2119),e.exports.FAILSAFE_SCHEMA=n(7759),e.exports.JSON_SCHEMA=n(6184),e.exports.CORE_SCHEMA=n(1769),e.exports.DEFAULT_SCHEMA=n(5489),e.exports.load=r.load,e.exports.loadAll=r.loadAll,e.exports.dump=i.dump,e.exports.YAMLException=n(1231),e.exports.types={binary:n(9342),float:n(1461),map:n(2369),null:n(9198),pairs:n(6942),set:n(6663),timestamp:n(127),bool:n(6199),int:n(4466),merge:n(1851),omap:n(6946),seq:n(8636),str:n(7212)},e.exports.safeLoad=o("safeLoad","load"),e.exports.safeLoadAll=o("safeLoadAll","loadAll"),e.exports.safeDump=o("safeDump","dump")},7212(e,t,n){"use strict";var r=n(5388);e.exports=new r("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}})},7287(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8512),i=n(8771),o=n(5379);function a(e){if(e.provider){const n=t.WRAPPER_PROVIDERS[e.provider];if(!n)throw new Error(`Unknown wrapper provider "${e.provider}". Supported providers: ${Object.keys(t.WRAPPER_PROVIDERS).join(", ")}.`);return n}if(!e.wrapper)throw new Error(`wrapper "${e.name}" must set either "provider" or an explicit "wrapper" extension name.`);if(!e.handler||!e.validator)throw new Error(`wrapper "${e.name}" without a "provider" preset must also set "handler" and "validator".`);return{extension:e.wrapper,wrapper:e.wrapper,handler:e.handler,validator:e.validator}}t.WRAPPER_PROVIDERS={bigquery:{extension:"wrappers",wrapper:"bigquery_wrapper",handler:"big_query_fdw_handler",validator:"big_query_fdw_validator"},postgres_fdw:{extension:"postgres_fdw",wrapper:"postgres_fdw",handler:"",validator:""}},t.resolveWrapper=a;class s extends i.ActionBuilder{constructor(e,t){super(e),this.proto=o.sqlanvil.Operation.create(),this.session=e,this.config=t;const n=o.sqlanvil.Target.create({name:t.name});this.proto.target=this.applySessionToTarget(n,e.projectConfig,t.filename,{validateTarget:!0}),this.proto.canonicalTarget=this.applySessionToTarget(n,e.canonicalProjectConfig),this.proto.fileName=t.filename||""}getFileName(){return this.proto.fileName}getTarget(){return o.sqlanvil.Target.create(this.proto.target)}compile(){const e=a(this.config),t=Object.assign({},this.config.serverOptions||this.config.options||{});this.config.credential&&this.config.credential.saKeyId&&(t.sa_key_id=this.config.credential.saKeyId);const n=Object.entries(t).map((([e,t])=>`${e} '${String(t).replace(/'/g,"''")}'`)),i=n.length>0?` options (${n.join(", ")})`:"",s=[`create extension if not exists "${e.extension}" cascade`];if(e.handler&&e.validator&&s.push(`do $$ begin if not exists (select 1 from pg_foreign_data_wrapper where fdwname = '${e.wrapper}') then create foreign data wrapper ${e.wrapper} handler ${e.handler} validator ${e.validator}; end if; end $$`),s.push(`drop server if exists "${this.config.server}" cascade`),s.push(`create server "${this.config.server}" foreign data wrapper "${e.wrapper}"${i}`),this.config.userMappingConnection){const e=this.config.userMappingConnection,t="${SA_CONN:"+e+":user}",n="${SA_CONN:"+e+":password}";s.push(`create user mapping for current_user server "${this.config.server}" options (user '${t}', password '${n}')`)}return this.proto.queries=s,r.verifyObjectMatchesProto(o.sqlanvil.Operation,this.proto,r.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM)}}t.Wrapper=s},7595(e,t,n){"use strict";e.exports=i;var r=n(3610);function i(e,t,n){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(n)}(i.prototype=Object.create(r.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function e(t,n,i,o,a){if(!o)throw TypeError("request must be specified");var s=this;if(!a)return r.asPromise(e,s,t,n,i,o);if(s.rpcImpl)try{return s.rpcImpl(t,n[s.requestDelimited?"encodeDelimited":"encode"](o).finish(),(function(e,n){if(e)return s.emit("error",e,t),a(e);if(null!==n){if(!(n instanceof i))try{n=i[s.responseDelimited?"decodeDelimited":"decode"](n)}catch(e){return s.emit("error",e,t),a(e)}return s.emit("data",n,t),a(null,n)}s.end(!0)}))}catch(e){return s.emit("error",e,t),void setTimeout((function(){a(e)}),0)}else setTimeout((function(){a(Error("already ended"))}),0)},i.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},7728(e,t,n){"use strict";e.exports=function(e){for(var t=o.codegen(["r","l","e"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(e.fieldsArray.filter((function(e){return e.map})).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()")("if(t===e)")("break")("switch(t>>>3){"),n=0;n<e.fieldsArray.length;++n){var s=e._fieldsArray[n].resolve(),l=s.resolvedType instanceof r?"int32":s.type,c="m"+o.safeProp(s.name);t("case %i: {",s.id),s.map?(t("if(%s===util.emptyObject)",c)("%s={}",c)("var c2 = r.uint32()+r.pos"),void 0!==i.defaults[s.keyType]?t("k=%j",i.defaults[s.keyType]):t("k=null"),void 0!==i.defaults[l]?t("value=%j",i.defaults[l]):t("value=null"),t("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",s.keyType)("case 2:"),void 0===i.basic[l]?t("value=types[%i].decode(r,r.uint32())",n):t("value=r.%s()",l),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==i.long[s.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',c):t("%s[k]=value",c)):s.repeated?(t("if(!(%s&&%s.length))",c,c)("%s=[]",c),void 0!==i.packed[l]&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",c,l)("}else"),void 0===i.basic[l]?t(s.delimited?"%s.push(types[%i].decode(r,undefined,((t&~7)|4)))":"%s.push(types[%i].decode(r,r.uint32()))",c,n):t("%s.push(r.%s())",c,l)):void 0===i.basic[l]?t(s.delimited?"%s=types[%i].decode(r,undefined,((t&~7)|4))":"%s=types[%i].decode(r,r.uint32())",c,n):t("%s=r.%s()",c,l),t("break")("}")}for(t("default:")("r.skipType(t&7)")("break")("}")("}"),n=0;n<e._fieldsArray.length;++n){var u=e._fieldsArray[n];u.required&&t("if(!m.hasOwnProperty(%j))",u.name)("throw util.ProtocolError(%j,{instance:m})",a(u))}return t("return m")};var r=n(5643),i=n(361),o=n(3262);function a(e){return"missing required '"+e.name+"'"}},7759(e,t,n){"use strict";var r=n(2119);e.exports=new r({explicit:[n(7212),n(8636),n(2369)]})},7848(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=n(8512),o=n(5436),a=r(n(9553)),s=n(2545),l=n(5379);class c extends o.ActionBuilder{constructor(e,t,n){if(super(e),this.proto=l.sqlanvil.Assertion.create(),this.session=e,!t)return;const r=this.verifyConfig(t);r.name||(r.name=a.basename(r.filename));const i=s.actionConfigToCompiledGraphTarget(r);return this.proto.target=this.applySessionToTarget(i,e.projectConfig,r.filename,{validateTarget:!0,useDefaultAssertionDataset:!0}),this.proto.canonicalTarget=this.applySessionToTarget(i,e.canonicalProjectConfig,void 0,{validateTarget:!1,useDefaultAssertionDataset:!0}),n&&(r.filename=s.resolveActionsConfigFilename(r.filename,n),this.query(s.nativeRequire(r.filename).query)),r.dependencyTargets&&this.dependencies(r.dependencyTargets.map((e=>s.configTargetToCompiledGraphTarget(l.sqlanvil.ActionConfig.Target.create(e))))),r.hermetic&&this.hermetic(r.hermetic),(r.disabled||e.projectConfig.disableAssertions)&&this.disabled(),r.tags&&this.tags(r.tags),r.description&&this.description(r.description),r.project&&this.database(r.project),r.dataset&&this.schema(r.dataset),r.filename&&(this.proto.fileName=r.filename),r.reservation&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.reservation=r.reservation),this}query(e){return this.contextableQuery=e,this}jitCode(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.compilationMode=l.sqlanvil.ActionCompilationMode.ACTION_COMPILATION_MODE_JIT,this.contextableJitCode=e,this}dependencies(e){return(Array.isArray(e)?e:[e]).forEach((e=>{const t=s.resolvableAsTarget(e);this.session.actionAssertionMap.set(t,this),this.proto.dependencyTargets.push(t)})),this}hermetic(e){this.proto.hermeticity=e?l.sqlanvil.ActionHermeticity.HERMETIC:l.sqlanvil.ActionHermeticity.NON_HERMETIC}disabled(e=!0){return this.proto.disabled=e,this}tags(e){return("string"==typeof e?[e]:e).forEach((e=>{this.proto.tags.indexOf(e)<0&&this.proto.tags.push(e)})),this}description(e){return this.proto.actionDescriptor={description:e},this}database(e){return this.proto.target=this.applySessionToTarget(l.sqlanvil.Target.create(Object.assign(Object.assign({},this.proto.target),{database:e})),this.session.projectConfig,this.proto.fileName,{validateTarget:!0,useDefaultAssertionDataset:!0}),this}schema(e){return this.proto.target=this.applySessionToTarget(l.sqlanvil.Target.create(Object.assign(Object.assign({},this.proto.target),{schema:e})),this.session.projectConfig,this.proto.fileName,{validateTarget:!0,useDefaultAssertionDataset:!0}),this}getFileName(){return this.proto.fileName}getTarget(){return l.sqlanvil.Target.create(this.proto.target)}getParentAction(){return l.sqlanvil.Target.create(this.proto.parentAction)}setParentAction(e){this.proto.parentAction=e}compile(){const e=new u(this);return this.contextableJitCode&&this.contextableQuery?(this.session.compileError(new Error("Assertion may set either .jitCode() or .query(), but not both."),this.proto.fileName,this.proto.target),this.proto):(this.contextableJitCode?(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.jitCode=this.contextableJitCode.toString()):(this.proto.query=e.apply(this.contextableQuery),s.validateQueryString(this.session,this.proto.query,this.proto.fileName)),i.verifyObjectMatchesProto(l.sqlanvil.Assertion,this.proto,i.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM))}verifyConfig(e){return e.dependencies&&(e.dependencyTargets=e.dependencies.map((e=>s.resolvableAsActionConfigTarget(e))),delete e.dependencies),e.database&&(e.project=e.database,delete e.database),e.schema&&(e.dataset=e.schema,delete e.schema),e.fileName&&(e.filename=e.fileName,delete e.fileName),e.type&&delete e.type,i.verifyObjectMatchesProto(l.sqlanvil.ActionConfig.AssertionConfig,e,i.VerifyProtoErrorBehaviour.SHOW_DOCS_LINK)}}t.Assertion=c;class u{constructor(e){this.assertion=e}self(){return this.resolve(this.assertion.getTarget())}name(){return this.assertion.session.finalizeName(this.assertion.getTarget().name)}ref(e,...t){return e=s.toResolvable(e,t),s.resolvableAsTarget(e)?(this.assertion.dependencies(e),this.resolve(e)):(this.assertion.session.compileError(new Error("Action name is not specified")),"")}resolve(e,...t){return this.assertion.session.resolve(e,...t)}schema(){return this.assertion.session.finalizeSchema(this.assertion.getTarget().schema)}database(){return this.assertion.getTarget().database?this.assertion.session.finalizeDatabase(this.assertion.getTarget().database):(this.assertion.session.compileError(new Error("Warehouse does not support multiple databases")),"")}dependencies(e){return this.assertion.dependencies(e),""}tags(e){return this.assertion.tags(e),""}when(e,t,n=""){return e?t:n}apply(e){return"function"==typeof e?e(this):e}}t.AssertionContext=u},7882(e,t,n){"use strict";e.exports=b;var r=n(8923);((b.prototype=Object.create(r.prototype)).constructor=b).className="Type";var i=n(5643),o=n(1457),a=n(1344),s=n(8252),l=n(9687),c=n(2551),u=n(6237),p=n(3449),f=n(3262),d=n(1080),g=n(7728),h=n(420),y=n(744),m=n(6434);function b(e,t){e=e.replace(/\W/g,""),r.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function v(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}Object.defineProperties(b.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var n=this.fields[e[t]],r=n.id;if(this._fieldsById[r])throw Error("duplicate id "+r+" in "+this);this._fieldsById[r]=n}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=f.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=f.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=b.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof c||((e.prototype=new c).constructor=e,f.merge(e.prototype,t)),e.$type=e.prototype.$type=this,f.merge(e,c,!0),this._ctor=e;for(var n=0;n<this.fieldsArray.length;++n)this._fieldsArray[n].resolve();var r={};for(n=0;n<this.oneofsArray.length;++n)r[this._oneofsArray[n].resolve().name]={get:f.oneOfGetter(this._oneofsArray[n].oneof),set:f.oneOfSetter(this._oneofsArray[n].oneof)};n&&Object.defineProperties(e.prototype,r)}}}),b.generateConstructor=function(e){for(var t,n=f.codegen(["p"],e.name),r=0;r<e.fieldsArray.length;++r)(t=e._fieldsArray[r]).map?n("this%s={}",f.safeProp(t.name)):t.repeated&&n("this%s=[]",f.safeProp(t.name));return n("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},b.fromJSON=function(e,t){var n=new b(e,t.options);n.extensions=t.extensions,n.reserved=t.reserved;for(var c=Object.keys(t.fields),u=0;u<c.length;++u)n.add((void 0!==t.fields[c[u]].keyType?s.fromJSON:a.fromJSON)(c[u],t.fields[c[u]]));if(t.oneofs)for(c=Object.keys(t.oneofs),u=0;u<c.length;++u)n.add(o.fromJSON(c[u],t.oneofs[c[u]]));if(t.nested)for(c=Object.keys(t.nested),u=0;u<c.length;++u){var p=t.nested[c[u]];n.add((void 0!==p.id?a.fromJSON:void 0!==p.fields?b.fromJSON:void 0!==p.values?i.fromJSON:void 0!==p.methods?l.fromJSON:r.fromJSON)(c[u],p))}return t.extensions&&t.extensions.length&&(n.extensions=t.extensions),t.reserved&&t.reserved.length&&(n.reserved=t.reserved),t.group&&(n.group=!0),t.comment&&(n.comment=t.comment),t.edition&&(n._edition=t.edition),n._defaultEdition="proto3",n},b.prototype.toJSON=function(e){var t=r.prototype.toJSON.call(this,e),n=!!e&&Boolean(e.keepComments);return f.toObject(["edition",this._editionToJSON(),"options",t&&t.options||void 0,"oneofs",r.arrayToJSON(this.oneofsArray,e),"fields",r.arrayToJSON(this.fieldsArray.filter((function(e){return!e.declaringField})),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",t&&t.nested||void 0,"comment",n?this.comment:void 0])},b.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;r.prototype.resolveAll.call(this);var e=this.oneofsArray;for(n=0;n<e.length;)e[n++].resolve();for(var t=this.fieldsArray,n=0;n<t.length;)t[n++].resolve();return this},b.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,r.prototype._resolveFeaturesRecursive.call(this,e),this.oneofsArray.forEach((t=>{t._resolveFeatures(e)})),this.fieldsArray.forEach((t=>{t._resolveFeatures(e)})),this):this},b.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},b.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof a&&void 0===e.extend){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),v(this)}return e instanceof o?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),v(this)):r.prototype.add.call(this,e)},b.prototype.remove=function(e){if(e instanceof a&&void 0===e.extend){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),v(this)}if(e instanceof o){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),v(this)}return r.prototype.remove.call(this,e)},b.prototype.isReservedId=function(e){return r.isReservedId(this.reserved,e)},b.prototype.isReservedName=function(e){return r.isReservedName(this.reserved,e)},b.prototype.create=function(e){return new this.ctor(e)},b.prototype.setup=function(){for(var e=this.fullName,t=[],n=0;n<this.fieldsArray.length;++n)t.push(this._fieldsArray[n].resolve().resolvedType);this.encode=d(this)({Writer:p,types:t,util:f}),this.decode=g(this)({Reader:u,types:t,util:f}),this.verify=h(this)({types:t,util:f}),this.fromObject=y.fromObject(this)({types:t,util:f}),this.toObject=y.toObject(this)({types:t,util:f});var r=m[e];if(r){var i=Object.create(this);i.fromObject=this.fromObject,this.fromObject=r.fromObject.bind(i),i.toObject=this.toObject,this.toObject=r.toObject.bind(i)}return this},b.prototype.encode=function(e,t){return this.setup().encode(e,t)},b.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},b.prototype.decode=function(e,t){return this.setup().decode(e,t)},b.prototype.decodeDelimited=function(e){return e instanceof u||(e=u.create(e)),this.decode(e,e.uint32())},b.prototype.verify=function(e){return this.setup().verify(e)},b.prototype.fromObject=function(e){return this.setup().fromObject(e)},b.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},b.d=function(e){return function(t){f.decorateType(t,e)}}},7983(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=n(8512),o=n(7848),a=n(3788),s=n(6660),l=n(1299),c=n(2795),u=n(9293),p=n(2008),f=n(8995),d=r(n(9553)),g=n(2545),h=n(8375),y=n(5379);function m(e,t){var n,r;try{(0,g.nativeRequire(null===(n=null==e?void 0:e.compileConfig)||void 0===n?void 0:n.extension.name).extension)().compile(e,t)}catch(n){t.compileError(n,null===(r=null==e?void 0:e.compileConfig)||void 0===r?void 0:r.extension.name)}}t.main=function(e){var t,n,r;const b=global;let v;v="string"==typeof e?i.decode64(y.sqlanvil.CoreExecutionRequest,e):y.sqlanvil.CoreExecutionRequest.decode(e);const O=v.compile,T=!(null===(n=null===(t=null==O?void 0:O.compileConfig)||void 0===t?void 0:t.extension)||void 0===n?void 0:n.compilationMode);let w=h.readWorkflowSettings(T);const j=null!==(r=O.compileConfig.projectConfigOverride)&&void 0!==r?r:{};w=y.sqlanvil.ProjectConfig.create(Object.assign(Object.assign(Object.assign({},w),j),{vars:Object.assign(Object.assign({},w.vars),j.vars),connections:Object.assign(Object.assign({},w.connections),j.connections)}));const q=g.nativeRequire("@sqlanvil/core").session;q.init(O.compileConfig.projectDir,w,w),b.sqlanvil=q,function(e,t){var n,r;(null===(r=null===(n=null==e?void 0:e.compileConfig)||void 0===n?void 0:n.extension)||void 0===r?void 0:r.compilationMode)===y.sqlanvil.ExtensionCompilationMode.PROLOGUE&&m(e,t)}(O,q),function(e,t){var n,r;(null===(r=null===(n=null==e?void 0:e.compileConfig)||void 0===n?void 0:n.extension)||void 0===r?void 0:r.compilationMode)!==y.sqlanvil.ExtensionCompilationMode.APPLICATION_CODE?function(e,t){const n=global,r={};e.compileConfig.filePaths.filter((e=>e.startsWith(`includes${d.separator}`))).filter((e=>2===e.split(d.separator).length)).filter((e=>"js"===d.fileExtension(e))).forEach((e=>{try{r[d.basename(e)]=g.nativeRequire(e)}catch(n){t.compileError(n,e)}})),Object.assign(n,r),n.publish=t.publish.bind(t),n.operate=t.operate.bind(t),n.assert=t.assert.bind(t),n.declare=t.declare.bind(t),n.notebook=t.notebook.bind(t),n.test=t.test.bind(t),n.jitData=t.jitData.bind(t),n.rlsPolicy=t.rlsPolicy.bind(t),n.realtimePublication=t.realtimePublication.bind(t),n.wrapper=t.wrapper.bind(t),n.vectorIndex=t.vectorIndex.bind(t),function(e,t){t.filter((e=>e.startsWith(`definitions${d.separator}`)&&"actions"===d.basename(e)&&"yaml"===d.fileExtension(e))).sort().forEach((t=>{const n=function(e,t){let n={};try{n=g.nativeRequire(t).asJson}catch(n){e.compileError(n,t)}return i.verifyObjectMatchesProto(y.sqlanvil.ActionConfigs,n,i.VerifyProtoErrorBehaviour.SHOW_DOCS_LINK),y.sqlanvil.ActionConfigs.fromObject(n)}(e,t);n.actions.forEach((n=>{const r=y.sqlanvil.ActionConfig.create(n);if(r.table)e.actions.push(new p.Table(e,y.sqlanvil.ActionConfig.TableConfig.create(r.table),t));else if(r.view)e.actions.push(new f.View(e,y.sqlanvil.ActionConfig.ViewConfig.create(r.view),t));else if(r.incrementalTable)e.actions.push(new l.IncrementalTable(e,y.sqlanvil.ActionConfig.IncrementalTableConfig.create(r.incrementalTable),t));else if(r.assertion)e.actions.push(new o.Assertion(e,y.sqlanvil.ActionConfig.AssertionConfig.create(r.assertion),t));else if(r.operation)e.actions.push(new u.Operation(e,y.sqlanvil.ActionConfig.OperationConfig.create(r.operation),t));else if(r.declaration){const n=y.sqlanvil.ActionConfig.DeclarationConfig.create(r.declaration);n.connection?(n.filename||(n.filename=t),e.declare(n)):e.actions.push(new s.Declaration(e,n))}else if(r.notebook)e.actions.push(new c.Notebook(e,y.sqlanvil.ActionConfig.NotebookConfig.create(r.notebook),t));else{if(!r.dataPreparation)throw Error("Empty action configs are not permitted.");e.actions.push(new a.DataPreparation(e,y.sqlanvil.ActionConfig.DataPreparationConfig.create(r.dataPreparation),t))}}))}))}(t,e.compileConfig.filePaths),e.compileConfig.filePaths.filter((e=>e.startsWith(`definitions${d.separator}`))).filter((e=>"js"===d.fileExtension(e)||"sqlx"===d.fileExtension(e))).sort().forEach((e=>{try{g.nativeRequire(e)}catch(n){t.compileError(n,e)}}))}(e,t):m(e,t)}(O,q);const P=y.sqlanvil.CoreExecutionResponse.create({compile:{compiledGraph:q.compile()}});return"string"==typeof e?i.encode64(y.sqlanvil.CoreExecutionResponse,P):y.sqlanvil.CoreExecutionResponse.encode(P).finish()}},8043(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3314),i=n(2545);class o{constructor(e,t){this.adapter=e,this.request=t,this.target=t.target;const n=t.dependencies,o=[this.target,...n];this.resolvableMap=new i.ResolvableMap(o.map((e=>{return{actionTarget:e,value:(t=e,`${t.database}.${t.schema}.${t.name}`)};var t}))),this.data=r.Structs.toObject(t.jitData),this.executionData=t.executionData}self(){return this.resolve(this.name())}name(){return this.target.name}ref(e,...t){return this.resolve(e,...t)}resolve(e,...t){e=i.toResolvable(e,t);const n=i.resolvableAsTarget(e),r=this.resolvableMap.find(n);if(r.length>1)throw new Error(i.ambiguousActionNameMsg(e,r));return this.resolveReference(i.stringifyResolvable(e),r.length>0?r[0]:void 0)}schema(){return this.target.schema}database(){return this.target.database}resolveReference(e,t){if(t)return`\`${t}\``;throw new Error(`Undeclared dependency referenced: ${e}.\nJiT action must have its dependencies declared explicitly.`)}}t.SqlActionJitContext=o;class a extends o{constructor(e,t){super(e,t)}when(e,t,n){return e?t:n||""}incremental(){return!1}}t.TableJitContext=a,t.IncrementalTableJitContext=class extends a{constructor(e,t,n){super(e,t),this.isIncrementalContext=n}incremental(){return this.isIncrementalContext}}},8045(e){"use strict";e.exports=function(e,t){for(var n=new Array(arguments.length-1),r=0,i=2,o=!0;i<arguments.length;)n[r++]=arguments[i++];return new Promise((function(i,a){n[r]=function(e){if(o)if(o=!1,e)a(e);else{for(var t=new Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];i.apply(null,t)}};try{e.apply(t||null,n)}catch(e){o&&(o=!1,a(e))}}))}},8083(e,t,n){"use strict";var r=n(8433);function i(e,t,n,r,i){var o="",a="",s=Math.floor(i/2)-1;return r-t>s&&(t=r-s+(o=" ... ").length),n-r>s&&(n=r+s-(a=" ...").length),{str:o+e.slice(t,n).replace(/\t/g,"→")+a,pos:r-t+o.length}}function o(e,t){return r.repeat(" ",t-e.length)+e}e.exports=function(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),"number"!=typeof t.indent&&(t.indent=1),"number"!=typeof t.linesBefore&&(t.linesBefore=3),"number"!=typeof t.linesAfter&&(t.linesAfter=2);for(var n,a=/\r?\n|\r|\0/g,s=[0],l=[],c=-1;n=a.exec(e.buffer);)l.push(n.index),s.push(n.index+n[0].length),e.position<=n.index&&c<0&&(c=s.length-2);c<0&&(c=s.length-1);var u,p,f="",d=Math.min(e.line+t.linesAfter,l.length).toString().length,g=t.maxLength-(t.indent+d+3);for(u=1;u<=t.linesBefore&&!(c-u<0);u++)p=i(e.buffer,s[c-u],l[c-u],e.position-(s[c]-s[c-u]),g),f=r.repeat(" ",t.indent)+o((e.line-u+1).toString(),d)+" | "+p.str+"\n"+f;for(p=i(e.buffer,s[c],l[c],e.position,g),f+=r.repeat(" ",t.indent)+o((e.line+1).toString(),d)+" | "+p.str+"\n",f+=r.repeat("-",t.indent+d+3+p.pos)+"^\n",u=1;u<=t.linesAfter&&!(c+u>=l.length);u++)p=i(e.buffer,s[c+u],l[c+u],e.position-(s[c]-s[c+u]),g),f+=r.repeat(" ",t.indent)+o((e.line+u+1).toString(),d)+" | "+p.str+"\n";return f.replace(/\n$/,"")}},8202(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8512),i=n(8771),o=n(5379);class a extends i.ActionBuilder{constructor(e,t){super(e),this.proto=o.sqlanvil.Operation.create(),this.session=e,this.config=t;const n=this.applySessionToTarget(o.sqlanvil.Target.create({name:t.table}),e.projectConfig),r=o.sqlanvil.Target.create({name:`${t.table}_idx_${t.name}`});this.proto.target=this.applySessionToTarget(r,e.projectConfig,t.filename,{validateTarget:!0}),this.proto.canonicalTarget=this.applySessionToTarget(r,e.canonicalProjectConfig),this.proto.fileName=t.filename||"",this.proto.dependencyTargets.push(n)}getFileName(){return this.proto.fileName}getTarget(){return o.sqlanvil.Target.create(this.proto.target)}compile(){var e;const t=this.finalizeTarget(o.sqlanvil.Target.create({name:this.config.table})),n=this.session.compilationSql().resolveTarget(t),i=(null===(e=this.config.params)||void 0===e?void 0:e.opclass)||"vector_cosine_ops",a=this.config.indexType?this.config.indexType.toLowerCase():"hnsw",s=[];if(this.config.params)for(const[e,t]of Object.entries(this.config.params))"opclass"!==e&&s.push(`${e} = ${t}`);const l=s.length>0?` with (${s.join(", ")})`:"",c=["create extension if not exists vector cascade",`drop index if exists "${this.config.name}"`,`create index "${this.config.name}" on ${n} using ${a} ("${this.config.column}" ${i})${l}`];return this.proto.queries=c,r.verifyObjectMatchesProto(o.sqlanvil.Operation,this.proto,r.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM)}}t.VectorIndex=a},8252(e,t,n){"use strict";e.exports=a;var r=n(1344);((a.prototype=Object.create(r.prototype)).constructor=a).className="MapField";var i=n(361),o=n(3262);function a(e,t,n,i,a,s){if(r.call(this,e,t,i,void 0,void 0,a,s),!o.isString(n))throw TypeError("keyType must be a string");this.keyType=n,this.resolvedKeyType=null,this.map=!0}a.fromJSON=function(e,t){return new a(e,t.id,t.keyType,t.type,t.options,t.comment)},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},a.prototype.resolve=function(){if(this.resolved)return this;if(void 0===i.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return r.prototype.resolve.call(this)},a.d=function(e,t,n){return"function"==typeof n?n=o.decorateType(n).name:n&&"object"==typeof n&&(n=o.decorateEnum(n).name),function(r,i){o.decorateType(r.constructor).add(new a(i,e,t,n))}}},8375(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7210),i=n(8512),o=n(390),a=n(2628),s=n(5379),l=require;function c(e){var t;const n=s.sqlanvil.ProjectConfig.create();if(e.defaultProject&&(n.defaultDatabase=e.defaultProject),e.defaultDataset&&(n.defaultSchema=e.defaultDataset),e.defaultLocation&&(n.defaultLocation=e.defaultLocation),e.defaultAssertionDataset&&(n.assertionSchema=e.defaultAssertionDataset),e.vars&&(n.vars=e.vars),e.projectSuffix&&(n.databaseSuffix=e.projectSuffix),e.datasetSuffix&&(n.schemaSuffix=e.datasetSuffix),e.namePrefix&&(n.tablePrefix=e.namePrefix),e.builtinAssertionNamePrefix&&(n.builtinAssertionNamePrefix=e.builtinAssertionNamePrefix),e.defaultNotebookRuntimeOptions){n.defaultNotebookRuntimeOptions={};const{outputBucket:t,runtimeTemplateName:r,repositorySnapshotDestination:i}=e.defaultNotebookRuntimeOptions;if(t&&(n.defaultNotebookRuntimeOptions.outputBucket=t),r&&(n.defaultNotebookRuntimeOptions.runtimeTemplateName=r),i)if(n.defaultNotebookRuntimeOptions.repositorySnapshotDestination={},i.repositorySnapshotUri)n.defaultNotebookRuntimeOptions.repositorySnapshotDestination.repositorySnapshotUri=i.repositorySnapshotUri;else{if(!t)throw Error("Invalid repository_snapshot_destination: either repository_snapshot_uri or output_bucket has to be defined");n.defaultNotebookRuntimeOptions.repositorySnapshotDestination.repositorySnapshotUri=t}}e.defaultIcebergConfig&&(n.defaultIcebergConfig={},e.defaultIcebergConfig.bucketName&&(n.defaultIcebergConfig.bucketName=e.defaultIcebergConfig.bucketName),e.defaultIcebergConfig.tableFolderRoot&&(n.defaultIcebergConfig.tableFolderRoot=e.defaultIcebergConfig.tableFolderRoot),e.defaultIcebergConfig.tableFolderSubpath&&(n.defaultIcebergConfig.tableFolderSubpath=e.defaultIcebergConfig.tableFolderSubpath),e.defaultIcebergConfig.connection&&(n.defaultIcebergConfig.connection=e.defaultIcebergConfig.connection)),e.disableAssertions&&(n.disableAssertions=e.disableAssertions),e.defaultReservation&&(n.defaultReservation=e.defaultReservation),e.includeTestsInCompiledGraph&&(n.includeTestsInCompiledGraph=e.includeTestsInCompiledGraph);const r=["bigquery","postgres","supabase","mysql"];if(e.connections&&(n.connections=e.connections,Object.keys(e.connections).forEach((t=>{const n=e.connections[t];if(!n.platform)throw new Error(`Connection "${t}" is missing required field "platform".`);if(!r.includes(n.platform))throw new Error(`Connection "${t}" has unsupported platform "${n.platform}". Supported platforms: ${r.join(", ")}.`)}))),e.warehouse){const i=null===(t=e.connections)||void 0===t?void 0:t[e.warehouse],o=i?i.platform:e.warehouse;if(!r.includes(o))throw new Error(i?`Connection "${e.warehouse}" has unsupported platform "${o}". Supported platforms: ${r.join(", ")}.`:`Unsupported warehouse "${e.warehouse}". Supported warehouses: ${r.join(", ")}.`);n.warehouse=o,i&&(n.warehouseConnection=e.warehouse)}else n.warehouse="bigquery";return n}t.readWorkflowSettings=function(e=!0){const t=global.workflowSettingsYaml||function(){var e;try{return l("workflow_settings.yaml")}catch(t){if(t instanceof SyntaxError||t instanceof r.YAMLException)throw t;if(null===(e=null==t?void 0:t.message)||void 0===e?void 0:e.includes(o.INVALID_YAML_ERROR_STRING))throw t;return}}();if(t){const e=t.asJson;if(!e)throw Error("workflow_settings.yaml is invalid");return c(function(e){let t=s.sqlanvil.WorkflowSettings.create();try{t=s.sqlanvil.WorkflowSettings.create(i.verifyObjectMatchesProto(s.sqlanvil.WorkflowSettings,e,i.VerifyProtoErrorBehaviour.SHOW_DOCS_LINK))}catch(e){if(e instanceof ReferenceError)throw ReferenceError(`Workflow settings error: ${e.message}`);throw e}if(t.sqlanvilCoreVersion&&t.sqlanvilCoreVersion!==a.version)throw Error(`Version mismatch: workflow settings specifies version ${t.sqlanvilCoreVersion}, but ${a.version} was found`);return t}(e))}if(e)throw Error("Failed to resolve workflow_settings.yaml");return s.sqlanvil.ProjectConfig.create()},t.workflowSettingsAsProjectConfig=c},8390(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8512),i=n(8771),o=n(5379);class a extends i.ActionBuilder{constructor(e,t){super(e),this.proto=o.sqlanvil.Operation.create(),this.session=e,this.config=t;const n=this.applySessionToTarget(o.sqlanvil.Target.create({name:t.table}),e.projectConfig),r=t.name||"supabase_realtime",i=o.sqlanvil.Target.create({name:`${t.table}_realtime_${r}`});this.proto.target=this.applySessionToTarget(i,e.projectConfig,t.filename,{validateTarget:!0}),this.proto.canonicalTarget=this.applySessionToTarget(i,e.canonicalProjectConfig),this.proto.fileName=t.filename||"",this.proto.dependencyTargets.push(n)}getFileName(){return this.proto.fileName}getTarget(){return o.sqlanvil.Target.create(this.proto.target)}compile(){const e=this.finalizeTarget(o.sqlanvil.Target.create({name:this.config.table})),t=this.session.compilationSql().resolveTarget(e),n=[`alter table ${t} replica identity full`,`alter publication ${this.config.name||"supabase_realtime"} add table ${t}`];return this.proto.queries=n,r.verifyObjectMatchesProto(o.sqlanvil.Operation,this.proto,r.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM)}}t.RealtimePublication=a},8433(e){"use strict";function t(e){return null==e}e.exports.isNothing=t,e.exports.isObject=function(e){return"object"==typeof e&&null!==e},e.exports.toArray=function(e){return Array.isArray(e)?e:t(e)?[]:[e]},e.exports.repeat=function(e,t){var n,r="";for(n=0;n<t;n+=1)r+=e;return r},e.exports.isNegativeZero=function(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e},e.exports.extend=function(e,t){var n,r,i,o;if(t)for(n=0,r=(o=Object.keys(t)).length;n<r;n+=1)e[i=o[n]]=t[i];return e}},8512(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2549),i=n(5379);var o;!function(e){e[e.DEFAULT=0]="DEFAULT",e[e.SUGGEST_REPORTING_TO_DATAFORM_TEAM=1]="SUGGEST_REPORTING_TO_DATAFORM_TEAM",e[e.SHOW_DOCS_LINK=2]="SHOW_DOCS_LINK"}(o=t.VerifyProtoErrorBehaviour||(t.VerifyProtoErrorBehaviour={}));const a=i.google.protobuf.Struct,s=a.verify;function l(e,t){return e===o.SHOW_DOCS_LINK?` See https://github.com/sqlanvil/docs/blob/main/reference/configs.md#${t.getTypeUrl("").replace(/\./g,"-").replace(/\//,"")} for allowed properties.`:""}function c(e,t={}){return function(e){return r.util.base64.encode(e,0,e.length)}(e.encode(e.create(t)).finish())}function u(e){if(null==e)return{nullValue:0};if("string"==typeof e)return{stringValue:e};if("number"==typeof e)return{numberValue:e};if("boolean"==typeof e)return{boolValue:e};if(Array.isArray(e))return{listValue:{values:e.map(u)}};if("object"==typeof e)return{structValue:e};throw new Error(`Unsupported value: ${e}`)}a.verify=function(e){if(e&&"object"==typeof e&&!("fields"in e)){const t={};for(const[n,r]of Object.entries(e))t[n]=u(r);Object.keys(e).forEach((t=>delete e[t])),e.fields=t}return s.call(this,e)},t.verifyObjectMatchesProto=function(e,t,n=o.DEFAULT){if(Array.isArray(t))throw ReferenceError("Expected a top-level object, but found an array");e.verify(t);const r=e.create(t);return function t(r,i){Object.entries(r).forEach((([r,a])=>{const s=i[r];if(typeof s!=typeof a){if(Array.isArray(a)&&0===a.length)return;if(!a)throw ReferenceError(`Unexpected empty value for "${r}".`+l(n,e));if("object"==typeof a&&0===Object.keys(a).length)return;if(n===o.SUGGEST_REPORTING_TO_DATAFORM_TEAM)throw ReferenceError(`Unexpected property "${r}" for "${e.getTypeUrl("").replace("/","")}", please report this to the sqlanvil team at https://github.com/sqlanvil/sqlanvil/issues.`);throw ReferenceError(`Unexpected property "${r}", or property value type of "${typeof a}" is incorrect.`+l(n,e))}"object"==typeof a&&t(a,s)}))}(t,e.toObject(r)),r},t.encode64=c,t.decode64=function(e,t){return t?e.decode(function(e){const t=new Uint8Array(r.util.base64.length(e));return r.util.base64.decode(e,t,0),t}(t)):e.create()},t.equals=function(e,t,n){return c(e,t)===c(e,n)},t.deepClone=function(e,t){return e.fromObject(e.toObject(e.create(t)))},t.unknownToValue=function e(t){if(null==t)return{nullValue:0};if("string"==typeof t)return{stringValue:t};if("number"==typeof t)return{numberValue:t};if("boolean"==typeof t)return{boolValue:t};if(Array.isArray(t))return{listValue:{values:t.map(e)}};if("object"==typeof t)return{structValue:{fields:Object.fromEntries(Object.entries(t).map((([t,n])=>[t,e(n)])))}};throw new Error(`Unsupported value: ${t}`)}},8545(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(2545)),o=n(5379);t.IRecordDescriptorProperties=()=>i.strictKeysOf()(["description","columns","displayName","tags","bigqueryPolicyTags"]);class a{static mapConfigProtoToCompilationProto(e){return e.map((e=>o.sqlanvil.ColumnDescriptor.create({path:e.path,description:e.description,tags:e.tags,bigqueryPolicyTags:e.bigqueryPolicyTags})))}static mapLegacyObjectToConfigProto(e){return Object.keys(e).map((t=>a.mapColumnDescriptionToProto([t],e[t]))).flat()}static mapColumnDescriptionToProto(e,t){if("string"==typeof t)return[o.sqlanvil.ColumnDescriptor.create({description:t,path:e})];const n=t?[o.sqlanvil.ActionConfig.ColumnDescriptor.create({path:e,description:t.description,tags:"string"==typeof t.tags?[t.tags]:t.tags,bigqueryPolicyTags:"string"==typeof t.bigqueryPolicyTags?[t.bigqueryPolicyTags]:t.bigqueryPolicyTags})]:[],r=t.columns?Object.keys(t.columns):[];return n.concat(r.map((n=>a.mapColumnDescriptionToProto(e.concat([n]),t.columns[n]))).flat())}}t.ColumnDescriptors=a;class s{static mapToColumnProtoArray(e,t){return Object.keys(e).map((n=>s.mapColumnDescriptionToProto([n],e[n],t))).flat()}static mapColumnDescriptionToProto(e,n,r){if("string"==typeof n)return[o.sqlanvil.ColumnDescriptor.create({description:n,path:e})];i.checkExcessProperties(r,n,t.IRecordDescriptorProperties(),`${e.join(".")} column descriptor`);const a=n?[o.sqlanvil.ColumnDescriptor.create({path:e,description:n.description,displayName:n.displayName,tags:"string"==typeof n.tags?[n.tags]:n.tags,bigqueryPolicyTags:"string"==typeof n.bigqueryPolicyTags?[n.bigqueryPolicyTags]:n.bigqueryPolicyTags})]:[],l=n.columns?Object.keys(n.columns):[];return a.concat(l.map((t=>s.mapColumnDescriptionToProto(e.concat([t]),n.columns[t],r))).flat())}}t.LegacyColumnDescriptors=s},8561(e){"use strict";function t(e,n){"string"==typeof e&&(n=e,e=void 0);var r=[];function i(e){if("string"!=typeof e){var n=o();if(t.verbose&&console.log("codegen: "+n),n="return "+n,e){for(var a=Object.keys(e),s=new Array(a.length+1),l=new Array(a.length),c=0;c<a.length;)s[c]=a[c],l[c]=e[a[c++]];return s[c]=n,Function.apply(null,s).apply(null,l)}return Function(n)()}for(var u=new Array(arguments.length-1),p=0;p<u.length;)u[p]=arguments[++p];if(p=0,e=e.replace(/%([%dfijs])/g,(function(e,t){var n=u[p++];switch(t){case"d":case"f":return String(Number(n));case"i":return String(Math.floor(n));case"j":return JSON.stringify(n);case"s":return String(n)}return"%"})),p!==u.length)throw Error("parameter count mismatch");return r.push(e),i}function o(t){return"function "+(t||n||"")+"("+(e&&e.join(",")||"")+"){\n "+r.join("\n ")+"\n}"}return i.toString=o,i}e.exports=t,t.verbose=!1},8636(e,t,n){"use strict";var r=n(5388);e.exports=new r("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}})},8771(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5379);t.ActionBuilder=class{constructor(e){this.includeAssertionsForDependency=new Map,this.session=e}applySessionToTarget(e,t,n,i){const o=(null==i?void 0:i.useDefaultAssertionDataset)&&t.assertionSchema||t.defaultSchema,a=r.sqlanvil.Target.create({name:e.name,schema:e.schema||o||void 0,database:e.database||t.defaultDatabase||void 0});return(null==i?void 0:i.validateTarget)&&this.validateTarget(e,n),a}finalizeTarget(e){return r.sqlanvil.Target.create({name:this.session.finalizeName(e.name),schema:e.schema?this.session.finalizeSchema(e.schema):void 0,database:e.database?this.session.finalizeDatabase(e.database):void 0})}generateInlineAssertions(e,t){var n,i,o;const a={uniqueKeyAssertions:[]};(null===(n=e.uniqueKey)||void 0===n?void 0:n.length)&&(null===(i=e.uniqueKeys)||void 0===i?void 0:i.length)&&this.session.compileError(new Error("Specify at most one of 'assertions.uniqueKey' and 'assertions.uniqueKeys'."));const s=this.session.projectConfig.builtinAssertionNamePrefix?`${this.session.projectConfig.builtinAssertionNamePrefix}_`:"";let l=e.uniqueKeys.map((e=>r.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey.create(e)));(null===(o=e.uniqueKey)||void 0===o?void 0:o.length)&&(l=[r.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey.create({uniqueKey:e.uniqueKey})]),l&&l.forEach((({uniqueKey:e},n)=>{const i=this.session.assert(`${s}${t.target.schema}_${t.target.name}_assertions_uniqueKey_${n}`,r.sqlanvil.ActionConfig.AssertionConfig.create({filename:t.fileName})).query((n=>this.session.compilationSql().indexAssertion(n.ref(t.target),e)));t.tags&&i.tags(t.tags),i.setParentAction(r.sqlanvil.Target.create(t.target)),t.disabled&&i.disabled(),a.uniqueKeyAssertions.push(i)}));const c=e.rowConditions||[];return e.nonNull&&("string"==typeof e.nonNull?[e.nonNull]:e.nonNull).forEach((e=>c.push(`${e} IS NOT NULL`))),c&&c.length>0&&(a.rowConditionsAssertion=this.session.assert(`${s}${t.target.schema}_${t.target.name}_assertions_rowConditions`,{filename:t.fileName}).query((e=>this.session.compilationSql().rowConditionsAssertion(e.ref(t.target),c))),a.rowConditionsAssertion.setParentAction(r.sqlanvil.Target.create(t.target)),t.disabled&&a.rowConditionsAssertion.disabled(),t.tags&&a.rowConditionsAssertion.tags(t.tags)),a}validateTarget(e,t){e.name.includes(".")&&this.session.compileError(new Error("Action target names cannot include '.'"),t,e),e.schema.includes(".")&&this.session.compileError(new Error("Action target datasets cannot include '.'"),t,e),e.database.includes(".")&&this.session.compileError(new Error("Action target projects cannot include '.'"),t,e)}}},8811(e,t,n){"use strict";e.exports=o;var r=n(7209);((o.prototype=Object.create(r.prototype)).constructor=o).className="Method";var i=n(3262);function o(e,t,n,o,a,s,l,c,u){if(i.isObject(a)?(l=a,a=s=void 0):i.isObject(s)&&(l=s,s=void 0),void 0!==t&&!i.isString(t))throw TypeError("type must be a string");if(!i.isString(n))throw TypeError("requestType must be a string");if(!i.isString(o))throw TypeError("responseType must be a string");r.call(this,e,l),this.type=t||"rpc",this.requestType=n,this.requestStream=!!a||void 0,this.responseType=o,this.responseStream=!!s||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=c,this.parsedOptions=u}o.fromJSON=function(e,t){return new o(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},o.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0,"parsedOptions",this.parsedOptions])},o.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),r.prototype.resolve.call(this))}},8839(e,t){"use strict";var n=t;n.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&"="===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};for(var r=new Array(64),i=new Array(123),o=0;o<64;)i[r[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;n.encode=function(e,t,n){for(var i,o=null,a=[],s=0,l=0;t<n;){var c=e[t++];switch(l){case 0:a[s++]=r[c>>2],i=(3&c)<<4,l=1;break;case 1:a[s++]=r[i|c>>4],i=(15&c)<<2,l=2;break;case 2:a[s++]=r[i|c>>6],a[s++]=r[63&c],l=0}s>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,a)),s=0)}return l&&(a[s++]=r[i],a[s++]=61,1===l&&(a[s++]=61)),o?(s&&o.push(String.fromCharCode.apply(String,a.slice(0,s))),o.join("")):String.fromCharCode.apply(String,a.slice(0,s))};var a="invalid encoding";n.decode=function(e,t,n){for(var r,o=n,s=0,l=0;l<e.length;){var c=e.charCodeAt(l++);if(61===c&&s>1)break;if(void 0===(c=i[c]))throw Error(a);switch(s){case 0:r=c,s=1;break;case 1:t[n++]=r<<2|(48&c)>>4,r=c,s=2;break;case 2:t[n++]=(15&r)<<4|(60&c)>>2,r=c,s=3;break;case 3:t[n++]=(3&r)<<6|c,s=0}}if(1===s)throw Error(a);return n-o},n.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},8923(e,t,n){"use strict";e.exports=p;var r=n(7209);((p.prototype=Object.create(r.prototype)).constructor=p).className="Namespace";var i,o,a,s=n(1344),l=n(3262),c=n(1457);function u(e,t){if(e&&e.length){for(var n={},r=0;r<e.length;++r)n[e[r].name]=e[r].toJSON(t);return n}}function p(e,t){r.call(this,e,t),this.nested=void 0,this._nestedArray=null,this._lookupCache={},this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0}function f(e){e._nestedArray=null,e._lookupCache={};for(var t=e;t=t.parent;)t._lookupCache={};return e}p.fromJSON=function(e,t){return new p(e,t.options).addJSON(t.nested)},p.arrayToJSON=u,p.isReservedId=function(e,t){if(e)for(var n=0;n<e.length;++n)if("string"!=typeof e[n]&&e[n][0]<=t&&e[n][1]>t)return!0;return!1},p.isReservedName=function(e,t){if(e)for(var n=0;n<e.length;++n)if(e[n]===t)return!0;return!1},Object.defineProperty(p.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=l.toArray(this.nested))}}),p.prototype.toJSON=function(e){return l.toObject(["options",this.options,"nested",u(this.nestedArray,e)])},p.prototype.addJSON=function(e){if(e)for(var t,n=Object.keys(e),r=0;r<n.length;++r)t=e[n[r]],this.add((void 0!==t.fields?i.fromJSON:void 0!==t.values?a.fromJSON:void 0!==t.methods?o.fromJSON:void 0!==t.id?s.fromJSON:p.fromJSON)(n[r],t));return this},p.prototype.get=function(e){return this.nested&&this.nested[e]||null},p.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof a)return this.nested[e].values;throw Error("no such enum: "+e)},p.prototype.add=function(e){if(!(e instanceof s&&void 0!==e.extend||e instanceof i||e instanceof c||e instanceof a||e instanceof o||e instanceof p))throw TypeError("object must be a valid nested object");if(this.nested){var t=this.get(e.name);if(t){if(!(t instanceof p&&e instanceof p)||t instanceof i||t instanceof o)throw Error("duplicate name '"+e.name+"' in "+this);for(var n=t.nestedArray,r=0;r<n.length;++r)e.add(n[r]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}}else this.nested={};this.nested[e.name]=e,this instanceof i||this instanceof o||this instanceof a||this instanceof s||e._edition||(e._edition=e._defaultEdition),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0;for(var l=this;l=l.parent;)l._needsRecursiveFeatureResolution=!0,l._needsRecursiveResolve=!0;return e.onAdd(this),f(this)},p.prototype.remove=function(e){if(!(e instanceof r))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),f(this)},p.prototype.define=function(e,t){if(l.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&""===e[0])throw Error("path must be relative");for(var n=this;e.length>0;){var r=e.shift();if(n.nested&&n.nested[r]){if(!((n=n.nested[r])instanceof p))throw Error("path conflicts with non-namespace objects")}else n.add(n=new p(r))}return t&&n.addJSON(t),n},p.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;this._resolveFeaturesRecursive(this._edition);var e=this.nestedArray,t=0;for(this.resolve();t<e.length;)e[t]instanceof p?e[t++].resolveAll():e[t++].resolve();return this._needsRecursiveResolve=!1,this},p.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(this._needsRecursiveFeatureResolution=!1,e=this._edition||e,r.prototype._resolveFeaturesRecursive.call(this,e),this.nestedArray.forEach((t=>{t._resolveFeaturesRecursive(e)})),this):this},p.prototype.lookup=function(e,t,n){if("boolean"==typeof t?(n=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),l.isString(e)&&e.length){if("."===e)return this.root;e=e.split(".")}else if(!e.length)return this;var r=e.join(".");if(""===e[0])return this.root.lookup(e.slice(1),t);var i=this.root._fullyQualifiedObjects&&this.root._fullyQualifiedObjects["."+r];if(i&&(!t||t.indexOf(i.constructor)>-1))return i;if((i=this._lookupImpl(e,r))&&(!t||t.indexOf(i.constructor)>-1))return i;if(n)return null;for(var o=this;o.parent;){if((i=o.parent._lookupImpl(e,r))&&(!t||t.indexOf(i.constructor)>-1))return i;o=o.parent}return null},p.prototype._lookupImpl=function(e,t){if(Object.prototype.hasOwnProperty.call(this._lookupCache,t))return this._lookupCache[t];var n=this.get(e[0]),r=null;if(n)1===e.length?r=n:n instanceof p&&(e=e.slice(1),r=n._lookupImpl(e,e.join(".")));else for(var i=0;i<this.nestedArray.length;++i)this._nestedArray[i]instanceof p&&(n=this._nestedArray[i]._lookupImpl(e,t))&&(r=n);return this._lookupCache[t]=r,r},p.prototype.lookupType=function(e){var t=this.lookup(e,[i]);if(!t)throw Error("no such type: "+e);return t},p.prototype.lookupEnum=function(e){var t=this.lookup(e,[a]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},p.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[i,a]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t},p.prototype.lookupService=function(e){var t=this.lookup(e,[o]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},p._configure=function(e,t,n){i=e,o=t,a=n}},8995(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=n(8512),o=n(5436),a=n(1299),s=n(2008),l=n(8545),c=r(n(9553)),u=n(2545),p=n(5379);class f extends o.ActionBuilder{constructor(e,t,n){var r;if(super(e),this.dependOnDependencyAssertions=!1,this.contextablePreOps=[],this.contextablePostOps=[],this.proto=p.sqlanvil.Table.create({type:"view",enumType:p.sqlanvil.TableType.VIEW,disabled:!1,tags:[]}),this.uniqueKeyAssertions=[],this.session=e,this.configPath=n,this.unverifiedConfig=Object.assign({},t),!t)return;const i=this.verifyConfig(t);i.name||(i.name=c.basename(i.filename));const o=u.actionConfigToCompiledGraphTarget(i);return this.proto.target=this.applySessionToTarget(o,e.projectConfig,i.filename,{validateTarget:!0}),this.proto.canonicalTarget=this.applySessionToTarget(o,e.canonicalProjectConfig),n&&(i.filename=u.resolveActionsConfigFilename(i.filename,n),this.query(u.nativeRequire(i.filename).query)),i.filename&&(this.proto.fileName=i.filename),i.dependOnDependencyAssertions&&this.setDependOnDependencyAssertions(i.dependOnDependencyAssertions),i.dependencyTargets&&this.dependencies(i.dependencyTargets.map((e=>u.configTargetToCompiledGraphTarget(p.sqlanvil.ActionConfig.Target.create(e))))),void 0!==i.hermetic&&this.hermetic(i.hermetic),i.disabled&&this.disabled(),i.tags&&this.tags(i.tags),i.description&&this.description(i.description),i.metadata&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.metadata=i.metadata),(null===(r=i.columns)||void 0===r?void 0:r.length)&&this.columns(i.columns.map((e=>p.sqlanvil.ActionConfig.ColumnDescriptor.create(e)))),i.project&&this.database(i.project),i.dataset&&this.schema(i.dataset),i.assertions&&this.assertions(p.sqlanvil.ActionConfig.TableAssertionsConfig.create(i.assertions)),i.materialized&&this.materialized(i.materialized),i.postgres&&this.postgres(i.postgres),i.preOperations&&this.preOps(i.preOperations),i.postOperations&&this.postOps(i.postOperations),(Object.keys(i.labels).length||Object.keys(i.additionalOptions).length||i.partitionBy.length>0||i.clusterBy.length>0)&&this.bigquery({partitionBy:i.partitionBy,clusterBy:i.clusterBy,labels:i.labels,additionalOptions:i.additionalOptions}),i.reservation&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.reservation=i.reservation),this}type(e){let t;switch(e){case"table":t=new s.Table(this.session,Object.assign(Object.assign({},this.unverifiedConfig),{type:"table"}),this.configPath);break;case"incremental":t=new a.IncrementalTable(this.session,Object.assign(Object.assign({},this.unverifiedConfig),{type:"incremental"}),this.configPath);break;case"view":return this;default:throw new Error(`Unexpected table type: ${e}`)}const n=this.session.actions.indexOf(this);if(-1===n)throw Error("Expected pre-existing action, but none found. Please report this to the sqlanvil team.");this.session.actions[n]=t}query(e){return this.contextableQuery=e,this}where(e){return this.contextableWhere=e,this}preOps(e){return this.contextablePreOps.push(e),this}postOps(e){return this.contextablePostOps.push(e),this}disabled(e=!0){var t;return this.proto.disabled=e,this.uniqueKeyAssertions.forEach((t=>t.disabled(e))),null===(t=this.rowConditionsAssertion)||void 0===t||t.disabled(e),this}materialized(e){this.proto.materialized=e}postgres(e){this.proto.postgres=p.sqlanvil.PostgresOptions.create(e)}bigquery(e){return this.proto.bigquery=p.sqlanvil.BigQueryOptions.create(e),e.labels&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.bigqueryLabels=e.labels),this}dependencies(e){return(Array.isArray(e)?e:[e]).forEach((e=>{const t=u.checkAssertionsForDependency(this,e);t&&this.proto.dependencyTargets.push(t)})),this}hermetic(e){this.proto.hermeticity=e?p.sqlanvil.ActionHermeticity.HERMETIC:p.sqlanvil.ActionHermeticity.NON_HERMETIC}tags(e){var t;return("string"==typeof e?[e]:e).forEach((e=>{this.proto.tags.push(e)})),this.uniqueKeyAssertions.forEach((t=>t.tags(e))),null===(t=this.rowConditionsAssertion)||void 0===t||t.tags(e),this}description(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.description=e,this}columns(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.columns=l.ColumnDescriptors.mapConfigProtoToCompilationProto(e),this}database(e){return this.proto.target=this.applySessionToTarget(p.sqlanvil.Target.create(Object.assign(Object.assign({},this.proto.target),{database:e})),this.session.projectConfig,this.proto.fileName,{validateTarget:!0}),this}schema(e){return this.proto.target=this.applySessionToTarget(p.sqlanvil.Target.create(Object.assign(Object.assign({},this.proto.target),{schema:e})),this.session.projectConfig,this.proto.fileName,{validateTarget:!0}),this}assertions(e){const t=this.generateInlineAssertions(e,this.proto);return this.uniqueKeyAssertions=t.uniqueKeyAssertions,this.rowConditionsAssertion=t.rowConditionsAssertion,this}setDependOnDependencyAssertions(e){return this.dependOnDependencyAssertions=e,this}jitCode(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.compilationMode=p.sqlanvil.ActionCompilationMode.ACTION_COMPILATION_MODE_JIT,this.contextableJitCode=e,this}getFileName(){return this.proto.fileName}getTarget(){return p.sqlanvil.Target.create(this.proto.target)}compile(){return this.contextableJitCode?this.compileJit():this.compileAot(),i.verifyObjectMatchesProto(p.sqlanvil.Table,this.proto,i.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM)}compileJit(){u.validateNoMixedCompilationMode(this.session,this.getFileName(),this.contextableQuery,this.contextableWhere,this.contextablePostOps,this.contextablePreOps),this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.jitCode=this.contextableJitCode.toString()}compileAot(){const e=new d(this),t=new d(this,!0);this.proto.query=e.apply(this.contextableQuery),this.proto.enumType===p.sqlanvil.TableType.INCREMENTAL&&(this.proto.incrementalQuery=t.apply(this.contextableQuery),this.proto.incrementalPreOps=this.contextifyOps(this.contextablePreOps,t),this.proto.incrementalPostOps=this.contextifyOps(this.contextablePostOps,t)),this.contextableWhere&&(this.proto.where=e.apply(this.contextableWhere)),this.proto.preOps=this.contextifyOps(this.contextablePreOps,e).filter((e=>!!e.trim())),this.proto.postOps=this.contextifyOps(this.contextablePostOps,e).filter((e=>!!e.trim())),u.validateQueryString(this.session,this.proto.query,this.proto.fileName),u.validateQueryString(this.session,this.proto.incrementalQuery,this.proto.fileName)}contextifyOps(e,t){let n=[];return e.forEach((e=>{const r=t.apply(e);n=n.concat("string"==typeof r?[r]:r)})),n}verifyConfig(e){e.type&&(delete e.type,e.dependencies&&(e.dependencyTargets=e.dependencies.map((e=>u.resolvableAsActionConfigTarget(e))),delete e.dependencies),e.database&&(e.project=e.database,delete e.database),e.schema&&(e.dataset=e.schema,delete e.schema),e.fileName&&(e.filename=e.fileName,delete e.fileName),e.columns&&(e.columns=l.ColumnDescriptors.mapLegacyObjectToConfigProto(e.columns)),(null==(e=o.LegacyConfigConverter.insertLegacyInlineAssertionsToConfigProto(e))?void 0:e.bigquery)&&(u.checkExcessProperties((e=>{throw e}),e.bigquery,u.strictKeysOf()(["labels","additionalOptions","partitionBy","clusterBy"]),"BigQuery view config"),e.bigquery.labels&&(e.labels=e.bigquery.labels,delete e.bigquery.labels),e.bigquery.additionalOptions&&(e.additionalOptions=e.bigquery.additionalOptions,delete e.bigquery.additionalOptions),e.bigquery.partitionBy&&(e.partitionBy=e.bigquery.partitionBy,delete e.bigquery.partitionBy),e.bigquery.clusterBy&&(e.clusterBy=e.bigquery.clusterBy,delete e.bigquery.clusterBy)));const t=i.verifyObjectMatchesProto(p.sqlanvil.ActionConfig.ViewConfig,e,i.VerifyProtoErrorBehaviour.SHOW_DOCS_LINK);return!t.materialized&&(t.partitionBy.length>0||t.clusterBy.length>0)&&this.session.compileError("partitionBy/clusterBy can be applied only to materialized views",t.filename,p.sqlanvil.Target.create({database:t.project,schema:t.dataset,name:t.name})),t}}t.View=f;class d{constructor(e,t=!1){this.view=e,this.isIncremental=t}self(){return this.resolve(this.view.getTarget())}name(){return this.view.session.finalizeName(this.view.getTarget().name)}ref(e,...t){return e=u.toResolvable(e,t),u.resolvableAsTarget(e)?(this.view.dependencies(e),this.resolve(e)):(this.view.session.compileError(new Error("Action name is not specified")),"")}resolve(e,...t){return this.view.session.resolve(e,...t)}schema(){return this.view.session.finalizeSchema(this.view.getTarget().schema)}database(){return this.view.getTarget().database?this.view.session.finalizeDatabase(this.view.getTarget().database):(this.view.session.compileError(new Error("Warehouse does not support multiple databases")),"")}where(e){return this.view.where(e),""}when(e,t,n=""){return e?t:n}incremental(){return!!this.isIncremental}preOps(e){return this.view.preOps(e),""}postOps(e){return this.view.postOps(e),""}disabled(){return this.view.disabled(),""}bigquery(e){return this.view.bigquery(e),""}dependencies(e){return this.view.dependencies(e),""}apply(e){return"function"==typeof e?e(this):e}tags(e){return this.view.tags(e),""}}t.ViewContext=d},9100(e,t,n){"use strict";var r=e.exports=n(5325);r.build="full",r.tokenize=n(527),r.parse=n(4863),r.common=n(5095),r.Root._configure(r.Type,r.parse,r.common)},9198(e,t,n){"use strict";var r=n(5388);e.exports=new r("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"})},9207(e,t){"use strict";var n=t,r=n.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},i=n.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),n=r(e),i="";n&&(i=t.shift()+"/");for(var o=0;o<t.length;)".."===t[o]?o>0&&".."!==t[o-1]?t.splice(--o,2):n?t.splice(o,1):++o:"."===t[o]?t.splice(o,1):++o;return i+t.join("/")};n.resolve=function(e,t,n){return n||(t=i(t)),r(t)?t:(n||(e=i(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?i(e+"/"+t):t)}},9243(e,t,n){"use strict";var r=n(8433),i=n(1231),o=n(8083),a=n(5489),s=Object.prototype.hasOwnProperty,l=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,c=/[\x85\u2028\u2029]/,u=/[,\[\]\{\}]/,p=/^(?:!|!!|![a-z\-]+!)$/i,f=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function d(e){return Object.prototype.toString.call(e)}function g(e){return 10===e||13===e}function h(e){return 9===e||32===e}function y(e){return 9===e||32===e||10===e||13===e}function m(e){return 44===e||91===e||93===e||123===e||125===e}function b(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function v(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e||9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"
":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function O(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}function T(e,t,n){"__proto__"===t?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}for(var w=new Array(256),j=new Array(256),q=0;q<256;q++)w[q]=v(q)?1:0,j[q]=v(q);function P(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||a,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function A(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=o(n),new i(t,n)}function C(e,t){throw A(e,t)}function S(e,t){e.onWarning&&e.onWarning.call(null,A(e,t))}var x={YAML:function(e,t,n){var r,i,o;null!==e.version&&C(e,"duplication of %YAML directive"),1!==n.length&&C(e,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&C(e,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),o=parseInt(r[2],10),1!==i&&C(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,1!==o&&2!==o&&S(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var r,i;2!==n.length&&C(e,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],p.test(r)||C(e,"ill-formed tag handle (first argument) of the TAG directive"),s.call(e.tagMap,r)&&C(e,'there is a previously declared suffix for "'+r+'" tag handle'),f.test(i)||C(e,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch(t){C(e,"tag prefix is malformed: "+i)}e.tagMap[r]=i}};function k(e,t,n,r){var i,o,a,s;if(t<n){if(s=e.input.slice(t,n),r)for(i=0,o=s.length;i<o;i+=1)9===(a=s.charCodeAt(i))||32<=a&&a<=1114111||C(e,"expected valid JSON character");else l.test(s)&&C(e,"the stream contains non-printable characters");e.result+=s}}function E(e,t,n,i){var o,a,l,c;for(r.isObject(n)||C(e,"cannot merge mappings; the provided source object is unacceptable"),l=0,c=(o=Object.keys(n)).length;l<c;l+=1)a=o[l],s.call(t,a)||(T(t,a,n[a]),i[a]=!0)}function D(e,t,n,r,i,o,a,l,c){var u,p;if(Array.isArray(i))for(u=0,p=(i=Array.prototype.slice.call(i)).length;u<p;u+=1)Array.isArray(i[u])&&C(e,"nested arrays are not supported inside keys"),"object"==typeof i&&"[object Object]"===d(i[u])&&(i[u]="[object Object]");if("object"==typeof i&&"[object Object]"===d(i)&&(i="[object Object]"),i=String(i),null===t&&(t={}),"tag:yaml.org,2002:merge"===r)if(Array.isArray(o))for(u=0,p=o.length;u<p;u+=1)E(e,t,o[u],n);else E(e,t,o,n);else e.json||s.call(n,i)||!s.call(t,i)||(e.line=a||e.line,e.lineStart=l||e.lineStart,e.position=c||e.position,C(e,"duplicated mapping key")),T(t,i,o),delete n[i];return t}function N(e){var t;10===(t=e.input.charCodeAt(e.position))?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):C(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function R(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);0!==i;){for(;h(i);)9===i&&-1===e.firstTabInLine&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&35===i)do{i=e.input.charCodeAt(++e.position)}while(10!==i&&13!==i&&0!==i);if(!g(i))break;for(N(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;32===i;)e.lineIndent++,i=e.input.charCodeAt(++e.position)}return-1!==n&&0!==r&&e.lineIndent<n&&S(e,"deficient indentation"),r}function _(e){var t,n=e.position;return!(45!==(t=e.input.charCodeAt(n))&&46!==t||t!==e.input.charCodeAt(n+1)||t!==e.input.charCodeAt(n+2)||(n+=3,0!==(t=e.input.charCodeAt(n))&&!y(t)))}function I(e,t){1===t?e.result+=" ":t>1&&(e.result+=r.repeat("\n",t-1))}function L(e,t){var n,r,i=e.tag,o=e.anchor,a=[],s=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),r=e.input.charCodeAt(e.position);0!==r&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,C(e,"tab characters must not be used in indentation")),45===r)&&y(e.input.charCodeAt(e.position+1));)if(s=!0,e.position++,R(e,!0,-1)&&e.lineIndent<=t)a.push(null),r=e.input.charCodeAt(e.position);else if(n=e.line,F(e,t,3,!1,!0),a.push(e.result),R(e,!0,-1),r=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==r)C(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return!!s&&(e.tag=i,e.anchor=o,e.kind="sequence",e.result=a,!0)}function M(e){var t,n,r,i,o=!1,a=!1;if(33!==(i=e.input.charCodeAt(e.position)))return!1;if(null!==e.tag&&C(e,"duplication of a tag property"),60===(i=e.input.charCodeAt(++e.position))?(o=!0,i=e.input.charCodeAt(++e.position)):33===i?(a=!0,n="!!",i=e.input.charCodeAt(++e.position)):n="!",t=e.position,o){do{i=e.input.charCodeAt(++e.position)}while(0!==i&&62!==i);e.position<e.length?(r=e.input.slice(t,e.position),i=e.input.charCodeAt(++e.position)):C(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==i&&!y(i);)33===i&&(a?C(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),p.test(n)||C(e,"named tag handle cannot contain such characters"),a=!0,t=e.position+1)),i=e.input.charCodeAt(++e.position);r=e.input.slice(t,e.position),u.test(r)&&C(e,"tag suffix cannot contain flow indicator characters")}r&&!f.test(r)&&C(e,"tag name cannot contain such characters: "+r);try{r=decodeURIComponent(r)}catch(t){C(e,"tag name is malformed: "+r)}return o?e.tag=r:s.call(e.tagMap,n)?e.tag=e.tagMap[n]+r:"!"===n?e.tag="!"+r:"!!"===n?e.tag="tag:yaml.org,2002:"+r:C(e,'undeclared tag handle "'+n+'"'),!0}function B(e){var t,n;if(38!==(n=e.input.charCodeAt(e.position)))return!1;for(null!==e.anchor&&C(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!y(n)&&!m(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&C(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function F(e,t,n,i,o){var a,l,c,u,p,f,d,v,T,q=1,P=!1,A=!1;if(null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=l=c=4===n||3===n,i&&R(e,!0,-1)&&(P=!0,e.lineIndent>t?q=1:e.lineIndent===t?q=0:e.lineIndent<t&&(q=-1)),1===q)for(;M(e)||B(e);)R(e,!0,-1)?(P=!0,c=a,e.lineIndent>t?q=1:e.lineIndent===t?q=0:e.lineIndent<t&&(q=-1)):c=!1;if(c&&(c=P||o),1!==q&&4!==n||(v=1===n||2===n?t:t+1,T=e.position-e.lineStart,1===q?c&&(L(e,T)||function(e,t,n){var r,i,o,a,s,l,c,u=e.tag,p=e.anchor,f={},d=Object.create(null),g=null,m=null,b=null,v=!1,O=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=f),c=e.input.charCodeAt(e.position);0!==c;){if(v||-1===e.firstTabInLine||(e.position=e.firstTabInLine,C(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),o=e.line,63!==c&&58!==c||!y(r)){if(a=e.line,s=e.lineStart,l=e.position,!F(e,n,2,!1,!0))break;if(e.line===o){for(c=e.input.charCodeAt(e.position);h(c);)c=e.input.charCodeAt(++e.position);if(58===c)y(c=e.input.charCodeAt(++e.position))||C(e,"a whitespace character is expected after the key-value separator within a block mapping"),v&&(D(e,f,d,g,m,null,a,s,l),g=m=b=null),O=!0,v=!1,i=!1,g=e.tag,m=e.result;else{if(!O)return e.tag=u,e.anchor=p,!0;C(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!O)return e.tag=u,e.anchor=p,!0;C(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===c?(v&&(D(e,f,d,g,m,null,a,s,l),g=m=b=null),O=!0,v=!0,i=!0):v?(v=!1,i=!0):C(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,c=r;if((e.line===o||e.lineIndent>t)&&(v&&(a=e.line,s=e.lineStart,l=e.position),F(e,t,4,!0,i)&&(v?m=e.result:b=e.result),v||(D(e,f,d,g,m,b,a,s,l),g=m=b=null),R(e,!0,-1),c=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&0!==c)C(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return v&&D(e,f,d,g,m,null,a,s,l),O&&(e.tag=u,e.anchor=p,e.kind="mapping",e.result=f),O}(e,T,v))||function(e,t){var n,r,i,o,a,s,l,c,u,p,f,d,g=!0,h=e.tag,m=e.anchor,b=Object.create(null);if(91===(d=e.input.charCodeAt(e.position)))a=93,c=!1,o=[];else{if(123!==d)return!1;a=125,c=!0,o={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=o),d=e.input.charCodeAt(++e.position);0!==d;){if(R(e,!0,t),(d=e.input.charCodeAt(e.position))===a)return e.position++,e.tag=h,e.anchor=m,e.kind=c?"mapping":"sequence",e.result=o,!0;g?44===d&&C(e,"expected the node content, but found ','"):C(e,"missed comma between flow collection entries"),f=null,s=l=!1,63===d&&y(e.input.charCodeAt(e.position+1))&&(s=l=!0,e.position++,R(e,!0,t)),n=e.line,r=e.lineStart,i=e.position,F(e,t,1,!1,!0),p=e.tag,u=e.result,R(e,!0,t),d=e.input.charCodeAt(e.position),!l&&e.line!==n||58!==d||(s=!0,d=e.input.charCodeAt(++e.position),R(e,!0,t),F(e,t,1,!1,!0),f=e.result),c?D(e,o,b,p,u,f,n,r,i):s?o.push(D(e,null,b,p,u,f,n,r,i)):o.push(u),R(e,!0,t),44===(d=e.input.charCodeAt(e.position))?(g=!0,d=e.input.charCodeAt(++e.position)):g=!1}C(e,"unexpected end of the stream within a flow collection")}(e,v)?A=!0:(l&&function(e,t){var n,i,o,a,s,l=1,c=!1,u=!1,p=t,f=0,d=!1;if(124===(a=e.input.charCodeAt(e.position)))i=!1;else{if(62!==a)return!1;i=!0}for(e.kind="scalar",e.result="";0!==a;)if(43===(a=e.input.charCodeAt(++e.position))||45===a)1===l?l=43===a?3:2:C(e,"repeat of a chomping mode identifier");else{if(!((o=48<=(s=a)&&s<=57?s-48:-1)>=0))break;0===o?C(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):u?C(e,"repeat of an indentation width identifier"):(p=t+o-1,u=!0)}if(h(a)){do{a=e.input.charCodeAt(++e.position)}while(h(a));if(35===a)do{a=e.input.charCodeAt(++e.position)}while(!g(a)&&0!==a)}for(;0!==a;){for(N(e),e.lineIndent=0,a=e.input.charCodeAt(e.position);(!u||e.lineIndent<p)&&32===a;)e.lineIndent++,a=e.input.charCodeAt(++e.position);if(!u&&e.lineIndent>p&&(p=e.lineIndent),g(a))f++;else{if(e.lineIndent<p){3===l?e.result+=r.repeat("\n",c?1+f:f):1===l&&c&&(e.result+="\n");break}for(i?h(a)?(d=!0,e.result+=r.repeat("\n",c?1+f:f)):d?(d=!1,e.result+=r.repeat("\n",f+1)):0===f?c&&(e.result+=" "):e.result+=r.repeat("\n",f):e.result+=r.repeat("\n",c?1+f:f),c=!0,u=!0,f=0,n=e.position;!g(a)&&0!==a;)a=e.input.charCodeAt(++e.position);k(e,n,e.position,!1)}}return!0}(e,v)||function(e,t){var n,r,i;if(39!==(n=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(k(e,r,e.position,!0),39!==(n=e.input.charCodeAt(++e.position)))return!0;r=e.position,e.position++,i=e.position}else g(n)?(k(e,r,i,!0),I(e,R(e,!1,t)),r=i=e.position):e.position===e.lineStart&&_(e)?C(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);C(e,"unexpected end of the stream within a single quoted scalar")}(e,v)||function(e,t){var n,r,i,o,a,s,l;if(34!==(s=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;0!==(s=e.input.charCodeAt(e.position));){if(34===s)return k(e,n,e.position,!0),e.position++,!0;if(92===s){if(k(e,n,e.position,!0),g(s=e.input.charCodeAt(++e.position)))R(e,!1,t);else if(s<256&&w[s])e.result+=j[s],e.position++;else if((a=120===(l=s)?2:117===l?4:85===l?8:0)>0){for(i=a,o=0;i>0;i--)(a=b(s=e.input.charCodeAt(++e.position)))>=0?o=(o<<4)+a:C(e,"expected hexadecimal character");e.result+=O(o),e.position++}else C(e,"unknown escape sequence");n=r=e.position}else g(s)?(k(e,n,r,!0),I(e,R(e,!1,t)),n=r=e.position):e.position===e.lineStart&&_(e)?C(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}C(e,"unexpected end of the stream within a double quoted scalar")}(e,v)?A=!0:function(e){var t,n,r;if(42!==(r=e.input.charCodeAt(e.position)))return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!y(r)&&!m(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&C(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),s.call(e.anchorMap,n)||C(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],R(e,!0,-1),!0}(e)?(A=!0,null===e.tag&&null===e.anchor||C(e,"alias node should not have any properties")):function(e,t,n){var r,i,o,a,s,l,c,u,p=e.kind,f=e.result;if(y(u=e.input.charCodeAt(e.position))||m(u)||35===u||38===u||42===u||33===u||124===u||62===u||39===u||34===u||37===u||64===u||96===u)return!1;if((63===u||45===u)&&(y(r=e.input.charCodeAt(e.position+1))||n&&m(r)))return!1;for(e.kind="scalar",e.result="",i=o=e.position,a=!1;0!==u;){if(58===u){if(y(r=e.input.charCodeAt(e.position+1))||n&&m(r))break}else if(35===u){if(y(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&_(e)||n&&m(u))break;if(g(u)){if(s=e.line,l=e.lineStart,c=e.lineIndent,R(e,!1,-1),e.lineIndent>=t){a=!0,u=e.input.charCodeAt(e.position);continue}e.position=o,e.line=s,e.lineStart=l,e.lineIndent=c;break}}a&&(k(e,i,o,!1),I(e,e.line-s),i=o=e.position,a=!1),h(u)||(o=e.position+1),u=e.input.charCodeAt(++e.position)}return k(e,i,o,!1),!!e.result||(e.kind=p,e.result=f,!1)}(e,v,1===n)&&(A=!0,null===e.tag&&(e.tag="?")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===q&&(A=c&&L(e,T))),null===e.tag)null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);else if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&C(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),u=0,p=e.implicitTypes.length;u<p;u+=1)if((d=e.implicitTypes[u]).resolve(e.result)){e.result=d.construct(e.result),e.tag=d.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else if("!"!==e.tag){if(s.call(e.typeMap[e.kind||"fallback"],e.tag))d=e.typeMap[e.kind||"fallback"][e.tag];else for(d=null,u=0,p=(f=e.typeMap.multi[e.kind||"fallback"]).length;u<p;u+=1)if(e.tag.slice(0,f[u].tag.length)===f[u].tag){d=f[u];break}d||C(e,"unknown tag !<"+e.tag+">"),null!==e.result&&d.kind!==e.kind&&C(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+d.kind+'", not "'+e.kind+'"'),d.resolve(e.result,e.tag)?(e.result=d.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):C(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||A}function U(e){var t,n,r,i,o=e.position,a=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(i=e.input.charCodeAt(e.position))&&(R(e,!0,-1),i=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==i));){for(a=!0,i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!y(i);)i=e.input.charCodeAt(++e.position);for(r=[],(n=e.input.slice(t,e.position)).length<1&&C(e,"directive name must not be less than one character in length");0!==i;){for(;h(i);)i=e.input.charCodeAt(++e.position);if(35===i){do{i=e.input.charCodeAt(++e.position)}while(0!==i&&!g(i));break}if(g(i))break;for(t=e.position;0!==i&&!y(i);)i=e.input.charCodeAt(++e.position);r.push(e.input.slice(t,e.position))}0!==i&&N(e),s.call(x,n)?x[n](e,n,r):S(e,'unknown document directive "'+n+'"')}R(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,R(e,!0,-1)):a&&C(e,"directives end mark is expected"),F(e,e.lineIndent-1,4,!1,!0),R(e,!0,-1),e.checkLineBreaks&&c.test(e.input.slice(o,e.position))&&S(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&_(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,R(e,!0,-1)):e.position<e.length-1&&C(e,"end of the stream or a document separator is expected")}function J(e,t){t=t||{},0!==(e=String(e)).length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var n=new P(e,t),r=e.indexOf("\0");for(-1!==r&&(n.position=r,C(n,"null byte is not allowed in input")),n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)U(n);return n.documents}e.exports.loadAll=function(e,t,n){null!==t&&"object"==typeof t&&void 0===n&&(n=t,t=null);var r=J(e,n);if("function"!=typeof t)return r;for(var i=0,o=r.length;i<o;i+=1)t(r[i])},e.exports.load=function(e,t){var n=J(e,t);if(0!==n.length){if(1===n.length)return n[0];throw new i("expected a single document in the stream, but found more")}}},9293(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=n(8512),o=n(5436),a=n(8545),s=r(n(9553)),l=n(2545),c=n(5379);class u extends o.ActionBuilder{constructor(e,t,n){var r;if(super(e),this.dependOnDependencyAssertions=!1,this.proto=c.sqlanvil.Operation.create(),this.session=e,!t)return;const i=this.verifyConfig(t);i.name||(i.name=s.basename(i.filename));const o=l.actionConfigToCompiledGraphTarget(i);return this.proto.target=this.applySessionToTarget(o,e.projectConfig,i.filename,{validateTarget:!0}),this.proto.canonicalTarget=this.applySessionToTarget(o,e.canonicalProjectConfig),n&&(i.filename=l.resolveActionsConfigFilename(i.filename,n),this.queries(l.nativeRequire(i.filename).query)),i.dependOnDependencyAssertions&&this.setDependOnDependencyAssertions(i.dependOnDependencyAssertions),i.dependencyTargets&&this.dependencies(i.dependencyTargets.map((e=>l.configTargetToCompiledGraphTarget(c.sqlanvil.ActionConfig.Target.create(e))))),void 0!==i.hermetic&&this.hermetic(i.hermetic),i.disabled&&this.disabled(),i.tags&&this.tags(i.tags),i.hasOutput&&this.hasOutput(i.hasOutput),i.description&&this.description(i.description),(null===(r=i.columns)||void 0===r?void 0:r.length)&&this.columns(i.columns.map((e=>c.sqlanvil.ActionConfig.ColumnDescriptor.create(e)))),i.project&&this.database(i.project),i.dataset&&this.schema(i.dataset),i.filename&&(this.proto.fileName=i.filename),i.reservation&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.reservation=i.reservation),this}queries(e){return this.contextableQueries=e,this}jitCode(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.compilationMode=c.sqlanvil.ActionCompilationMode.ACTION_COMPILATION_MODE_JIT,this.contextableJitCode=e,this}dependencies(e){return(Array.isArray(e)?e:[e]).forEach((e=>{const t=l.checkAssertionsForDependency(this,e);t&&this.proto.dependencyTargets.push(t)})),this}hermetic(e){this.proto.hermeticity=e?c.sqlanvil.ActionHermeticity.HERMETIC:c.sqlanvil.ActionHermeticity.NON_HERMETIC}disabled(e=!0){return this.proto.disabled=e,this}tags(e){return("string"==typeof e?[e]:e).forEach((e=>{this.proto.tags.indexOf(e)<0&&this.proto.tags.push(e)})),this}hasOutput(e){return this.proto.hasOutput=e,this}description(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.description=e,this}columns(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.columns=a.ColumnDescriptors.mapConfigProtoToCompilationProto(e),this}database(e){return this.proto.target=this.applySessionToTarget(c.sqlanvil.Target.create(Object.assign(Object.assign({},this.proto.target),{database:e})),this.session.projectConfig,this.proto.fileName,{validateTarget:!0}),this}schema(e){return this.proto.target=this.applySessionToTarget(c.sqlanvil.Target.create(Object.assign(Object.assign({},this.proto.target),{schema:e})),this.session.projectConfig,this.proto.fileName,{validateTarget:!0}),this}setDependOnDependencyAssertions(e){return this.dependOnDependencyAssertions=e,this}getFileName(){return this.proto.fileName}getTarget(){return c.sqlanvil.Target.create(this.proto.target)}getHasOutput(){return this.proto.hasOutput}compile(){var e,t;if((null===(t=null===(e=this.proto.actionDescriptor)||void 0===e?void 0:e.columns)||void 0===t?void 0:t.length)>0&&!this.proto.hasOutput&&this.session.compileError(new Error("Actions of type 'operations' may only describe columns if they specify 'hasOutput: true'."),this.proto.fileName),this.contextableJitCode)this.compileJit();else{const e=new p(this).apply(this.contextableQueries);this.proto.queries="string"==typeof e?[e]:e}return i.verifyObjectMatchesProto(c.sqlanvil.Operation,this.proto,i.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM)}compileJit(){if(this.contextableQueries){const e=new Error(`Cannot mix AoT and JiT compilation in action: ${this.contextableQueries}`);throw this.session.compileError(e,this.getFileName()),e}this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.jitCode=this.contextableJitCode.toString()}verifyConfig(e){return e.type&&(delete e.type,e.dependencies&&(e.dependencyTargets=e.dependencies.map((e=>l.resolvableAsActionConfigTarget(e))),delete e.dependencies),e.database&&(e.project=e.database,delete e.database),e.schema&&(e.dataset=e.schema,delete e.schema),e.fileName&&(e.filename=e.fileName,delete e.fileName),e.columns&&(e.columns=a.ColumnDescriptors.mapLegacyObjectToConfigProto(e.columns))),i.verifyObjectMatchesProto(c.sqlanvil.ActionConfig.OperationConfig,e,i.VerifyProtoErrorBehaviour.SHOW_DOCS_LINK)}}t.Operation=u;class p{constructor(e){this.operation=e}self(){return this.resolve(this.operation.getTarget())}name(){return this.operation.session.finalizeName(this.operation.getTarget().name)}ref(e,...t){return e=l.toResolvable(e,t),l.resolvableAsTarget(e)?(this.operation.dependencies(e),this.resolve(e)):(this.operation.session.compileError(new Error("Action name is not specified")),"")}resolve(e,...t){return this.operation.session.resolve(e,...t)}schema(){return this.operation.session.finalizeSchema(this.operation.getTarget().schema)}database(){return this.operation.getTarget().database?this.operation.session.finalizeDatabase(this.operation.getTarget().database):(this.operation.session.compileError(new Error("Warehouse does not support multiple databases")),"")}dependencies(e){return this.operation.dependencies(e),""}tags(e){return this.operation.tags(e),""}hasOutput(e){return this.operation.hasOutput(e),""}when(e,t,n=""){return e?t:n}apply(e){return"function"==typeof e?e(this):e}}t.OperationContext=p},9342(e,t,n){"use strict";var r=n(5388),i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";e.exports=new r("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=0,o=e.length,a=i;for(n=0;n<o;n++)if(!((t=a.indexOf(e.charAt(n)))>64)){if(t<0)return!1;r+=6}return r%8==0},construct:function(e){var t,n,r=e.replace(/[\r\n=]/g,""),o=r.length,a=i,s=0,l=[];for(t=0;t<o;t++)t%4==0&&t&&(l.push(s>>16&255),l.push(s>>8&255),l.push(255&s)),s=s<<6|a.indexOf(r.charAt(t));return 0==(n=o%4*6)?(l.push(s>>16&255),l.push(s>>8&255),l.push(255&s)):18===n?(l.push(s>>10&255),l.push(s>>2&255)):12===n&&l.push(s>>4&255),new Uint8Array(l)},predicate:function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function(e){var t,n,r="",o=0,a=e.length,s=i;for(t=0;t<a;t++)t%3==0&&t&&(r+=s[o>>18&63],r+=s[o>>12&63],r+=s[o>>6&63],r+=s[63&o]),o=(o<<8)+e[t];return 0==(n=a%3)?(r+=s[o>>18&63],r+=s[o>>12&63],r+=s[o>>6&63],r+=s[63&o]):2===n?(r+=s[o>>10&63],r+=s[o>>4&63],r+=s[o<<2&63],r+=s[64]):1===n&&(r+=s[o>>2&63],r+=s[o<<4&63],r+=s[64],r+=s[64]),r}})},9364(e){class t{constructor(e,t){this.name=e,this.successors=t,this.reset()}reset(){this.index=-1,this.lowLink=-1,this.onStack=!1,this.visited=!1}}class n{constructor(){this.vertices={}}add(e,n){const r=(n=Array.isArray(n)?n:[n]).map((e=>(this.vertices[e]||(this.vertices[e]=new t(e,[])),this.vertices[e])));return this.vertices[e]||(this.vertices[e]=new t(e)),this.vertices[e].successors=r.concat([]).reverse(),this}reset(){Object.keys(this.vertices).forEach((e=>{this.vertices[e].reset()}))}addAndVerify(e,t){this.add(e,t);const n=this.getCycles();if(n.length){let e=`Detected ${n.length} cycle${1===n.length?"":"s"}:`;e+="\n"+n.map((e=>{const t=e.map((e=>e.name));return` ${t.join(" -> ")} -> ${t[0]}`})).join("\n");const t=new Error(e);throw t.cycles=n,t}return this}dfs(e,t){this.reset();const n=[this.vertices[e]];let r;for(;r=n.pop();)r.visited||(t(r),r.visited=!0,r.successors.forEach((e=>n.push(e))))}getDescendants(e){const t=[];let n=!0;return this.dfs(e,(e=>{n?n=!1:t.push(e.name)})),t}hasCycle(){return this.getCycles().length>0}getStronglyConnectedComponents(){const e=Object.keys(this.vertices).map((e=>(this.vertices[e].reset(),this.vertices[e])));let t=0;const n=[],r=[],i=e=>{if(e.index=t,e.lowLink=t,t++,n.push(e),e.onStack=!0,e.successors.forEach((t=>{t.index<0?(i(t),e.lowLink=Math.min(e.lowLink,t.lowLink)):t.onStack&&(e.lowLink=Math.min(e.lowLink,t.index))})),e.lowLink===e.index){const t=[];let i;do{i=n.pop(),i.onStack=!1,t.push(i)}while(i!==e);r.push(t)}};return e.forEach((function(e){e.index<0&&i(e)})),r}getCycles(){return this.getStronglyConnectedComponents().filter((e=>{if(e.length>1)return!0;const t=e[0];return t&&t.successors.some((e=>e===t))}))}clone(){const e=new n;return Object.keys(this.vertices).forEach((t=>{const n=this.vertices[t];e.add(n.name,n.successors.map((e=>e.name)))})),e}toDot(){const e=this.vertices,t=["digraph {"];return this.getCycles().forEach(((e,n)=>{t.push(" subgraph cluster"+n+" {"),t.push(" color=red;"),t.push(" "+e.map((e=>e.name)).join("; ")+";"),t.push(" }")})),Object.keys(e).forEach((n=>{const r=e[n];r.successors.length&&r.successors.forEach((e=>{t.push(` ${r.name} -> ${e.name}`)}))})),t.push("}"),t.join("\n")+"\n"}}e.exports=n},9390(e){"use strict";e.exports=function(e,t,n){var r=n||8192,i=r>>>1,o=null,a=r;return function(n){if(n<1||n>i)return e(n);a+n>r&&(o=e(r),a=0);var s=t.call(o,a,a+=n);return 7&a&&(a=1+(7|a)),s}}},9410(e){"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),r=128===n[3];function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3]}function o(e,r,i){t[0]=e,r[i]=n[3],r[i+1]=n[2],r[i+2]=n[1],r[i+3]=n[0]}function a(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],t[0]}function s(e,r){return n[3]=e[r],n[2]=e[r+1],n[1]=e[r+2],n[0]=e[r+3],t[0]}e.writeFloatLE=r?i:o,e.writeFloatBE=r?o:i,e.readFloatLE=r?a:s,e.readFloatBE=r?s:a}():function(){function t(e,t,n,r){var i=t<0?1:0;if(i&&(t=-t),0===t)e(1/t>0?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,n,r);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var o=Math.floor(Math.log(t)/Math.LN2);e((i<<31|o+127<<23|8388607&Math.round(t*Math.pow(2,-o)*8388608))>>>0,n,r)}}function a(e,t,n){var r=e(t,n),i=2*(r>>31)+1,o=r>>>23&255,a=8388607&r;return 255===o?a?NaN:i*(1/0):0===o?1401298464324817e-60*i*a:i*Math.pow(2,o-150)*(a+8388608)}e.writeFloatLE=t.bind(null,n),e.writeFloatBE=t.bind(null,r),e.readFloatLE=a.bind(null,i),e.readFloatBE=a.bind(null,o)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),r=128===n[7];function i(e,r,i){t[0]=e,r[i]=n[0],r[i+1]=n[1],r[i+2]=n[2],r[i+3]=n[3],r[i+4]=n[4],r[i+5]=n[5],r[i+6]=n[6],r[i+7]=n[7]}function o(e,r,i){t[0]=e,r[i]=n[7],r[i+1]=n[6],r[i+2]=n[5],r[i+3]=n[4],r[i+4]=n[3],r[i+5]=n[2],r[i+6]=n[1],r[i+7]=n[0]}function a(e,r){return n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],t[0]}function s(e,r){return n[7]=e[r],n[6]=e[r+1],n[5]=e[r+2],n[4]=e[r+3],n[3]=e[r+4],n[2]=e[r+5],n[1]=e[r+6],n[0]=e[r+7],t[0]}e.writeDoubleLE=r?i:o,e.writeDoubleBE=r?o:i,e.readDoubleLE=r?a:s,e.readDoubleBE=r?s:a}():function(){function t(e,t,n,r,i,o){var a=r<0?1:0;if(a&&(r=-r),0===r)e(0,i,o+t),e(1/r>0?0:2147483648,i,o+n);else if(isNaN(r))e(0,i,o+t),e(2146959360,i,o+n);else if(r>17976931348623157e292)e(0,i,o+t),e((a<<31|2146435072)>>>0,i,o+n);else{var s;if(r<22250738585072014e-324)e((s=r/5e-324)>>>0,i,o+t),e((a<<31|s/4294967296)>>>0,i,o+n);else{var l=Math.floor(Math.log(r)/Math.LN2);1024===l&&(l=1023),e(4503599627370496*(s=r*Math.pow(2,-l))>>>0,i,o+t),e((a<<31|l+1023<<20|1048576*s&1048575)>>>0,i,o+n)}}}function a(e,t,n,r,i){var o=e(r,i+t),a=e(r,i+n),s=2*(a>>31)+1,l=a>>>20&2047,c=4294967296*(1048575&a)+o;return 2047===l?c?NaN:s*(1/0):0===l?5e-324*s*c:s*Math.pow(2,l-1075)*(c+4503599627370496)}e.writeDoubleLE=t.bind(null,n,0,4),e.writeDoubleBE=t.bind(null,r,4,0),e.readDoubleLE=a.bind(null,i,0,4),e.readDoubleBE=a.bind(null,o,4,0)}(),e}function n(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function r(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=255&e}function i(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},9553(e,t){"use strict";function n(e){return e.split(t.separator).slice(-1)[0]}function r(e){const t=n(e);return t.substring(0,t.lastIndexOf("."))}Object.defineProperty(t,"__esModule",{value:!0}),t.separator="undefined"!=typeof process&&"win32"===process.platform?"\\":"/",t.relativePath=function(e,n){if(0===n.length)return e;const r=e.substr(n.length);return r.startsWith(t.separator)?r.substr(1):r},t.filename=n,t.basename=r,t.dirName=function(e){return e.slice(0,e.lastIndexOf(t.separator))},t.join=function(...e){return e.map((e=>(e.startsWith(t.separator)&&(e=e.slice(1)),e.endsWith(t.separator)&&(e=e.slice(0,-1)),e))).join(t.separator)},t.escapedBasename=function(e){return r(e).replace(/\\/g,"\\\\")},t.fileExtension=function(e){return e.split(".").slice(-1)[0]},t.normalize=function(e){const t=[];let n=0;for(const r of e.split("/").filter((e=>!!e&&"."!==e)))".."===r?0===t.length?n++:t.pop():t.push(r);if(e.startsWith("/")){if(0===t.length)return"/";t.unshift("")}else if(t.unshift(...new Array(n).fill("..")),0===t.length)return".";return t.join("/")}},9687(e,t,n){"use strict";e.exports=s;var r=n(8923);((s.prototype=Object.create(r.prototype)).constructor=s).className="Service";var i=n(8811),o=n(3262),a=n(5047);function s(e,t){r.call(this,e,t),this.methods={},this._methodsArray=null}function l(e){return e._methodsArray=null,e}s.fromJSON=function(e,t){var n=new s(e,t.options);if(t.methods)for(var r=Object.keys(t.methods),o=0;o<r.length;++o)n.add(i.fromJSON(r[o],t.methods[r[o]]));return t.nested&&n.addJSON(t.nested),t.edition&&(n._edition=t.edition),n.comment=t.comment,n._defaultEdition="proto3",n},s.prototype.toJSON=function(e){var t=r.prototype.toJSON.call(this,e),n=!!e&&Boolean(e.keepComments);return o.toObject(["edition",this._editionToJSON(),"options",t&&t.options||void 0,"methods",r.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",n?this.comment:void 0])},Object.defineProperty(s.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=o.toArray(this.methods))}}),s.prototype.get=function(e){return this.methods[e]||r.prototype.get.call(this,e)},s.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;r.prototype.resolve.call(this);for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return this},s.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,r.prototype._resolveFeaturesRecursive.call(this,e),this.methodsArray.forEach((t=>{t._resolveFeaturesRecursive(e)})),this):this},s.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof i?(this.methods[e.name]=e,e.parent=this,l(this)):r.prototype.add.call(this,e)},s.prototype.remove=function(e){if(e instanceof i){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,l(this)}return r.prototype.remove.call(this,e)},s.prototype.create=function(e,t,n){for(var r,i=new a.Service(e,t,n),s=0;s<this.methodsArray.length;++s){var l=o.lcFirst((r=this._methodsArray[s]).resolve().name).replace(/[^$\w_]/g,"");i[l]=o.codegen(["r","c"],o.isReserved(l)?l+"_":l)("return this.rpcCall(m,q,s,r,c)")({m:r,q:r.resolvedRequestType.ctor,s:r.resolvedResponseType.ctor})}return i}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}var __webpack_exports__={};(()=>{"use strict";var e=__webpack_exports__;Object.defineProperty(e,"__esModule",{value:!0});var t=__webpack_require__(472);e.compiler=t.compiler,e.indexFileGenerator=t.indexFileGenerator,e.jitCompiler=t.jitCompiler,e.main=t.main,e.session=t.session,e.supportedFeatures=t.supportedFeatures,e.version=t.version})(),module.exports=__webpack_exports__})();
|