@sqlanvil/core 1.8.3 → 1.9.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 +1 -1
- package/bundle.js +1 -1
- 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 e={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,d=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]&&(d=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(d=-d)),u=new Date(Date.UTC(n,r,a,s,l,c,p)),d&&u.setTime(u.getTime()-d),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=Object.create(null);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:d,inputs:f}=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: ${d.length>0?`(ctx) => {\n ${s}\n ${l}\n ${r}\n return [${d.map((e=>`\`${e}\``))}];\n }`:"undefined"},\n inputContextables: [\n ${f.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","n"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected")("if(n===undefined)n=0")("if(n>util.recursionLimit)")("return%j","maximum nesting depth exceeded"),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+1);",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,d=1,f=0,g={},h=[],y=null;function m(e){return Error("illegal "+e+" (line "+d+")")}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[d]=c,f=d}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,f,g,w=0===c;do{if(c===p)return null;for(i=!1;s.test(a=b(c));)if("\n"===a&&(w=!0,++d),++c===p)return null;if("/"===b(c)){if(++c===p)throw m("comment");if("/"===b(c))if(l){if(f=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(f,c,w),w=!0),d++,i=!0}else{for(g="/"===b(f=c+1);"\n"!==b(++c);)if(c===p)return null;++c,g&&(v(f,c-1,w),w=!0),++d,i=!0}else{if("*"!==(a=b(c)))return"/";f=c+1,g=l||"*"===b(f);do{if("\n"===a&&++d,++c===p)throw m("comment");o=a,a=b(c)}while("*"!==o||"/"!==a);++c,g&&(v(f,c-2,w),w=!0),i=!0}}}while(i);var x=c;if(t.lastIndex=0,!t.test(b(x++)))for(;x<p&&!t.test(b(x));)++x;var q=e.substring(c,c=x);return'"'!==q&&"'"!==q||(y=q),q}function j(e){h.push(e)}function x(){if(!h.length){var e=w();if(null===e)return null;j(e)}return h[0]}return Object.defineProperty({next:w,peek:x,push:j,skip:function(e,t){var n=x();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[d-1],delete g[d-1],t&&(l||"*"===t.type||t.lineEmpty)&&(n=t.leading?t.text:null)):(f<e&&x(),t=g[e],delete g[e],!t||t.lineEmpty||!l&&"/"!==t.type||(n=t.leading?null:t.text)),n}},"line",{get:function(){return d}})}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,n+1)",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","n"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d")("if(n===undefined)n=0")("if(n>util.recursionLimit)")('throw Error("maximum nesting depth exceeded")');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),n('if(ks[i]==="__proto__")')("util.makeProp(m%s,ks[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 d=Array.prototype.slice.call(u.typeDefault);n("if(o.bytes===String)d%s=%j",p,String.fromCharCode.apply(String,u.typeDefault))("else{")("d%s=%j",p,d)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",p,p)("}")}else n("d%s=%j",p,u.typeDefault)}n("}")}var f=!1;for(c=0;c<t.length;++c){u=t[c];var g=e._fieldsArray.indexOf(u);p=o.safeProp(u.name),u.map?(f||(f=!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){"),n('if(ks2[j]==="__proto__")')("util.makeProp(d%s,ks2[j])",p),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()},876(e){function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=876,e.exports=t},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,d=[],f=[],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,d.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);f.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(f)+j,w),groups:d,fast:l,error:i||u}}function d(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 f=function(e,t){this.startState=t,this.states=e,this.buffer="",this.stack=[],this.reset()};f.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},f.prototype.save=function(){return{line:this.line,col:this.col,state:this.state,stack:this.stack.slice(),queuedToken:this.queuedToken,queuedThrow:this.queuedThrow}},f.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}},f.prototype.popState=function(){this.setState(this.stack.pop())},f.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(f.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")},f.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)}},f.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},f.prototype[Symbol.iterator]=function(){return new y(this)}}return f.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(" ")+"^"},f.prototype.clone=function(){return new f(this.states,this.state)},f.prototype.has=function(e){return!0},{compile:function(e){var t=p(c(e));return new f({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++)d(w[l],O,b);var j=Object.getOwnPropertyNames(T.fast);for(l=0;l<j.length;l++)d(T.fast[j[l]],O,b)}return new f(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,d=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===d?n("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",u,t):n(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|d,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===d?a(n,c,u,t+"[i]"):n("w.uint32(%i).%s(%s[i])",(c.id<<3|d)>>>0,p,t)),n("}")):(c.optional&&n("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,c.name),void 0===d?a(n,c,u,t):n("w.uint32(%i).%s(%s)",(c.id<<3|d)>>>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,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r")}'`}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 d 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 d=this.verifyConfig(t);d.name||(d.name=c.basename(d.filename));const f=u.actionConfigToCompiledGraphTarget(d);return this.proto.target=this.applySessionToTarget(f,e.projectConfig,d.filename,{validateTarget:!0}),this.proto.canonicalTarget=this.applySessionToTarget(f,e.canonicalProjectConfig),n&&(d.filename=u.resolveActionsConfigFilename(d.filename,n),this.query(u.nativeRequire(d.filename).query)),d.filename&&(this.proto.fileName=d.filename),d.dependOnDependencyAssertions&&this.setDependOnDependencyAssertions(d.dependOnDependencyAssertions),d.dependencyTargets&&this.dependencies(d.dependencyTargets.map((e=>u.configTargetToCompiledGraphTarget(p.sqlanvil.ActionConfig.Target.create(e))))),void 0!==d.hermetic&&this.hermetic(d.hermetic),d.disabled&&this.disabled(),d.tags&&this.tags(d.tags),d.description&&this.description(d.description),d.metadata&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.metadata=d.metadata),(null===(r=d.columns)||void 0===r?void 0:r.length)&&this.columns(d.columns.map((e=>p.sqlanvil.ActionConfig.ColumnDescriptor.create(e)))),d.project&&this.database(d.project),d.dataset&&this.schema(d.dataset),d.assertions&&this.assertions(p.sqlanvil.ActionConfig.TableAssertionsConfig.create(d.assertions)),d.uniqueKey&&this.uniqueKey(d.uniqueKey),this.protected(d.protected),d.preOperations&&this.preOps(d.preOperations),d.postOperations&&this.postOps(d.postOperations),this.bigquery(Object.assign({partitionBy:d.partitionBy,clusterBy:d.clusterBy,updatePartitionFilter:d.updatePartitionFilter,labels:d.labels,partitionExpirationDays:d.partitionExpirationDays,requirePartitionFilter:d.requirePartitionFilter,additionalOptions:d.additionalOptions},d.iceberg?{connection:u.getConnectionForIcebergTable(d.iceberg.connection,null===(i=e.projectConfig.defaultIcebergConfig)||void 0===i?void 0:i.connection),fileFormat:u.getFileFormatValueForIcebergTable(null===(o=d.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,d.iceberg.bucketName),u.getEffectiveTableFolderRoot(null===(s=e.projectConfig.defaultIcebergConfig)||void 0===s?void 0:s.tableFolderRoot,d.iceberg.tableFolderRoot),u.getEffectiveTableFolderSubpath(this.proto.target.schema,this.proto.target.name,null===(l=e.projectConfig.defaultIcebergConfig)||void 0===l?void 0:l.tableFolderSubpath,d.iceberg.tableFolderSubpath))}:{})),d.postgres&&this.postgres(d.postgres),d.supabase&&this.supabase(d.supabase),d.mysql&&this.mysql(d.mysql),this.proto.onSchemaChange=this.mapOnSchemaChange(d.onSchemaChange),d.reservation&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.reservation=d.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 f(this),t=new f(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=d;class f{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=f},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=t;i<n;){var o=e[i++];if(o<=127)r+=String.fromCharCode(o);else if(o>=192&&o<224){var a=(31&o)<<6|63&e[i++];r+=a>=128?String.fromCharCode(a):"�"}else if(o>=224&&o<240){var s=(15&o)<<12|(63&e[i++])<<6|63&e[i++];r+=s>=2048?String.fromCharCode(s):"�"}else if(o>=240){var l=(7&o)<<18|(63&e[i++])<<12|(63&e[i++])<<6|63&e[i++];l<65536||l>1114111?r+="�":(l-=65536,r+=String.fromCharCode(55296+(l>>10)),r+=String.fromCharCode(56320+(1023&l)))}}return r},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 d 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 d=this.verifyConfig(t);d.name||(d.name=c.basename(d.filename));const f=u.actionConfigToCompiledGraphTarget(d);return this.proto.target=this.applySessionToTarget(f,e.projectConfig,d.filename,{validateTarget:!0}),this.proto.canonicalTarget=this.applySessionToTarget(f,e.canonicalProjectConfig),n&&(d.filename=u.resolveActionsConfigFilename(d.filename,n),this.query(u.nativeRequire(d.filename).query)),d.filename&&(this.proto.fileName=d.filename),d.dependOnDependencyAssertions&&this.setDependOnDependencyAssertions(d.dependOnDependencyAssertions),d.dependencyTargets&&this.dependencies(d.dependencyTargets),void 0!==d.hermetic&&this.hermetic(d.hermetic),d.disabled&&this.disabled(),d.tags&&this.tags(d.tags),d.description&&this.description(d.description),d.metadata&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.metadata=d.metadata),(null===(r=d.columns)||void 0===r?void 0:r.length)&&this.columns(d.columns.map((e=>p.sqlanvil.ActionConfig.ColumnDescriptor.create(e)))),d.assertions&&this.assertions(p.sqlanvil.ActionConfig.TableAssertionsConfig.create(d.assertions)),d.preOperations&&this.preOps(d.preOperations),d.postOperations&&this.postOps(d.postOperations),this.bigquery(Object.assign({partitionBy:d.partitionBy,clusterBy:d.clusterBy,labels:d.labels,partitionExpirationDays:d.partitionExpirationDays,requirePartitionFilter:d.requirePartitionFilter,additionalOptions:d.additionalOptions},d.iceberg?{connection:u.getConnectionForIcebergTable(d.iceberg.connection,null===(i=e.projectConfig.defaultIcebergConfig)||void 0===i?void 0:i.connection),fileFormat:u.getFileFormatValueForIcebergTable(null===(o=d.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,d.iceberg.bucketName),u.getEffectiveTableFolderRoot(null===(s=e.projectConfig.defaultIcebergConfig)||void 0===s?void 0:s.tableFolderRoot,d.iceberg.tableFolderRoot),u.getEffectiveTableFolderSubpath(this.proto.target.schema,this.proto.target.name,null===(l=e.projectConfig.defaultIcebergConfig)||void 0===l?void 0:l.tableFolderSubpath,d.iceberg.tableFolderSubpath))}:{})),d.postgres&&this.postgres(d.postgres),d.supabase&&this.supabase(d.supabase),d.mysql&&this.mysql(d.mysql),d.reservation&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.reservation=d.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 f(this),t=new f(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=d;class f{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=f},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 d(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 f(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=d,t.tableTypeEnumToString=f,t.setOrValidateTableEnumType=function(e){let t=null;if(""!==e.type&&void 0!==e.type&&(t=d(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 "${f(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.8.3",t.dataformVersion="3.0.60"},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",d="innerTripleDoubleQuote",f={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:d+"_escapedBackslash",START_JS_PLACEHOLDER:d+"_startJsPlaceholder",CLOSE_QUOTE:d+"_closeTripleQuoteDouble",CAPTURE_EVERYTHING_ELSE:d+"_captureEverythingElse"},T=i.states(function(){const e={};e[f.START_CONFIG]={match:"config {",push:a},e[f.START_JS]={match:"js {",push:a},e[f.START_INCREMENTAL]={match:"incremental_where {",push:l},e[f.START_PRE_OPERATIONS]={match:"pre_operations {",push:l},e[f.START_POST_OPERATIONS]={match:"post_operations {",push:l},e[f.START_INPUT]={match:/input "[a-zA-Z0-9_-]+"(?:,\s*"[a-zA-Z0-9_-]+")* {/,push:l},e[f.STATEMENT_SEPERATOR]=/[^\S\r\n]*---[^\S\r\n]*$/,e[f.SINGLE_LINE_COMMENT]=/--.*?$/,e[f.MULTI_LINE_COMMENT]=/\/\*[\s\S]*?\*\//,e[f.START_JS_PLACEHOLDER]={match:"${",push:a},e[f.BACKTICK]="`",e[f.START_TRIPLE_QUOTE_SINGLE]={match:"'''",push:p},e[f.START_TRIPLE_QUOTE_DOUBLE]={match:'"""',push:d},e[f.START_QUOTE_SINGLE]={match:"'",push:c},e[f.START_QUOTE_DOUBLE]={match:'"',push:u},e[f.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:d},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 x={};return x[o]=e,x[a]=t,x[s]=n,x[l]=r,x[c]=i,x[u]=T,x[p]=w,x[d]=j,x}());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([[f.START_CONFIG,w.JAVASCRIPT],[f.START_INCREMENTAL,w.SQL],[f.START_INPUT,w.SQL],[f.START_JS,w.JAVASCRIPT],[f.START_JS_PLACEHOLDER,w.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER],[f.START_POST_OPERATIONS,w.SQL],[f.START_PRE_OPERATIONS,w.SQL],[f.START_QUOTE_SINGLE,w.SQL_LITERAL_STRING],[f.START_QUOTE_DOUBLE,w.SQL_LITERAL_STRING],[f.START_TRIPLE_QUOTE_SINGLE,w.SQL_LITERAL_MULTILINE_STRING],[f.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]]),x=new Set([g.CLOSE_BLOCK,y.CLOSE_BLOCK,m.CLOSE_QUOTE,b.CLOSE_QUOTE,v.CLOSE_QUOTE,O.CLOSE_QUOTE]),q=new Map([[f.MULTI_LINE_COMMENT,w.SQL_COMMENT],[f.SINGLE_LINE_COMMENT,w.SQL_COMMENT],[f.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 P{constructor(e,t=[]){this.type=e,this.allChildren=t}static create(e){const t=new P(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 P(t,[e.value]);r.push(i),n.push(i),n=i}else x.has(e.type)?(n.push(e.value),r.pop(),n=r[r.length-1]):q.has(e.type)?n.push(new P(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=P},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.patterns=n(4854);var s=o.patterns.reservedRe,l=o.patterns.unsafePropertyRe;o.fs=o.inquire("fs"),o.checkDepth=function(e){if(void 0===e&&(e=0),e>o.recursionLimit)throw Error("max depth exceeded");return e},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},o.isReserved=function(e){return s.test(e)},o.safeProp=function(e){return!/^[$\w_]+$/.test(e)||s.test(e)?"["+JSON.stringify(e)+"]":"."+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(l.test(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 d=function(){return i.Buffer?function(){return(p.create=function(){return new r})()}:function(){return new p}};function f(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=d(),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(f,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(f,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(f,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=d(),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||"__proto__"!==r[i]&&(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.recursionLimit=100,r.makeProp=function(e,t){Object.defineProperty(e,t,{enumerable:!0,configurable:!0,writable:!0})},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 d 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 f(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=d;class f{constructor(e){this.test=e}apply(e){return"function"==typeof e?e(this):e}}t.TestContext=f;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(e,t,n){"use strict";e.exports=function(e){try{var t=n(876)(e);return t&&(t.length||Object.keys(t).length)?t:null}catch(e){return null}}},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 d(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 f(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),f=r||e.flowLevel>-1&&n>=e.flowLevel;switch(function(e,t,n,r,i,o,a,s){var c,u,p=0,d=null,f=!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,d,s),d=p}else{for(c=0;c<e.length;p>=65536?c+=2:c++){if(10===(p=O(e,c)))f=!0,h&&(g=g||c-b-1>r&&" "!==e[b+1],b=c);else if(!m(p))return 5;w=w&&v(p,d,s),d=p}g=g||h&&c-b-1>r&&" "!==e[b+1]}return f||g?n>9&&T(e)?5:a?2===o?5:2:g?4:3:!w||a||i(e)?2===o?5:2:1}(t,f,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)+x(g(t,a));case 4:return">"+j(t,e.indent)+x(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])&&m(r)?(n+=e[i],r>=65536&&(n+=e[i+1])):n+=t||d(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 x(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 P(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)),(C(e,t+1,a,!0,!0,!1,!0)||void 0===a&&C(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 A(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 C(e,t,n,r,o,s,l){e.tag=null,e.dump=n,A(e,n,!1)||A(e,n,!0);var c,u=a.call(e.dump),p=r;r&&(r=e.flowLevel<0||e.flowLevel>t);var d,f,g="[object Object]"===u||"[object Array]"===u;if(g&&(f=-1!==(d=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||f||2!==e.indent&&t>0)&&(o=!1),f&&e.usedDuplicates[d])e.dump="*ref_"+d;else{if(g&&f&&!e.usedDuplicates[d]&&(e.usedDuplicates[d]=!0),"[object Object]"===u)r&&0!==Object.keys(e.dump).length?(function(e,t,n,r){var o,a,s,l,c,u,p="",d=e.tag,f=Object.keys(n);if(!0===e.sortKeys)f.sort();else if("function"==typeof e.sortKeys)f.sort(e.sortKeys);else if(e.sortKeys)throw new i("sortKeys must be a boolean or a function");for(o=0,a=f.length;o<a;o+=1)u="",r&&""===p||(u+=h(e,t)),l=n[s=f[o]],e.replacer&&(l=e.replacer.call(n,s,l)),C(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)),C(e,t+1,l,!0,c)&&(e.dump&&10===e.dump.charCodeAt(0)?u+=":":u+=": ",p+=u+=e.dump));e.tag=d,e.dump=p||"{}"}(e,t,e.dump,o),f&&(e.dump="&ref_"+d+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)),C(e,t,o,!1,!1)&&(e.dump.length>1024&&(s+="? "),s+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),C(e,t,a,!1,!1)&&(l+=s+=e.dump));e.tag=c,e.dump="{"+l+"}"}(e,t,e.dump),f&&(e.dump="&ref_"+d+" "+e.dump));else if("[object Array]"===u)r&&0!==e.dump.length?(e.noArrayIndent&&!l&&t>0?P(e,t-1,e.dump,o):P(e,t,e.dump,o),f&&(e.dump="&ref_"+d+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)),(C(e,t,o,!1,!1)||void 0===o&&C(e,t,null,!1,!1))&&(""!==a&&(a+=","+(e.condenseFlow?"":" ")),a+=e.dump);e.tag=s,e.dump="["+a+"]"}(e,t,e.dump),f&&(e.dump="&ref_"+d+" "+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 S(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 f(t=t||{});n.noRefs||S(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},"",r)),C(n,0,r,!0,!0)?n.dump+"\n":""}},4854(e,t){"use strict";var n=t;n.numberRe=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,n.typeRefRe=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,n.reservedRe=/^(?: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)$/,n.unsafePropertyRe=/^(?:__proto__|prototype|constructor)$/},4863(e,t,n){"use strict";e.exports=x,x.filename=null,x.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),d=n(7209),f=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=g.patterns.numberRe,w=/^[a-zA-Z_][a-zA-Z_0-9]*$/,j=g.patterns.typeRefRe;function x(e,t,n){t instanceof i||(n=t,t=new i),n||(n=x.defaults);var q,P,A,C,S=n.preferTrailingComment||!1,k=r(e,n.alternateCommentMode||!1),E=k.next,_=k.push,D=k.peek,N=k.skip,L=k.cmnt,R=!0,I="proto2",M=t,B=[],F={},U=n.keepCase?function(e){return e}:g.camelCase;function J(e,t,n){var r=x.filename;return n||(x.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()),N(e),e=D()}while('"'===e||"'"===e);return t.join("")}function K(e){var t=E();switch(t){case"'":case'"':return _(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=D())&&"'"!==n)try{e.push([r=Q(E()),N("to",!0)?Q(E()):r])}catch(r){if(!(t&&j.test(n)&&I>=2023))throw r;e.push(n)}else{var i=V();if(e.push(i),I>=2023)throw J(i,"id")}}while(N(",",!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),N(";")}),(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!==q)throw J("package");if(q=E(),!j.test(q))throw J(q,"name");M=M.define(q),N(";")}function W(){var e,t=D();switch(t){case"weak":e=A||(A=[]),E();break;case"public":E();default:e=P||(P=[])}t=V(),N(";"),e.push(t)}function H(){if(N("="),(I=V())<2023)throw J(I,"syntax");N(";")}function z(){if(N("="),I=V(),!["2023"].includes(I))throw J(I,"edition");N(";")}function Y(e,t,n){switch(n=g.checkDepth(n),t){case"option":return ne(e,t),N(";"),!0;case"message":return X(e,t,n+1),!0;case"enum":return te(e,t),!0;case"service":return function(e,t,n){if(n=g.checkDepth(n),!w.test(t=E()))throw J(t,"service name");var r=new u(t);Z(r,(function(e){if(!Y(r,e,n)){if("rpc"!==e)throw J(e);!function(e,t){var n=L(),r=t;if(!w.test(t=E()))throw J(t,"name");var i,o,a,s,l=t;if(N("("),N("stream",!0)&&(o=!0),!j.test(t=E()))throw J(t);if(i=t,N(")"),N("returns"),N("("),N("stream",!0)&&(s=!0),!j.test(t=E()))throw J(t);a=t,N(")");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),N(";")})),e.add(c)}(r,e)}})),e.add(r),e===M&&B.push(r)}(e,t,n+1),!0;case"extend":return function(e,t,n){if(!j.test(t=E()))throw J(t,"reference");var r=t;Z(null,(function(t){switch(t){case"required":case"repeated":ee(e,t,r,n+1);break;case"optional":ee(e,"proto3"===I?"proto3_optional":"optional",r,n+1);break;default:if("proto2"===I||!j.test(t))throw J(t);_(t),ee(e,"optional",r,n+1)}}))}(e,t,n),!0}return!1}function Z(e,t,n){var r=k.line;if(e&&("string"!=typeof e.comment&&(e.comment=L()),e.filename=x.filename),N("{",!0)){for(var i;"}"!==(i=E());)t(i);N(";",!0)}else n&&n(),N(";"),e&&("string"!=typeof e.comment||S)&&(e.comment=L(r)||e.comment)}function X(e,t,n){if(n=g.checkDepth(n),!w.test(t=E()))throw J(t,"type name");var r=new o(t);Z(r,(function(e){if(!Y(r,e,n))switch(e){case"map":!function(e){N("<");var t=E();if(void 0===f.mapKey[t])throw J(t,"type");N(",");var n=E();if(!j.test(n))throw J(n,"type");N(">");var r=E();if(!w.test(r))throw J(r,"name");N("=");var i=new s(U(r),Q(E()),t,n);Z(i,(function(e){if("option"!==e)throw J(e);ne(i,e),N(";")}),(function(){oe(i)})),e.add(i)}(r);break;case"required":if("proto2"!==I)throw J(e);case"repeated":ee(r,e,void 0,n+1);break;case"optional":if("proto3"===I)ee(r,"proto3_optional",void 0,n+1);else{if("proto2"!==I)throw J(e);ee(r,"optional",void 0,n+1)}break;case"oneof":!function(e,t,n){if(!w.test(t=E()))throw J(t,"name");var r=new l(U(t));Z(r,(function(e){"option"===e?(ne(r,e),N(";")):(_(e),ee(r,"optional",void 0,n))})),e.add(r)}(r,e,n+1);break;case"extensions":G(r.extensions||(r.extensions=[]));break;case"reserved":G(r.reserved||(r.reserved=[]),!0);break;default:if("proto2"===I||!j.test(e))throw J(e);_(e),ee(r,"optional",void 0,n+1)}})),e.add(r),e===M&&B.push(r)}function ee(e,t,n,r){var i=E();if("group"!==i){for(;i.endsWith(".")||D().startsWith(".");)i+=E();if(!j.test(i))throw J(i,"type");var s=E();if(!w.test(s))throw J(s,"name");s=U(s),N("=");var c=new a(s,Q(E()),i,t,n);if(Z(c,(function(e){if("option"!==e)throw J(e);ne(c,e),N(";")}),(function(){oe(c)})),"proto3_optional"===t){var u=new l("_"+s);c.setOption("proto3_optional",!0),u.add(c),e.add(u)}else e.add(c);e===M&&B.push(c)}else!function(e,t,n){if(n=g.checkDepth(n),I>=2023)throw J("group");var r=E();if(!w.test(r))throw J(r,"name");var i=g.lcFirst(r);r===i&&(r=g.ucFirst(r)),N("=");var s=Q(E()),l=new o(r);l.group=!0;var c=new a(i,s,r,t);c.filename=x.filename,Z(l,(function(e){switch(e){case"option":ne(l,e),N(";");break;case"required":case"repeated":ee(l,e,void 0,n+1);break;case"optional":ee(l,"proto3"===I?"proto3_optional":"optional",void 0,n+1);break;case"message":X(l,e,n+1);break;case"enum":te(l,e);break;case"reserved":G(l.reserved||(l.reserved=[]),!0);break;default:throw J(e)}})),e.add(l).add(c)}(e,t,r)}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),N(";");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");N("=");var n=Q(E(),!0),r={options:void 0,getOption:function(e){return this.options[e]},setOption:function(e,t){d.prototype.setOption.call(r,e,t)},setParsedOption:function(){}};Z(r,(function(e){if("option"!==e)throw J(e);ne(r,e),N(";")}),(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();N(")"),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,n){if(n=g.checkDepth(n),N("{",!0)){for(var r={};!N("}",!0);){if(!w.test(C=E()))throw J(C,"name");if(null===C)throw J(C,"end of input");var i,o=C;if(N(":",!0),"{"===D())i=re(e,t+"."+C,n+1);else if("["===D()){var a;if(i=[],N("[",!0)){do{a=K(!0),i.push(a)}while(N(",",!0));N("]"),void 0!==a&&ie(e,t+"."+C,a)}}else i=K(!0),ie(e,t+"."+C,i);var s=r[o];s&&(i=[].concat(s).concat(i)),"__proto__"!==o&&(r[o]=i),N(",",!0),N(";",!0)}return r}var l=K(!0);return ie(e,t,l),l}function ie(e,t,n){M===e&&/^features\./.test(t)?F[t]=n:e.setOption&&e.setOption(t,n)}function oe(e){if(N("[",!0)){do{ne(e,"option")}while(N(",",!0));N("]")}return e}for(;null!==(C=E());)switch(C){case"package":if(!R)throw J(C);$();break;case"import":if(!R)throw J(C);W();break;case"syntax":if(!R)throw J(C);H();break;case"edition":if(!R)throw J(C);z();break;case"option":ne(M,C),N(";",!0);break;default:if(Y(M,C,0)){R=!1;continue}throw J(C)}return B.forEach((e=>{e._edition=I,Object.keys(F).forEach((t=>{void 0===e.getOption(t)&&e.setOption(t,F[t],!0)}))})),x.filename=null,{package:q,imports:P,weakImports:A,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 d(){}p.fromJSON=function(e,t,n){return n=u.checkDepth(n),t||(t=new p),e.options&&t.setOptions(e.options),t.addJSON(e.nested,n).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===d;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]))&&f(r);if(a.weakImports)for(p=0;p<a.weakImports.length;++p)(r=c(a.weakImports[p])||i.resolvePath(e,a.weakImports[p]))&&f(r,!0)}else i.setOptions(t.options).addJSON(t.nested)}catch(e){l(e)}s||g||l(null,i)}function f(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]))&&f(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,d)},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 f=/^[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)f.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]);f.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)f.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]);f.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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.WorkflowSettings;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.sqlanvilCoreVersion=e.string();break;case 2:u.defaultProject=e.string();break;case 3:u.defaultDataset=e.string();break;case 4:u.defaultLocation=e.string();break;case 5:u.defaultAssertionDataset=e.string();break;case 6:u.vars===a.emptyObject&&(u.vars={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;)switch((f=e.uint32())>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}"__proto__"===o&&a.makeProp(u.vars,o),u.vars[o]=l;break;case 7:u.projectSuffix=e.string();break;case 8:u.datasetSuffix=e.string();break;case 9:u.namePrefix=e.string();break;case 10:u.defaultNotebookRuntimeOptions=s.sqlanvil.NotebookRuntimeOptionsConfig.decode(e,e.uint32(),void 0,r+1);break;case 11:u.builtinAssertionNamePrefix=e.string();break;case 12:u.defaultIcebergConfig=s.sqlanvil.DefaultIcebergConfig.decode(e,e.uint32(),void 0,r+1);break;case 13:u.disableAssertions=e.bool();break;case 14:u.defaultReservation=e.string();break;case 15:u.extension=s.sqlanvil.Extension.decode(e,e.uint32(),void 0,r+1);break;case 16:u.includeTestsInCompiledGraph=e.bool();break;case 17:u.warehouse=e.string();break;case 18:for(u.connections===a.emptyObject&&(u.connections={}),d=e.uint32()+e.pos,o="",l=null;e.pos<d;)switch((f=e.uint32())>>>3){case 1:o=e.string();break;case 2:l=s.sqlanvil.ConnectionConfig.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&f,r)}"__proto__"===o&&a.makeProp(u.connections,o),u.connections[o]=l;break;case 19:for(u.environments===a.emptyObject&&(u.environments={}),d=e.uint32()+e.pos,o="",l=null;e.pos<d;){var f;switch((f=e.uint32())>>>3){case 1:o=e.string();break;case 2:l=s.sqlanvil.Environment.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.environments,o),u.environments[o]=l;break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=Object.keys(e.vars),r=0;r<n.length;++r)if(!a.isString(e.vars[n[r]]))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")&&(i=s.sqlanvil.NotebookRuntimeOptionsConfig.verify(e.defaultNotebookRuntimeOptions,t+1)))return"defaultNotebookRuntimeOptions."+i;if(null!=e.builtinAssertionNamePrefix&&e.hasOwnProperty("builtinAssertionNamePrefix")&&!a.isString(e.builtinAssertionNamePrefix))return"builtinAssertionNamePrefix: string expected";if(null!=e.defaultIcebergConfig&&e.hasOwnProperty("defaultIcebergConfig")&&(i=s.sqlanvil.DefaultIcebergConfig.verify(e.defaultIcebergConfig,t+1)))return"defaultIcebergConfig."+i;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")&&(i=s.sqlanvil.Extension.verify(e.extension,t+1)))return"extension."+i;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(n=Object.keys(e.connections),r=0;r<n.length;++r)if(i=s.sqlanvil.ConnectionConfig.verify(e.connections[n[r]],t+1))return"connections."+i}if(null!=e.environments&&e.hasOwnProperty("environments")){if(!a.isObject(e.environments))return"environments: object expected";for(n=Object.keys(e.environments),r=0;r<n.length;++r){var i;if(i=s.sqlanvil.Environment.verify(e.environments[n[r]],t+1))return"environments."+i}}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.WorkflowSettings)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.WorkflowSettings;if(null!=e.sqlanvilCoreVersion&&(n.sqlanvilCoreVersion=String(e.sqlanvilCoreVersion)),null!=e.defaultProject&&(n.defaultProject=String(e.defaultProject)),null!=e.defaultDataset&&(n.defaultDataset=String(e.defaultDataset)),null!=e.defaultLocation&&(n.defaultLocation=String(e.defaultLocation)),null!=e.defaultAssertionDataset&&(n.defaultAssertionDataset=String(e.defaultAssertionDataset)),e.vars){if("object"!=typeof e.vars)throw TypeError(".sqlanvil.WorkflowSettings.vars: object expected");n.vars={};for(var r=Object.keys(e.vars),i=0;i<r.length;++i)"__proto__"===r[i]&&a.makeProp(n.vars,r[i]),n.vars[r[i]]=String(e.vars[r[i]])}if(null!=e.projectSuffix&&(n.projectSuffix=String(e.projectSuffix)),null!=e.datasetSuffix&&(n.datasetSuffix=String(e.datasetSuffix)),null!=e.namePrefix&&(n.namePrefix=String(e.namePrefix)),null!=e.defaultNotebookRuntimeOptions){if("object"!=typeof e.defaultNotebookRuntimeOptions)throw TypeError(".sqlanvil.WorkflowSettings.defaultNotebookRuntimeOptions: object expected");n.defaultNotebookRuntimeOptions=s.sqlanvil.NotebookRuntimeOptionsConfig.fromObject(e.defaultNotebookRuntimeOptions,t+1)}if(null!=e.builtinAssertionNamePrefix&&(n.builtinAssertionNamePrefix=String(e.builtinAssertionNamePrefix)),null!=e.defaultIcebergConfig){if("object"!=typeof e.defaultIcebergConfig)throw TypeError(".sqlanvil.WorkflowSettings.defaultIcebergConfig: object expected");n.defaultIcebergConfig=s.sqlanvil.DefaultIcebergConfig.fromObject(e.defaultIcebergConfig,t+1)}if(null!=e.disableAssertions&&(n.disableAssertions=Boolean(e.disableAssertions)),null!=e.defaultReservation&&(n.defaultReservation=String(e.defaultReservation)),null!=e.extension){if("object"!=typeof e.extension)throw TypeError(".sqlanvil.WorkflowSettings.extension: object expected");n.extension=s.sqlanvil.Extension.fromObject(e.extension,t+1)}if(null!=e.includeTestsInCompiledGraph&&(n.includeTestsInCompiledGraph=Boolean(e.includeTestsInCompiledGraph)),null!=e.warehouse&&(n.warehouse=String(e.warehouse)),e.connections){if("object"!=typeof e.connections)throw TypeError(".sqlanvil.WorkflowSettings.connections: object expected");for(n.connections={},r=Object.keys(e.connections),i=0;i<r.length;++i){if("__proto__"===r[i]&&a.makeProp(n.connections,r[i]),"object"!=typeof e.connections[r[i]])throw TypeError(".sqlanvil.WorkflowSettings.connections: object expected");n.connections[r[i]]=s.sqlanvil.ConnectionConfig.fromObject(e.connections[r[i]],t+1)}}if(e.environments){if("object"!=typeof e.environments)throw TypeError(".sqlanvil.WorkflowSettings.environments: object expected");for(n.environments={},r=Object.keys(e.environments),i=0;i<r.length;++i){if("__proto__"===r[i]&&a.makeProp(n.environments,r[i]),"object"!=typeof e.environments[r[i]])throw TypeError(".sqlanvil.WorkflowSettings.environments: object expected");n.environments[r[i]]=s.sqlanvil.Environment.fromObject(e.environments[r[i]],t+1)}}return n},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)"__proto__"===n[i]&&a.makeProp(r.vars,n[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)"__proto__"===n[i]&&a.makeProp(r.connections,n[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)"__proto__"===n[i]&&a.makeProp(r.environments,n[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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.Environment;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.schemaSuffix=e.string();break;case 2:u.vars===a.emptyObject&&(u.vars={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;){var f=e.uint32();switch(f>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.vars,o),u.vars[o]=l;break;case 3:u.defaultDatabase=e.string();break;case 4:u.defaultLocation=e.string();break;case 5:u.credentials=e.string();break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=Object.keys(e.vars),r=0;r<n.length;++r)if(!a.isString(e.vars[n[r]]))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,t){if(e instanceof s.sqlanvil.Environment)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.Environment;if(null!=e.schemaSuffix&&(n.schemaSuffix=String(e.schemaSuffix)),e.vars){if("object"!=typeof e.vars)throw TypeError(".sqlanvil.Environment.vars: object expected");n.vars={};for(var r=Object.keys(e.vars),i=0;i<r.length;++i)"__proto__"===r[i]&&a.makeProp(n.vars,r[i]),n.vars[r[i]]=String(e.vars[r[i]])}return null!=e.defaultDatabase&&(n.defaultDatabase=String(e.defaultDatabase)),null!=e.defaultLocation&&(n.defaultLocation=String(e.defaultLocation)),null!=e.credentials&&(n.credentials=String(e.credentials)),n},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)"__proto__"===n[i]&&a.makeProp(r.vars,n[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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ConnectionConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.platform=e.string();break;case 2:a.project=e.string();break;case 3:a.dataset=e.string();break;case 4:a.saKeyId=e.string();break;case 5:a.host=e.string();break;case 6:a.port=e.uint32();break;case 7:a.database=e.string();break;case 8:a.defaultSchema=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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,t){if(e instanceof s.sqlanvil.ConnectionConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ConnectionConfig;return null!=e.platform&&(n.platform=String(e.platform)),null!=e.project&&(n.project=String(e.project)),null!=e.dataset&&(n.dataset=String(e.dataset)),null!=e.saKeyId&&(n.saKeyId=String(e.saKeyId)),null!=e.host&&(n.host=String(e.host)),null!=e.port&&(n.port=e.port>>>0),null!=e.database&&(n.database=String(e.database)),null!=e.defaultSchema&&(n.defaultSchema=String(e.defaultSchema)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.DefaultIcebergConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.bucketName=e.string();break;case 2:a.tableFolderRoot=e.string();break;case 3:a.tableFolderSubpath=e.string();break;case 4:a.connection=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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,t){if(e instanceof s.sqlanvil.DefaultIcebergConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.DefaultIcebergConfig;return null!=e.bucketName&&(n.bucketName=String(e.bucketName)),null!=e.tableFolderRoot&&(n.tableFolderRoot=String(e.tableFolderRoot)),null!=e.tableFolderSubpath&&(n.tableFolderSubpath=String(e.tableFolderSubpath)),null!=e.connection&&(n.connection=String(e.connection)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfigs;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?(a.actions&&a.actions.length||(a.actions=[]),a.actions.push(s.sqlanvil.ActionConfig.decode(e,e.uint32(),void 0,r+1))):e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.actions&&e.hasOwnProperty("actions")){if(!Array.isArray(e.actions))return"actions: array expected";for(var n=0;n<e.actions.length;++n){var r=s.sqlanvil.ActionConfig.verify(e.actions[n],t+1);if(r)return"actions."+r}}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfigs)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfigs;if(e.actions){if(!Array.isArray(e.actions))throw TypeError(".sqlanvil.ActionConfigs.actions: array expected");n.actions=[];for(var r=0;r<e.actions.length;++r){if("object"!=typeof e.actions[r])throw TypeError(".sqlanvil.ActionConfigs.actions: object expected");n.actions[r]=s.sqlanvil.ActionConfig.fromObject(e.actions[r],t+1)}}return n},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]]&&"__proto__"!==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,t.prototype.export=null,Object.defineProperty(t.prototype,"action",{get:a.oneOfGetter(n=["table","view","incrementalTable","assertion","operation","declaration","notebook","dataPreparation","rlsPolicy","realtimePublication","foreignWrapper","vectorIndex","export"]),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(),null!=e.export&&Object.hasOwnProperty.call(e,"export")&&s.sqlanvil.ActionConfig.ExportConfig.encode(e.export,t.uint32(106).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.table=s.sqlanvil.ActionConfig.TableConfig.decode(e,e.uint32(),void 0,r+1);break;case 2:a.view=s.sqlanvil.ActionConfig.ViewConfig.decode(e,e.uint32(),void 0,r+1);break;case 3:a.incrementalTable=s.sqlanvil.ActionConfig.IncrementalTableConfig.decode(e,e.uint32(),void 0,r+1);break;case 4:a.assertion=s.sqlanvil.ActionConfig.AssertionConfig.decode(e,e.uint32(),void 0,r+1);break;case 5:a.operation=s.sqlanvil.ActionConfig.OperationConfig.decode(e,e.uint32(),void 0,r+1);break;case 6:a.declaration=s.sqlanvil.ActionConfig.DeclarationConfig.decode(e,e.uint32(),void 0,r+1);break;case 7:a.notebook=s.sqlanvil.ActionConfig.NotebookConfig.decode(e,e.uint32(),void 0,r+1);break;case 8:a.dataPreparation=s.sqlanvil.ActionConfig.DataPreparationConfig.decode(e,e.uint32(),void 0,r+1);break;case 9:a.rlsPolicy=s.sqlanvil.ActionConfig.RlsPolicyConfig.decode(e,e.uint32(),void 0,r+1);break;case 10:a.realtimePublication=s.sqlanvil.ActionConfig.RealtimePublicationConfig.decode(e,e.uint32(),void 0,r+1);break;case 11:a.foreignWrapper=s.sqlanvil.ActionConfig.ForeignWrapperConfig.decode(e,e.uint32(),void 0,r+1);break;case 12:a.vectorIndex=s.sqlanvil.ActionConfig.VectorIndexConfig.decode(e,e.uint32(),void 0,r+1);break;case 13:a.export=s.sqlanvil.ActionConfig.ExportConfig.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";var n={};if(null!=e.table&&e.hasOwnProperty("table")&&(n.action=1,r=s.sqlanvil.ActionConfig.TableConfig.verify(e.table,t+1)))return"table."+r;if(null!=e.view&&e.hasOwnProperty("view")){if(1===n.action)return"action: multiple values";if(n.action=1,r=s.sqlanvil.ActionConfig.ViewConfig.verify(e.view,t+1))return"view."+r}if(null!=e.incrementalTable&&e.hasOwnProperty("incrementalTable")){if(1===n.action)return"action: multiple values";if(n.action=1,r=s.sqlanvil.ActionConfig.IncrementalTableConfig.verify(e.incrementalTable,t+1))return"incrementalTable."+r}if(null!=e.assertion&&e.hasOwnProperty("assertion")){if(1===n.action)return"action: multiple values";if(n.action=1,r=s.sqlanvil.ActionConfig.AssertionConfig.verify(e.assertion,t+1))return"assertion."+r}if(null!=e.operation&&e.hasOwnProperty("operation")){if(1===n.action)return"action: multiple values";if(n.action=1,r=s.sqlanvil.ActionConfig.OperationConfig.verify(e.operation,t+1))return"operation."+r}if(null!=e.declaration&&e.hasOwnProperty("declaration")){if(1===n.action)return"action: multiple values";if(n.action=1,r=s.sqlanvil.ActionConfig.DeclarationConfig.verify(e.declaration,t+1))return"declaration."+r}if(null!=e.notebook&&e.hasOwnProperty("notebook")){if(1===n.action)return"action: multiple values";if(n.action=1,r=s.sqlanvil.ActionConfig.NotebookConfig.verify(e.notebook,t+1))return"notebook."+r}if(null!=e.dataPreparation&&e.hasOwnProperty("dataPreparation")){if(1===n.action)return"action: multiple values";if(n.action=1,r=s.sqlanvil.ActionConfig.DataPreparationConfig.verify(e.dataPreparation,t+1))return"dataPreparation."+r}if(null!=e.rlsPolicy&&e.hasOwnProperty("rlsPolicy")){if(1===n.action)return"action: multiple values";if(n.action=1,r=s.sqlanvil.ActionConfig.RlsPolicyConfig.verify(e.rlsPolicy,t+1))return"rlsPolicy."+r}if(null!=e.realtimePublication&&e.hasOwnProperty("realtimePublication")){if(1===n.action)return"action: multiple values";if(n.action=1,r=s.sqlanvil.ActionConfig.RealtimePublicationConfig.verify(e.realtimePublication,t+1))return"realtimePublication."+r}if(null!=e.foreignWrapper&&e.hasOwnProperty("foreignWrapper")){if(1===n.action)return"action: multiple values";if(n.action=1,r=s.sqlanvil.ActionConfig.ForeignWrapperConfig.verify(e.foreignWrapper,t+1))return"foreignWrapper."+r}if(null!=e.vectorIndex&&e.hasOwnProperty("vectorIndex")){if(1===n.action)return"action: multiple values";if(n.action=1,r=s.sqlanvil.ActionConfig.VectorIndexConfig.verify(e.vectorIndex,t+1))return"vectorIndex."+r}if(null!=e.export&&e.hasOwnProperty("export")){if(1===n.action)return"action: multiple values";var r;if(n.action=1,r=s.sqlanvil.ActionConfig.ExportConfig.verify(e.export,t+1))return"export."+r}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig;if(null!=e.table){if("object"!=typeof e.table)throw TypeError(".sqlanvil.ActionConfig.table: object expected");n.table=s.sqlanvil.ActionConfig.TableConfig.fromObject(e.table,t+1)}if(null!=e.view){if("object"!=typeof e.view)throw TypeError(".sqlanvil.ActionConfig.view: object expected");n.view=s.sqlanvil.ActionConfig.ViewConfig.fromObject(e.view,t+1)}if(null!=e.incrementalTable){if("object"!=typeof e.incrementalTable)throw TypeError(".sqlanvil.ActionConfig.incrementalTable: object expected");n.incrementalTable=s.sqlanvil.ActionConfig.IncrementalTableConfig.fromObject(e.incrementalTable,t+1)}if(null!=e.assertion){if("object"!=typeof e.assertion)throw TypeError(".sqlanvil.ActionConfig.assertion: object expected");n.assertion=s.sqlanvil.ActionConfig.AssertionConfig.fromObject(e.assertion,t+1)}if(null!=e.operation){if("object"!=typeof e.operation)throw TypeError(".sqlanvil.ActionConfig.operation: object expected");n.operation=s.sqlanvil.ActionConfig.OperationConfig.fromObject(e.operation,t+1)}if(null!=e.declaration){if("object"!=typeof e.declaration)throw TypeError(".sqlanvil.ActionConfig.declaration: object expected");n.declaration=s.sqlanvil.ActionConfig.DeclarationConfig.fromObject(e.declaration,t+1)}if(null!=e.notebook){if("object"!=typeof e.notebook)throw TypeError(".sqlanvil.ActionConfig.notebook: object expected");n.notebook=s.sqlanvil.ActionConfig.NotebookConfig.fromObject(e.notebook,t+1)}if(null!=e.dataPreparation){if("object"!=typeof e.dataPreparation)throw TypeError(".sqlanvil.ActionConfig.dataPreparation: object expected");n.dataPreparation=s.sqlanvil.ActionConfig.DataPreparationConfig.fromObject(e.dataPreparation,t+1)}if(null!=e.rlsPolicy){if("object"!=typeof e.rlsPolicy)throw TypeError(".sqlanvil.ActionConfig.rlsPolicy: object expected");n.rlsPolicy=s.sqlanvil.ActionConfig.RlsPolicyConfig.fromObject(e.rlsPolicy,t+1)}if(null!=e.realtimePublication){if("object"!=typeof e.realtimePublication)throw TypeError(".sqlanvil.ActionConfig.realtimePublication: object expected");n.realtimePublication=s.sqlanvil.ActionConfig.RealtimePublicationConfig.fromObject(e.realtimePublication,t+1)}if(null!=e.foreignWrapper){if("object"!=typeof e.foreignWrapper)throw TypeError(".sqlanvil.ActionConfig.foreignWrapper: object expected");n.foreignWrapper=s.sqlanvil.ActionConfig.ForeignWrapperConfig.fromObject(e.foreignWrapper,t+1)}if(null!=e.vectorIndex){if("object"!=typeof e.vectorIndex)throw TypeError(".sqlanvil.ActionConfig.vectorIndex: object expected");n.vectorIndex=s.sqlanvil.ActionConfig.VectorIndexConfig.fromObject(e.vectorIndex,t+1)}if(null!=e.export){if("object"!=typeof e.export)throw TypeError(".sqlanvil.ActionConfig.export: object expected");n.export=s.sqlanvil.ActionConfig.ExportConfig.fromObject(e.export,t+1)}return n},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")),null!=e.export&&e.hasOwnProperty("export")&&(n.export=s.sqlanvil.ActionConfig.ExportConfig.toObject(e.export,t),t.oneofs&&(n.action="export")),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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfig.Target;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.project=e.string();break;case 2:a.dataset=e.string();break;case 4:a.name=e.string();break;case 5:a.includeDependentAssertions=e.bool();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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,t){if(e instanceof s.sqlanvil.ActionConfig.Target)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.Target;return null!=e.project&&(n.project=String(e.project)),null!=e.dataset&&(n.dataset=String(e.dataset)),null!=e.name&&(n.name=String(e.name)),null!=e.includeDependentAssertions&&(n.includeDependentAssertions=Boolean(e.includeDependentAssertions)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfig.ColumnDescriptor;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.path&&a.path.length||(a.path=[]),a.path.push(e.string());break;case 2:a.description=e.string();break;case 3:a.bigqueryPolicyTags&&a.bigqueryPolicyTags.length||(a.bigqueryPolicyTags=[]),a.bigqueryPolicyTags.push(e.string());break;case 4:a.tags&&a.tags.length||(a.tags=[]),a.tags.push(e.string());break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.path&&e.hasOwnProperty("path")){if(!Array.isArray(e.path))return"path: array expected";for(var n=0;n<e.path.length;++n)if(!a.isString(e.path[n]))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(n=0;n<e.bigqueryPolicyTags.length;++n)if(!a.isString(e.bigqueryPolicyTags[n]))return"bigqueryPolicyTags: string[] expected"}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"}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.ColumnDescriptor)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.ColumnDescriptor;if(e.path){if(!Array.isArray(e.path))throw TypeError(".sqlanvil.ActionConfig.ColumnDescriptor.path: array expected");n.path=[];for(var r=0;r<e.path.length;++r)n.path[r]=String(e.path[r])}if(null!=e.description&&(n.description=String(e.description)),e.bigqueryPolicyTags){if(!Array.isArray(e.bigqueryPolicyTags))throw TypeError(".sqlanvil.ActionConfig.ColumnDescriptor.bigqueryPolicyTags: array expected");for(n.bigqueryPolicyTags=[],r=0;r<e.bigqueryPolicyTags.length;++r)n.bigqueryPolicyTags[r]=String(e.bigqueryPolicyTags[r])}if(e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.ColumnDescriptor.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfig.TableAssertionsConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.uniqueKey&&a.uniqueKey.length||(a.uniqueKey=[]),a.uniqueKey.push(e.string());break;case 2:a.uniqueKeys&&a.uniqueKeys.length||(a.uniqueKeys=[]),a.uniqueKeys.push(s.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey.decode(e,e.uint32(),void 0,r+1));break;case 3:a.nonNull&&a.nonNull.length||(a.nonNull=[]),a.nonNull.push(e.string());break;case 4:a.rowConditions&&a.rowConditions.length||(a.rowConditions=[]),a.rowConditions.push(e.string());break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.uniqueKey&&e.hasOwnProperty("uniqueKey")){if(!Array.isArray(e.uniqueKey))return"uniqueKey: array expected";for(var n=0;n<e.uniqueKey.length;++n)if(!a.isString(e.uniqueKey[n]))return"uniqueKey: string[] expected"}if(null!=e.uniqueKeys&&e.hasOwnProperty("uniqueKeys")){if(!Array.isArray(e.uniqueKeys))return"uniqueKeys: array expected";for(n=0;n<e.uniqueKeys.length;++n){var r=s.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey.verify(e.uniqueKeys[n],t+1);if(r)return"uniqueKeys."+r}}if(null!=e.nonNull&&e.hasOwnProperty("nonNull")){if(!Array.isArray(e.nonNull))return"nonNull: array expected";for(n=0;n<e.nonNull.length;++n)if(!a.isString(e.nonNull[n]))return"nonNull: string[] expected"}if(null!=e.rowConditions&&e.hasOwnProperty("rowConditions")){if(!Array.isArray(e.rowConditions))return"rowConditions: array expected";for(n=0;n<e.rowConditions.length;++n)if(!a.isString(e.rowConditions[n]))return"rowConditions: string[] expected"}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.TableAssertionsConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.TableAssertionsConfig;if(e.uniqueKey){if(!Array.isArray(e.uniqueKey))throw TypeError(".sqlanvil.ActionConfig.TableAssertionsConfig.uniqueKey: array expected");n.uniqueKey=[];for(var r=0;r<e.uniqueKey.length;++r)n.uniqueKey[r]=String(e.uniqueKey[r])}if(e.uniqueKeys){if(!Array.isArray(e.uniqueKeys))throw TypeError(".sqlanvil.ActionConfig.TableAssertionsConfig.uniqueKeys: array expected");for(n.uniqueKeys=[],r=0;r<e.uniqueKeys.length;++r){if("object"!=typeof e.uniqueKeys[r])throw TypeError(".sqlanvil.ActionConfig.TableAssertionsConfig.uniqueKeys: object expected");n.uniqueKeys[r]=s.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey.fromObject(e.uniqueKeys[r],t+1)}}if(e.nonNull){if(!Array.isArray(e.nonNull))throw TypeError(".sqlanvil.ActionConfig.TableAssertionsConfig.nonNull: array expected");for(n.nonNull=[],r=0;r<e.nonNull.length;++r)n.nonNull[r]=String(e.nonNull[r])}if(e.rowConditions){if(!Array.isArray(e.rowConditions))throw TypeError(".sqlanvil.ActionConfig.TableAssertionsConfig.rowConditions: array expected");for(n.rowConditions=[],r=0;r<e.rowConditions.length;++r)n.rowConditions[r]=String(e.rowConditions[r])}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?(a.uniqueKey&&a.uniqueKey.length||(a.uniqueKey=[]),a.uniqueKey.push(e.string())):e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.uniqueKey&&e.hasOwnProperty("uniqueKey")){if(!Array.isArray(e.uniqueKey))return"uniqueKey: array expected";for(var n=0;n<e.uniqueKey.length;++n)if(!a.isString(e.uniqueKey[n]))return"uniqueKey: string[] expected"}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey;if(e.uniqueKey){if(!Array.isArray(e.uniqueKey))throw TypeError(".sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey.uniqueKey: array expected");n.uniqueKey=[];for(var r=0;r<e.uniqueKey.length;++r)n.uniqueKey[r]=String(e.uniqueKey[r])}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfig.IcebergTableConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.fileFormat=e.int32();break;case 2:a.connection=e.string();break;case 3:a.bucketName=e.string();break;case 4:a.tableFolderRoot=e.string();break;case 5:a.tableFolderSubpath=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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,t){if(e instanceof s.sqlanvil.ActionConfig.IcebergTableConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.IcebergTableConfig;switch(e.fileFormat){default:if("number"==typeof e.fileFormat){n.fileFormat=e.fileFormat;break}break;case"FILE_FORMAT_UNSPECIFIED":case 0:n.fileFormat=0;break;case"PARQUET":case 1:n.fileFormat=1}return null!=e.connection&&(n.connection=String(e.connection)),null!=e.bucketName&&(n.bucketName=String(e.bucketName)),null!=e.tableFolderRoot&&(n.tableFolderRoot=String(e.tableFolderRoot)),null!=e.tableFolderSubpath&&(n.tableFolderSubpath=String(e.tableFolderSubpath)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.ActionConfig.TableConfig;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.name=e.string();break;case 2:u.dataset=e.string();break;case 3:u.project=e.string();break;case 4:u.dependencyTargets&&u.dependencyTargets.length||(u.dependencyTargets=[]),u.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32(),void 0,r+1));break;case 5:u.filename=e.string();break;case 6:u.tags&&u.tags.length||(u.tags=[]),u.tags.push(e.string());break;case 7:u.disabled=e.bool();break;case 8:u.preOperations&&u.preOperations.length||(u.preOperations=[]),u.preOperations.push(e.string());break;case 9:u.postOperations&&u.postOperations.length||(u.postOperations=[]),u.postOperations.push(e.string());break;case 10:u.description=e.string();break;case 11:u.columns&&u.columns.length||(u.columns=[]),u.columns.push(s.sqlanvil.ActionConfig.ColumnDescriptor.decode(e,e.uint32(),void 0,r+1));break;case 12:u.partitionBy=e.string();break;case 13:u.partitionExpirationDays=e.int32();break;case 14:u.requirePartitionFilter=e.bool();break;case 15:u.clusterBy&&u.clusterBy.length||(u.clusterBy=[]),u.clusterBy.push(e.string());break;case 16:u.labels===a.emptyObject&&(u.labels={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;)switch((f=e.uint32())>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}"__proto__"===o&&a.makeProp(u.labels,o),u.labels[o]=l;break;case 17:for(u.additionalOptions===a.emptyObject&&(u.additionalOptions={}),d=e.uint32()+e.pos,o="",l="";e.pos<d;){var f;switch((f=e.uint32())>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.additionalOptions,o),u.additionalOptions[o]=l;break;case 18:u.dependOnDependencyAssertions=e.bool();break;case 19:u.assertions=s.sqlanvil.ActionConfig.TableAssertionsConfig.decode(e,e.uint32(),void 0,r+1);break;case 20:u.hermetic=e.bool();break;case 22:u.iceberg=s.sqlanvil.ActionConfig.IcebergTableConfig.decode(e,e.uint32(),void 0,r+1);break;case 23:u.metadata=s.sqlanvil.ActionConfig.Metadata.decode(e,e.uint32(),void 0,r+1);break;case 24:u.reservation=e.string();break;case 25:u.postgres=s.sqlanvil.PostgresOptions.decode(e,e.uint32(),void 0,r+1);break;case 26:u.supabase=s.sqlanvil.SupabaseOptions.decode(e,e.uint32(),void 0,r+1);break;case 27:u.mysql=s.sqlanvil.MysqlOptions.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.dependencyTargets.length;++n)if(i=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[n],t+1))return"dependencyTargets."+i}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(n=0;n<e.tags.length;++n)if(!a.isString(e.tags[n]))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(n=0;n<e.preOperations.length;++n)if(!a.isString(e.preOperations[n]))return"preOperations: string[] expected"}if(null!=e.postOperations&&e.hasOwnProperty("postOperations")){if(!Array.isArray(e.postOperations))return"postOperations: array expected";for(n=0;n<e.postOperations.length;++n)if(!a.isString(e.postOperations[n]))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(n=0;n<e.columns.length;++n)if(i=s.sqlanvil.ActionConfig.ColumnDescriptor.verify(e.columns[n],t+1))return"columns."+i}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(n=0;n<e.clusterBy.length;++n)if(!a.isString(e.clusterBy[n]))return"clusterBy: 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(n=0;n<r.length;++n)if(!a.isString(e.labels[r[n]]))return"labels: string{k:string} expected"}if(null!=e.additionalOptions&&e.hasOwnProperty("additionalOptions")){if(!a.isObject(e.additionalOptions))return"additionalOptions: object expected";for(r=Object.keys(e.additionalOptions),n=0;n<r.length;++n)if(!a.isString(e.additionalOptions[r[n]]))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")&&(i=s.sqlanvil.ActionConfig.TableAssertionsConfig.verify(e.assertions,t+1))?"assertions."+i:null!=e.hermetic&&e.hasOwnProperty("hermetic")&&"boolean"!=typeof e.hermetic?"hermetic: boolean expected":null!=e.iceberg&&e.hasOwnProperty("iceberg")&&(i=s.sqlanvil.ActionConfig.IcebergTableConfig.verify(e.iceberg,t+1))?"iceberg."+i:null!=e.metadata&&e.hasOwnProperty("metadata")&&(i=s.sqlanvil.ActionConfig.Metadata.verify(e.metadata,t+1))?"metadata."+i:null!=e.reservation&&e.hasOwnProperty("reservation")&&!a.isString(e.reservation)?"reservation: string expected":null!=e.postgres&&e.hasOwnProperty("postgres")&&(i=s.sqlanvil.PostgresOptions.verify(e.postgres,t+1))?"postgres."+i:null!=e.supabase&&e.hasOwnProperty("supabase")&&(i=s.sqlanvil.SupabaseOptions.verify(e.supabase,t+1))?"supabase."+i:null!=e.mysql&&e.hasOwnProperty("mysql")&&(i=s.sqlanvil.MysqlOptions.verify(e.mysql,t+1))?"mysql."+i:null;var i},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.TableConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.TableConfig;if(null!=e.name&&(n.name=String(e.name)),null!=e.dataset&&(n.dataset=String(e.dataset)),null!=e.project&&(n.project=String(e.project)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.TableConfig.dependencyTargets: array expected");n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.ActionConfig.TableConfig.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[r],t+1)}}if(null!=e.filename&&(n.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.TableConfig.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}if(null!=e.disabled&&(n.disabled=Boolean(e.disabled)),e.preOperations){if(!Array.isArray(e.preOperations))throw TypeError(".sqlanvil.ActionConfig.TableConfig.preOperations: array expected");for(n.preOperations=[],r=0;r<e.preOperations.length;++r)n.preOperations[r]=String(e.preOperations[r])}if(e.postOperations){if(!Array.isArray(e.postOperations))throw TypeError(".sqlanvil.ActionConfig.TableConfig.postOperations: array expected");for(n.postOperations=[],r=0;r<e.postOperations.length;++r)n.postOperations[r]=String(e.postOperations[r])}if(null!=e.description&&(n.description=String(e.description)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.ActionConfig.TableConfig.columns: array expected");for(n.columns=[],r=0;r<e.columns.length;++r){if("object"!=typeof e.columns[r])throw TypeError(".sqlanvil.ActionConfig.TableConfig.columns: object expected");n.columns[r]=s.sqlanvil.ActionConfig.ColumnDescriptor.fromObject(e.columns[r],t+1)}}if(null!=e.partitionBy&&(n.partitionBy=String(e.partitionBy)),null!=e.partitionExpirationDays&&(n.partitionExpirationDays=0|e.partitionExpirationDays),null!=e.requirePartitionFilter&&(n.requirePartitionFilter=Boolean(e.requirePartitionFilter)),e.clusterBy){if(!Array.isArray(e.clusterBy))throw TypeError(".sqlanvil.ActionConfig.TableConfig.clusterBy: array expected");for(n.clusterBy=[],r=0;r<e.clusterBy.length;++r)n.clusterBy[r]=String(e.clusterBy[r])}if(e.labels){if("object"!=typeof e.labels)throw TypeError(".sqlanvil.ActionConfig.TableConfig.labels: object expected");n.labels={};var i=Object.keys(e.labels);for(r=0;r<i.length;++r)"__proto__"===i[r]&&a.makeProp(n.labels,i[r]),n.labels[i[r]]=String(e.labels[i[r]])}if(e.additionalOptions){if("object"!=typeof e.additionalOptions)throw TypeError(".sqlanvil.ActionConfig.TableConfig.additionalOptions: object expected");for(n.additionalOptions={},i=Object.keys(e.additionalOptions),r=0;r<i.length;++r)"__proto__"===i[r]&&a.makeProp(n.additionalOptions,i[r]),n.additionalOptions[i[r]]=String(e.additionalOptions[i[r]])}if(null!=e.dependOnDependencyAssertions&&(n.dependOnDependencyAssertions=Boolean(e.dependOnDependencyAssertions)),null!=e.assertions){if("object"!=typeof e.assertions)throw TypeError(".sqlanvil.ActionConfig.TableConfig.assertions: object expected");n.assertions=s.sqlanvil.ActionConfig.TableAssertionsConfig.fromObject(e.assertions,t+1)}if(null!=e.hermetic&&(n.hermetic=Boolean(e.hermetic)),null!=e.iceberg){if("object"!=typeof e.iceberg)throw TypeError(".sqlanvil.ActionConfig.TableConfig.iceberg: object expected");n.iceberg=s.sqlanvil.ActionConfig.IcebergTableConfig.fromObject(e.iceberg,t+1)}if(null!=e.metadata){if("object"!=typeof e.metadata)throw TypeError(".sqlanvil.ActionConfig.TableConfig.metadata: object expected");n.metadata=s.sqlanvil.ActionConfig.Metadata.fromObject(e.metadata,t+1)}if(null!=e.reservation&&(n.reservation=String(e.reservation)),null!=e.postgres){if("object"!=typeof e.postgres)throw TypeError(".sqlanvil.ActionConfig.TableConfig.postgres: object expected");n.postgres=s.sqlanvil.PostgresOptions.fromObject(e.postgres,t+1)}if(null!=e.supabase){if("object"!=typeof e.supabase)throw TypeError(".sqlanvil.ActionConfig.TableConfig.supabase: object expected");n.supabase=s.sqlanvil.SupabaseOptions.fromObject(e.supabase,t+1)}if(null!=e.mysql){if("object"!=typeof e.mysql)throw TypeError(".sqlanvil.ActionConfig.TableConfig.mysql: object expected");n.mysql=s.sqlanvil.MysqlOptions.fromObject(e.mysql,t+1)}return n},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)"__proto__"===n[i]&&a.makeProp(r.labels,n[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)"__proto__"===n[i]&&a.makeProp(r.additionalOptions,n[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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfig.Metadata;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.overview=e.string();break;case 2:a.extraProperties=s.google.protobuf.Struct.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.overview&&e.hasOwnProperty("overview")&&!a.isString(e.overview))return"overview: string expected";if(null!=e.extraProperties&&e.hasOwnProperty("extraProperties")){var n=s.google.protobuf.Struct.verify(e.extraProperties,t+1);if(n)return"extraProperties."+n}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.Metadata)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.Metadata;if(null!=e.overview&&(n.overview=String(e.overview)),null!=e.extraProperties){if("object"!=typeof e.extraProperties)throw TypeError(".sqlanvil.ActionConfig.Metadata.extraProperties: object expected");n.extraProperties=s.google.protobuf.Struct.fromObject(e.extraProperties,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.ActionConfig.ViewConfig;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.name=e.string();break;case 2:u.dataset=e.string();break;case 3:u.project=e.string();break;case 4:u.dependencyTargets&&u.dependencyTargets.length||(u.dependencyTargets=[]),u.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32(),void 0,r+1));break;case 5:u.filename=e.string();break;case 6:u.tags&&u.tags.length||(u.tags=[]),u.tags.push(e.string());break;case 7:u.disabled=e.bool();break;case 8:u.preOperations&&u.preOperations.length||(u.preOperations=[]),u.preOperations.push(e.string());break;case 9:u.postOperations&&u.postOperations.length||(u.postOperations=[]),u.postOperations.push(e.string());break;case 10:u.materialized=e.bool();break;case 18:u.partitionBy=e.string();break;case 19:u.clusterBy&&u.clusterBy.length||(u.clusterBy=[]),u.clusterBy.push(e.string());break;case 11:u.description=e.string();break;case 12:u.columns&&u.columns.length||(u.columns=[]),u.columns.push(s.sqlanvil.ActionConfig.ColumnDescriptor.decode(e,e.uint32(),void 0,r+1));break;case 13:u.labels===a.emptyObject&&(u.labels={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;)switch((f=e.uint32())>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}"__proto__"===o&&a.makeProp(u.labels,o),u.labels[o]=l;break;case 14:for(u.additionalOptions===a.emptyObject&&(u.additionalOptions={}),d=e.uint32()+e.pos,o="",l="";e.pos<d;){var f;switch((f=e.uint32())>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.additionalOptions,o),u.additionalOptions[o]=l;break;case 15:u.dependOnDependencyAssertions=e.bool();break;case 16:u.hermetic=e.bool();break;case 17:u.assertions=s.sqlanvil.ActionConfig.TableAssertionsConfig.decode(e,e.uint32(),void 0,r+1);break;case 20:u.metadata=s.sqlanvil.ActionConfig.Metadata.decode(e,e.uint32(),void 0,r+1);break;case 21:u.reservation=e.string();break;case 22:u.postgres=s.sqlanvil.PostgresOptions.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.dependencyTargets.length;++n)if(i=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[n],t+1))return"dependencyTargets."+i}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(n=0;n<e.tags.length;++n)if(!a.isString(e.tags[n]))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(n=0;n<e.preOperations.length;++n)if(!a.isString(e.preOperations[n]))return"preOperations: string[] expected"}if(null!=e.postOperations&&e.hasOwnProperty("postOperations")){if(!Array.isArray(e.postOperations))return"postOperations: array expected";for(n=0;n<e.postOperations.length;++n)if(!a.isString(e.postOperations[n]))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(n=0;n<e.clusterBy.length;++n)if(!a.isString(e.clusterBy[n]))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(n=0;n<e.columns.length;++n)if(i=s.sqlanvil.ActionConfig.ColumnDescriptor.verify(e.columns[n],t+1))return"columns."+i}if(null!=e.labels&&e.hasOwnProperty("labels")){if(!a.isObject(e.labels))return"labels: object expected";var r=Object.keys(e.labels);for(n=0;n<r.length;++n)if(!a.isString(e.labels[r[n]]))return"labels: string{k:string} expected"}if(null!=e.additionalOptions&&e.hasOwnProperty("additionalOptions")){if(!a.isObject(e.additionalOptions))return"additionalOptions: object expected";for(r=Object.keys(e.additionalOptions),n=0;n<r.length;++n)if(!a.isString(e.additionalOptions[r[n]]))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")&&(i=s.sqlanvil.ActionConfig.TableAssertionsConfig.verify(e.assertions,t+1))?"assertions."+i:null!=e.metadata&&e.hasOwnProperty("metadata")&&(i=s.sqlanvil.ActionConfig.Metadata.verify(e.metadata,t+1))?"metadata."+i:null!=e.reservation&&e.hasOwnProperty("reservation")&&!a.isString(e.reservation)?"reservation: string expected":null!=e.postgres&&e.hasOwnProperty("postgres")&&(i=s.sqlanvil.PostgresOptions.verify(e.postgres,t+1))?"postgres."+i:null;var i},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.ViewConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.ViewConfig;if(null!=e.name&&(n.name=String(e.name)),null!=e.dataset&&(n.dataset=String(e.dataset)),null!=e.project&&(n.project=String(e.project)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.ViewConfig.dependencyTargets: array expected");n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.ActionConfig.ViewConfig.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[r],t+1)}}if(null!=e.filename&&(n.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.ViewConfig.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}if(null!=e.disabled&&(n.disabled=Boolean(e.disabled)),e.preOperations){if(!Array.isArray(e.preOperations))throw TypeError(".sqlanvil.ActionConfig.ViewConfig.preOperations: array expected");for(n.preOperations=[],r=0;r<e.preOperations.length;++r)n.preOperations[r]=String(e.preOperations[r])}if(e.postOperations){if(!Array.isArray(e.postOperations))throw TypeError(".sqlanvil.ActionConfig.ViewConfig.postOperations: array expected");for(n.postOperations=[],r=0;r<e.postOperations.length;++r)n.postOperations[r]=String(e.postOperations[r])}if(null!=e.materialized&&(n.materialized=Boolean(e.materialized)),null!=e.partitionBy&&(n.partitionBy=String(e.partitionBy)),e.clusterBy){if(!Array.isArray(e.clusterBy))throw TypeError(".sqlanvil.ActionConfig.ViewConfig.clusterBy: array expected");for(n.clusterBy=[],r=0;r<e.clusterBy.length;++r)n.clusterBy[r]=String(e.clusterBy[r])}if(null!=e.description&&(n.description=String(e.description)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.ActionConfig.ViewConfig.columns: array expected");for(n.columns=[],r=0;r<e.columns.length;++r){if("object"!=typeof e.columns[r])throw TypeError(".sqlanvil.ActionConfig.ViewConfig.columns: object expected");n.columns[r]=s.sqlanvil.ActionConfig.ColumnDescriptor.fromObject(e.columns[r],t+1)}}if(e.labels){if("object"!=typeof e.labels)throw TypeError(".sqlanvil.ActionConfig.ViewConfig.labels: object expected");n.labels={};var i=Object.keys(e.labels);for(r=0;r<i.length;++r)"__proto__"===i[r]&&a.makeProp(n.labels,i[r]),n.labels[i[r]]=String(e.labels[i[r]])}if(e.additionalOptions){if("object"!=typeof e.additionalOptions)throw TypeError(".sqlanvil.ActionConfig.ViewConfig.additionalOptions: object expected");for(n.additionalOptions={},i=Object.keys(e.additionalOptions),r=0;r<i.length;++r)"__proto__"===i[r]&&a.makeProp(n.additionalOptions,i[r]),n.additionalOptions[i[r]]=String(e.additionalOptions[i[r]])}if(null!=e.dependOnDependencyAssertions&&(n.dependOnDependencyAssertions=Boolean(e.dependOnDependencyAssertions)),null!=e.hermetic&&(n.hermetic=Boolean(e.hermetic)),null!=e.assertions){if("object"!=typeof e.assertions)throw TypeError(".sqlanvil.ActionConfig.ViewConfig.assertions: object expected");n.assertions=s.sqlanvil.ActionConfig.TableAssertionsConfig.fromObject(e.assertions,t+1)}if(null!=e.metadata){if("object"!=typeof e.metadata)throw TypeError(".sqlanvil.ActionConfig.ViewConfig.metadata: object expected");n.metadata=s.sqlanvil.ActionConfig.Metadata.fromObject(e.metadata,t+1)}if(null!=e.reservation&&(n.reservation=String(e.reservation)),null!=e.postgres){if("object"!=typeof e.postgres)throw TypeError(".sqlanvil.ActionConfig.ViewConfig.postgres: object expected");n.postgres=s.sqlanvil.PostgresOptions.fromObject(e.postgres,t+1)}return n},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)"__proto__"===n[i]&&a.makeProp(r.labels,n[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)"__proto__"===n[i]&&a.makeProp(r.additionalOptions,n[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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.ActionConfig.IncrementalTableConfig;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.name=e.string();break;case 2:u.dataset=e.string();break;case 3:u.project=e.string();break;case 4:u.dependencyTargets&&u.dependencyTargets.length||(u.dependencyTargets=[]),u.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32(),void 0,r+1));break;case 5:u.filename=e.string();break;case 6:u.tags&&u.tags.length||(u.tags=[]),u.tags.push(e.string());break;case 7:u.disabled=e.bool();break;case 8:u.preOperations&&u.preOperations.length||(u.preOperations=[]),u.preOperations.push(e.string());break;case 9:u.postOperations&&u.postOperations.length||(u.postOperations=[]),u.postOperations.push(e.string());break;case 10:u.protected=e.bool();break;case 11:u.uniqueKey&&u.uniqueKey.length||(u.uniqueKey=[]),u.uniqueKey.push(e.string());break;case 12:u.description=e.string();break;case 13:u.columns&&u.columns.length||(u.columns=[]),u.columns.push(s.sqlanvil.ActionConfig.ColumnDescriptor.decode(e,e.uint32(),void 0,r+1));break;case 14:u.partitionBy=e.string();break;case 15:u.partitionExpirationDays=e.int32();break;case 16:u.requirePartitionFilter=e.bool();break;case 17:u.updatePartitionFilter=e.string();break;case 18:u.clusterBy&&u.clusterBy.length||(u.clusterBy=[]),u.clusterBy.push(e.string());break;case 19:u.labels===a.emptyObject&&(u.labels={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;)switch((f=e.uint32())>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}"__proto__"===o&&a.makeProp(u.labels,o),u.labels[o]=l;break;case 20:for(u.additionalOptions===a.emptyObject&&(u.additionalOptions={}),d=e.uint32()+e.pos,o="",l="";e.pos<d;){var f;switch((f=e.uint32())>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.additionalOptions,o),u.additionalOptions[o]=l;break;case 21:u.dependOnDependencyAssertions=e.bool();break;case 22:u.assertions=s.sqlanvil.ActionConfig.TableAssertionsConfig.decode(e,e.uint32(),void 0,r+1);break;case 23:u.hermetic=e.bool();break;case 24:u.onSchemaChange=e.int32();break;case 25:u.iceberg=s.sqlanvil.ActionConfig.IcebergTableConfig.decode(e,e.uint32(),void 0,r+1);break;case 26:u.metadata=s.sqlanvil.ActionConfig.Metadata.decode(e,e.uint32(),void 0,r+1);break;case 27:u.reservation=e.string();break;case 28:u.postgres=s.sqlanvil.PostgresOptions.decode(e,e.uint32(),void 0,r+1);break;case 29:u.supabase=s.sqlanvil.SupabaseOptions.decode(e,e.uint32(),void 0,r+1);break;case 30:u.mysql=s.sqlanvil.MysqlOptions.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.dependencyTargets.length;++n)if(i=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[n],t+1))return"dependencyTargets."+i}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(n=0;n<e.tags.length;++n)if(!a.isString(e.tags[n]))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(n=0;n<e.preOperations.length;++n)if(!a.isString(e.preOperations[n]))return"preOperations: string[] expected"}if(null!=e.postOperations&&e.hasOwnProperty("postOperations")){if(!Array.isArray(e.postOperations))return"postOperations: array expected";for(n=0;n<e.postOperations.length;++n)if(!a.isString(e.postOperations[n]))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(n=0;n<e.uniqueKey.length;++n)if(!a.isString(e.uniqueKey[n]))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(n=0;n<e.columns.length;++n)if(i=s.sqlanvil.ActionConfig.ColumnDescriptor.verify(e.columns[n],t+1))return"columns."+i}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(n=0;n<e.clusterBy.length;++n)if(!a.isString(e.clusterBy[n]))return"clusterBy: 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(n=0;n<r.length;++n)if(!a.isString(e.labels[r[n]]))return"labels: string{k:string} expected"}if(null!=e.additionalOptions&&e.hasOwnProperty("additionalOptions")){if(!a.isObject(e.additionalOptions))return"additionalOptions: object expected";for(r=Object.keys(e.additionalOptions),n=0;n<r.length;++n)if(!a.isString(e.additionalOptions[r[n]]))return"additionalOptions: string{k:string} expected"}if(null!=e.dependOnDependencyAssertions&&e.hasOwnProperty("dependOnDependencyAssertions")&&"boolean"!=typeof e.dependOnDependencyAssertions)return"dependOnDependencyAssertions: boolean expected";var i;if(null!=e.assertions&&e.hasOwnProperty("assertions")&&(i=s.sqlanvil.ActionConfig.TableAssertionsConfig.verify(e.assertions,t+1)))return"assertions."+i;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")&&(i=s.sqlanvil.ActionConfig.IcebergTableConfig.verify(e.iceberg,t+1))?"iceberg."+i:null!=e.metadata&&e.hasOwnProperty("metadata")&&(i=s.sqlanvil.ActionConfig.Metadata.verify(e.metadata,t+1))?"metadata."+i:null!=e.reservation&&e.hasOwnProperty("reservation")&&!a.isString(e.reservation)?"reservation: string expected":null!=e.postgres&&e.hasOwnProperty("postgres")&&(i=s.sqlanvil.PostgresOptions.verify(e.postgres,t+1))?"postgres."+i:null!=e.supabase&&e.hasOwnProperty("supabase")&&(i=s.sqlanvil.SupabaseOptions.verify(e.supabase,t+1))?"supabase."+i:null!=e.mysql&&e.hasOwnProperty("mysql")&&(i=s.sqlanvil.MysqlOptions.verify(e.mysql,t+1))?"mysql."+i:null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.IncrementalTableConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.IncrementalTableConfig;if(null!=e.name&&(n.name=String(e.name)),null!=e.dataset&&(n.dataset=String(e.dataset)),null!=e.project&&(n.project=String(e.project)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.dependencyTargets: array expected");n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[r],t+1)}}if(null!=e.filename&&(n.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}if(null!=e.disabled&&(n.disabled=Boolean(e.disabled)),e.preOperations){if(!Array.isArray(e.preOperations))throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.preOperations: array expected");for(n.preOperations=[],r=0;r<e.preOperations.length;++r)n.preOperations[r]=String(e.preOperations[r])}if(e.postOperations){if(!Array.isArray(e.postOperations))throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.postOperations: array expected");for(n.postOperations=[],r=0;r<e.postOperations.length;++r)n.postOperations[r]=String(e.postOperations[r])}if(null!=e.protected&&(n.protected=Boolean(e.protected)),e.uniqueKey){if(!Array.isArray(e.uniqueKey))throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.uniqueKey: array expected");for(n.uniqueKey=[],r=0;r<e.uniqueKey.length;++r)n.uniqueKey[r]=String(e.uniqueKey[r])}if(null!=e.description&&(n.description=String(e.description)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.columns: array expected");for(n.columns=[],r=0;r<e.columns.length;++r){if("object"!=typeof e.columns[r])throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.columns: object expected");n.columns[r]=s.sqlanvil.ActionConfig.ColumnDescriptor.fromObject(e.columns[r],t+1)}}if(null!=e.partitionBy&&(n.partitionBy=String(e.partitionBy)),null!=e.partitionExpirationDays&&(n.partitionExpirationDays=0|e.partitionExpirationDays),null!=e.requirePartitionFilter&&(n.requirePartitionFilter=Boolean(e.requirePartitionFilter)),null!=e.updatePartitionFilter&&(n.updatePartitionFilter=String(e.updatePartitionFilter)),e.clusterBy){if(!Array.isArray(e.clusterBy))throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.clusterBy: array expected");for(n.clusterBy=[],r=0;r<e.clusterBy.length;++r)n.clusterBy[r]=String(e.clusterBy[r])}if(e.labels){if("object"!=typeof e.labels)throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.labels: object expected");n.labels={};var i=Object.keys(e.labels);for(r=0;r<i.length;++r)"__proto__"===i[r]&&a.makeProp(n.labels,i[r]),n.labels[i[r]]=String(e.labels[i[r]])}if(e.additionalOptions){if("object"!=typeof e.additionalOptions)throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.additionalOptions: object expected");for(n.additionalOptions={},i=Object.keys(e.additionalOptions),r=0;r<i.length;++r)"__proto__"===i[r]&&a.makeProp(n.additionalOptions,i[r]),n.additionalOptions[i[r]]=String(e.additionalOptions[i[r]])}if(null!=e.dependOnDependencyAssertions&&(n.dependOnDependencyAssertions=Boolean(e.dependOnDependencyAssertions)),null!=e.assertions){if("object"!=typeof e.assertions)throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.assertions: object expected");n.assertions=s.sqlanvil.ActionConfig.TableAssertionsConfig.fromObject(e.assertions,t+1)}switch(null!=e.hermetic&&(n.hermetic=Boolean(e.hermetic)),e.onSchemaChange){default:if("number"==typeof e.onSchemaChange){n.onSchemaChange=e.onSchemaChange;break}break;case"IGNORE":case 0:n.onSchemaChange=0;break;case"FAIL":case 1:n.onSchemaChange=1;break;case"EXTEND":case 2:n.onSchemaChange=2;break;case"SYNCHRONIZE":case 3:n.onSchemaChange=3}if(null!=e.iceberg){if("object"!=typeof e.iceberg)throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.iceberg: object expected");n.iceberg=s.sqlanvil.ActionConfig.IcebergTableConfig.fromObject(e.iceberg,t+1)}if(null!=e.metadata){if("object"!=typeof e.metadata)throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.metadata: object expected");n.metadata=s.sqlanvil.ActionConfig.Metadata.fromObject(e.metadata,t+1)}if(null!=e.reservation&&(n.reservation=String(e.reservation)),null!=e.postgres){if("object"!=typeof e.postgres)throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.postgres: object expected");n.postgres=s.sqlanvil.PostgresOptions.fromObject(e.postgres,t+1)}if(null!=e.supabase){if("object"!=typeof e.supabase)throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.supabase: object expected");n.supabase=s.sqlanvil.SupabaseOptions.fromObject(e.supabase,t+1)}if(null!=e.mysql){if("object"!=typeof e.mysql)throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.mysql: object expected");n.mysql=s.sqlanvil.MysqlOptions.fromObject(e.mysql,t+1)}return n},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)"__proto__"===n[i]&&a.makeProp(r.labels,n[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)"__proto__"===n[i]&&a.makeProp(r.additionalOptions,n[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]]&&"__proto__"!==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.prototype.metadata=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]);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),null!=e.metadata&&Object.hasOwnProperty.call(e,"metadata")&&s.sqlanvil.ActionConfig.Metadata.encode(e.metadata,t.uint32(98).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfig.AssertionConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.name=e.string();break;case 2:a.dataset=e.string();break;case 3:a.project=e.string();break;case 4:a.dependencyTargets&&a.dependencyTargets.length||(a.dependencyTargets=[]),a.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32(),void 0,r+1));break;case 5:a.filename=e.string();break;case 6:a.tags&&a.tags.length||(a.tags=[]),a.tags.push(e.string());break;case 7:a.disabled=e.bool();break;case 8:a.description=e.string();break;case 9:a.hermetic=e.bool();break;case 10:a.dependOnDependencyAssertions=e.bool();break;case 11:a.reservation=e.string();break;case 12:a.metadata=s.sqlanvil.ActionConfig.Metadata.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.dependencyTargets.length;++n)if(r=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[n],t+1))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(n=0;n<e.tags.length;++n)if(!a.isString(e.tags[n]))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!=e.metadata&&e.hasOwnProperty("metadata")&&(r=s.sqlanvil.ActionConfig.Metadata.verify(e.metadata,t+1))?"metadata."+r:null;var r},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.AssertionConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.AssertionConfig;if(null!=e.name&&(n.name=String(e.name)),null!=e.dataset&&(n.dataset=String(e.dataset)),null!=e.project&&(n.project=String(e.project)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.AssertionConfig.dependencyTargets: array expected");n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.ActionConfig.AssertionConfig.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[r],t+1)}}if(null!=e.filename&&(n.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.AssertionConfig.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}if(null!=e.disabled&&(n.disabled=Boolean(e.disabled)),null!=e.description&&(n.description=String(e.description)),null!=e.hermetic&&(n.hermetic=Boolean(e.hermetic)),null!=e.dependOnDependencyAssertions&&(n.dependOnDependencyAssertions=Boolean(e.dependOnDependencyAssertions)),null!=e.reservation&&(n.reservation=String(e.reservation)),null!=e.metadata){if("object"!=typeof e.metadata)throw TypeError(".sqlanvil.ActionConfig.AssertionConfig.metadata: object expected");n.metadata=s.sqlanvil.ActionConfig.Metadata.fromObject(e.metadata,t+1)}return n},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="",n.metadata=null),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),null!=e.metadata&&e.hasOwnProperty("metadata")&&(n.metadata=s.sqlanvil.ActionConfig.Metadata.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.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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfig.OperationConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.name=e.string();break;case 2:a.dataset=e.string();break;case 3:a.project=e.string();break;case 4:a.dependencyTargets&&a.dependencyTargets.length||(a.dependencyTargets=[]),a.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32(),void 0,r+1));break;case 5:a.filename=e.string();break;case 6:a.tags&&a.tags.length||(a.tags=[]),a.tags.push(e.string());break;case 7:a.disabled=e.bool();break;case 8:a.hasOutput=e.bool();break;case 9:a.description=e.string();break;case 10:a.columns&&a.columns.length||(a.columns=[]),a.columns.push(s.sqlanvil.ActionConfig.ColumnDescriptor.decode(e,e.uint32(),void 0,r+1));break;case 11:a.dependOnDependencyAssertions=e.bool();break;case 12:a.hermetic=e.bool();break;case 13:a.reservation=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.dependencyTargets.length;++n)if(r=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[n],t+1))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(n=0;n<e.tags.length;++n)if(!a.isString(e.tags[n]))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(n=0;n<e.columns.length;++n){var r;if(r=s.sqlanvil.ActionConfig.ColumnDescriptor.verify(e.columns[n],t+1))return"columns."+r}}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,t){if(e instanceof s.sqlanvil.ActionConfig.OperationConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.OperationConfig;if(null!=e.name&&(n.name=String(e.name)),null!=e.dataset&&(n.dataset=String(e.dataset)),null!=e.project&&(n.project=String(e.project)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.OperationConfig.dependencyTargets: array expected");n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.ActionConfig.OperationConfig.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[r],t+1)}}if(null!=e.filename&&(n.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.OperationConfig.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}if(null!=e.disabled&&(n.disabled=Boolean(e.disabled)),null!=e.hasOutput&&(n.hasOutput=Boolean(e.hasOutput)),null!=e.description&&(n.description=String(e.description)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.ActionConfig.OperationConfig.columns: array expected");for(n.columns=[],r=0;r<e.columns.length;++r){if("object"!=typeof e.columns[r])throw TypeError(".sqlanvil.ActionConfig.OperationConfig.columns: object expected");n.columns[r]=s.sqlanvil.ActionConfig.ColumnDescriptor.fromObject(e.columns[r],t+1)}}return null!=e.dependOnDependencyAssertions&&(n.dependOnDependencyAssertions=Boolean(e.dependOnDependencyAssertions)),null!=e.hermetic&&(n.hermetic=Boolean(e.hermetic)),null!=e.reservation&&(n.reservation=String(e.reservation)),n},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.ExportOptions=function(){function t(e){if(this.options={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&"__proto__"!==t[n]&&(this[t[n]]=e[t[n]])}return t.prototype.location="",t.prototype.format="",t.prototype.overwrite=!1,t.prototype.filename="",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.location&&Object.hasOwnProperty.call(e,"location")&&t.uint32(10).string(e.location),null!=e.format&&Object.hasOwnProperty.call(e,"format")&&t.uint32(18).string(e.format),null!=e.overwrite&&Object.hasOwnProperty.call(e,"overwrite")&&t.uint32(24).bool(e.overwrite),null!=e.filename&&Object.hasOwnProperty.call(e,"filename")&&t.uint32(34).string(e.filename),null!=e.options&&Object.hasOwnProperty.call(e,"options"))for(var n=Object.keys(e.options),r=0;r<n.length;++r)t.uint32(42).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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.ActionConfig.ExportOptions;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.location=e.string();break;case 2:u.format=e.string();break;case 3:u.overwrite=e.bool();break;case 4:u.filename=e.string();break;case 5:u.options===a.emptyObject&&(u.options={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;){var f=e.uint32();switch(f>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.options,o),u.options[o]=l;break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.location&&e.hasOwnProperty("location")&&!a.isString(e.location))return"location: string expected";if(null!=e.format&&e.hasOwnProperty("format")&&!a.isString(e.format))return"format: string expected";if(null!=e.overwrite&&e.hasOwnProperty("overwrite")&&"boolean"!=typeof e.overwrite)return"overwrite: boolean expected";if(null!=e.filename&&e.hasOwnProperty("filename")&&!a.isString(e.filename))return"filename: string expected";if(null!=e.options&&e.hasOwnProperty("options")){if(!a.isObject(e.options))return"options: object expected";for(var n=Object.keys(e.options),r=0;r<n.length;++r)if(!a.isString(e.options[n[r]]))return"options: string{k:string} expected"}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.ExportOptions)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.ExportOptions;if(null!=e.location&&(n.location=String(e.location)),null!=e.format&&(n.format=String(e.format)),null!=e.overwrite&&(n.overwrite=Boolean(e.overwrite)),null!=e.filename&&(n.filename=String(e.filename)),e.options){if("object"!=typeof e.options)throw TypeError(".sqlanvil.ActionConfig.ExportOptions.options: object expected");n.options={};for(var r=Object.keys(e.options),i=0;i<r.length;++i)"__proto__"===r[i]&&a.makeProp(n.options,r[i]),n.options[r[i]]=String(e.options[r[i]])}return n},t.toObject=function(e,t){t||(t={});var n,r={};if((t.objects||t.defaults)&&(r.options={}),t.defaults&&(r.location="",r.format="",r.overwrite=!1,r.filename=""),null!=e.location&&e.hasOwnProperty("location")&&(r.location=e.location),null!=e.format&&e.hasOwnProperty("format")&&(r.format=e.format),null!=e.overwrite&&e.hasOwnProperty("overwrite")&&(r.overwrite=e.overwrite),null!=e.filename&&e.hasOwnProperty("filename")&&(r.filename=e.filename),e.options&&(n=Object.keys(e.options)).length){r.options={};for(var i=0;i<n.length;++i)"__proto__"===n[i]&&a.makeProp(r.options,n[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.ActionConfig.ExportOptions"},t}(),t.ExportConfig=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]]&&"__proto__"!==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.export=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]);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.export&&Object.hasOwnProperty.call(e,"export")&&s.sqlanvil.ActionConfig.ExportOptions.encode(e.export,t.uint32(82).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfig.ExportConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.name=e.string();break;case 2:a.dataset=e.string();break;case 3:a.project=e.string();break;case 4:a.dependencyTargets&&a.dependencyTargets.length||(a.dependencyTargets=[]),a.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32(),void 0,r+1));break;case 5:a.filename=e.string();break;case 6:a.tags&&a.tags.length||(a.tags=[]),a.tags.push(e.string());break;case 7:a.disabled=e.bool();break;case 8:a.description=e.string();break;case 9:a.hermetic=e.bool();break;case 10:a.export=s.sqlanvil.ActionConfig.ExportOptions.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.dependencyTargets.length;++n)if(r=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[n],t+1))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(n=0;n<e.tags.length;++n)if(!a.isString(e.tags[n]))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.export&&e.hasOwnProperty("export")&&(r=s.sqlanvil.ActionConfig.ExportOptions.verify(e.export,t+1))?"export."+r:null;var r},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.ExportConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.ExportConfig;if(null!=e.name&&(n.name=String(e.name)),null!=e.dataset&&(n.dataset=String(e.dataset)),null!=e.project&&(n.project=String(e.project)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.ExportConfig.dependencyTargets: array expected");n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.ActionConfig.ExportConfig.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[r],t+1)}}if(null!=e.filename&&(n.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.ExportConfig.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}if(null!=e.disabled&&(n.disabled=Boolean(e.disabled)),null!=e.description&&(n.description=String(e.description)),null!=e.hermetic&&(n.hermetic=Boolean(e.hermetic)),null!=e.export){if("object"!=typeof e.export)throw TypeError(".sqlanvil.ActionConfig.ExportConfig.export: object expected");n.export=s.sqlanvil.ActionConfig.ExportOptions.fromObject(e.export,t+1)}return n},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.export=null),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.export&&e.hasOwnProperty("export")&&(n.export=s.sqlanvil.ActionConfig.ExportOptions.toObject(e.export,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.ExportConfig"},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.ActionConfig.DeclarationConfig;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.name=e.string();break;case 2:u.dataset=e.string();break;case 3:u.project=e.string();break;case 4:u.description=e.string();break;case 5:u.columns&&u.columns.length||(u.columns=[]),u.columns.push(s.sqlanvil.ActionConfig.ColumnDescriptor.decode(e,e.uint32(),void 0,r+1));break;case 6:u.filename=e.string();break;case 7:u.tags&&u.tags.length||(u.tags=[]),u.tags.push(e.string());break;case 8:u.connection=e.string();break;case 9:u.columnTypes===a.emptyObject&&(u.columnTypes={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;){var f=e.uint32();switch(f>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.columnTypes,o),u.columnTypes[o]=l;break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.columns.length;++n){var r=s.sqlanvil.ActionConfig.ColumnDescriptor.verify(e.columns[n],t+1);if(r)return"columns."+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(n=0;n<e.tags.length;++n)if(!a.isString(e.tags[n]))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 i=Object.keys(e.columnTypes);for(n=0;n<i.length;++n)if(!a.isString(e.columnTypes[i[n]]))return"columnTypes: string{k:string} expected"}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.DeclarationConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.DeclarationConfig;if(null!=e.name&&(n.name=String(e.name)),null!=e.dataset&&(n.dataset=String(e.dataset)),null!=e.project&&(n.project=String(e.project)),null!=e.description&&(n.description=String(e.description)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.ActionConfig.DeclarationConfig.columns: array expected");n.columns=[];for(var r=0;r<e.columns.length;++r){if("object"!=typeof e.columns[r])throw TypeError(".sqlanvil.ActionConfig.DeclarationConfig.columns: object expected");n.columns[r]=s.sqlanvil.ActionConfig.ColumnDescriptor.fromObject(e.columns[r],t+1)}}if(null!=e.filename&&(n.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.DeclarationConfig.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}if(null!=e.connection&&(n.connection=String(e.connection)),e.columnTypes){if("object"!=typeof e.columnTypes)throw TypeError(".sqlanvil.ActionConfig.DeclarationConfig.columnTypes: object expected");n.columnTypes={};var i=Object.keys(e.columnTypes);for(r=0;r<i.length;++r)"__proto__"===i[r]&&a.makeProp(n.columnTypes,i[r]),n.columnTypes[i[r]]=String(e.columnTypes[i[r]])}return n},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)"__proto__"===n[i]&&a.makeProp(r.columnTypes,n[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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfig.NotebookConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.name=e.string();break;case 2:a.location=e.string();break;case 3:a.project=e.string();break;case 4:a.dependencyTargets&&a.dependencyTargets.length||(a.dependencyTargets=[]),a.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32(),void 0,r+1));break;case 5:a.filename=e.string();break;case 6:a.tags&&a.tags.length||(a.tags=[]),a.tags.push(e.string());break;case 7:a.disabled=e.bool();break;case 8:a.description=e.string();break;case 9:a.dependOnDependencyAssertions=e.bool();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.dependencyTargets.length;++n){var r=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[n],t+1);if(r)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(n=0;n<e.tags.length;++n)if(!a.isString(e.tags[n]))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,t){if(e instanceof s.sqlanvil.ActionConfig.NotebookConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.NotebookConfig;if(null!=e.name&&(n.name=String(e.name)),null!=e.location&&(n.location=String(e.location)),null!=e.project&&(n.project=String(e.project)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.NotebookConfig.dependencyTargets: array expected");n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.ActionConfig.NotebookConfig.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[r],t+1)}}if(null!=e.filename&&(n.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.NotebookConfig.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}return null!=e.disabled&&(n.disabled=Boolean(e.disabled)),null!=e.description&&(n.description=String(e.description)),null!=e.dependOnDependencyAssertions&&(n.dependOnDependencyAssertions=Boolean(e.dependOnDependencyAssertions)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfig.DataPreparationConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.name=e.string();break;case 13:a.dataset=e.string();break;case 14:a.project=e.string();break;case 2:a.dependencyTargets&&a.dependencyTargets.length||(a.dependencyTargets=[]),a.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32(),void 0,r+1));break;case 3:a.filename=e.string();break;case 4:a.tags&&a.tags.length||(a.tags=[]),a.tags.push(e.string());break;case 7:a.disabled=e.bool();break;case 8:a.description=e.string();break;case 11:a.errorTable=s.sqlanvil.ActionConfig.DataPreparationConfig.ErrorTableConfig.decode(e,e.uint32(),void 0,r+1);break;case 12:a.loadMode=s.sqlanvil.ActionConfig.LoadModeConfig.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.dependencyTargets.length;++n)if(r=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[n],t+1))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(n=0;n<e.tags.length;++n)if(!a.isString(e.tags[n]))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")&&(r=s.sqlanvil.ActionConfig.DataPreparationConfig.ErrorTableConfig.verify(e.errorTable,t+1))?"errorTable."+r:null!=e.loadMode&&e.hasOwnProperty("loadMode")&&(r=s.sqlanvil.ActionConfig.LoadModeConfig.verify(e.loadMode,t+1))?"loadMode."+r:null;var r},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.DataPreparationConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.DataPreparationConfig;if(null!=e.name&&(n.name=String(e.name)),null!=e.dataset&&(n.dataset=String(e.dataset)),null!=e.project&&(n.project=String(e.project)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.DataPreparationConfig.dependencyTargets: array expected");n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.ActionConfig.DataPreparationConfig.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[r],t+1)}}if(null!=e.filename&&(n.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.DataPreparationConfig.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}if(null!=e.disabled&&(n.disabled=Boolean(e.disabled)),null!=e.description&&(n.description=String(e.description)),null!=e.errorTable){if("object"!=typeof e.errorTable)throw TypeError(".sqlanvil.ActionConfig.DataPreparationConfig.errorTable: object expected");n.errorTable=s.sqlanvil.ActionConfig.DataPreparationConfig.ErrorTableConfig.fromObject(e.errorTable,t+1)}if(null!=e.loadMode){if("object"!=typeof e.loadMode)throw TypeError(".sqlanvil.ActionConfig.DataPreparationConfig.loadMode: object expected");n.loadMode=s.sqlanvil.ActionConfig.LoadModeConfig.fromObject(e.loadMode,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfig.DataPreparationConfig.ErrorTableConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.name=e.string();break;case 2:a.dataset=e.string();break;case 3:a.project=e.string();break;case 4:a.retentionDays=e.int32();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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,t){if(e instanceof s.sqlanvil.ActionConfig.DataPreparationConfig.ErrorTableConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.DataPreparationConfig.ErrorTableConfig;return null!=e.name&&(n.name=String(e.name)),null!=e.dataset&&(n.dataset=String(e.dataset)),null!=e.project&&(n.project=String(e.project)),null!=e.retentionDays&&(n.retentionDays=0|e.retentionDays),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfig.RlsPolicyConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.name=e.string();break;case 2:a.table=e.string();break;case 3:a.command=e.string();break;case 4:a.roles&&a.roles.length||(a.roles=[]),a.roles.push(e.string());break;case 5:a.using=e.string();break;case 6:a.withCheck=e.string();break;case 7:a.filename=e.string();break;case 8:a.dependencyTargets&&a.dependencyTargets.length||(a.dependencyTargets=[]),a.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32(),void 0,r+1));break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.roles.length;++n)if(!a.isString(e.roles[n]))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(n=0;n<e.dependencyTargets.length;++n){var r=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[n],t+1);if(r)return"dependencyTargets."+r}}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.RlsPolicyConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.RlsPolicyConfig;if(null!=e.name&&(n.name=String(e.name)),null!=e.table&&(n.table=String(e.table)),null!=e.command&&(n.command=String(e.command)),e.roles){if(!Array.isArray(e.roles))throw TypeError(".sqlanvil.ActionConfig.RlsPolicyConfig.roles: array expected");n.roles=[];for(var r=0;r<e.roles.length;++r)n.roles[r]=String(e.roles[r])}if(null!=e.using&&(n.using=String(e.using)),null!=e.withCheck&&(n.withCheck=String(e.withCheck)),null!=e.filename&&(n.filename=String(e.filename)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.RlsPolicyConfig.dependencyTargets: array expected");for(n.dependencyTargets=[],r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.ActionConfig.RlsPolicyConfig.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[r],t+1)}}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfig.RealtimePublicationConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.name=e.string();break;case 2:a.table=e.string();break;case 3:a.events&&a.events.length||(a.events=[]),a.events.push(e.string());break;case 4:a.filename=e.string();break;case 5:a.dependencyTargets&&a.dependencyTargets.length||(a.dependencyTargets=[]),a.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32(),void 0,r+1));break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.events.length;++n)if(!a.isString(e.events[n]))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(n=0;n<e.dependencyTargets.length;++n){var r=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[n],t+1);if(r)return"dependencyTargets."+r}}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.RealtimePublicationConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.RealtimePublicationConfig;if(null!=e.name&&(n.name=String(e.name)),null!=e.table&&(n.table=String(e.table)),e.events){if(!Array.isArray(e.events))throw TypeError(".sqlanvil.ActionConfig.RealtimePublicationConfig.events: array expected");n.events=[];for(var r=0;r<e.events.length;++r)n.events[r]=String(e.events[r])}if(null!=e.filename&&(n.filename=String(e.filename)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.RealtimePublicationConfig.dependencyTargets: array expected");for(n.dependencyTargets=[],r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.ActionConfig.RealtimePublicationConfig.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[r],t+1)}}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.ActionConfig.ForeignWrapperConfig;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.name=e.string();break;case 2:u.wrapper=e.string();break;case 3:u.server=e.string();break;case 4:u.options===a.emptyObject&&(u.options={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;){var f=e.uint32();switch(f>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.options,o),u.options[o]=l;break;case 5:u.filename=e.string();break;case 6:u.dependencyTargets&&u.dependencyTargets.length||(u.dependencyTargets=[]),u.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32(),void 0,r+1));break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=Object.keys(e.options),r=0;r<n.length;++r)if(!a.isString(e.options[n[r]]))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(r=0;r<e.dependencyTargets.length;++r){var i=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[r],t+1);if(i)return"dependencyTargets."+i}}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.ForeignWrapperConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.ForeignWrapperConfig;if(null!=e.name&&(n.name=String(e.name)),null!=e.wrapper&&(n.wrapper=String(e.wrapper)),null!=e.server&&(n.server=String(e.server)),e.options){if("object"!=typeof e.options)throw TypeError(".sqlanvil.ActionConfig.ForeignWrapperConfig.options: object expected");n.options={};for(var r=Object.keys(e.options),i=0;i<r.length;++i)"__proto__"===r[i]&&a.makeProp(n.options,r[i]),n.options[r[i]]=String(e.options[r[i]])}if(null!=e.filename&&(n.filename=String(e.filename)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.ForeignWrapperConfig.dependencyTargets: array expected");for(n.dependencyTargets=[],i=0;i<e.dependencyTargets.length;++i){if("object"!=typeof e.dependencyTargets[i])throw TypeError(".sqlanvil.ActionConfig.ForeignWrapperConfig.dependencyTargets: object expected");n.dependencyTargets[i]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[i],t+1)}}return n},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)"__proto__"===n[i]&&a.makeProp(r.options,n[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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.ActionConfig.VectorIndexConfig;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.name=e.string();break;case 2:u.table=e.string();break;case 3:u.column=e.string();break;case 4:u.dimensions=e.uint32();break;case 5:u.indexType=e.string();break;case 6:u.params===a.emptyObject&&(u.params={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;){var f=e.uint32();switch(f>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.params,o),u.params[o]=l;break;case 7:u.filename=e.string();break;case 8:u.dependencyTargets&&u.dependencyTargets.length||(u.dependencyTargets=[]),u.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32(),void 0,r+1));break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=Object.keys(e.params),r=0;r<n.length;++r)if(!a.isString(e.params[n[r]]))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(r=0;r<e.dependencyTargets.length;++r){var i=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[r],t+1);if(i)return"dependencyTargets."+i}}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.VectorIndexConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.VectorIndexConfig;if(null!=e.name&&(n.name=String(e.name)),null!=e.table&&(n.table=String(e.table)),null!=e.column&&(n.column=String(e.column)),null!=e.dimensions&&(n.dimensions=e.dimensions>>>0),null!=e.indexType&&(n.indexType=String(e.indexType)),e.params){if("object"!=typeof e.params)throw TypeError(".sqlanvil.ActionConfig.VectorIndexConfig.params: object expected");n.params={};for(var r=Object.keys(e.params),i=0;i<r.length;++i)"__proto__"===r[i]&&a.makeProp(n.params,r[i]),n.params[r[i]]=String(e.params[r[i]])}if(null!=e.filename&&(n.filename=String(e.filename)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.VectorIndexConfig.dependencyTargets: array expected");for(n.dependencyTargets=[],i=0;i<e.dependencyTargets.length;++i){if("object"!=typeof e.dependencyTargets[i])throw TypeError(".sqlanvil.ActionConfig.VectorIndexConfig.dependencyTargets: object expected");n.dependencyTargets[i]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[i],t+1)}}return n},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)"__proto__"===n[i]&&a.makeProp(r.params,n[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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfig.LoadModeConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.mode=e.int32();break;case 2:a.incrementalColumn=e.string();break;case 3:a.uniqueKey&&a.uniqueKey.length||(a.uniqueKey=[]),a.uniqueKey.push(e.string());break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.uniqueKey.length;++n)if(!a.isString(e.uniqueKey[n]))return"uniqueKey: string[] expected"}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.LoadModeConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.LoadModeConfig;switch(e.mode){default:if("number"==typeof e.mode){n.mode=e.mode;break}break;case"REPLACE_TABLE":case 0:n.mode=0;break;case"APPEND":case 1:n.mode=1;break;case"MAXIMUM":case 2:n.mode=2;break;case"UNIQUE":case 3:n.mode=3;break;case"MERGE":case 4:n.mode=4}if(null!=e.incrementalColumn&&(n.incrementalColumn=String(e.incrementalColumn)),e.uniqueKey){if(!Array.isArray(e.uniqueKey))throw TypeError(".sqlanvil.ActionConfig.LoadModeConfig.uniqueKey: array expected");n.uniqueKey=[];for(var r=0;r<e.uniqueKey.length;++r)n.uniqueKey[r]=String(e.uniqueKey[r])}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.RepositorySnapshotDestinationConfig;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?a.repositorySnapshotUri=e.string():e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":null!=e.repositorySnapshotUri&&e.hasOwnProperty("repositorySnapshotUri")&&!a.isString(e.repositorySnapshotUri)?"repositorySnapshotUri: string expected":null)},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.RepositorySnapshotDestinationConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.RepositorySnapshotDestinationConfig;return null!=e.repositorySnapshotUri&&(n.repositorySnapshotUri=String(e.repositorySnapshotUri)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.NotebookRuntimeOptionsConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.outputBucket=e.string();break;case 2:a.runtimeTemplateName=e.string();break;case 3:a.repositorySnapshotDestination=s.sqlanvil.RepositorySnapshotDestinationConfig.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";var n={};if(null!=e.outputBucket&&e.hasOwnProperty("outputBucket")&&(n.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")){n.repositorySnapshotStorage=1;var r=s.sqlanvil.RepositorySnapshotDestinationConfig.verify(e.repositorySnapshotDestination,t+1);if(r)return"repositorySnapshotDestination."+r}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.NotebookRuntimeOptionsConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.NotebookRuntimeOptionsConfig;if(null!=e.outputBucket&&(n.outputBucket=String(e.outputBucket)),null!=e.runtimeTemplateName&&(n.runtimeTemplateName=String(e.runtimeTemplateName)),null!=e.repositorySnapshotDestination){if("object"!=typeof e.repositorySnapshotDestination)throw TypeError(".sqlanvil.NotebookRuntimeOptionsConfig.repositorySnapshotDestination: object expected");n.repositorySnapshotDestination=s.sqlanvil.RepositorySnapshotDestinationConfig.fromObject(e.repositorySnapshotDestination,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.PostgresOptions;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.tablespace=e.string();break;case 2:a.fillfactor=e.uint32();break;case 3:a.unlogged=e.bool();break;case 4:a.partition=s.sqlanvil.PostgresOptions.Partition.decode(e,e.uint32(),void 0,r+1);break;case 5:a.indexes&&a.indexes.length||(a.indexes=[]),a.indexes.push(s.sqlanvil.PostgresOptions.Index.decode(e,e.uint32(),void 0,r+1));break;case 6:a.noData=e.bool();break;case 7:a.refreshPolicy=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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")&&(r=s.sqlanvil.PostgresOptions.Partition.verify(e.partition,t+1)))return"partition."+r;if(null!=e.indexes&&e.hasOwnProperty("indexes")){if(!Array.isArray(e.indexes))return"indexes: array expected";for(var n=0;n<e.indexes.length;++n){var r;if(r=s.sqlanvil.PostgresOptions.Index.verify(e.indexes[n],t+1))return"indexes."+r}}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,t){if(e instanceof s.sqlanvil.PostgresOptions)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.PostgresOptions;if(null!=e.tablespace&&(n.tablespace=String(e.tablespace)),null!=e.fillfactor&&(n.fillfactor=e.fillfactor>>>0),null!=e.unlogged&&(n.unlogged=Boolean(e.unlogged)),null!=e.partition){if("object"!=typeof e.partition)throw TypeError(".sqlanvil.PostgresOptions.partition: object expected");n.partition=s.sqlanvil.PostgresOptions.Partition.fromObject(e.partition,t+1)}if(e.indexes){if(!Array.isArray(e.indexes))throw TypeError(".sqlanvil.PostgresOptions.indexes: array expected");n.indexes=[];for(var r=0;r<e.indexes.length;++r){if("object"!=typeof e.indexes[r])throw TypeError(".sqlanvil.PostgresOptions.indexes: object expected");n.indexes[r]=s.sqlanvil.PostgresOptions.Index.fromObject(e.indexes[r],t+1)}}return null!=e.noData&&(n.noData=Boolean(e.noData)),null!=e.refreshPolicy&&(n.refreshPolicy=String(e.refreshPolicy)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.PostgresOptions.Partition;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.kind=e.int32();break;case 2:a.columns&&a.columns.length||(a.columns=[]),a.columns.push(e.string());break;case 3:a.partitions&&a.partitions.length||(a.partitions=[]),a.partitions.push(s.sqlanvil.PostgresOptions.Partition.Bound.decode(e,e.uint32(),void 0,r+1));break;case 4:a.includeDefault=e.bool();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.columns.length;++n)if(!a.isString(e.columns[n]))return"columns: string[] expected"}if(null!=e.partitions&&e.hasOwnProperty("partitions")){if(!Array.isArray(e.partitions))return"partitions: array expected";for(n=0;n<e.partitions.length;++n){var r=s.sqlanvil.PostgresOptions.Partition.Bound.verify(e.partitions[n],t+1);if(r)return"partitions."+r}}return null!=e.includeDefault&&e.hasOwnProperty("includeDefault")&&"boolean"!=typeof e.includeDefault?"includeDefault: boolean expected":null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.PostgresOptions.Partition)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.PostgresOptions.Partition;switch(e.kind){default:if("number"==typeof e.kind){n.kind=e.kind;break}break;case"RANGE":case 0:n.kind=0;break;case"LIST":case 1:n.kind=1;break;case"HASH":case 2:n.kind=2}if(e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.PostgresOptions.Partition.columns: array expected");n.columns=[];for(var r=0;r<e.columns.length;++r)n.columns[r]=String(e.columns[r])}if(e.partitions){if(!Array.isArray(e.partitions))throw TypeError(".sqlanvil.PostgresOptions.Partition.partitions: array expected");for(n.partitions=[],r=0;r<e.partitions.length;++r){if("object"!=typeof e.partitions[r])throw TypeError(".sqlanvil.PostgresOptions.Partition.partitions: object expected");n.partitions[r]=s.sqlanvil.PostgresOptions.Partition.Bound.fromObject(e.partitions[r],t+1)}}return null!=e.includeDefault&&(n.includeDefault=Boolean(e.includeDefault)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.PostgresOptions.Partition.Bound;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.name=e.string();break;case 2:a.values=e.string();break;case 3:a.subPartition=s.sqlanvil.PostgresOptions.Partition.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=s.sqlanvil.PostgresOptions.Partition.verify(e.subPartition,t+1);if(n)return"subPartition."+n}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.PostgresOptions.Partition.Bound)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.PostgresOptions.Partition.Bound;if(null!=e.name&&(n.name=String(e.name)),null!=e.values&&(n.values=String(e.values)),null!=e.subPartition){if("object"!=typeof e.subPartition)throw TypeError(".sqlanvil.PostgresOptions.Partition.Bound.subPartition: object expected");n.subPartition=s.sqlanvil.PostgresOptions.Partition.fromObject(e.subPartition,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.PostgresOptions.Index;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.name=e.string();break;case 2:a.columns&&a.columns.length||(a.columns=[]),a.columns.push(e.string());break;case 3:a.method=e.int32();break;case 4:a.where=e.string();break;case 5:a.unique=e.bool();break;case 6:a.include&&a.include.length||(a.include=[]),a.include.push(e.string());break;case 7:a.opclass=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.columns.length;++n)if(!a.isString(e.columns[n]))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(n=0;n<e.include.length;++n)if(!a.isString(e.include[n]))return"include: string[] expected"}return null!=e.opclass&&e.hasOwnProperty("opclass")&&!a.isString(e.opclass)?"opclass: string expected":null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.PostgresOptions.Index)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.PostgresOptions.Index;if(null!=e.name&&(n.name=String(e.name)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.PostgresOptions.Index.columns: array expected");n.columns=[];for(var r=0;r<e.columns.length;++r)n.columns[r]=String(e.columns[r])}switch(e.method){default:if("number"==typeof e.method){n.method=e.method;break}break;case"BTREE":case 0:n.method=0;break;case"HASH":case 1:n.method=1;break;case"GIN":case 2:n.method=2;break;case"GIST":case 3:n.method=3;break;case"BRIN":case 4:n.method=4}if(null!=e.where&&(n.where=String(e.where)),null!=e.unique&&(n.unique=Boolean(e.unique)),e.include){if(!Array.isArray(e.include))throw TypeError(".sqlanvil.PostgresOptions.Index.include: array expected");for(n.include=[],r=0;r<e.include.length;++r)n.include[r]=String(e.include[r])}return null!=e.opclass&&(n.opclass=String(e.opclass)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.MysqlOptions;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.engine=e.string();break;case 2:a.charset=e.string();break;case 3:a.collation=e.string();break;case 4:a.indexes&&a.indexes.length||(a.indexes=[]),a.indexes.push(s.sqlanvil.MysqlOptions.Index.decode(e,e.uint32(),void 0,r+1));break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.indexes.length;++n){var r=s.sqlanvil.MysqlOptions.Index.verify(e.indexes[n],t+1);if(r)return"indexes."+r}}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.MysqlOptions)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.MysqlOptions;if(null!=e.engine&&(n.engine=String(e.engine)),null!=e.charset&&(n.charset=String(e.charset)),null!=e.collation&&(n.collation=String(e.collation)),e.indexes){if(!Array.isArray(e.indexes))throw TypeError(".sqlanvil.MysqlOptions.indexes: array expected");n.indexes=[];for(var r=0;r<e.indexes.length;++r){if("object"!=typeof e.indexes[r])throw TypeError(".sqlanvil.MysqlOptions.indexes: object expected");n.indexes[r]=s.sqlanvil.MysqlOptions.Index.fromObject(e.indexes[r],t+1)}}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.MysqlOptions.Index;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.name=e.string();break;case 2:a.columns&&a.columns.length||(a.columns=[]),a.columns.push(e.string());break;case 3:a.unique=e.bool();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.columns.length;++n)if(!a.isString(e.columns[n]))return"columns: string[] expected"}return null!=e.unique&&e.hasOwnProperty("unique")&&"boolean"!=typeof e.unique?"unique: boolean expected":null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.MysqlOptions.Index)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.MysqlOptions.Index;if(null!=e.name&&(n.name=String(e.name)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.MysqlOptions.Index.columns: array expected");n.columns=[];for(var r=0;r<e.columns.length;++r)n.columns[r]=String(e.columns[r])}return null!=e.unique&&(n.unique=Boolean(e.unique)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.SupabaseOptions;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.postgres=s.sqlanvil.PostgresOptions.decode(e,e.uint32(),void 0,r+1);break;case 2:a.publishToRealtime=e.bool();break;case 3:a.enableRls=e.bool();break;case 4:a.ownerRole=e.string();break;case 5:a.vectors&&a.vectors.length||(a.vectors=[]),a.vectors.push(s.sqlanvil.SupabaseOptions.VectorConfig.decode(e,e.uint32(),void 0,r+1));break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.postgres&&e.hasOwnProperty("postgres")&&(r=s.sqlanvil.PostgresOptions.verify(e.postgres,t+1)))return"postgres."+r;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 n=0;n<e.vectors.length;++n){var r;if(r=s.sqlanvil.SupabaseOptions.VectorConfig.verify(e.vectors[n],t+1))return"vectors."+r}}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.SupabaseOptions)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.SupabaseOptions;if(null!=e.postgres){if("object"!=typeof e.postgres)throw TypeError(".sqlanvil.SupabaseOptions.postgres: object expected");n.postgres=s.sqlanvil.PostgresOptions.fromObject(e.postgres,t+1)}if(null!=e.publishToRealtime&&(n.publishToRealtime=Boolean(e.publishToRealtime)),null!=e.enableRls&&(n.enableRls=Boolean(e.enableRls)),null!=e.ownerRole&&(n.ownerRole=String(e.ownerRole)),e.vectors){if(!Array.isArray(e.vectors))throw TypeError(".sqlanvil.SupabaseOptions.vectors: array expected");n.vectors=[];for(var r=0;r<e.vectors.length;++r){if("object"!=typeof e.vectors[r])throw TypeError(".sqlanvil.SupabaseOptions.vectors: object expected");n.vectors[r]=s.sqlanvil.SupabaseOptions.VectorConfig.fromObject(e.vectors[r],t+1)}}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.SupabaseOptions.VectorConfig;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.column=e.string();break;case 2:u.dimensions=e.uint32();break;case 3:u.indexType=e.int32();break;case 4:u.params===a.emptyObject&&(u.params={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;){var f=e.uint32();switch(f>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.params,o),u.params[o]=l;break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=Object.keys(e.params),r=0;r<n.length;++r)if(!a.isString(e.params[n[r]]))return"params: string{k:string} expected"}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.SupabaseOptions.VectorConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.SupabaseOptions.VectorConfig;switch(null!=e.column&&(n.column=String(e.column)),null!=e.dimensions&&(n.dimensions=e.dimensions>>>0),e.indexType){default:if("number"==typeof e.indexType){n.indexType=e.indexType;break}break;case"IVFFLAT":case 0:n.indexType=0;break;case"HNSW":case 1:n.indexType=1}if(e.params){if("object"!=typeof e.params)throw TypeError(".sqlanvil.SupabaseOptions.VectorConfig.params: object expected");n.params={};for(var r=Object.keys(e.params),i=0;i<r.length;++i)"__proto__"===r[i]&&a.makeProp(n.params,r[i]),n.params[r[i]]=String(e.params[r[i]])}return n},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)"__proto__"===n[i]&&a.makeProp(r.params,n[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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.BigQueryConnection;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.project=e.string();break;case 2:a.location=e.string();break;case 3:a.defaultDataset=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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,t){if(e instanceof s.sqlanvil.BigQueryConnection)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.BigQueryConnection;return null!=e.project&&(n.project=String(e.project)),null!=e.location&&(n.location=String(e.location)),null!=e.defaultDataset&&(n.defaultDataset=String(e.defaultDataset)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.PostgresConnection;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.host=e.string();break;case 2:a.port=e.uint32();break;case 3:a.database=e.string();break;case 4:a.user=e.string();break;case 5:a.password=e.string();break;case 6:a.sslMode=e.string();break;case 7:a.defaultSchema=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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,t){if(e instanceof s.sqlanvil.PostgresConnection)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.PostgresConnection;return null!=e.host&&(n.host=String(e.host)),null!=e.port&&(n.port=e.port>>>0),null!=e.database&&(n.database=String(e.database)),null!=e.user&&(n.user=String(e.user)),null!=e.password&&(n.password=String(e.password)),null!=e.sslMode&&(n.sslMode=String(e.sslMode)),null!=e.defaultSchema&&(n.defaultSchema=String(e.defaultSchema)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.SupabaseConnection;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.projectRef=e.string();break;case 2:a.serviceRoleKey=e.string();break;case 3:a.defaultSchema=e.string();break;case 4:a.connectionString=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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,t){if(e instanceof s.sqlanvil.SupabaseConnection)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.SupabaseConnection;return null!=e.projectRef&&(n.projectRef=String(e.projectRef)),null!=e.serviceRoleKey&&(n.serviceRoleKey=String(e.serviceRoleKey)),null!=e.defaultSchema&&(n.defaultSchema=String(e.defaultSchema)),null!=e.connectionString&&(n.connectionString=String(e.connectionString)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.MysqlConnection;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.host=e.string();break;case 2:a.port=e.uint32();break;case 3:a.database=e.string();break;case 4:a.user=e.string();break;case 5:a.password=e.string();break;case 6:a.sslMode=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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,t){if(e instanceof s.sqlanvil.MysqlConnection)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.MysqlConnection;return null!=e.host&&(n.host=String(e.host)),null!=e.port&&(n.port=e.port>>>0),null!=e.database&&(n.database=String(e.database)),null!=e.user&&(n.user=String(e.user)),null!=e.password&&(n.password=String(e.password)),null!=e.sslMode&&(n.sslMode=String(e.sslMode)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.WarehouseConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.bigquery=s.sqlanvil.BigQueryConnection.decode(e,e.uint32(),void 0,r+1);break;case 2:a.postgres=s.sqlanvil.PostgresConnection.decode(e,e.uint32(),void 0,r+1);break;case 3:a.supabase=s.sqlanvil.SupabaseConnection.decode(e,e.uint32(),void 0,r+1);break;case 4:a.mysql=s.sqlanvil.MysqlConnection.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";var n={};if(null!=e.bigquery&&e.hasOwnProperty("bigquery")&&(n.connection=1,r=s.sqlanvil.BigQueryConnection.verify(e.bigquery,t+1)))return"bigquery."+r;if(null!=e.postgres&&e.hasOwnProperty("postgres")){if(1===n.connection)return"connection: multiple values";if(n.connection=1,r=s.sqlanvil.PostgresConnection.verify(e.postgres,t+1))return"postgres."+r}if(null!=e.supabase&&e.hasOwnProperty("supabase")){if(1===n.connection)return"connection: multiple values";if(n.connection=1,r=s.sqlanvil.SupabaseConnection.verify(e.supabase,t+1))return"supabase."+r}if(null!=e.mysql&&e.hasOwnProperty("mysql")){if(1===n.connection)return"connection: multiple values";var r;if(n.connection=1,r=s.sqlanvil.MysqlConnection.verify(e.mysql,t+1))return"mysql."+r}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.WarehouseConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.WarehouseConfig;if(null!=e.bigquery){if("object"!=typeof e.bigquery)throw TypeError(".sqlanvil.WarehouseConfig.bigquery: object expected");n.bigquery=s.sqlanvil.BigQueryConnection.fromObject(e.bigquery,t+1)}if(null!=e.postgres){if("object"!=typeof e.postgres)throw TypeError(".sqlanvil.WarehouseConfig.postgres: object expected");n.postgres=s.sqlanvil.PostgresConnection.fromObject(e.postgres,t+1)}if(null!=e.supabase){if("object"!=typeof e.supabase)throw TypeError(".sqlanvil.WarehouseConfig.supabase: object expected");n.supabase=s.sqlanvil.SupabaseConnection.fromObject(e.supabase,t+1)}if(null!=e.mysql){if("object"!=typeof e.mysql)throw TypeError(".sqlanvil.WarehouseConfig.mysql: object expected");n.mysql=s.sqlanvil.MysqlConnection.fromObject(e.mysql,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.Extension;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.name=e.string();break;case 2:u.compilationMode=e.int32();break;case 3:u.options===a.emptyObject&&(u.options={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;){var f=e.uint32();switch(f>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.options,o),u.options[o]=l;break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=Object.keys(e.options),r=0;r<n.length;++r)if(!a.isString(e.options[n[r]]))return"options: string{k:string} expected"}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.Extension)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.Extension;switch(null!=e.name&&(n.name=String(e.name)),e.compilationMode){default:if("number"==typeof e.compilationMode){n.compilationMode=e.compilationMode;break}break;case"COMPILATION_MODE_UNSPECIFIED":case 0:n.compilationMode=0;break;case"PROLOGUE":case 1:n.compilationMode=1;break;case"APPLICATION_CODE":case 2:n.compilationMode=2}if(e.options){if("object"!=typeof e.options)throw TypeError(".sqlanvil.Extension.options: object expected");n.options={};for(var r=Object.keys(e.options),i=0;i<r.length;++i)"__proto__"===r[i]&&a.makeProp(n.options,r[i]),n.options[r[i]]=String(e.options[r[i]])}return n},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)"__proto__"===n[i]&&a.makeProp(r.options,n[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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.ProjectConfig;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.warehouse=e.string();break;case 9:u.defaultDatabase=e.string();break;case 2:u.defaultSchema=e.string();break;case 16:u.defaultLocation=e.string();break;case 5:u.assertionSchema=e.string();break;case 14:u.vars===a.emptyObject&&(u.vars={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;)switch((f=e.uint32())>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}"__proto__"===o&&a.makeProp(u.vars,o),u.vars[o]=l;break;case 15:u.databaseSuffix=e.string();break;case 7:u.schemaSuffix=e.string();break;case 11:u.tablePrefix=e.string();break;case 18:u.builtinAssertionNamePrefix=e.string();break;case 17:u.defaultNotebookRuntimeOptions=s.sqlanvil.NotebookRuntimeOptions.decode(e,e.uint32(),void 0,r+1);break;case 19:u.defaultIcebergConfig=s.sqlanvil.DefaultIcebergConfig.decode(e,e.uint32(),void 0,r+1);break;case 20:u.disableAssertions=e.bool();break;case 21:u.defaultReservation=e.string();break;case 22:u.includeTestsInCompiledGraph=e.bool();break;case 23:for(u.connections===a.emptyObject&&(u.connections={}),d=e.uint32()+e.pos,o="",l=null;e.pos<d;){var f;switch((f=e.uint32())>>>3){case 1:o=e.string();break;case 2:l=s.sqlanvil.ConnectionConfig.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.connections,o),u.connections[o]=l;break;case 24:u.warehouseConnection=e.string();break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=Object.keys(e.vars),r=0;r<n.length;++r)if(!a.isString(e.vars[n[r]]))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")&&(i=s.sqlanvil.NotebookRuntimeOptions.verify(e.defaultNotebookRuntimeOptions,t+1)))return"defaultNotebookRuntimeOptions."+i;if(null!=e.defaultIcebergConfig&&e.hasOwnProperty("defaultIcebergConfig")&&(i=s.sqlanvil.DefaultIcebergConfig.verify(e.defaultIcebergConfig,t+1)))return"defaultIcebergConfig."+i;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(n=Object.keys(e.connections),r=0;r<n.length;++r){var i;if(i=s.sqlanvil.ConnectionConfig.verify(e.connections[n[r]],t+1))return"connections."+i}}return null!=e.warehouseConnection&&e.hasOwnProperty("warehouseConnection")&&!a.isString(e.warehouseConnection)?"warehouseConnection: string expected":null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ProjectConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ProjectConfig;if(null!=e.warehouse&&(n.warehouse=String(e.warehouse)),null!=e.defaultDatabase&&(n.defaultDatabase=String(e.defaultDatabase)),null!=e.defaultSchema&&(n.defaultSchema=String(e.defaultSchema)),null!=e.defaultLocation&&(n.defaultLocation=String(e.defaultLocation)),null!=e.assertionSchema&&(n.assertionSchema=String(e.assertionSchema)),e.vars){if("object"!=typeof e.vars)throw TypeError(".sqlanvil.ProjectConfig.vars: object expected");n.vars={};for(var r=Object.keys(e.vars),i=0;i<r.length;++i)"__proto__"===r[i]&&a.makeProp(n.vars,r[i]),n.vars[r[i]]=String(e.vars[r[i]])}if(null!=e.databaseSuffix&&(n.databaseSuffix=String(e.databaseSuffix)),null!=e.schemaSuffix&&(n.schemaSuffix=String(e.schemaSuffix)),null!=e.tablePrefix&&(n.tablePrefix=String(e.tablePrefix)),null!=e.builtinAssertionNamePrefix&&(n.builtinAssertionNamePrefix=String(e.builtinAssertionNamePrefix)),null!=e.defaultNotebookRuntimeOptions){if("object"!=typeof e.defaultNotebookRuntimeOptions)throw TypeError(".sqlanvil.ProjectConfig.defaultNotebookRuntimeOptions: object expected");n.defaultNotebookRuntimeOptions=s.sqlanvil.NotebookRuntimeOptions.fromObject(e.defaultNotebookRuntimeOptions,t+1)}if(null!=e.defaultIcebergConfig){if("object"!=typeof e.defaultIcebergConfig)throw TypeError(".sqlanvil.ProjectConfig.defaultIcebergConfig: object expected");n.defaultIcebergConfig=s.sqlanvil.DefaultIcebergConfig.fromObject(e.defaultIcebergConfig,t+1)}if(null!=e.disableAssertions&&(n.disableAssertions=Boolean(e.disableAssertions)),null!=e.defaultReservation&&(n.defaultReservation=String(e.defaultReservation)),null!=e.includeTestsInCompiledGraph&&(n.includeTestsInCompiledGraph=Boolean(e.includeTestsInCompiledGraph)),e.connections){if("object"!=typeof e.connections)throw TypeError(".sqlanvil.ProjectConfig.connections: object expected");for(n.connections={},r=Object.keys(e.connections),i=0;i<r.length;++i){if("__proto__"===r[i]&&a.makeProp(n.connections,r[i]),"object"!=typeof e.connections[r[i]])throw TypeError(".sqlanvil.ProjectConfig.connections: object expected");n.connections[r[i]]=s.sqlanvil.ConnectionConfig.fromObject(e.connections[r[i]],t+1)}}return null!=e.warehouseConnection&&(n.warehouseConnection=String(e.warehouseConnection)),n},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)"__proto__"===n[i]&&a.makeProp(r.vars,n[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)"__proto__"===n[i]&&a.makeProp(r.connections,n[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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.CompileConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.projectDir=e.string();break;case 8:a.filePaths&&a.filePaths.length||(a.filePaths=[]),a.filePaths.push(e.string());break;case 3:a.projectConfigOverride=s.sqlanvil.ProjectConfig.decode(e,e.uint32(),void 0,r+1);break;case 6:a.timeoutMillis=e.int32();break;case 10:a.extension=s.sqlanvil.Extension.decode(e,e.uint32(),void 0,r+1);break;case 11:a.verbose=e.bool();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.filePaths.length;++n)if(!a.isString(e.filePaths[n]))return"filePaths: string[] expected"}var r;return null!=e.projectConfigOverride&&e.hasOwnProperty("projectConfigOverride")&&(r=s.sqlanvil.ProjectConfig.verify(e.projectConfigOverride,t+1))?"projectConfigOverride."+r:null!=e.timeoutMillis&&e.hasOwnProperty("timeoutMillis")&&!a.isInteger(e.timeoutMillis)?"timeoutMillis: integer expected":null!=e.extension&&e.hasOwnProperty("extension")&&(r=s.sqlanvil.Extension.verify(e.extension,t+1))?"extension."+r:null!=e.verbose&&e.hasOwnProperty("verbose")&&"boolean"!=typeof e.verbose?"verbose: boolean expected":null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.CompileConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.CompileConfig;if(null!=e.projectDir&&(n.projectDir=String(e.projectDir)),e.filePaths){if(!Array.isArray(e.filePaths))throw TypeError(".sqlanvil.CompileConfig.filePaths: array expected");n.filePaths=[];for(var r=0;r<e.filePaths.length;++r)n.filePaths[r]=String(e.filePaths[r])}if(null!=e.projectConfigOverride){if("object"!=typeof e.projectConfigOverride)throw TypeError(".sqlanvil.CompileConfig.projectConfigOverride: object expected");n.projectConfigOverride=s.sqlanvil.ProjectConfig.fromObject(e.projectConfigOverride,t+1)}if(null!=e.timeoutMillis&&(n.timeoutMillis=0|e.timeoutMillis),null!=e.extension){if("object"!=typeof e.extension)throw TypeError(".sqlanvil.CompileConfig.extension: object expected");n.extension=s.sqlanvil.Extension.fromObject(e.extension,t+1)}return null!=e.verbose&&(n.verbose=Boolean(e.verbose)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.Target;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 3:a.database=e.string();break;case 1:a.schema=e.string();break;case 2:a.name=e.string();break;case 4:a.includeDependentAssertions=e.bool();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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,t){if(e instanceof s.sqlanvil.Target)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.Target;return null!=e.database&&(n.database=String(e.database)),null!=e.schema&&(n.schema=String(e.schema)),null!=e.name&&(n.name=String(e.name)),null!=e.includeDependentAssertions&&(n.includeDependentAssertions=Boolean(e.includeDependentAssertions)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.BigQueryOptions;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.partitionBy=e.string();break;case 2:u.clusterBy&&u.clusterBy.length||(u.clusterBy=[]),u.clusterBy.push(e.string());break;case 3:u.updatePartitionFilter=e.string();break;case 4:u.labels===a.emptyObject&&(u.labels={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;)switch((f=e.uint32())>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}"__proto__"===o&&a.makeProp(u.labels,o),u.labels[o]=l;break;case 5:u.partitionExpirationDays=e.int32();break;case 6:u.requirePartitionFilter=e.bool();break;case 7:for(u.additionalOptions===a.emptyObject&&(u.additionalOptions={}),d=e.uint32()+e.pos,o="",l="";e.pos<d;){var f;switch((f=e.uint32())>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.additionalOptions,o),u.additionalOptions[o]=l;break;case 8:u.connection=e.string();break;case 9:u.tableFormat=e.int32();break;case 10:u.fileFormat=e.int32();break;case 11:u.storageUri=e.string();break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.clusterBy.length;++n)if(!a.isString(e.clusterBy[n]))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 r=Object.keys(e.labels);for(n=0;n<r.length;++n)if(!a.isString(e.labels[r[n]]))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(r=Object.keys(e.additionalOptions),n=0;n<r.length;++n)if(!a.isString(e.additionalOptions[r[n]]))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,t){if(e instanceof s.sqlanvil.BigQueryOptions)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.BigQueryOptions;if(null!=e.partitionBy&&(n.partitionBy=String(e.partitionBy)),e.clusterBy){if(!Array.isArray(e.clusterBy))throw TypeError(".sqlanvil.BigQueryOptions.clusterBy: array expected");n.clusterBy=[];for(var r=0;r<e.clusterBy.length;++r)n.clusterBy[r]=String(e.clusterBy[r])}if(null!=e.updatePartitionFilter&&(n.updatePartitionFilter=String(e.updatePartitionFilter)),e.labels){if("object"!=typeof e.labels)throw TypeError(".sqlanvil.BigQueryOptions.labels: object expected");n.labels={};var i=Object.keys(e.labels);for(r=0;r<i.length;++r)"__proto__"===i[r]&&a.makeProp(n.labels,i[r]),n.labels[i[r]]=String(e.labels[i[r]])}if(null!=e.partitionExpirationDays&&(n.partitionExpirationDays=0|e.partitionExpirationDays),null!=e.requirePartitionFilter&&(n.requirePartitionFilter=Boolean(e.requirePartitionFilter)),e.additionalOptions){if("object"!=typeof e.additionalOptions)throw TypeError(".sqlanvil.BigQueryOptions.additionalOptions: object expected");for(n.additionalOptions={},i=Object.keys(e.additionalOptions),r=0;r<i.length;++r)"__proto__"===i[r]&&a.makeProp(n.additionalOptions,i[r]),n.additionalOptions[i[r]]=String(e.additionalOptions[i[r]])}switch(null!=e.connection&&(n.connection=String(e.connection)),e.tableFormat){default:if("number"==typeof e.tableFormat){n.tableFormat=e.tableFormat;break}break;case"TABLE_FORMAT_UNSPECIFIED":case 0:n.tableFormat=0;break;case"ICEBERG":case 1:n.tableFormat=1}switch(e.fileFormat){default:if("number"==typeof e.fileFormat){n.fileFormat=e.fileFormat;break}break;case"FILE_FORMAT_UNSPECIFIED":case 0:n.fileFormat=0;break;case"PARQUET":case 1:n.fileFormat=1}return null!=e.storageUri&&(n.storageUri=String(e.storageUri)),n},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)"__proto__"===n[i]&&a.makeProp(r.labels,n[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)"__proto__"===n[i]&&a.makeProp(r.additionalOptions,n[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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.GraphErrors;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?(a.compilationErrors&&a.compilationErrors.length||(a.compilationErrors=[]),a.compilationErrors.push(s.sqlanvil.CompilationError.decode(e,e.uint32(),void 0,r+1))):e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.compilationErrors&&e.hasOwnProperty("compilationErrors")){if(!Array.isArray(e.compilationErrors))return"compilationErrors: array expected";for(var n=0;n<e.compilationErrors.length;++n){var r=s.sqlanvil.CompilationError.verify(e.compilationErrors[n],t+1);if(r)return"compilationErrors."+r}}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.GraphErrors)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.GraphErrors;if(e.compilationErrors){if(!Array.isArray(e.compilationErrors))throw TypeError(".sqlanvil.GraphErrors.compilationErrors: array expected");n.compilationErrors=[];for(var r=0;r<e.compilationErrors.length;++r){if("object"!=typeof e.compilationErrors[r])throw TypeError(".sqlanvil.GraphErrors.compilationErrors: object expected");n.compilationErrors[r]=s.sqlanvil.CompilationError.fromObject(e.compilationErrors[r],t+1)}}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.CompilationError;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.fileName=e.string();break;case 4:a.actionName=e.string();break;case 5:a.actionTarget=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 2:a.message=e.string();break;case 3:a.stack=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=s.sqlanvil.Target.verify(e.actionTarget,t+1);if(n)return"actionTarget."+n}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,t){if(e instanceof s.sqlanvil.CompilationError)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.CompilationError;if(null!=e.fileName&&(n.fileName=String(e.fileName)),null!=e.actionName&&(n.actionName=String(e.actionName)),null!=e.actionTarget){if("object"!=typeof e.actionTarget)throw TypeError(".sqlanvil.CompilationError.actionTarget: object expected");n.actionTarget=s.sqlanvil.Target.fromObject(e.actionTarget,t+1)}return null!=e.message&&(n.message=String(e.message)),null!=e.stack&&(n.stack=String(e.stack)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.ActionDescriptor;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.description=e.string();break;case 2:u.columns&&u.columns.length||(u.columns=[]),u.columns.push(s.sqlanvil.ColumnDescriptor.decode(e,e.uint32(),void 0,r+1));break;case 3:u.bigqueryLabels===a.emptyObject&&(u.bigqueryLabels={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;){var f=e.uint32();switch(f>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.bigqueryLabels,o),u.bigqueryLabels[o]=l;break;case 4:u.metadata=s.sqlanvil.Metadata.decode(e,e.uint32(),void 0,r+1);break;case 5:u.compilationMode=e.int32();break;case 6:u.reservation=e.string();break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.columns.length;++n)if(i=s.sqlanvil.ColumnDescriptor.verify(e.columns[n],t+1))return"columns."+i}if(null!=e.bigqueryLabels&&e.hasOwnProperty("bigqueryLabels")){if(!a.isObject(e.bigqueryLabels))return"bigqueryLabels: object expected";var r=Object.keys(e.bigqueryLabels);for(n=0;n<r.length;++n)if(!a.isString(e.bigqueryLabels[r[n]]))return"bigqueryLabels: string{k:string} expected"}var i;if(null!=e.metadata&&e.hasOwnProperty("metadata")&&(i=s.sqlanvil.Metadata.verify(e.metadata,t+1)))return"metadata."+i;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,t){if(e instanceof s.sqlanvil.ActionDescriptor)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionDescriptor;if(null!=e.description&&(n.description=String(e.description)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.ActionDescriptor.columns: array expected");n.columns=[];for(var r=0;r<e.columns.length;++r){if("object"!=typeof e.columns[r])throw TypeError(".sqlanvil.ActionDescriptor.columns: object expected");n.columns[r]=s.sqlanvil.ColumnDescriptor.fromObject(e.columns[r],t+1)}}if(e.bigqueryLabels){if("object"!=typeof e.bigqueryLabels)throw TypeError(".sqlanvil.ActionDescriptor.bigqueryLabels: object expected");n.bigqueryLabels={};var i=Object.keys(e.bigqueryLabels);for(r=0;r<i.length;++r)"__proto__"===i[r]&&a.makeProp(n.bigqueryLabels,i[r]),n.bigqueryLabels[i[r]]=String(e.bigqueryLabels[i[r]])}if(null!=e.metadata){if("object"!=typeof e.metadata)throw TypeError(".sqlanvil.ActionDescriptor.metadata: object expected");n.metadata=s.sqlanvil.Metadata.fromObject(e.metadata,t+1)}switch(e.compilationMode){default:if("number"==typeof e.compilationMode){n.compilationMode=e.compilationMode;break}break;case"ACTION_COMPILATION_MODE_UNSPECIFIED":case 0:n.compilationMode=0;break;case"ACTION_COMPILATION_MODE_AOT":case 1:n.compilationMode=1;break;case"ACTION_COMPILATION_MODE_JIT":case 2:n.compilationMode=2}return null!=e.reservation&&(n.reservation=String(e.reservation)),n},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)"__proto__"===n[i]&&a.makeProp(r.bigqueryLabels,n[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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.Metadata;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.overview=e.string();break;case 2:a.extraProperties=s.google.protobuf.Struct.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.overview&&e.hasOwnProperty("overview")&&!a.isString(e.overview))return"overview: string expected";if(null!=e.extraProperties&&e.hasOwnProperty("extraProperties")){var n=s.google.protobuf.Struct.verify(e.extraProperties,t+1);if(n)return"extraProperties."+n}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.Metadata)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.Metadata;if(null!=e.overview&&(n.overview=String(e.overview)),null!=e.extraProperties){if("object"!=typeof e.extraProperties)throw TypeError(".sqlanvil.Metadata.extraProperties: object expected");n.extraProperties=s.google.protobuf.Struct.fromObject(e.extraProperties,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ColumnDescriptor;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.description=e.string();break;case 2:a.path&&a.path.length||(a.path=[]),a.path.push(e.string());break;case 3:a.displayName=e.string();break;case 7:a.tags&&a.tags.length||(a.tags=[]),a.tags.push(e.string());break;case 8:a.bigqueryPolicyTags&&a.bigqueryPolicyTags.length||(a.bigqueryPolicyTags=[]),a.bigqueryPolicyTags.push(e.string());break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.path.length;++n)if(!a.isString(e.path[n]))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(n=0;n<e.tags.length;++n)if(!a.isString(e.tags[n]))return"tags: string[] expected"}if(null!=e.bigqueryPolicyTags&&e.hasOwnProperty("bigqueryPolicyTags")){if(!Array.isArray(e.bigqueryPolicyTags))return"bigqueryPolicyTags: array expected";for(n=0;n<e.bigqueryPolicyTags.length;++n)if(!a.isString(e.bigqueryPolicyTags[n]))return"bigqueryPolicyTags: string[] expected"}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ColumnDescriptor)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ColumnDescriptor;if(null!=e.description&&(n.description=String(e.description)),e.path){if(!Array.isArray(e.path))throw TypeError(".sqlanvil.ColumnDescriptor.path: array expected");n.path=[];for(var r=0;r<e.path.length;++r)n.path[r]=String(e.path[r])}if(null!=e.displayName&&(n.displayName=String(e.displayName)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ColumnDescriptor.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}if(e.bigqueryPolicyTags){if(!Array.isArray(e.bigqueryPolicyTags))throw TypeError(".sqlanvil.ColumnDescriptor.bigqueryPolicyTags: array expected");for(n.bigqueryPolicyTags=[],r=0;r<e.bigqueryPolicyTags.length;++r)n.bigqueryPolicyTags[r]=String(e.bigqueryPolicyTags[r])}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.Table;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 36:a.enumType=e.int32();break;case 4:a.target=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 32:a.canonicalTarget=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 27:a.dependencyTargets&&a.dependencyTargets.length||(a.dependencyTargets=[]),a.dependencyTargets.push(s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1));break;case 31:a.hermeticity=e.int32();break;case 6:a.disabled=e.bool();break;case 3:a.type=e.string();break;case 5:a.query=e.string();break;case 9:a.protected=e.bool();break;case 35:a.materialized=e.bool();break;case 24:a.actionDescriptor=s.sqlanvil.ActionDescriptor.decode(e,e.uint32(),void 0,r+1);break;case 23:a.tags&&a.tags.length||(a.tags=[]),a.tags.push(e.string());break;case 8:a.where=e.string();break;case 26:a.incrementalQuery=e.string();break;case 30:a.uniqueKey&&a.uniqueKey.length||(a.uniqueKey=[]),a.uniqueKey.push(e.string());break;case 37:a.onSchemaChange=e.int32();break;case 13:a.preOps&&a.preOps.length||(a.preOps=[]),a.preOps.push(e.string());break;case 14:a.postOps&&a.postOps.length||(a.postOps=[]),a.postOps.push(e.string());break;case 28:a.incrementalPreOps&&a.incrementalPreOps.length||(a.incrementalPreOps=[]),a.incrementalPreOps.push(e.string());break;case 29:a.incrementalPostOps&&a.incrementalPostOps.length||(a.incrementalPostOps=[]),a.incrementalPostOps.push(e.string());break;case 38:a.jitCode=e.string();break;case 22:a.bigquery=s.sqlanvil.BigQueryOptions.decode(e,e.uint32(),void 0,r+1);break;case 39:a.postgres=s.sqlanvil.PostgresOptions.decode(e,e.uint32(),void 0,r+1);break;case 40:a.supabase=s.sqlanvil.SupabaseOptions.decode(e,e.uint32(),void 0,r+1);break;case 41:a.mysql=s.sqlanvil.MysqlOptions.decode(e,e.uint32(),void 0,r+1);break;case 18:a.fileName=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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")&&(r=s.sqlanvil.Target.verify(e.target,t+1)))return"target."+r;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(r=s.sqlanvil.Target.verify(e.canonicalTarget,t+1)))return"canonicalTarget."+r;if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var n=0;n<e.dependencyTargets.length;++n){var r;if(r=s.sqlanvil.Target.verify(e.dependencyTargets[n],t+1))return"dependencyTargets."+r}}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")&&(r=s.sqlanvil.ActionDescriptor.verify(e.actionDescriptor,t+1)))return"actionDescriptor."+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.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(n=0;n<e.uniqueKey.length;++n)if(!a.isString(e.uniqueKey[n]))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(n=0;n<e.preOps.length;++n)if(!a.isString(e.preOps[n]))return"preOps: string[] expected"}if(null!=e.postOps&&e.hasOwnProperty("postOps")){if(!Array.isArray(e.postOps))return"postOps: array expected";for(n=0;n<e.postOps.length;++n)if(!a.isString(e.postOps[n]))return"postOps: string[] expected"}if(null!=e.incrementalPreOps&&e.hasOwnProperty("incrementalPreOps")){if(!Array.isArray(e.incrementalPreOps))return"incrementalPreOps: array expected";for(n=0;n<e.incrementalPreOps.length;++n)if(!a.isString(e.incrementalPreOps[n]))return"incrementalPreOps: string[] expected"}if(null!=e.incrementalPostOps&&e.hasOwnProperty("incrementalPostOps")){if(!Array.isArray(e.incrementalPostOps))return"incrementalPostOps: array expected";for(n=0;n<e.incrementalPostOps.length;++n)if(!a.isString(e.incrementalPostOps[n]))return"incrementalPostOps: string[] expected"}return null!=e.jitCode&&e.hasOwnProperty("jitCode")&&!a.isString(e.jitCode)?"jitCode: string expected":null!=e.bigquery&&e.hasOwnProperty("bigquery")&&(r=s.sqlanvil.BigQueryOptions.verify(e.bigquery,t+1))?"bigquery."+r:null!=e.postgres&&e.hasOwnProperty("postgres")&&(r=s.sqlanvil.PostgresOptions.verify(e.postgres,t+1))?"postgres."+r:null!=e.supabase&&e.hasOwnProperty("supabase")&&(r=s.sqlanvil.SupabaseOptions.verify(e.supabase,t+1))?"supabase."+r:null!=e.mysql&&e.hasOwnProperty("mysql")&&(r=s.sqlanvil.MysqlOptions.verify(e.mysql,t+1))?"mysql."+r:null!=e.fileName&&e.hasOwnProperty("fileName")&&!a.isString(e.fileName)?"fileName: string expected":null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.Table)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.Table;switch(e.enumType){default:if("number"==typeof e.enumType){n.enumType=e.enumType;break}break;case"UNKNOWN_TYPE":case 0:n.enumType=0;break;case"TABLE":case 1:n.enumType=1;break;case"INCREMENTAL":case 2:n.enumType=2;break;case"VIEW":case 3:n.enumType=3}if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.Table.target: object expected");n.target=s.sqlanvil.Target.fromObject(e.target,t+1)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".sqlanvil.Table.canonicalTarget: object expected");n.canonicalTarget=s.sqlanvil.Target.fromObject(e.canonicalTarget,t+1)}if(e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.Table.dependencyTargets: array expected");n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.Table.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.Target.fromObject(e.dependencyTargets[r],t+1)}}switch(e.hermeticity){default:if("number"==typeof e.hermeticity){n.hermeticity=e.hermeticity;break}break;case"UNKNOWN":case 0:n.hermeticity=0;break;case"HERMETIC":case 1:n.hermeticity=1;break;case"NON_HERMETIC":case 2:n.hermeticity=2}if(null!=e.disabled&&(n.disabled=Boolean(e.disabled)),null!=e.type&&(n.type=String(e.type)),null!=e.query&&(n.query=String(e.query)),null!=e.protected&&(n.protected=Boolean(e.protected)),null!=e.materialized&&(n.materialized=Boolean(e.materialized)),null!=e.actionDescriptor){if("object"!=typeof e.actionDescriptor)throw TypeError(".sqlanvil.Table.actionDescriptor: object expected");n.actionDescriptor=s.sqlanvil.ActionDescriptor.fromObject(e.actionDescriptor,t+1)}if(e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.Table.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}if(null!=e.where&&(n.where=String(e.where)),null!=e.incrementalQuery&&(n.incrementalQuery=String(e.incrementalQuery)),e.uniqueKey){if(!Array.isArray(e.uniqueKey))throw TypeError(".sqlanvil.Table.uniqueKey: array expected");for(n.uniqueKey=[],r=0;r<e.uniqueKey.length;++r)n.uniqueKey[r]=String(e.uniqueKey[r])}switch(e.onSchemaChange){default:if("number"==typeof e.onSchemaChange){n.onSchemaChange=e.onSchemaChange;break}break;case"IGNORE":case 0:n.onSchemaChange=0;break;case"FAIL":case 1:n.onSchemaChange=1;break;case"EXTEND":case 2:n.onSchemaChange=2;break;case"SYNCHRONIZE":case 3:n.onSchemaChange=3}if(e.preOps){if(!Array.isArray(e.preOps))throw TypeError(".sqlanvil.Table.preOps: array expected");for(n.preOps=[],r=0;r<e.preOps.length;++r)n.preOps[r]=String(e.preOps[r])}if(e.postOps){if(!Array.isArray(e.postOps))throw TypeError(".sqlanvil.Table.postOps: array expected");for(n.postOps=[],r=0;r<e.postOps.length;++r)n.postOps[r]=String(e.postOps[r])}if(e.incrementalPreOps){if(!Array.isArray(e.incrementalPreOps))throw TypeError(".sqlanvil.Table.incrementalPreOps: array expected");for(n.incrementalPreOps=[],r=0;r<e.incrementalPreOps.length;++r)n.incrementalPreOps[r]=String(e.incrementalPreOps[r])}if(e.incrementalPostOps){if(!Array.isArray(e.incrementalPostOps))throw TypeError(".sqlanvil.Table.incrementalPostOps: array expected");for(n.incrementalPostOps=[],r=0;r<e.incrementalPostOps.length;++r)n.incrementalPostOps[r]=String(e.incrementalPostOps[r])}if(null!=e.jitCode&&(n.jitCode=String(e.jitCode)),null!=e.bigquery){if("object"!=typeof e.bigquery)throw TypeError(".sqlanvil.Table.bigquery: object expected");n.bigquery=s.sqlanvil.BigQueryOptions.fromObject(e.bigquery,t+1)}if(null!=e.postgres){if("object"!=typeof e.postgres)throw TypeError(".sqlanvil.Table.postgres: object expected");n.postgres=s.sqlanvil.PostgresOptions.fromObject(e.postgres,t+1)}if(null!=e.supabase){if("object"!=typeof e.supabase)throw TypeError(".sqlanvil.Table.supabase: object expected");n.supabase=s.sqlanvil.SupabaseOptions.fromObject(e.supabase,t+1)}if(null!=e.mysql){if("object"!=typeof e.mysql)throw TypeError(".sqlanvil.Table.mysql: object expected");n.mysql=s.sqlanvil.MysqlOptions.fromObject(e.mysql,t+1)}return null!=e.fileName&&(n.fileName=String(e.fileName)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.Operation;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 3:a.target=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 13:a.canonicalTarget=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 11:a.dependencyTargets&&a.dependencyTargets.length||(a.dependencyTargets=[]),a.dependencyTargets.push(s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1));break;case 12:a.hermeticity=e.int32();break;case 14:a.disabled=e.bool();break;case 6:a.queries&&a.queries.length||(a.queries=[]),a.queries.push(e.string());break;case 15:a.jitCode=e.string();break;case 8:a.hasOutput=e.bool();break;case 9:a.tags&&a.tags.length||(a.tags=[]),a.tags.push(e.string());break;case 10:a.actionDescriptor=s.sqlanvil.ActionDescriptor.decode(e,e.uint32(),void 0,r+1);break;case 7:a.fileName=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.target&&e.hasOwnProperty("target")&&(r=s.sqlanvil.Target.verify(e.target,t+1)))return"target."+r;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(r=s.sqlanvil.Target.verify(e.canonicalTarget,t+1)))return"canonicalTarget."+r;if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var n=0;n<e.dependencyTargets.length;++n){var r;if(r=s.sqlanvil.Target.verify(e.dependencyTargets[n],t+1))return"dependencyTargets."+r}}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(n=0;n<e.queries.length;++n)if(!a.isString(e.queries[n]))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(n=0;n<e.tags.length;++n)if(!a.isString(e.tags[n]))return"tags: string[] expected"}return null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(r=s.sqlanvil.ActionDescriptor.verify(e.actionDescriptor,t+1))?"actionDescriptor."+r:null!=e.fileName&&e.hasOwnProperty("fileName")&&!a.isString(e.fileName)?"fileName: string expected":null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.Operation)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.Operation;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.Operation.target: object expected");n.target=s.sqlanvil.Target.fromObject(e.target,t+1)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".sqlanvil.Operation.canonicalTarget: object expected");n.canonicalTarget=s.sqlanvil.Target.fromObject(e.canonicalTarget,t+1)}if(e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.Operation.dependencyTargets: array expected");n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.Operation.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.Target.fromObject(e.dependencyTargets[r],t+1)}}switch(e.hermeticity){default:if("number"==typeof e.hermeticity){n.hermeticity=e.hermeticity;break}break;case"UNKNOWN":case 0:n.hermeticity=0;break;case"HERMETIC":case 1:n.hermeticity=1;break;case"NON_HERMETIC":case 2:n.hermeticity=2}if(null!=e.disabled&&(n.disabled=Boolean(e.disabled)),e.queries){if(!Array.isArray(e.queries))throw TypeError(".sqlanvil.Operation.queries: array expected");for(n.queries=[],r=0;r<e.queries.length;++r)n.queries[r]=String(e.queries[r])}if(null!=e.jitCode&&(n.jitCode=String(e.jitCode)),null!=e.hasOutput&&(n.hasOutput=Boolean(e.hasOutput)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.Operation.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}if(null!=e.actionDescriptor){if("object"!=typeof e.actionDescriptor)throw TypeError(".sqlanvil.Operation.actionDescriptor: object expected");n.actionDescriptor=s.sqlanvil.ActionDescriptor.fromObject(e.actionDescriptor,t+1)}return null!=e.fileName&&(n.fileName=String(e.fileName)),n},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.Export=function(){function t(e){if(this.dependencyTargets=[],this.tags=[],this.options={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&"__proto__"!==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.tags=a.emptyArray,t.prototype.actionDescriptor=null,t.prototype.query="",t.prototype.location="",t.prototype.format="",t.prototype.overwrite=!1,t.prototype.filename="",t.prototype.options=a.emptyObject,t.prototype.fileName="",t.prototype.jitCode="",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.dependencyTargets&&e.dependencyTargets.length)for(var n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.Target.encode(e.dependencyTargets[n],t.uint32(26).fork()).ldelim();if(null!=e.hermeticity&&Object.hasOwnProperty.call(e,"hermeticity")&&t.uint32(32).int32(e.hermeticity),null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(40).bool(e.disabled),null!=e.tags&&e.tags.length)for(n=0;n<e.tags.length;++n)t.uint32(50).string(e.tags[n]);if(null!=e.actionDescriptor&&Object.hasOwnProperty.call(e,"actionDescriptor")&&s.sqlanvil.ActionDescriptor.encode(e.actionDescriptor,t.uint32(58).fork()).ldelim(),null!=e.query&&Object.hasOwnProperty.call(e,"query")&&t.uint32(66).string(e.query),null!=e.location&&Object.hasOwnProperty.call(e,"location")&&t.uint32(74).string(e.location),null!=e.format&&Object.hasOwnProperty.call(e,"format")&&t.uint32(82).string(e.format),null!=e.overwrite&&Object.hasOwnProperty.call(e,"overwrite")&&t.uint32(88).bool(e.overwrite),null!=e.filename&&Object.hasOwnProperty.call(e,"filename")&&t.uint32(98).string(e.filename),null!=e.options&&Object.hasOwnProperty.call(e,"options")){var r=Object.keys(e.options);for(n=0;n<r.length;++n)t.uint32(106).fork().uint32(10).string(r[n]).uint32(18).string(e.options[r[n]]).ldelim()}return null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(114).string(e.fileName),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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.Export;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.target=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 2:u.canonicalTarget=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 3:u.dependencyTargets&&u.dependencyTargets.length||(u.dependencyTargets=[]),u.dependencyTargets.push(s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1));break;case 4:u.hermeticity=e.int32();break;case 5:u.disabled=e.bool();break;case 6:u.tags&&u.tags.length||(u.tags=[]),u.tags.push(e.string());break;case 7:u.actionDescriptor=s.sqlanvil.ActionDescriptor.decode(e,e.uint32(),void 0,r+1);break;case 8:u.query=e.string();break;case 9:u.location=e.string();break;case 10:u.format=e.string();break;case 11:u.overwrite=e.bool();break;case 12:u.filename=e.string();break;case 13:u.options===a.emptyObject&&(u.options={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;){var f=e.uint32();switch(f>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.options,o),u.options[o]=l;break;case 14:u.fileName=e.string();break;case 15:u.jitCode=e.string();break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.target&&e.hasOwnProperty("target")&&(r=s.sqlanvil.Target.verify(e.target,t+1)))return"target."+r;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(r=s.sqlanvil.Target.verify(e.canonicalTarget,t+1)))return"canonicalTarget."+r;if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var n=0;n<e.dependencyTargets.length;++n){var r;if(r=s.sqlanvil.Target.verify(e.dependencyTargets[n],t+1))return"dependencyTargets."+r}}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.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.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(r=s.sqlanvil.ActionDescriptor.verify(e.actionDescriptor,t+1)))return"actionDescriptor."+r;if(null!=e.query&&e.hasOwnProperty("query")&&!a.isString(e.query))return"query: string expected";if(null!=e.location&&e.hasOwnProperty("location")&&!a.isString(e.location))return"location: string expected";if(null!=e.format&&e.hasOwnProperty("format")&&!a.isString(e.format))return"format: string expected";if(null!=e.overwrite&&e.hasOwnProperty("overwrite")&&"boolean"!=typeof e.overwrite)return"overwrite: boolean expected";if(null!=e.filename&&e.hasOwnProperty("filename")&&!a.isString(e.filename))return"filename: string expected";if(null!=e.options&&e.hasOwnProperty("options")){if(!a.isObject(e.options))return"options: object expected";var i=Object.keys(e.options);for(n=0;n<i.length;++n)if(!a.isString(e.options[i[n]]))return"options: string{k:string} expected"}return null!=e.fileName&&e.hasOwnProperty("fileName")&&!a.isString(e.fileName)?"fileName: string expected":null!=e.jitCode&&e.hasOwnProperty("jitCode")&&!a.isString(e.jitCode)?"jitCode: string expected":null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.Export)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.Export;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.Export.target: object expected");n.target=s.sqlanvil.Target.fromObject(e.target,t+1)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".sqlanvil.Export.canonicalTarget: object expected");n.canonicalTarget=s.sqlanvil.Target.fromObject(e.canonicalTarget,t+1)}if(e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.Export.dependencyTargets: array expected");n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.Export.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.Target.fromObject(e.dependencyTargets[r],t+1)}}switch(e.hermeticity){default:if("number"==typeof e.hermeticity){n.hermeticity=e.hermeticity;break}break;case"UNKNOWN":case 0:n.hermeticity=0;break;case"HERMETIC":case 1:n.hermeticity=1;break;case"NON_HERMETIC":case 2:n.hermeticity=2}if(null!=e.disabled&&(n.disabled=Boolean(e.disabled)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.Export.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}if(null!=e.actionDescriptor){if("object"!=typeof e.actionDescriptor)throw TypeError(".sqlanvil.Export.actionDescriptor: object expected");n.actionDescriptor=s.sqlanvil.ActionDescriptor.fromObject(e.actionDescriptor,t+1)}if(null!=e.query&&(n.query=String(e.query)),null!=e.location&&(n.location=String(e.location)),null!=e.format&&(n.format=String(e.format)),null!=e.overwrite&&(n.overwrite=Boolean(e.overwrite)),null!=e.filename&&(n.filename=String(e.filename)),e.options){if("object"!=typeof e.options)throw TypeError(".sqlanvil.Export.options: object expected");n.options={};var i=Object.keys(e.options);for(r=0;r<i.length;++r)"__proto__"===i[r]&&a.makeProp(n.options,i[r]),n.options[i[r]]=String(e.options[i[r]])}return null!=e.fileName&&(n.fileName=String(e.fileName)),null!=e.jitCode&&(n.jitCode=String(e.jitCode)),n},t.toObject=function(e,t){t||(t={});var n,r={};if((t.arrays||t.defaults)&&(r.dependencyTargets=[],r.tags=[]),(t.objects||t.defaults)&&(r.options={}),t.defaults&&(r.target=null,r.canonicalTarget=null,r.hermeticity=t.enums===String?"UNKNOWN":0,r.disabled=!1,r.actionDescriptor=null,r.query="",r.location="",r.format="",r.overwrite=!1,r.filename="",r.fileName="",r.jitCode=""),null!=e.target&&e.hasOwnProperty("target")&&(r.target=s.sqlanvil.Target.toObject(e.target,t)),null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(r.canonicalTarget=s.sqlanvil.Target.toObject(e.canonicalTarget,t)),e.dependencyTargets&&e.dependencyTargets.length){r.dependencyTargets=[];for(var i=0;i<e.dependencyTargets.length;++i)r.dependencyTargets[i]=s.sqlanvil.Target.toObject(e.dependencyTargets[i],t)}if(null!=e.hermeticity&&e.hasOwnProperty("hermeticity")&&(r.hermeticity=t.enums===String?void 0===s.sqlanvil.ActionHermeticity[e.hermeticity]?e.hermeticity:s.sqlanvil.ActionHermeticity[e.hermeticity]:e.hermeticity),null!=e.disabled&&e.hasOwnProperty("disabled")&&(r.disabled=e.disabled),e.tags&&e.tags.length)for(r.tags=[],i=0;i<e.tags.length;++i)r.tags[i]=e.tags[i];if(null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(r.actionDescriptor=s.sqlanvil.ActionDescriptor.toObject(e.actionDescriptor,t)),null!=e.query&&e.hasOwnProperty("query")&&(r.query=e.query),null!=e.location&&e.hasOwnProperty("location")&&(r.location=e.location),null!=e.format&&e.hasOwnProperty("format")&&(r.format=e.format),null!=e.overwrite&&e.hasOwnProperty("overwrite")&&(r.overwrite=e.overwrite),null!=e.filename&&e.hasOwnProperty("filename")&&(r.filename=e.filename),e.options&&(n=Object.keys(e.options)).length)for(r.options={},i=0;i<n.length;++i)"__proto__"===n[i]&&a.makeProp(r.options,n[i]),r.options[n[i]]=e.options[n[i]];return null!=e.fileName&&e.hasOwnProperty("fileName")&&(r.fileName=e.fileName),null!=e.jitCode&&e.hasOwnProperty("jitCode")&&(r.jitCode=e.jitCode),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.Export"},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.Assertion;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 8:a.target=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 13:a.canonicalTarget=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 11:a.dependencyTargets&&a.dependencyTargets.length||(a.dependencyTargets=[]),a.dependencyTargets.push(s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1));break;case 12:a.hermeticity=e.int32();break;case 14:a.disabled=e.bool();break;case 3:a.query=e.string();break;case 9:a.tags&&a.tags.length||(a.tags=[]),a.tags.push(e.string());break;case 10:a.actionDescriptor=s.sqlanvil.ActionDescriptor.decode(e,e.uint32(),void 0,r+1);break;case 15:a.parentAction=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 16:a.jitCode=e.string();break;case 7:a.fileName=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.target&&e.hasOwnProperty("target")&&(r=s.sqlanvil.Target.verify(e.target,t+1)))return"target."+r;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(r=s.sqlanvil.Target.verify(e.canonicalTarget,t+1)))return"canonicalTarget."+r;if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var n=0;n<e.dependencyTargets.length;++n){var r;if(r=s.sqlanvil.Target.verify(e.dependencyTargets[n],t+1))return"dependencyTargets."+r}}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(n=0;n<e.tags.length;++n)if(!a.isString(e.tags[n]))return"tags: string[] expected"}return null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(r=s.sqlanvil.ActionDescriptor.verify(e.actionDescriptor,t+1))?"actionDescriptor."+r:null!=e.parentAction&&e.hasOwnProperty("parentAction")&&(r=s.sqlanvil.Target.verify(e.parentAction,t+1))?"parentAction."+r: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,t){if(e instanceof s.sqlanvil.Assertion)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.Assertion;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.Assertion.target: object expected");n.target=s.sqlanvil.Target.fromObject(e.target,t+1)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".sqlanvil.Assertion.canonicalTarget: object expected");n.canonicalTarget=s.sqlanvil.Target.fromObject(e.canonicalTarget,t+1)}if(e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.Assertion.dependencyTargets: array expected");n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.Assertion.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.Target.fromObject(e.dependencyTargets[r],t+1)}}switch(e.hermeticity){default:if("number"==typeof e.hermeticity){n.hermeticity=e.hermeticity;break}break;case"UNKNOWN":case 0:n.hermeticity=0;break;case"HERMETIC":case 1:n.hermeticity=1;break;case"NON_HERMETIC":case 2:n.hermeticity=2}if(null!=e.disabled&&(n.disabled=Boolean(e.disabled)),null!=e.query&&(n.query=String(e.query)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.Assertion.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}if(null!=e.actionDescriptor){if("object"!=typeof e.actionDescriptor)throw TypeError(".sqlanvil.Assertion.actionDescriptor: object expected");n.actionDescriptor=s.sqlanvil.ActionDescriptor.fromObject(e.actionDescriptor,t+1)}if(null!=e.parentAction){if("object"!=typeof e.parentAction)throw TypeError(".sqlanvil.Assertion.parentAction: object expected");n.parentAction=s.sqlanvil.Target.fromObject(e.parentAction,t+1)}return null!=e.jitCode&&(n.jitCode=String(e.jitCode)),null!=e.fileName&&(n.fileName=String(e.fileName)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.Declaration;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 2:a.target=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 5:a.canonicalTarget=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 3:a.actionDescriptor=s.sqlanvil.ActionDescriptor.decode(e,e.uint32(),void 0,r+1);break;case 4:a.fileName=e.string();break;case 6:a.tags&&a.tags.length||(a.tags=[]),a.tags.push(e.string());break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";var n;if(null!=e.target&&e.hasOwnProperty("target")&&(n=s.sqlanvil.Target.verify(e.target,t+1)))return"target."+n;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(n=s.sqlanvil.Target.verify(e.canonicalTarget,t+1)))return"canonicalTarget."+n;if(null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(n=s.sqlanvil.ActionDescriptor.verify(e.actionDescriptor,t+1)))return"actionDescriptor."+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(var r=0;r<e.tags.length;++r)if(!a.isString(e.tags[r]))return"tags: string[] expected"}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.Declaration)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.Declaration;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.Declaration.target: object expected");n.target=s.sqlanvil.Target.fromObject(e.target,t+1)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".sqlanvil.Declaration.canonicalTarget: object expected");n.canonicalTarget=s.sqlanvil.Target.fromObject(e.canonicalTarget,t+1)}if(null!=e.actionDescriptor){if("object"!=typeof e.actionDescriptor)throw TypeError(".sqlanvil.Declaration.actionDescriptor: object expected");n.actionDescriptor=s.sqlanvil.ActionDescriptor.fromObject(e.actionDescriptor,t+1)}if(null!=e.fileName&&(n.fileName=String(e.fileName)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.Declaration.tags: array expected");n.tags=[];for(var r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.Test;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.name=e.string();break;case 2:a.testQuery=e.string();break;case 3:a.expectedOutputQuery=e.string();break;case 10:a.jitCode=e.string();break;case 4:a.fileName=e.string();break;case 5:a.disabled=e.bool();break;case 6:a.tags&&a.tags.length||(a.tags=[]),a.tags.push(e.string());break;case 7:a.target=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 8:a.canonicalTarget=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 9:a.dependencyTargets&&a.dependencyTargets.length||(a.dependencyTargets=[]),a.dependencyTargets.push(s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1));break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.tags.length;++n)if(!a.isString(e.tags[n]))return"tags: string[] expected"}if(null!=e.target&&e.hasOwnProperty("target")&&(r=s.sqlanvil.Target.verify(e.target,t+1)))return"target."+r;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(r=s.sqlanvil.Target.verify(e.canonicalTarget,t+1)))return"canonicalTarget."+r;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],t+1))return"dependencyTargets."+r}}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.Test)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.Test;if(null!=e.name&&(n.name=String(e.name)),null!=e.testQuery&&(n.testQuery=String(e.testQuery)),null!=e.expectedOutputQuery&&(n.expectedOutputQuery=String(e.expectedOutputQuery)),null!=e.jitCode&&(n.jitCode=String(e.jitCode)),null!=e.fileName&&(n.fileName=String(e.fileName)),null!=e.disabled&&(n.disabled=Boolean(e.disabled)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.Test.tags: array expected");n.tags=[];for(var r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.Test.target: object expected");n.target=s.sqlanvil.Target.fromObject(e.target,t+1)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".sqlanvil.Test.canonicalTarget: object expected");n.canonicalTarget=s.sqlanvil.Target.fromObject(e.canonicalTarget,t+1)}if(e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.Test.dependencyTargets: array expected");for(n.dependencyTargets=[],r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.Test.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.Target.fromObject(e.dependencyTargets[r],t+1)}}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.Notebook;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.target=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 2:a.canonicalTarget=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 3:a.tags&&a.tags.length||(a.tags=[]),a.tags.push(e.string());break;case 4:a.dependencyTargets&&a.dependencyTargets.length||(a.dependencyTargets=[]),a.dependencyTargets.push(s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1));break;case 5:a.fileName=e.string();break;case 6:a.disabled=e.bool();break;case 7:a.notebookContents=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.target&&e.hasOwnProperty("target")&&(r=s.sqlanvil.Target.verify(e.target,t+1)))return"target."+r;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(r=s.sqlanvil.Target.verify(e.canonicalTarget,t+1)))return"canonicalTarget."+r;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"}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],t+1))return"dependencyTargets."+r}}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,t){if(e instanceof s.sqlanvil.Notebook)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.Notebook;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.Notebook.target: object expected");n.target=s.sqlanvil.Target.fromObject(e.target,t+1)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".sqlanvil.Notebook.canonicalTarget: object expected");n.canonicalTarget=s.sqlanvil.Target.fromObject(e.canonicalTarget,t+1)}if(e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.Notebook.tags: array expected");n.tags=[];for(var r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}if(e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.Notebook.dependencyTargets: array expected");for(n.dependencyTargets=[],r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.Notebook.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.Target.fromObject(e.dependencyTargets[r],t+1)}}return null!=e.fileName&&(n.fileName=String(e.fileName)),null!=e.disabled&&(n.disabled=Boolean(e.disabled)),null!=e.notebookContents&&(n.notebookContents=String(e.notebookContents)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.RepositorySnapshotDestination;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?a.repositorySnapshotUri=e.string():e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":null!=e.repositorySnapshotUri&&e.hasOwnProperty("repositorySnapshotUri")&&!a.isString(e.repositorySnapshotUri)?"repositorySnapshotUri: string expected":null)},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.RepositorySnapshotDestination)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.RepositorySnapshotDestination;return null!=e.repositorySnapshotUri&&(n.repositorySnapshotUri=String(e.repositorySnapshotUri)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.NotebookRuntimeOptions;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.outputBucket=e.string();break;case 2:a.runtimeTemplateName=e.string();break;case 3:a.repositorySnapshotDestination=s.sqlanvil.RepositorySnapshotDestination.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";var n={};if(null!=e.outputBucket&&e.hasOwnProperty("outputBucket")&&(n.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")){n.repositorySnapshotStorage=1;var r=s.sqlanvil.RepositorySnapshotDestination.verify(e.repositorySnapshotDestination,t+1);if(r)return"repositorySnapshotDestination."+r}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.NotebookRuntimeOptions)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.NotebookRuntimeOptions;if(null!=e.outputBucket&&(n.outputBucket=String(e.outputBucket)),null!=e.runtimeTemplateName&&(n.runtimeTemplateName=String(e.runtimeTemplateName)),null!=e.repositorySnapshotDestination){if("object"!=typeof e.repositorySnapshotDestination)throw TypeError(".sqlanvil.NotebookRuntimeOptions.repositorySnapshotDestination: object expected");n.repositorySnapshotDestination=s.sqlanvil.RepositorySnapshotDestination.fromObject(e.repositorySnapshotDestination,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.DataPreparation;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 8:a.target=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 9:a.canonicalTarget=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 1:a.targets&&a.targets.length||(a.targets=[]),a.targets.push(s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1));break;case 2:a.canonicalTargets&&a.canonicalTargets.length||(a.canonicalTargets=[]),a.canonicalTargets.push(s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1));break;case 3:a.tags&&a.tags.length||(a.tags=[]),a.tags.push(e.string());break;case 4:a.dependencyTargets&&a.dependencyTargets.length||(a.dependencyTargets=[]),a.dependencyTargets.push(s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1));break;case 5:a.fileName=e.string();break;case 6:a.disabled=e.bool();break;case 11:a.dataPreparationYaml=e.string();break;case 15:a.query=e.string();break;case 12:a.errorTable=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 13:a.errorTableRetentionDays=e.int32();break;case 16:a.load=s.sqlanvil.LoadConfiguration.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";var n={};if(null!=e.target&&e.hasOwnProperty("target")&&(i=s.sqlanvil.Target.verify(e.target,t+1)))return"target."+i;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(i=s.sqlanvil.Target.verify(e.canonicalTarget,t+1)))return"canonicalTarget."+i;if(null!=e.targets&&e.hasOwnProperty("targets")){if(!Array.isArray(e.targets))return"targets: array expected";for(var r=0;r<e.targets.length;++r)if(i=s.sqlanvil.Target.verify(e.targets[r],t+1))return"targets."+i}if(null!=e.canonicalTargets&&e.hasOwnProperty("canonicalTargets")){if(!Array.isArray(e.canonicalTargets))return"canonicalTargets: array expected";for(r=0;r<e.canonicalTargets.length;++r)if(i=s.sqlanvil.Target.verify(e.canonicalTargets[r],t+1))return"canonicalTargets."+i}if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(r=0;r<e.tags.length;++r)if(!a.isString(e.tags[r]))return"tags: string[] expected"}if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(r=0;r<e.dependencyTargets.length;++r){var i;if(i=s.sqlanvil.Target.verify(e.dependencyTargets[r],t+1))return"dependencyTargets."+i}}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")&&(n.definition=1,!a.isString(e.dataPreparationYaml)))return"dataPreparationYaml: string expected";if(null!=e.query&&e.hasOwnProperty("query")){if(1===n.definition)return"definition: multiple values";if(n.definition=1,!a.isString(e.query))return"query: string expected"}return null!=e.errorTable&&e.hasOwnProperty("errorTable")&&(i=s.sqlanvil.Target.verify(e.errorTable,t+1))?"errorTable."+i:null!=e.errorTableRetentionDays&&e.hasOwnProperty("errorTableRetentionDays")&&!a.isInteger(e.errorTableRetentionDays)?"errorTableRetentionDays: integer expected":null!=e.load&&e.hasOwnProperty("load")&&(i=s.sqlanvil.LoadConfiguration.verify(e.load,t+1))?"load."+i:null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.DataPreparation)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.DataPreparation;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.DataPreparation.target: object expected");n.target=s.sqlanvil.Target.fromObject(e.target,t+1)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".sqlanvil.DataPreparation.canonicalTarget: object expected");n.canonicalTarget=s.sqlanvil.Target.fromObject(e.canonicalTarget,t+1)}if(e.targets){if(!Array.isArray(e.targets))throw TypeError(".sqlanvil.DataPreparation.targets: array expected");n.targets=[];for(var r=0;r<e.targets.length;++r){if("object"!=typeof e.targets[r])throw TypeError(".sqlanvil.DataPreparation.targets: object expected");n.targets[r]=s.sqlanvil.Target.fromObject(e.targets[r],t+1)}}if(e.canonicalTargets){if(!Array.isArray(e.canonicalTargets))throw TypeError(".sqlanvil.DataPreparation.canonicalTargets: array expected");for(n.canonicalTargets=[],r=0;r<e.canonicalTargets.length;++r){if("object"!=typeof e.canonicalTargets[r])throw TypeError(".sqlanvil.DataPreparation.canonicalTargets: object expected");n.canonicalTargets[r]=s.sqlanvil.Target.fromObject(e.canonicalTargets[r],t+1)}}if(e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.DataPreparation.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}if(e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.DataPreparation.dependencyTargets: array expected");for(n.dependencyTargets=[],r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.DataPreparation.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.Target.fromObject(e.dependencyTargets[r],t+1)}}if(null!=e.fileName&&(n.fileName=String(e.fileName)),null!=e.disabled&&(n.disabled=Boolean(e.disabled)),null!=e.dataPreparationYaml&&(n.dataPreparationYaml=String(e.dataPreparationYaml)),null!=e.query&&(n.query=String(e.query)),null!=e.errorTable){if("object"!=typeof e.errorTable)throw TypeError(".sqlanvil.DataPreparation.errorTable: object expected");n.errorTable=s.sqlanvil.Target.fromObject(e.errorTable,t+1)}if(null!=e.errorTableRetentionDays&&(n.errorTableRetentionDays=0|e.errorTableRetentionDays),null!=e.load){if("object"!=typeof e.load)throw TypeError(".sqlanvil.DataPreparation.load: object expected");n.load=s.sqlanvil.LoadConfiguration.fromObject(e.load,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.LoadConfiguration;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.replace=s.sqlanvil.SimpleLoadMode.decode(e,e.uint32(),void 0,r+1);break;case 2:a.append=s.sqlanvil.SimpleLoadMode.decode(e,e.uint32(),void 0,r+1);break;case 3:a.maximum=s.sqlanvil.IncrementalLoadMode.decode(e,e.uint32(),void 0,r+1);break;case 4:a.unique=s.sqlanvil.IncrementalLoadMode.decode(e,e.uint32(),void 0,r+1);break;case 5:a.automatic=s.sqlanvil.IncrementalLoadMode.decode(e,e.uint32(),void 0,r+1);break;case 6:a.merge=s.sqlanvil.MergeLoadMode.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";var n={};if(null!=e.replace&&e.hasOwnProperty("replace")&&(n.mode=1,r=s.sqlanvil.SimpleLoadMode.verify(e.replace,t+1)))return"replace."+r;if(null!=e.append&&e.hasOwnProperty("append")){if(1===n.mode)return"mode: multiple values";if(n.mode=1,r=s.sqlanvil.SimpleLoadMode.verify(e.append,t+1))return"append."+r}if(null!=e.maximum&&e.hasOwnProperty("maximum")){if(1===n.mode)return"mode: multiple values";if(n.mode=1,r=s.sqlanvil.IncrementalLoadMode.verify(e.maximum,t+1))return"maximum."+r}if(null!=e.unique&&e.hasOwnProperty("unique")){if(1===n.mode)return"mode: multiple values";if(n.mode=1,r=s.sqlanvil.IncrementalLoadMode.verify(e.unique,t+1))return"unique."+r}if(null!=e.automatic&&e.hasOwnProperty("automatic")){if(1===n.mode)return"mode: multiple values";if(n.mode=1,r=s.sqlanvil.IncrementalLoadMode.verify(e.automatic,t+1))return"automatic."+r}if(null!=e.merge&&e.hasOwnProperty("merge")){if(1===n.mode)return"mode: multiple values";var r;if(n.mode=1,r=s.sqlanvil.MergeLoadMode.verify(e.merge,t+1))return"merge."+r}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.LoadConfiguration)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.LoadConfiguration;if(null!=e.replace){if("object"!=typeof e.replace)throw TypeError(".sqlanvil.LoadConfiguration.replace: object expected");n.replace=s.sqlanvil.SimpleLoadMode.fromObject(e.replace,t+1)}if(null!=e.append){if("object"!=typeof e.append)throw TypeError(".sqlanvil.LoadConfiguration.append: object expected");n.append=s.sqlanvil.SimpleLoadMode.fromObject(e.append,t+1)}if(null!=e.maximum){if("object"!=typeof e.maximum)throw TypeError(".sqlanvil.LoadConfiguration.maximum: object expected");n.maximum=s.sqlanvil.IncrementalLoadMode.fromObject(e.maximum,t+1)}if(null!=e.unique){if("object"!=typeof e.unique)throw TypeError(".sqlanvil.LoadConfiguration.unique: object expected");n.unique=s.sqlanvil.IncrementalLoadMode.fromObject(e.unique,t+1)}if(null!=e.automatic){if("object"!=typeof e.automatic)throw TypeError(".sqlanvil.LoadConfiguration.automatic: object expected");n.automatic=s.sqlanvil.IncrementalLoadMode.fromObject(e.automatic,t+1)}if(null!=e.merge){if("object"!=typeof e.merge)throw TypeError(".sqlanvil.LoadConfiguration.merge: object expected");n.merge=s.sqlanvil.MergeLoadMode.fromObject(e.merge,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.SimpleLoadMode;e.pos<o;){var l=e.uint32();if(l===n)break;e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":null)},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.SimpleLoadMode)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");return 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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.IncrementalLoadMode;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?a.columnName=e.string():e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":null!=e.columnName&&e.hasOwnProperty("columnName")&&!a.isString(e.columnName)?"columnName: string expected":null)},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.IncrementalLoadMode)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.IncrementalLoadMode;return null!=e.columnName&&(n.columnName=String(e.columnName)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.MergeLoadMode;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?(a.uniqueKey&&a.uniqueKey.length||(a.uniqueKey=[]),a.uniqueKey.push(e.string())):e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.uniqueKey&&e.hasOwnProperty("uniqueKey")){if(!Array.isArray(e.uniqueKey))return"uniqueKey: array expected";for(var n=0;n<e.uniqueKey.length;++n)if(!a.isString(e.uniqueKey[n]))return"uniqueKey: string[] expected"}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.MergeLoadMode)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.MergeLoadMode;if(e.uniqueKey){if(!Array.isArray(e.uniqueKey))throw TypeError(".sqlanvil.MergeLoadMode.uniqueKey: array expected");n.uniqueKey=[];for(var r=0;r<e.uniqueKey.length;++r)n.uniqueKey[r]=String(e.uniqueKey[r])}return n},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.exports=[],this.targets=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&"__proto__"!==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.exports=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();if(null!=e.exports&&e.exports.length)for(n=0;n<e.exports.length;++n)s.sqlanvil.Export.encode(e.exports[n],t.uint32(114).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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.CompiledGraph;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 4:a.projectConfig=s.sqlanvil.ProjectConfig.decode(e,e.uint32(),void 0,r+1);break;case 1:a.tables&&a.tables.length||(a.tables=[]),a.tables.push(s.sqlanvil.Table.decode(e,e.uint32(),void 0,r+1));break;case 2:a.operations&&a.operations.length||(a.operations=[]),a.operations.push(s.sqlanvil.Operation.decode(e,e.uint32(),void 0,r+1));break;case 3:a.assertions&&a.assertions.length||(a.assertions=[]),a.assertions.push(s.sqlanvil.Assertion.decode(e,e.uint32(),void 0,r+1));break;case 9:a.declarations&&a.declarations.length||(a.declarations=[]),a.declarations.push(s.sqlanvil.Declaration.decode(e,e.uint32(),void 0,r+1));break;case 8:a.tests&&a.tests.length||(a.tests=[]),a.tests.push(s.sqlanvil.Test.decode(e,e.uint32(),void 0,r+1));break;case 12:a.notebooks&&a.notebooks.length||(a.notebooks=[]),a.notebooks.push(s.sqlanvil.Notebook.decode(e,e.uint32(),void 0,r+1));break;case 13:a.dataPreparations&&a.dataPreparations.length||(a.dataPreparations=[]),a.dataPreparations.push(s.sqlanvil.DataPreparation.decode(e,e.uint32(),void 0,r+1));break;case 14:a.exports&&a.exports.length||(a.exports=[]),a.exports.push(s.sqlanvil.Export.decode(e,e.uint32(),void 0,r+1));break;case 7:a.graphErrors=s.sqlanvil.GraphErrors.decode(e,e.uint32(),void 0,r+1);break;case 10:a.sqlanvilCoreVersion=e.string();break;case 11:a.targets&&a.targets.length||(a.targets=[]),a.targets.push(s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1));break;case 15:a.jitData=s.google.protobuf.Struct.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.projectConfig&&e.hasOwnProperty("projectConfig")&&(r=s.sqlanvil.ProjectConfig.verify(e.projectConfig,t+1)))return"projectConfig."+r;if(null!=e.tables&&e.hasOwnProperty("tables")){if(!Array.isArray(e.tables))return"tables: array expected";for(var n=0;n<e.tables.length;++n)if(r=s.sqlanvil.Table.verify(e.tables[n],t+1))return"tables."+r}if(null!=e.operations&&e.hasOwnProperty("operations")){if(!Array.isArray(e.operations))return"operations: array expected";for(n=0;n<e.operations.length;++n)if(r=s.sqlanvil.Operation.verify(e.operations[n],t+1))return"operations."+r}if(null!=e.assertions&&e.hasOwnProperty("assertions")){if(!Array.isArray(e.assertions))return"assertions: array expected";for(n=0;n<e.assertions.length;++n)if(r=s.sqlanvil.Assertion.verify(e.assertions[n],t+1))return"assertions."+r}if(null!=e.declarations&&e.hasOwnProperty("declarations")){if(!Array.isArray(e.declarations))return"declarations: array expected";for(n=0;n<e.declarations.length;++n)if(r=s.sqlanvil.Declaration.verify(e.declarations[n],t+1))return"declarations."+r}if(null!=e.tests&&e.hasOwnProperty("tests")){if(!Array.isArray(e.tests))return"tests: array expected";for(n=0;n<e.tests.length;++n)if(r=s.sqlanvil.Test.verify(e.tests[n],t+1))return"tests."+r}if(null!=e.notebooks&&e.hasOwnProperty("notebooks")){if(!Array.isArray(e.notebooks))return"notebooks: array expected";for(n=0;n<e.notebooks.length;++n)if(r=s.sqlanvil.Notebook.verify(e.notebooks[n],t+1))return"notebooks."+r}if(null!=e.dataPreparations&&e.hasOwnProperty("dataPreparations")){if(!Array.isArray(e.dataPreparations))return"dataPreparations: array expected";for(n=0;n<e.dataPreparations.length;++n)if(r=s.sqlanvil.DataPreparation.verify(e.dataPreparations[n],t+1))return"dataPreparations."+r}if(null!=e.exports&&e.hasOwnProperty("exports")){if(!Array.isArray(e.exports))return"exports: array expected";for(n=0;n<e.exports.length;++n)if(r=s.sqlanvil.Export.verify(e.exports[n],t+1))return"exports."+r}if(null!=e.graphErrors&&e.hasOwnProperty("graphErrors")&&(r=s.sqlanvil.GraphErrors.verify(e.graphErrors,t+1)))return"graphErrors."+r;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(n=0;n<e.targets.length;++n){var r;if(r=s.sqlanvil.Target.verify(e.targets[n],t+1))return"targets."+r}}return null!=e.jitData&&e.hasOwnProperty("jitData")&&(r=s.google.protobuf.Struct.verify(e.jitData,t+1))?"jitData."+r:null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.CompiledGraph)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.CompiledGraph;if(null!=e.projectConfig){if("object"!=typeof e.projectConfig)throw TypeError(".sqlanvil.CompiledGraph.projectConfig: object expected");n.projectConfig=s.sqlanvil.ProjectConfig.fromObject(e.projectConfig,t+1)}if(e.tables){if(!Array.isArray(e.tables))throw TypeError(".sqlanvil.CompiledGraph.tables: array expected");n.tables=[];for(var r=0;r<e.tables.length;++r){if("object"!=typeof e.tables[r])throw TypeError(".sqlanvil.CompiledGraph.tables: object expected");n.tables[r]=s.sqlanvil.Table.fromObject(e.tables[r],t+1)}}if(e.operations){if(!Array.isArray(e.operations))throw TypeError(".sqlanvil.CompiledGraph.operations: array expected");for(n.operations=[],r=0;r<e.operations.length;++r){if("object"!=typeof e.operations[r])throw TypeError(".sqlanvil.CompiledGraph.operations: object expected");n.operations[r]=s.sqlanvil.Operation.fromObject(e.operations[r],t+1)}}if(e.assertions){if(!Array.isArray(e.assertions))throw TypeError(".sqlanvil.CompiledGraph.assertions: array expected");for(n.assertions=[],r=0;r<e.assertions.length;++r){if("object"!=typeof e.assertions[r])throw TypeError(".sqlanvil.CompiledGraph.assertions: object expected");n.assertions[r]=s.sqlanvil.Assertion.fromObject(e.assertions[r],t+1)}}if(e.declarations){if(!Array.isArray(e.declarations))throw TypeError(".sqlanvil.CompiledGraph.declarations: array expected");for(n.declarations=[],r=0;r<e.declarations.length;++r){if("object"!=typeof e.declarations[r])throw TypeError(".sqlanvil.CompiledGraph.declarations: object expected");n.declarations[r]=s.sqlanvil.Declaration.fromObject(e.declarations[r],t+1)}}if(e.tests){if(!Array.isArray(e.tests))throw TypeError(".sqlanvil.CompiledGraph.tests: array expected");for(n.tests=[],r=0;r<e.tests.length;++r){if("object"!=typeof e.tests[r])throw TypeError(".sqlanvil.CompiledGraph.tests: object expected");n.tests[r]=s.sqlanvil.Test.fromObject(e.tests[r],t+1)}}if(e.notebooks){if(!Array.isArray(e.notebooks))throw TypeError(".sqlanvil.CompiledGraph.notebooks: array expected");for(n.notebooks=[],r=0;r<e.notebooks.length;++r){if("object"!=typeof e.notebooks[r])throw TypeError(".sqlanvil.CompiledGraph.notebooks: object expected");n.notebooks[r]=s.sqlanvil.Notebook.fromObject(e.notebooks[r],t+1)}}if(e.dataPreparations){if(!Array.isArray(e.dataPreparations))throw TypeError(".sqlanvil.CompiledGraph.dataPreparations: array expected");for(n.dataPreparations=[],r=0;r<e.dataPreparations.length;++r){if("object"!=typeof e.dataPreparations[r])throw TypeError(".sqlanvil.CompiledGraph.dataPreparations: object expected");n.dataPreparations[r]=s.sqlanvil.DataPreparation.fromObject(e.dataPreparations[r],t+1)}}if(e.exports){if(!Array.isArray(e.exports))throw TypeError(".sqlanvil.CompiledGraph.exports: array expected");for(n.exports=[],r=0;r<e.exports.length;++r){if("object"!=typeof e.exports[r])throw TypeError(".sqlanvil.CompiledGraph.exports: object expected");n.exports[r]=s.sqlanvil.Export.fromObject(e.exports[r],t+1)}}if(null!=e.graphErrors){if("object"!=typeof e.graphErrors)throw TypeError(".sqlanvil.CompiledGraph.graphErrors: object expected");n.graphErrors=s.sqlanvil.GraphErrors.fromObject(e.graphErrors,t+1)}if(null!=e.sqlanvilCoreVersion&&(n.sqlanvilCoreVersion=String(e.sqlanvilCoreVersion)),e.targets){if(!Array.isArray(e.targets))throw TypeError(".sqlanvil.CompiledGraph.targets: array expected");for(n.targets=[],r=0;r<e.targets.length;++r){if("object"!=typeof e.targets[r])throw TypeError(".sqlanvil.CompiledGraph.targets: object expected");n.targets[r]=s.sqlanvil.Target.fromObject(e.targets[r],t+1)}}if(null!=e.jitData){if("object"!=typeof e.jitData)throw TypeError(".sqlanvil.CompiledGraph.jitData: object expected");n.jitData=s.google.protobuf.Struct.fromObject(e.jitData,t+1)}return n},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=[],n.exports=[]),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);if(e.exports&&e.exports.length)for(n.exports=[],r=0;r<e.exports.length;++r)n.exports[r]=s.sqlanvil.Export.toObject(e.exports[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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.CoreExecutionRequest;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?a.compile=s.sqlanvil.CompileExecutionRequest.decode(e,e.uint32(),void 0,r+1):e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.compile&&e.hasOwnProperty("compile")){var n=s.sqlanvil.CompileExecutionRequest.verify(e.compile,t+1);if(n)return"compile."+n}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.CoreExecutionRequest)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.CoreExecutionRequest;if(null!=e.compile){if("object"!=typeof e.compile)throw TypeError(".sqlanvil.CoreExecutionRequest.compile: object expected");n.compile=s.sqlanvil.CompileExecutionRequest.fromObject(e.compile,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.CoreExecutionResponse;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?a.compile=s.sqlanvil.CompileExecutionResponse.decode(e,e.uint32(),void 0,r+1):e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.compile&&e.hasOwnProperty("compile")){var n=s.sqlanvil.CompileExecutionResponse.verify(e.compile,t+1);if(n)return"compile."+n}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.CoreExecutionResponse)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.CoreExecutionResponse;if(null!=e.compile){if("object"!=typeof e.compile)throw TypeError(".sqlanvil.CoreExecutionResponse.compile: object expected");n.compile=s.sqlanvil.CompileExecutionResponse.fromObject(e.compile,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.CompileExecutionRequest;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?a.compileConfig=s.sqlanvil.CompileConfig.decode(e,e.uint32(),void 0,r+1):e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.compileConfig&&e.hasOwnProperty("compileConfig")){var n=s.sqlanvil.CompileConfig.verify(e.compileConfig,t+1);if(n)return"compileConfig."+n}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.CompileExecutionRequest)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.CompileExecutionRequest;if(null!=e.compileConfig){if("object"!=typeof e.compileConfig)throw TypeError(".sqlanvil.CompileExecutionRequest.compileConfig: object expected");n.compileConfig=s.sqlanvil.CompileConfig.fromObject(e.compileConfig,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.CompileExecutionResponse;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?a.compiledGraph=s.sqlanvil.CompiledGraph.decode(e,e.uint32(),void 0,r+1):e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.compiledGraph&&e.hasOwnProperty("compiledGraph")){var n=s.sqlanvil.CompiledGraph.verify(e.compiledGraph,t+1);if(n)return"compiledGraph."+n}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.CompileExecutionResponse)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.CompileExecutionResponse;if(null!=e.compiledGraph){if("object"!=typeof e.compiledGraph)throw TypeError(".sqlanvil.CompileExecutionResponse.compiledGraph: object expected");n.compiledGraph=s.sqlanvil.CompiledGraph.fromObject(e.compiledGraph,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.Field;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.name=e.string();break;case 6:if(a.flags&&a.flags.length||(a.flags=[]),2==(7&l))for(var c=e.uint32()+e.pos;e.pos<c;)a.flags.push(e.int32());else a.flags.push(e.int32());break;case 7:a.primitive=e.int32();break;case 3:a.struct=s.sqlanvil.Fields.decode(e,e.uint32(),void 0,r+1);break;case 5:a.description=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";var n={};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 r=0;r<e.flags.length;++r)switch(e.flags[r]){default:return"flags: enum value[] expected";case 0:case 1:}}if(null!=e.primitive&&e.hasOwnProperty("primitive"))switch(n.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===n.type)return"type: multiple values";n.type=1;var i=s.sqlanvil.Fields.verify(e.struct,t+1);if(i)return"struct."+i}return null!=e.description&&e.hasOwnProperty("description")&&!a.isString(e.description)?"description: string expected":null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.Field)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.Field;if(null!=e.name&&(n.name=String(e.name)),e.flags){if(!Array.isArray(e.flags))throw TypeError(".sqlanvil.Field.flags: array expected");n.flags=[];for(var r=0;r<e.flags.length;++r)switch(e.flags[r]){default:if("number"==typeof e.flags[r]){n.flags[r]=e.flags[r];break}case"UNKNOWN_FLAG":case 0:n.flags[r]=0;break;case"REPEATED":case 1:n.flags[r]=1}}switch(e.primitive){default:if("number"==typeof e.primitive){n.primitive=e.primitive;break}break;case"UNKNOWN":case 0:n.primitive=0;break;case"INTEGER":case 1:n.primitive=1;break;case"FLOAT":case 2:n.primitive=2;break;case"NUMERIC":case 5:n.primitive=5;break;case"BOOLEAN":case 3:n.primitive=3;break;case"STRING":case 4:n.primitive=4;break;case"DATE":case 6:n.primitive=6;break;case"DATETIME":case 7:n.primitive=7;break;case"TIMESTAMP":case 8:n.primitive=8;break;case"TIME":case 9:n.primitive=9;break;case"BYTES":case 10:n.primitive=10;break;case"ANY":case 11:n.primitive=11;break;case"GEOGRAPHY":case 12:n.primitive=12;break;case"BIGNUMERIC":case 13:n.primitive=13;break;case"JSON":case 14:n.primitive=14;break;case"INTERVAL":case 15:n.primitive=15}if(null!=e.struct){if("object"!=typeof e.struct)throw TypeError(".sqlanvil.Field.struct: object expected");n.struct=s.sqlanvil.Fields.fromObject(e.struct,t+1)}return null!=e.description&&(n.description=String(e.description)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.Fields;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?(a.fields&&a.fields.length||(a.fields=[]),a.fields.push(s.sqlanvil.Field.decode(e,e.uint32(),void 0,r+1))):e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.fields&&e.hasOwnProperty("fields")){if(!Array.isArray(e.fields))return"fields: array expected";for(var n=0;n<e.fields.length;++n){var r=s.sqlanvil.Field.verify(e.fields[n],t+1);if(r)return"fields."+r}}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.Fields)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.Fields;if(e.fields){if(!Array.isArray(e.fields))throw TypeError(".sqlanvil.Fields.fields: array expected");n.fields=[];for(var r=0;r<e.fields.length;++r){if("object"!=typeof e.fields[r])throw TypeError(".sqlanvil.Fields.fields: object expected");n.fields[r]=s.sqlanvil.Field.fromObject(e.fields[r],t+1)}}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.TableMetadata;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.target=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 6:u.type=e.int32();break;case 3:u.fields&&u.fields.length||(u.fields=[]),u.fields.push(s.sqlanvil.Field.decode(e,e.uint32(),void 0,r+1));break;case 5:u.description=e.string();break;case 7:u.labels===a.emptyObject&&(u.labels={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;){var f=e.uint32();switch(f>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.labels,o),u.labels[o]=l;break;case 4:u.lastUpdatedMillis=e.int64();break;case 8:u.bigquery=s.sqlanvil.TableMetadata.BigQuery.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.target&&e.hasOwnProperty("target")&&(r=s.sqlanvil.Target.verify(e.target,t+1)))return"target."+r;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 n=0;n<e.fields.length;++n){var r;if(r=s.sqlanvil.Field.verify(e.fields[n],t+1))return"fields."+r}}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 i=Object.keys(e.labels);for(n=0;n<i.length;++n)if(!a.isString(e.labels[i[n]]))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")&&(r=s.sqlanvil.TableMetadata.BigQuery.verify(e.bigquery,t+1))?"bigquery."+r:null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.TableMetadata)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.TableMetadata;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.TableMetadata.target: object expected");n.target=s.sqlanvil.Target.fromObject(e.target,t+1)}switch(e.type){default:if("number"==typeof e.type){n.type=e.type;break}break;case"UNKNOWN":case 0:n.type=0;break;case"TABLE":case 1:n.type=1;break;case"VIEW":case 2:n.type=2;break;case"MATERIALIZED_VIEW":case 3:n.type=3}if(e.fields){if(!Array.isArray(e.fields))throw TypeError(".sqlanvil.TableMetadata.fields: array expected");n.fields=[];for(var r=0;r<e.fields.length;++r){if("object"!=typeof e.fields[r])throw TypeError(".sqlanvil.TableMetadata.fields: object expected");n.fields[r]=s.sqlanvil.Field.fromObject(e.fields[r],t+1)}}if(null!=e.description&&(n.description=String(e.description)),e.labels){if("object"!=typeof e.labels)throw TypeError(".sqlanvil.TableMetadata.labels: object expected");n.labels={};var i=Object.keys(e.labels);for(r=0;r<i.length;++r)"__proto__"===i[r]&&a.makeProp(n.labels,i[r]),n.labels[i[r]]=String(e.labels[i[r]])}if(null!=e.lastUpdatedMillis&&(a.Long?(n.lastUpdatedMillis=a.Long.fromValue(e.lastUpdatedMillis)).unsigned=!1:"string"==typeof e.lastUpdatedMillis?n.lastUpdatedMillis=parseInt(e.lastUpdatedMillis,10):"number"==typeof e.lastUpdatedMillis?n.lastUpdatedMillis=e.lastUpdatedMillis:"object"==typeof e.lastUpdatedMillis&&(n.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");n.bigquery=s.sqlanvil.TableMetadata.BigQuery.fromObject(e.bigquery,t+1)}return n},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)"__proto__"===n[i]&&a.makeProp(r.labels,n[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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.TableMetadata.BigQuery;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?a.hasStreamingBuffer=e.bool():e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":null!=e.hasStreamingBuffer&&e.hasOwnProperty("hasStreamingBuffer")&&"boolean"!=typeof e.hasStreamingBuffer?"hasStreamingBuffer: boolean expected":null)},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.TableMetadata.BigQuery)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.TableMetadata.BigQuery;return null!=e.hasStreamingBuffer&&(n.hasStreamingBuffer=Boolean(e.hasStreamingBuffer)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ExecutionMetadata;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?a.bigquery=s.sqlanvil.ExecutionMetadata.BigqueryMetadata.decode(e,e.uint32(),void 0,r+1):e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.bigquery&&e.hasOwnProperty("bigquery")){var n=s.sqlanvil.ExecutionMetadata.BigqueryMetadata.verify(e.bigquery,t+1);if(n)return"bigquery."+n}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ExecutionMetadata)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ExecutionMetadata;if(null!=e.bigquery){if("object"!=typeof e.bigquery)throw TypeError(".sqlanvil.ExecutionMetadata.bigquery: object expected");n.bigquery=s.sqlanvil.ExecutionMetadata.BigqueryMetadata.fromObject(e.bigquery,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ExecutionMetadata.BigqueryMetadata;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.jobId=e.string();break;case 2:a.totalBytesProcessed=e.int64();break;case 3:a.totalBytesBilled=e.int64();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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,t){if(e instanceof s.sqlanvil.ExecutionMetadata.BigqueryMetadata)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ExecutionMetadata.BigqueryMetadata;return null!=e.jobId&&(n.jobId=String(e.jobId)),null!=e.totalBytesProcessed&&(a.Long?(n.totalBytesProcessed=a.Long.fromValue(e.totalBytesProcessed)).unsigned=!1:"string"==typeof e.totalBytesProcessed?n.totalBytesProcessed=parseInt(e.totalBytesProcessed,10):"number"==typeof e.totalBytesProcessed?n.totalBytesProcessed=e.totalBytesProcessed:"object"==typeof e.totalBytesProcessed&&(n.totalBytesProcessed=new a.LongBits(e.totalBytesProcessed.low>>>0,e.totalBytesProcessed.high>>>0).toNumber())),null!=e.totalBytesBilled&&(a.Long?(n.totalBytesBilled=a.Long.fromValue(e.totalBytesBilled)).unsigned=!1:"string"==typeof e.totalBytesBilled?n.totalBytesBilled=parseInt(e.totalBytesBilled,10):"number"==typeof e.totalBytesBilled?n.totalBytesBilled=e.totalBytesBilled:"object"==typeof e.totalBytesBilled&&(n.totalBytesBilled=new a.LongBits(e.totalBytesBilled.low>>>0,e.totalBytesBilled.high>>>0).toNumber())),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.QueryEvaluationError;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.message=e.string();break;case 2:a.errorLocation=s.sqlanvil.QueryEvaluationError.ErrorLocation.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.message&&e.hasOwnProperty("message")&&!a.isString(e.message))return"message: string expected";if(null!=e.errorLocation&&e.hasOwnProperty("errorLocation")){var n=s.sqlanvil.QueryEvaluationError.ErrorLocation.verify(e.errorLocation,t+1);if(n)return"errorLocation."+n}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.QueryEvaluationError)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.QueryEvaluationError;if(null!=e.message&&(n.message=String(e.message)),null!=e.errorLocation){if("object"!=typeof e.errorLocation)throw TypeError(".sqlanvil.QueryEvaluationError.errorLocation: object expected");n.errorLocation=s.sqlanvil.QueryEvaluationError.ErrorLocation.fromObject(e.errorLocation,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.QueryEvaluationError.ErrorLocation;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.line=e.int32();break;case 2:a.column=e.int32();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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,t){if(e instanceof s.sqlanvil.QueryEvaluationError.ErrorLocation)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.QueryEvaluationError.ErrorLocation;return null!=e.line&&(n.line=0|e.line),null!=e.column&&(n.column=0|e.column),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.QueryEvaluation;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.status=e.int32();break;case 2:a.error=s.sqlanvil.QueryEvaluationError.decode(e,e.uint32(),void 0,r+1);break;case 3:a.incremental=e.bool();break;case 4:a.query=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=s.sqlanvil.QueryEvaluationError.verify(e.error,t+1);if(n)return"error."+n}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,t){if(e instanceof s.sqlanvil.QueryEvaluation)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.QueryEvaluation;switch(e.status){default:if("number"==typeof e.status){n.status=e.status;break}break;case"SUCCESS":case 0:n.status=0;break;case"FAILURE":case 1:n.status=1}if(null!=e.error){if("object"!=typeof e.error)throw TypeError(".sqlanvil.QueryEvaluation.error: object expected");n.error=s.sqlanvil.QueryEvaluationError.fromObject(e.error,t+1)}return null!=e.incremental&&(n.incremental=Boolean(e.incremental)),null!=e.query&&(n.query=String(e.query)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.RunConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.actions&&a.actions.length||(a.actions=[]),a.actions.push(e.string());break;case 5:a.tags&&a.tags.length||(a.tags=[]),a.tags.push(e.string());break;case 3:a.includeDependencies=e.bool();break;case 11:a.includeDependents=e.bool();break;case 2:a.fullRefresh=e.bool();break;case 7:a.timeoutMillis=e.int32();break;case 9:a.disableSetMetadata=e.bool();break;case 8:a.useRunCache=e.bool();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.actions&&e.hasOwnProperty("actions")){if(!Array.isArray(e.actions))return"actions: array expected";for(var n=0;n<e.actions.length;++n)if(!a.isString(e.actions[n]))return"actions: string[] expected"}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"}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,t){if(e instanceof s.sqlanvil.RunConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.RunConfig;if(e.actions){if(!Array.isArray(e.actions))throw TypeError(".sqlanvil.RunConfig.actions: array expected");n.actions=[];for(var r=0;r<e.actions.length;++r)n.actions[r]=String(e.actions[r])}if(e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.RunConfig.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}return null!=e.includeDependencies&&(n.includeDependencies=Boolean(e.includeDependencies)),null!=e.includeDependents&&(n.includeDependents=Boolean(e.includeDependents)),null!=e.fullRefresh&&(n.fullRefresh=Boolean(e.fullRefresh)),null!=e.timeoutMillis&&(n.timeoutMillis=0|e.timeoutMillis),null!=e.disableSetMetadata&&(n.disableSetMetadata=Boolean(e.disableSetMetadata)),null!=e.useRunCache&&(n.useRunCache=Boolean(e.useRunCache)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ExecutionTask;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.type=e.string();break;case 2:a.statement=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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,t){if(e instanceof s.sqlanvil.ExecutionTask)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ExecutionTask;return null!=e.type&&(n.type=String(e.type)),null!=e.statement&&(n.statement=String(e.statement)),n},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.ExportSpec=function(){function t(e){if(this.options={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&"__proto__"!==t[n]&&(this[t[n]]=e[t[n]])}return t.prototype.query="",t.prototype.location="",t.prototype.format="",t.prototype.overwrite=!1,t.prototype.filename="",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.query&&Object.hasOwnProperty.call(e,"query")&&t.uint32(10).string(e.query),null!=e.location&&Object.hasOwnProperty.call(e,"location")&&t.uint32(18).string(e.location),null!=e.format&&Object.hasOwnProperty.call(e,"format")&&t.uint32(26).string(e.format),null!=e.overwrite&&Object.hasOwnProperty.call(e,"overwrite")&&t.uint32(32).bool(e.overwrite),null!=e.filename&&Object.hasOwnProperty.call(e,"filename")&&t.uint32(42).string(e.filename),null!=e.options&&Object.hasOwnProperty.call(e,"options"))for(var n=Object.keys(e.options),r=0;r<n.length;++r)t.uint32(50).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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.ExportSpec;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.query=e.string();break;case 2:u.location=e.string();break;case 3:u.format=e.string();break;case 4:u.overwrite=e.bool();break;case 5:u.filename=e.string();break;case 6:u.options===a.emptyObject&&(u.options={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;){var f=e.uint32();switch(f>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.options,o),u.options[o]=l;break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.query&&e.hasOwnProperty("query")&&!a.isString(e.query))return"query: string expected";if(null!=e.location&&e.hasOwnProperty("location")&&!a.isString(e.location))return"location: string expected";if(null!=e.format&&e.hasOwnProperty("format")&&!a.isString(e.format))return"format: string expected";if(null!=e.overwrite&&e.hasOwnProperty("overwrite")&&"boolean"!=typeof e.overwrite)return"overwrite: boolean expected";if(null!=e.filename&&e.hasOwnProperty("filename")&&!a.isString(e.filename))return"filename: string expected";if(null!=e.options&&e.hasOwnProperty("options")){if(!a.isObject(e.options))return"options: object expected";for(var n=Object.keys(e.options),r=0;r<n.length;++r)if(!a.isString(e.options[n[r]]))return"options: string{k:string} expected"}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ExportSpec)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ExportSpec;if(null!=e.query&&(n.query=String(e.query)),null!=e.location&&(n.location=String(e.location)),null!=e.format&&(n.format=String(e.format)),null!=e.overwrite&&(n.overwrite=Boolean(e.overwrite)),null!=e.filename&&(n.filename=String(e.filename)),e.options){if("object"!=typeof e.options)throw TypeError(".sqlanvil.ExportSpec.options: object expected");n.options={};for(var r=Object.keys(e.options),i=0;i<r.length;++i)"__proto__"===r[i]&&a.makeProp(n.options,r[i]),n.options[r[i]]=String(e.options[r[i]])}return n},t.toObject=function(e,t){t||(t={});var n,r={};if((t.objects||t.defaults)&&(r.options={}),t.defaults&&(r.query="",r.location="",r.format="",r.overwrite=!1,r.filename=""),null!=e.query&&e.hasOwnProperty("query")&&(r.query=e.query),null!=e.location&&e.hasOwnProperty("location")&&(r.location=e.location),null!=e.format&&e.hasOwnProperty("format")&&(r.format=e.format),null!=e.overwrite&&e.hasOwnProperty("overwrite")&&(r.overwrite=e.overwrite),null!=e.filename&&e.hasOwnProperty("filename")&&(r.filename=e.filename),e.options&&(n=Object.keys(e.options)).length){r.options={};for(var i=0;i<n.length;++i)"__proto__"===n[i]&&a.makeProp(r.options,n[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.ExportSpec"},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]]&&"__proto__"!==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.prototype.export=null,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),null!=e.export&&Object.hasOwnProperty.call(e,"export")&&s.sqlanvil.ExportSpec.encode(e.export,t.uint32(106).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ExecutionAction;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 5:a.target=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 8:a.fileName=e.string();break;case 4:a.type=e.string();break;case 6:a.tableType=e.string();break;case 11:a.dependencyTargets&&a.dependencyTargets.length||(a.dependencyTargets=[]),a.dependencyTargets.push(s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1));break;case 10:a.hermeticity=e.int32();break;case 2:a.tasks&&a.tasks.length||(a.tasks=[]),a.tasks.push(s.sqlanvil.ExecutionTask.decode(e,e.uint32(),void 0,r+1));break;case 9:a.actionDescriptor=s.sqlanvil.ActionDescriptor.decode(e,e.uint32(),void 0,r+1);break;case 12:a.jitCode=e.string();break;case 13:a.export=s.sqlanvil.ExportSpec.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.target&&e.hasOwnProperty("target")&&(r=s.sqlanvil.Target.verify(e.target,t+1)))return"target."+r;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 n=0;n<e.dependencyTargets.length;++n)if(r=s.sqlanvil.Target.verify(e.dependencyTargets[n],t+1))return"dependencyTargets."+r}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(n=0;n<e.tasks.length;++n){var r;if(r=s.sqlanvil.ExecutionTask.verify(e.tasks[n],t+1))return"tasks."+r}}return null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(r=s.sqlanvil.ActionDescriptor.verify(e.actionDescriptor,t+1))?"actionDescriptor."+r:null!=e.jitCode&&e.hasOwnProperty("jitCode")&&!a.isString(e.jitCode)?"jitCode: string expected":null!=e.export&&e.hasOwnProperty("export")&&(r=s.sqlanvil.ExportSpec.verify(e.export,t+1))?"export."+r:null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ExecutionAction)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ExecutionAction;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.ExecutionAction.target: object expected");n.target=s.sqlanvil.Target.fromObject(e.target,t+1)}if(null!=e.fileName&&(n.fileName=String(e.fileName)),null!=e.type&&(n.type=String(e.type)),null!=e.tableType&&(n.tableType=String(e.tableType)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ExecutionAction.dependencyTargets: array expected");n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.ExecutionAction.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.Target.fromObject(e.dependencyTargets[r],t+1)}}switch(e.hermeticity){default:if("number"==typeof e.hermeticity){n.hermeticity=e.hermeticity;break}break;case"UNKNOWN":case 0:n.hermeticity=0;break;case"HERMETIC":case 1:n.hermeticity=1;break;case"NON_HERMETIC":case 2:n.hermeticity=2}if(e.tasks){if(!Array.isArray(e.tasks))throw TypeError(".sqlanvil.ExecutionAction.tasks: array expected");for(n.tasks=[],r=0;r<e.tasks.length;++r){if("object"!=typeof e.tasks[r])throw TypeError(".sqlanvil.ExecutionAction.tasks: object expected");n.tasks[r]=s.sqlanvil.ExecutionTask.fromObject(e.tasks[r],t+1)}}if(null!=e.actionDescriptor){if("object"!=typeof e.actionDescriptor)throw TypeError(".sqlanvil.ExecutionAction.actionDescriptor: object expected");n.actionDescriptor=s.sqlanvil.ActionDescriptor.fromObject(e.actionDescriptor,t+1)}if(null!=e.jitCode&&(n.jitCode=String(e.jitCode)),null!=e.export){if("object"!=typeof e.export)throw TypeError(".sqlanvil.ExecutionAction.export: object expected");n.export=s.sqlanvil.ExportSpec.fromObject(e.export,t+1)}return n},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="",n.export=null),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),null!=e.export&&e.hasOwnProperty("export")&&(n.export=s.sqlanvil.ExportSpec.toObject(e.export,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.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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.WarehouseState;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?(a.tables&&a.tables.length||(a.tables=[]),a.tables.push(s.sqlanvil.TableMetadata.decode(e,e.uint32(),void 0,r+1))):e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.tables&&e.hasOwnProperty("tables")){if(!Array.isArray(e.tables))return"tables: array expected";for(var n=0;n<e.tables.length;++n){var r=s.sqlanvil.TableMetadata.verify(e.tables[n],t+1);if(r)return"tables."+r}}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.WarehouseState)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.WarehouseState;if(e.tables){if(!Array.isArray(e.tables))throw TypeError(".sqlanvil.WarehouseState.tables: array expected");n.tables=[];for(var r=0;r<e.tables.length;++r){if("object"!=typeof e.tables[r])throw TypeError(".sqlanvil.WarehouseState.tables: object expected");n.tables[r]=s.sqlanvil.TableMetadata.fromObject(e.tables[r],t+1)}}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ExecutionGraph;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.projectConfig=s.sqlanvil.ProjectConfig.decode(e,e.uint32(),void 0,r+1);break;case 2:a.runConfig=s.sqlanvil.RunConfig.decode(e,e.uint32(),void 0,r+1);break;case 4:a.warehouseState=s.sqlanvil.WarehouseState.decode(e,e.uint32(),void 0,r+1);break;case 5:a.declarationTargets&&a.declarationTargets.length||(a.declarationTargets=[]),a.declarationTargets.push(s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1));break;case 3:a.actions&&a.actions.length||(a.actions=[]),a.actions.push(s.sqlanvil.ExecutionAction.decode(e,e.uint32(),void 0,r+1));break;case 7:a.jitData=s.google.protobuf.Struct.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.projectConfig&&e.hasOwnProperty("projectConfig")&&(r=s.sqlanvil.ProjectConfig.verify(e.projectConfig,t+1)))return"projectConfig."+r;if(null!=e.runConfig&&e.hasOwnProperty("runConfig")&&(r=s.sqlanvil.RunConfig.verify(e.runConfig,t+1)))return"runConfig."+r;if(null!=e.warehouseState&&e.hasOwnProperty("warehouseState")&&(r=s.sqlanvil.WarehouseState.verify(e.warehouseState,t+1)))return"warehouseState."+r;if(null!=e.declarationTargets&&e.hasOwnProperty("declarationTargets")){if(!Array.isArray(e.declarationTargets))return"declarationTargets: array expected";for(var n=0;n<e.declarationTargets.length;++n)if(r=s.sqlanvil.Target.verify(e.declarationTargets[n],t+1))return"declarationTargets."+r}if(null!=e.actions&&e.hasOwnProperty("actions")){if(!Array.isArray(e.actions))return"actions: array expected";for(n=0;n<e.actions.length;++n){var r;if(r=s.sqlanvil.ExecutionAction.verify(e.actions[n],t+1))return"actions."+r}}return null!=e.jitData&&e.hasOwnProperty("jitData")&&(r=s.google.protobuf.Struct.verify(e.jitData,t+1))?"jitData."+r:null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ExecutionGraph)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ExecutionGraph;if(null!=e.projectConfig){if("object"!=typeof e.projectConfig)throw TypeError(".sqlanvil.ExecutionGraph.projectConfig: object expected");n.projectConfig=s.sqlanvil.ProjectConfig.fromObject(e.projectConfig,t+1)}if(null!=e.runConfig){if("object"!=typeof e.runConfig)throw TypeError(".sqlanvil.ExecutionGraph.runConfig: object expected");n.runConfig=s.sqlanvil.RunConfig.fromObject(e.runConfig,t+1)}if(null!=e.warehouseState){if("object"!=typeof e.warehouseState)throw TypeError(".sqlanvil.ExecutionGraph.warehouseState: object expected");n.warehouseState=s.sqlanvil.WarehouseState.fromObject(e.warehouseState,t+1)}if(e.declarationTargets){if(!Array.isArray(e.declarationTargets))throw TypeError(".sqlanvil.ExecutionGraph.declarationTargets: array expected");n.declarationTargets=[];for(var r=0;r<e.declarationTargets.length;++r){if("object"!=typeof e.declarationTargets[r])throw TypeError(".sqlanvil.ExecutionGraph.declarationTargets: object expected");n.declarationTargets[r]=s.sqlanvil.Target.fromObject(e.declarationTargets[r],t+1)}}if(e.actions){if(!Array.isArray(e.actions))throw TypeError(".sqlanvil.ExecutionGraph.actions: array expected");for(n.actions=[],r=0;r<e.actions.length;++r){if("object"!=typeof e.actions[r])throw TypeError(".sqlanvil.ExecutionGraph.actions: object expected");n.actions[r]=s.sqlanvil.ExecutionAction.fromObject(e.actions[r],t+1)}}if(null!=e.jitData){if("object"!=typeof e.jitData)throw TypeError(".sqlanvil.ExecutionGraph.jitData: object expected");n.jitData=s.google.protobuf.Struct.fromObject(e.jitData,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.Timing;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.startTimeMillis=e.int64();break;case 2:a.endTimeMillis=e.int64();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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,t){if(e instanceof s.sqlanvil.Timing)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.Timing;return null!=e.startTimeMillis&&(a.Long?(n.startTimeMillis=a.Long.fromValue(e.startTimeMillis)).unsigned=!1:"string"==typeof e.startTimeMillis?n.startTimeMillis=parseInt(e.startTimeMillis,10):"number"==typeof e.startTimeMillis?n.startTimeMillis=e.startTimeMillis:"object"==typeof e.startTimeMillis&&(n.startTimeMillis=new a.LongBits(e.startTimeMillis.low>>>0,e.startTimeMillis.high>>>0).toNumber())),null!=e.endTimeMillis&&(a.Long?(n.endTimeMillis=a.Long.fromValue(e.endTimeMillis)).unsigned=!1:"string"==typeof e.endTimeMillis?n.endTimeMillis=parseInt(e.endTimeMillis,10):"number"==typeof e.endTimeMillis?n.endTimeMillis=e.endTimeMillis:"object"==typeof e.endTimeMillis&&(n.endTimeMillis=new a.LongBits(e.endTimeMillis.low>>>0,e.endTimeMillis.high>>>0).toNumber())),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.RunResult;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.status=e.int32();break;case 2:a.actions&&a.actions.length||(a.actions=[]),a.actions.push(s.sqlanvil.ActionResult.decode(e,e.uint32(),void 0,r+1));break;case 3:a.timing=s.sqlanvil.Timing.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.actions.length;++n)if(r=s.sqlanvil.ActionResult.verify(e.actions[n],t+1))return"actions."+r}var r;return null!=e.timing&&e.hasOwnProperty("timing")&&(r=s.sqlanvil.Timing.verify(e.timing,t+1))?"timing."+r:null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.RunResult)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.RunResult;switch(e.status){default:if("number"==typeof e.status){n.status=e.status;break}break;case"UNKNOWN":case 0:n.status=0;break;case"RUNNING":case 1:n.status=1;break;case"SUCCESSFUL":case 2:n.status=2;break;case"FAILED":case 3:n.status=3;break;case"CANCELLED":case 4:n.status=4;break;case"TIMED_OUT":case 5:n.status=5}if(e.actions){if(!Array.isArray(e.actions))throw TypeError(".sqlanvil.RunResult.actions: array expected");n.actions=[];for(var r=0;r<e.actions.length;++r){if("object"!=typeof e.actions[r])throw TypeError(".sqlanvil.RunResult.actions: object expected");n.actions[r]=s.sqlanvil.ActionResult.fromObject(e.actions[r],t+1)}}if(null!=e.timing){if("object"!=typeof e.timing)throw TypeError(".sqlanvil.RunResult.timing: object expected");n.timing=s.sqlanvil.Timing.fromObject(e.timing,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionResult;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 5:a.target=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 2:a.status=e.int32();break;case 3:a.tasks&&a.tasks.length||(a.tasks=[]),a.tasks.push(s.sqlanvil.TaskResult.decode(e,e.uint32(),void 0,r+1));break;case 4:a.timing=s.sqlanvil.Timing.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.target&&e.hasOwnProperty("target")&&(r=s.sqlanvil.Target.verify(e.target,t+1)))return"target."+r;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 n=0;n<e.tasks.length;++n){var r;if(r=s.sqlanvil.TaskResult.verify(e.tasks[n],t+1))return"tasks."+r}}return null!=e.timing&&e.hasOwnProperty("timing")&&(r=s.sqlanvil.Timing.verify(e.timing,t+1))?"timing."+r:null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionResult)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionResult;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.ActionResult.target: object expected");n.target=s.sqlanvil.Target.fromObject(e.target,t+1)}switch(e.status){default:if("number"==typeof e.status){n.status=e.status;break}break;case"UNKNOWN":case 0:n.status=0;break;case"RUNNING":case 1:n.status=1;break;case"SUCCESSFUL":case 2:n.status=2;break;case"FAILED":case 3:n.status=3;break;case"SKIPPED":case 4:n.status=4;break;case"DISABLED":case 5:n.status=5;break;case"CANCELLED":case 6:n.status=6}if(e.tasks){if(!Array.isArray(e.tasks))throw TypeError(".sqlanvil.ActionResult.tasks: array expected");n.tasks=[];for(var r=0;r<e.tasks.length;++r){if("object"!=typeof e.tasks[r])throw TypeError(".sqlanvil.ActionResult.tasks: object expected");n.tasks[r]=s.sqlanvil.TaskResult.fromObject(e.tasks[r],t+1)}}if(null!=e.timing){if("object"!=typeof e.timing)throw TypeError(".sqlanvil.ActionResult.timing: object expected");n.timing=s.sqlanvil.Timing.fromObject(e.timing,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.TaskResult;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.status=e.int32();break;case 2:a.errorMessage=e.string();break;case 3:a.timing=s.sqlanvil.Timing.decode(e,e.uint32(),void 0,r+1);break;case 4:a.metadata=s.sqlanvil.ExecutionMetadata.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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")&&(n=s.sqlanvil.Timing.verify(e.timing,t+1))?"timing."+n:null!=e.metadata&&e.hasOwnProperty("metadata")&&(n=s.sqlanvil.ExecutionMetadata.verify(e.metadata,t+1))?"metadata."+n:null;var n},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.TaskResult)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.TaskResult;switch(e.status){default:if("number"==typeof e.status){n.status=e.status;break}break;case"UNKNOWN":case 0:n.status=0;break;case"RUNNING":case 1:n.status=1;break;case"SUCCESSFUL":case 2:n.status=2;break;case"FAILED":case 3:n.status=3;break;case"SKIPPED":case 4:n.status=4;break;case"CANCELLED":case 5:n.status=5}if(null!=e.errorMessage&&(n.errorMessage=String(e.errorMessage)),null!=e.timing){if("object"!=typeof e.timing)throw TypeError(".sqlanvil.TaskResult.timing: object expected");n.timing=s.sqlanvil.Timing.fromObject(e.timing,t+1)}if(null!=e.metadata){if("object"!=typeof e.metadata)throw TypeError(".sqlanvil.TaskResult.metadata: object expected");n.metadata=s.sqlanvil.ExecutionMetadata.fromObject(e.metadata,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.TestResult;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.name=e.string();break;case 2:a.successful=e.bool();break;case 3:a.messages&&a.messages.length||(a.messages=[]),a.messages.push(e.string());break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.messages.length;++n)if(!a.isString(e.messages[n]))return"messages: string[] expected"}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.TestResult)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.TestResult;if(null!=e.name&&(n.name=String(e.name)),null!=e.successful&&(n.successful=Boolean(e.successful)),e.messages){if(!Array.isArray(e.messages))throw TypeError(".sqlanvil.TestResult.messages: array expected");n.messages=[];for(var r=0;r<e.messages.length;++r)n.messages[r]=String(e.messages[r])}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ExecuteRequest;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.statement=e.string();break;case 2:a.rowLimit=e.int64();break;case 3:a.byteLimit=e.int64();break;case 4:a.fetchResults=e.bool();break;case 5:a.bigQueryOptions=s.sqlanvil.BigQueryExecuteOptions.decode(e,e.uint32(),void 0,r+1);break;case 6:a.params=s.google.protobuf.Struct.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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")&&(n=s.sqlanvil.BigQueryExecuteOptions.verify(e.bigQueryOptions,t+1))?"bigQueryOptions."+n:null!=e.params&&e.hasOwnProperty("params")&&(n=s.google.protobuf.Struct.verify(e.params,t+1))?"params."+n:null);var n},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ExecuteRequest)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ExecuteRequest;if(null!=e.statement&&(n.statement=String(e.statement)),null!=e.rowLimit&&(a.Long?(n.rowLimit=a.Long.fromValue(e.rowLimit)).unsigned=!1:"string"==typeof e.rowLimit?n.rowLimit=parseInt(e.rowLimit,10):"number"==typeof e.rowLimit?n.rowLimit=e.rowLimit:"object"==typeof e.rowLimit&&(n.rowLimit=new a.LongBits(e.rowLimit.low>>>0,e.rowLimit.high>>>0).toNumber())),null!=e.byteLimit&&(a.Long?(n.byteLimit=a.Long.fromValue(e.byteLimit)).unsigned=!1:"string"==typeof e.byteLimit?n.byteLimit=parseInt(e.byteLimit,10):"number"==typeof e.byteLimit?n.byteLimit=e.byteLimit:"object"==typeof e.byteLimit&&(n.byteLimit=new a.LongBits(e.byteLimit.low>>>0,e.byteLimit.high>>>0).toNumber())),null!=e.fetchResults&&(n.fetchResults=Boolean(e.fetchResults)),null!=e.bigQueryOptions){if("object"!=typeof e.bigQueryOptions)throw TypeError(".sqlanvil.ExecuteRequest.bigQueryOptions: object expected");n.bigQueryOptions=s.sqlanvil.BigQueryExecuteOptions.fromObject(e.bigQueryOptions,t+1)}if(null!=e.params){if("object"!=typeof e.params)throw TypeError(".sqlanvil.ExecuteRequest.params: object expected");n.params=s.google.protobuf.Struct.fromObject(e.params,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.BigQueryExecuteOptions;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.interactive=e.bool();break;case 2:u.useLegacySql=e.bool();break;case 3:u.labels===a.emptyObject&&(u.labels={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;){var f=e.uint32();switch(f>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.labels,o),u.labels[o]=l;break;case 4:u.location=e.string();break;case 5:u.jobPrefix=e.string();break;case 6:u.dryRun=e.bool();break;case 7:u.reservation=e.string();break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=Object.keys(e.labels),r=0;r<n.length;++r)if(!a.isString(e.labels[n[r]]))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,t){if(e instanceof s.sqlanvil.BigQueryExecuteOptions)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.BigQueryExecuteOptions;if(null!=e.interactive&&(n.interactive=Boolean(e.interactive)),null!=e.useLegacySql&&(n.useLegacySql=Boolean(e.useLegacySql)),e.labels){if("object"!=typeof e.labels)throw TypeError(".sqlanvil.BigQueryExecuteOptions.labels: object expected");n.labels={};for(var r=Object.keys(e.labels),i=0;i<r.length;++i)"__proto__"===r[i]&&a.makeProp(n.labels,r[i]),n.labels[r[i]]=String(e.labels[r[i]])}return null!=e.location&&(n.location=String(e.location)),null!=e.jobPrefix&&(n.jobPrefix=String(e.jobPrefix)),null!=e.dryRun&&(n.dryRun=Boolean(e.dryRun)),null!=e.reservation&&(n.reservation=String(e.reservation)),n},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)"__proto__"===n[i]&&a.makeProp(r.labels,n[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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ExecuteResponse;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.executionMetadata=s.sqlanvil.ExecutionMetadata.decode(e,e.uint32(),void 0,r+1);break;case 2:a.rows&&a.rows.length||(a.rows=[]),a.rows.push(s.google.protobuf.Struct.decode(e,e.uint32(),void 0,r+1));break;case 3:a.errors&&a.errors.length||(a.errors=[]),a.errors.push(e.string());break;case 4:a.schemaFields&&a.schemaFields.length||(a.schemaFields=[]),a.schemaFields.push(s.sqlanvil.Field.decode(e,e.uint32(),void 0,r+1));break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.executionMetadata&&e.hasOwnProperty("executionMetadata")&&(r=s.sqlanvil.ExecutionMetadata.verify(e.executionMetadata,t+1)))return"executionMetadata."+r;if(null!=e.rows&&e.hasOwnProperty("rows")){if(!Array.isArray(e.rows))return"rows: array expected";for(var n=0;n<e.rows.length;++n)if(r=s.google.protobuf.Struct.verify(e.rows[n],t+1))return"rows."+r}if(null!=e.errors&&e.hasOwnProperty("errors")){if(!Array.isArray(e.errors))return"errors: array expected";for(n=0;n<e.errors.length;++n)if(!a.isString(e.errors[n]))return"errors: string[] expected"}if(null!=e.schemaFields&&e.hasOwnProperty("schemaFields")){if(!Array.isArray(e.schemaFields))return"schemaFields: array expected";for(n=0;n<e.schemaFields.length;++n){var r;if(r=s.sqlanvil.Field.verify(e.schemaFields[n],t+1))return"schemaFields."+r}}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ExecuteResponse)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ExecuteResponse;if(null!=e.executionMetadata){if("object"!=typeof e.executionMetadata)throw TypeError(".sqlanvil.ExecuteResponse.executionMetadata: object expected");n.executionMetadata=s.sqlanvil.ExecutionMetadata.fromObject(e.executionMetadata,t+1)}if(e.rows){if(!Array.isArray(e.rows))throw TypeError(".sqlanvil.ExecuteResponse.rows: array expected");n.rows=[];for(var r=0;r<e.rows.length;++r){if("object"!=typeof e.rows[r])throw TypeError(".sqlanvil.ExecuteResponse.rows: object expected");n.rows[r]=s.google.protobuf.Struct.fromObject(e.rows[r],t+1)}}if(e.errors){if(!Array.isArray(e.errors))throw TypeError(".sqlanvil.ExecuteResponse.errors: array expected");for(n.errors=[],r=0;r<e.errors.length;++r)n.errors[r]=String(e.errors[r])}if(e.schemaFields){if(!Array.isArray(e.schemaFields))throw TypeError(".sqlanvil.ExecuteResponse.schemaFields: array expected");for(n.schemaFields=[],r=0;r<e.schemaFields.length;++r){if("object"!=typeof e.schemaFields[r])throw TypeError(".sqlanvil.ExecuteResponse.schemaFields: object expected");n.schemaFields[r]=s.sqlanvil.Field.fromObject(e.schemaFields[r],t+1)}}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ListTablesRequest;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.database=e.string();break;case 2:a.schema=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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,t){if(e instanceof s.sqlanvil.ListTablesRequest)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ListTablesRequest;return null!=e.database&&(n.database=String(e.database)),null!=e.schema&&(n.schema=String(e.schema)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ListTablesResponse;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?(a.tables&&a.tables.length||(a.tables=[]),a.tables.push(s.sqlanvil.TableMetadata.decode(e,e.uint32(),void 0,r+1))):e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.tables&&e.hasOwnProperty("tables")){if(!Array.isArray(e.tables))return"tables: array expected";for(var n=0;n<e.tables.length;++n){var r=s.sqlanvil.TableMetadata.verify(e.tables[n],t+1);if(r)return"tables."+r}}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ListTablesResponse)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ListTablesResponse;if(e.tables){if(!Array.isArray(e.tables))throw TypeError(".sqlanvil.ListTablesResponse.tables: array expected");n.tables=[];for(var r=0;r<e.tables.length;++r){if("object"!=typeof e.tables[r])throw TypeError(".sqlanvil.ListTablesResponse.tables: object expected");n.tables[r]=s.sqlanvil.TableMetadata.fromObject(e.tables[r],t+1)}}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.GetTableRequest;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?a.target=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1):e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.target&&e.hasOwnProperty("target")){var n=s.sqlanvil.Target.verify(e.target,t+1);if(n)return"target."+n}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.GetTableRequest)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.GetTableRequest;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.GetTableRequest.target: object expected");n.target=s.sqlanvil.Target.fromObject(e.target,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.DeleteTableRequest;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?a.target=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1):e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.target&&e.hasOwnProperty("target")){var n=s.sqlanvil.Target.verify(e.target,t+1);if(n)return"target."+n}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.DeleteTableRequest)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.DeleteTableRequest;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.DeleteTableRequest.target: object expected");n.target=s.sqlanvil.Target.fromObject(e.target,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.RunningExecutionData;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.runTargets&&a.runTargets.length||(a.runTargets=[]),a.runTargets.push(s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1));break;case 2:a.executionId=e.string();break;case 3:a.executionStartTime=s.google.protobuf.Timestamp.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.runTargets&&e.hasOwnProperty("runTargets")){if(!Array.isArray(e.runTargets))return"runTargets: array expected";for(var n=0;n<e.runTargets.length;++n)if(r=s.sqlanvil.Target.verify(e.runTargets[n],t+1))return"runTargets."+r}return null!=e.executionId&&e.hasOwnProperty("executionId")&&!a.isString(e.executionId)?"executionId: string expected":null!=e.executionStartTime&&e.hasOwnProperty("executionStartTime")&&(r=s.google.protobuf.Timestamp.verify(e.executionStartTime,t+1))?"executionStartTime."+r:null;var r},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.RunningExecutionData)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.RunningExecutionData;if(e.runTargets){if(!Array.isArray(e.runTargets))throw TypeError(".sqlanvil.RunningExecutionData.runTargets: array expected");n.runTargets=[];for(var r=0;r<e.runTargets.length;++r){if("object"!=typeof e.runTargets[r])throw TypeError(".sqlanvil.RunningExecutionData.runTargets: object expected");n.runTargets[r]=s.sqlanvil.Target.fromObject(e.runTargets[r],t+1)}}if(null!=e.executionId&&(n.executionId=String(e.executionId)),null!=e.executionStartTime){if("object"!=typeof e.executionStartTime)throw TypeError(".sqlanvil.RunningExecutionData.executionStartTime: object expected");n.executionStartTime=s.google.protobuf.Timestamp.fromObject(e.executionStartTime,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.JitCompilationRequest;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.target=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 2:a.dependencies&&a.dependencies.length||(a.dependencies=[]),a.dependencies.push(s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1));break;case 3:a.jitCode=e.string();break;case 4:a.jitData=s.google.protobuf.Struct.decode(e,e.uint32(),void 0,r+1);break;case 5:a.compilationTargetType=e.int32();break;case 6:a.filePaths&&a.filePaths.length||(a.filePaths=[]),a.filePaths.push(e.string());break;case 7:a.executionData=s.sqlanvil.RunningExecutionData.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.target&&e.hasOwnProperty("target")&&(r=s.sqlanvil.Target.verify(e.target,t+1)))return"target."+r;if(null!=e.dependencies&&e.hasOwnProperty("dependencies")){if(!Array.isArray(e.dependencies))return"dependencies: array expected";for(var n=0;n<e.dependencies.length;++n){var r;if(r=s.sqlanvil.Target.verify(e.dependencies[n],t+1))return"dependencies."+r}}if(null!=e.jitCode&&e.hasOwnProperty("jitCode")&&!a.isString(e.jitCode))return"jitCode: string expected";if(null!=e.jitData&&e.hasOwnProperty("jitData")&&(r=s.google.protobuf.Struct.verify(e.jitData,t+1)))return"jitData."+r;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(n=0;n<e.filePaths.length;++n)if(!a.isString(e.filePaths[n]))return"filePaths: string[] expected"}return null!=e.executionData&&e.hasOwnProperty("executionData")&&(r=s.sqlanvil.RunningExecutionData.verify(e.executionData,t+1))?"executionData."+r:null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.JitCompilationRequest)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.JitCompilationRequest;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.JitCompilationRequest.target: object expected");n.target=s.sqlanvil.Target.fromObject(e.target,t+1)}if(e.dependencies){if(!Array.isArray(e.dependencies))throw TypeError(".sqlanvil.JitCompilationRequest.dependencies: array expected");n.dependencies=[];for(var r=0;r<e.dependencies.length;++r){if("object"!=typeof e.dependencies[r])throw TypeError(".sqlanvil.JitCompilationRequest.dependencies: object expected");n.dependencies[r]=s.sqlanvil.Target.fromObject(e.dependencies[r],t+1)}}if(null!=e.jitCode&&(n.jitCode=String(e.jitCode)),null!=e.jitData){if("object"!=typeof e.jitData)throw TypeError(".sqlanvil.JitCompilationRequest.jitData: object expected");n.jitData=s.google.protobuf.Struct.fromObject(e.jitData,t+1)}switch(e.compilationTargetType){default:if("number"==typeof e.compilationTargetType){n.compilationTargetType=e.compilationTargetType;break}break;case"JIT_COMPILATION_TARGET_TYPE_UNSPECIFIED":case 0:n.compilationTargetType=0;break;case"JIT_COMPILATION_TARGET_TYPE_TABLE":case 1:n.compilationTargetType=1;break;case"JIT_COMPILATION_TARGET_TYPE_OPERATION":case 2:n.compilationTargetType=2;break;case"JIT_COMPILATION_TARGET_TYPE_INCREMENTAL_TABLE":case 3:n.compilationTargetType=3;break;case"JIT_COMPILATION_TARGET_TYPE_ASSERTION":case 4:n.compilationTargetType=4}if(e.filePaths){if(!Array.isArray(e.filePaths))throw TypeError(".sqlanvil.JitCompilationRequest.filePaths: array expected");for(n.filePaths=[],r=0;r<e.filePaths.length;++r)n.filePaths[r]=String(e.filePaths[r])}if(null!=e.executionData){if("object"!=typeof e.executionData)throw TypeError(".sqlanvil.JitCompilationRequest.executionData: object expected");n.executionData=s.sqlanvil.RunningExecutionData.fromObject(e.executionData,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.JitCompilationResponse;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.table=s.sqlanvil.JitTableResult.decode(e,e.uint32(),void 0,r+1);break;case 2:a.operation=s.sqlanvil.JitOperationResult.decode(e,e.uint32(),void 0,r+1);break;case 3:a.incrementalTable=s.sqlanvil.JitIncrementalTableResult.decode(e,e.uint32(),void 0,r+1);break;case 4:a.assertion=s.sqlanvil.JitAssertionResult.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";var n={};if(null!=e.table&&e.hasOwnProperty("table")&&(n.response=1,r=s.sqlanvil.JitTableResult.verify(e.table,t+1)))return"table."+r;if(null!=e.operation&&e.hasOwnProperty("operation")){if(1===n.response)return"response: multiple values";if(n.response=1,r=s.sqlanvil.JitOperationResult.verify(e.operation,t+1))return"operation."+r}if(null!=e.incrementalTable&&e.hasOwnProperty("incrementalTable")){if(1===n.response)return"response: multiple values";if(n.response=1,r=s.sqlanvil.JitIncrementalTableResult.verify(e.incrementalTable,t+1))return"incrementalTable."+r}if(null!=e.assertion&&e.hasOwnProperty("assertion")){if(1===n.response)return"response: multiple values";var r;if(n.response=1,r=s.sqlanvil.JitAssertionResult.verify(e.assertion,t+1))return"assertion."+r}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.JitCompilationResponse)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.JitCompilationResponse;if(null!=e.table){if("object"!=typeof e.table)throw TypeError(".sqlanvil.JitCompilationResponse.table: object expected");n.table=s.sqlanvil.JitTableResult.fromObject(e.table,t+1)}if(null!=e.operation){if("object"!=typeof e.operation)throw TypeError(".sqlanvil.JitCompilationResponse.operation: object expected");n.operation=s.sqlanvil.JitOperationResult.fromObject(e.operation,t+1)}if(null!=e.incrementalTable){if("object"!=typeof e.incrementalTable)throw TypeError(".sqlanvil.JitCompilationResponse.incrementalTable: object expected");n.incrementalTable=s.sqlanvil.JitIncrementalTableResult.fromObject(e.incrementalTable,t+1)}if(null!=e.assertion){if("object"!=typeof e.assertion)throw TypeError(".sqlanvil.JitCompilationResponse.assertion: object expected");n.assertion=s.sqlanvil.JitAssertionResult.fromObject(e.assertion,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.JitTableResult;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.query=e.string();break;case 3:a.preOps&&a.preOps.length||(a.preOps=[]),a.preOps.push(e.string());break;case 4:a.postOps&&a.postOps.length||(a.postOps=[]),a.postOps.push(e.string());break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.preOps.length;++n)if(!a.isString(e.preOps[n]))return"preOps: string[] expected"}if(null!=e.postOps&&e.hasOwnProperty("postOps")){if(!Array.isArray(e.postOps))return"postOps: array expected";for(n=0;n<e.postOps.length;++n)if(!a.isString(e.postOps[n]))return"postOps: string[] expected"}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.JitTableResult)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.JitTableResult;if(null!=e.query&&(n.query=String(e.query)),e.preOps){if(!Array.isArray(e.preOps))throw TypeError(".sqlanvil.JitTableResult.preOps: array expected");n.preOps=[];for(var r=0;r<e.preOps.length;++r)n.preOps[r]=String(e.preOps[r])}if(e.postOps){if(!Array.isArray(e.postOps))throw TypeError(".sqlanvil.JitTableResult.postOps: array expected");for(n.postOps=[],r=0;r<e.postOps.length;++r)n.postOps[r]=String(e.postOps[r])}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.JitIncrementalTableResult;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.regular=s.sqlanvil.JitTableResult.decode(e,e.uint32(),void 0,r+1);break;case 2:a.incremental=s.sqlanvil.JitTableResult.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":null!=e.regular&&e.hasOwnProperty("regular")&&(n=s.sqlanvil.JitTableResult.verify(e.regular,t+1))?"regular."+n:null!=e.incremental&&e.hasOwnProperty("incremental")&&(n=s.sqlanvil.JitTableResult.verify(e.incremental,t+1))?"incremental."+n:null);var n},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.JitIncrementalTableResult)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.JitIncrementalTableResult;if(null!=e.regular){if("object"!=typeof e.regular)throw TypeError(".sqlanvil.JitIncrementalTableResult.regular: object expected");n.regular=s.sqlanvil.JitTableResult.fromObject(e.regular,t+1)}if(null!=e.incremental){if("object"!=typeof e.incremental)throw TypeError(".sqlanvil.JitIncrementalTableResult.incremental: object expected");n.incremental=s.sqlanvil.JitTableResult.fromObject(e.incremental,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.JitOperationResult;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?(a.queries&&a.queries.length||(a.queries=[]),a.queries.push(e.string())):e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.queries&&e.hasOwnProperty("queries")){if(!Array.isArray(e.queries))return"queries: array expected";for(var n=0;n<e.queries.length;++n)if(!a.isString(e.queries[n]))return"queries: string[] expected"}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.JitOperationResult)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.JitOperationResult;if(e.queries){if(!Array.isArray(e.queries))throw TypeError(".sqlanvil.JitOperationResult.queries: array expected");n.queries=[];for(var r=0;r<e.queries.length;++r)n.queries[r]=String(e.queries[r])}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.JitAssertionResult;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?a.query=e.string():e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":null!=e.query&&e.hasOwnProperty("query")&&!a.isString(e.query)?"query: string expected":null)},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.JitAssertionResult)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.JitAssertionResult;return null!=e.query&&(n.query=String(e.query)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.BigQuery;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.projectId=e.string();break;case 3:a.credentials=e.string();break;case 4:a.location=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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,t){if(e instanceof s.sqlanvil.BigQuery)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.BigQuery;return null!=e.projectId&&(n.projectId=String(e.projectId)),null!=e.credentials&&(n.credentials=String(e.credentials)),null!=e.location&&(n.location=String(e.location)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.google.protobuf.Struct;e.pos<c;){var p=e.uint32();if(p===n)break;if(p>>>3==1){u.fields===a.emptyObject&&(u.fields={});var d=e.uint32()+e.pos;for(o="",l=null;e.pos<d;){var f=e.uint32();switch(f>>>3){case 1:o=e.string();break;case 2:l=s.google.protobuf.Value.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.fields,o),u.fields[o]=l}else e.skipType(7&p,r)}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.fields&&e.hasOwnProperty("fields")){if(!a.isObject(e.fields))return"fields: object expected";for(var n=Object.keys(e.fields),r=0;r<n.length;++r){var i=s.google.protobuf.Value.verify(e.fields[n[r]],t+1);if(i)return"fields."+i}}return null},t.fromObject=function(e,t){if(e instanceof s.google.protobuf.Struct)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.google.protobuf.Struct;if(e.fields){if("object"!=typeof e.fields)throw TypeError(".google.protobuf.Struct.fields: object expected");n.fields={};for(var r=Object.keys(e.fields),i=0;i<r.length;++i){if("__proto__"===r[i]&&a.makeProp(n.fields,r[i]),"object"!=typeof e.fields[r[i]])throw TypeError(".google.protobuf.Struct.fields: object expected");n.fields[r[i]]=s.google.protobuf.Value.fromObject(e.fields[r[i]],t+1)}}return n},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)"__proto__"===n[i]&&a.makeProp(r.fields,n[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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.google.protobuf.Value;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.nullValue=e.int32();break;case 2:a.numberValue=e.double();break;case 3:a.stringValue=e.string();break;case 4:a.boolValue=e.bool();break;case 5:a.structValue=s.google.protobuf.Struct.decode(e,e.uint32(),void 0,r+1);break;case 6:a.listValue=s.google.protobuf.ListValue.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";var n={};if(null!=e.nullValue&&e.hasOwnProperty("nullValue")&&(n.kind=1,0!==e.nullValue))return"nullValue: enum value expected";if(null!=e.numberValue&&e.hasOwnProperty("numberValue")){if(1===n.kind)return"kind: multiple values";if(n.kind=1,"number"!=typeof e.numberValue)return"numberValue: number expected"}if(null!=e.stringValue&&e.hasOwnProperty("stringValue")){if(1===n.kind)return"kind: multiple values";if(n.kind=1,!a.isString(e.stringValue))return"stringValue: string expected"}if(null!=e.boolValue&&e.hasOwnProperty("boolValue")){if(1===n.kind)return"kind: multiple values";if(n.kind=1,"boolean"!=typeof e.boolValue)return"boolValue: boolean expected"}if(null!=e.structValue&&e.hasOwnProperty("structValue")){if(1===n.kind)return"kind: multiple values";if(n.kind=1,r=s.google.protobuf.Struct.verify(e.structValue,t+1))return"structValue."+r}if(null!=e.listValue&&e.hasOwnProperty("listValue")){if(1===n.kind)return"kind: multiple values";var r;if(n.kind=1,r=s.google.protobuf.ListValue.verify(e.listValue,t+1))return"listValue."+r}return null},t.fromObject=function(e,t){if(e instanceof s.google.protobuf.Value)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.google.protobuf.Value;switch(e.nullValue){default:if("number"==typeof e.nullValue){n.nullValue=e.nullValue;break}break;case"NULL_VALUE":case 0:n.nullValue=0}if(null!=e.numberValue&&(n.numberValue=Number(e.numberValue)),null!=e.stringValue&&(n.stringValue=String(e.stringValue)),null!=e.boolValue&&(n.boolValue=Boolean(e.boolValue)),null!=e.structValue){if("object"!=typeof e.structValue)throw TypeError(".google.protobuf.Value.structValue: object expected");n.structValue=s.google.protobuf.Struct.fromObject(e.structValue,t+1)}if(null!=e.listValue){if("object"!=typeof e.listValue)throw TypeError(".google.protobuf.Value.listValue: object expected");n.listValue=s.google.protobuf.ListValue.fromObject(e.listValue,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.google.protobuf.ListValue;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?(a.values&&a.values.length||(a.values=[]),a.values.push(s.google.protobuf.Value.decode(e,e.uint32(),void 0,r+1))):e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.values&&e.hasOwnProperty("values")){if(!Array.isArray(e.values))return"values: array expected";for(var n=0;n<e.values.length;++n){var r=s.google.protobuf.Value.verify(e.values[n],t+1);if(r)return"values."+r}}return null},t.fromObject=function(e,t){if(e instanceof s.google.protobuf.ListValue)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.google.protobuf.ListValue;if(e.values){if(!Array.isArray(e.values))throw TypeError(".google.protobuf.ListValue.values: array expected");n.values=[];for(var r=0;r<e.values.length;++r){if("object"!=typeof e.values[r])throw TypeError(".google.protobuf.ListValue.values: object expected");n.values[r]=s.google.protobuf.Value.fromObject(e.values[r],t+1)}}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.google.protobuf.Empty;e.pos<o;){var l=e.uint32();if(l===n)break;e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":null)},t.fromObject=function(e,t){if(e instanceof s.google.protobuf.Empty)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");return 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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.google.protobuf.Timestamp;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.seconds=e.int64();break;case 2:a.nanos=e.int32();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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,t){if(e instanceof s.google.protobuf.Timestamp)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.google.protobuf.Timestamp;return null!=e.seconds&&(a.Long?(n.seconds=a.Long.fromValue(e.seconds)).unsigned=!1:"string"==typeof e.seconds?n.seconds=parseInt(e.seconds,10):"number"==typeof e.seconds?n.seconds=e.seconds:"object"==typeof e.seconds&&(n.seconds=new a.LongBits(e.seconds.low>>>0,e.seconds.high>>>0).toNumber())),null!=e.nanos&&(n.nanos=0|e.nanos),n},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)]})},5572(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),c=["parquet","csv","json"];class u extends o.ActionBuilder{constructor(e,t,n){if(super(e),this.dependOnDependencyAssertions=!1,this.proto=l.sqlanvil.Export.create(),this.session=e,!t)return;const r=this.verifyConfig(t);r.name||(r.name=a.basename(r.filename));const i=s.actionConfigToCompiledGraphTarget(r);this.proto.target=this.applySessionToTarget(i,e.projectConfig,r.filename,{validateTarget:!0}),this.proto.canonicalTarget=this.applySessionToTarget(i,e.canonicalProjectConfig),r.dependencyTargets&&this.dependencies(r.dependencyTargets.map((e=>s.configTargetToCompiledGraphTarget(l.sqlanvil.ActionConfig.Target.create(e))))),void 0!==r.hermetic&&this.hermetic(r.hermetic),r.disabled&&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);const o=r.export||l.sqlanvil.ActionConfig.ExportOptions.create();return this.proto.location=o.location||"",this.proto.format=(o.format||"").toLowerCase(),this.proto.overwrite=!t.export||!t.export.hasOwnProperty("overwrite")||!!o.overwrite,this.proto.filename=o.filename||this.proto.target.name,o.options&&(this.proto.options=o.options),this}query(e){return this.contextableQuery=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}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||(this.proto.actionDescriptor={}),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}),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}),this}getFileName(){return this.proto.fileName}getTarget(){return l.sqlanvil.Target.create(this.proto.target)}compile(){const e=new p(this);return this.proto.query=e.apply(this.contextableQuery),this.validate(),i.verifyObjectMatchesProto(l.sqlanvil.Export,this.proto,i.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM)}validate(){const e=this.proto.fileName;if(this.proto.location){if(c.includes(this.proto.format)||this.session.compileError(new Error(`Invalid export format "${this.proto.format}". Valid formats: ${c.join(", ")}.`),e),"bigquery"===(this.session.projectConfig.warehouse||"bigquery").toLowerCase()&&!this.proto.location.startsWith("gs://")){const t=this.proto.location.includes("://")?`${this.proto.location.split("://")[0]}://`:"a local path";this.session.compileError(new Error(`BigQuery exports support only gs:// destinations; got ${t}.`),e)}}else this.session.compileError(new Error("Export actions require a `location` in the export config."),e)}verifyConfig(e){return e.type&&delete e.type,i.verifyObjectMatchesProto(l.sqlanvil.ActionConfig.ExportConfig,e,i.VerifyProtoErrorBehaviour.SHOW_DOCS_LINK)}}t.Export=u;class p{constructor(e){this.exportAction=e}self(){return this.resolve(this.exportAction.getTarget())}name(){return this.exportAction.session.finalizeName(this.exportAction.getTarget().name)}ref(e,...t){return e=s.toResolvable(e,t),s.resolvableAsTarget(e)?(this.exportAction.dependencies(e),this.resolve(e)):(this.exportAction.session.compileError(new Error("Action name is not specified")),"")}resolve(e,...t){return this.exportAction.session.resolve(e,...t)}schema(){return this.exportAction.session.finalizeSchema(this.exportAction.getTarget().schema)}database(){return this.exportAction.getTarget().database?this.exportAction.session.finalizeDatabase(this.exportAction.getTarget().database):(this.exportAction.session.compileError(new Error("Warehouse does not support multiple databases")),"")}dependencies(e){return this.exportAction.dependencies(e),""}tags(e){return this.exportAction.tags(e),""}hasOutput(e){return""}when(e,t,n=""){return e?t:n}apply(e){return"function"==typeof e?e(this):e}}t.ExportContext=p},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)"__proto__"!==s[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("__proto__"===e)return this;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 d(){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 f(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(f(this.buf,this.pos+=4),f(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 f(this.buf,this.pos+=4)},l.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|f(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.recursionLimit=i.recursionLimit,l.prototype.skipType=function(e,t){if(void 0===t&&(t=0),t>l.recursionLimit)throw Error("maximum nesting depth exceeded");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,t+1);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 d.call(this)[t](!1)},uint64:function(){return d.call(this)[t](!0)},sint64:function(){return d.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,t){if(e&&e["@type"]){var n=e["@type"].substring(e["@type"].lastIndexOf("/")+1),r=this.lookup(n);if(r){var i="."===e["@type"].charAt(0)?e["@type"].slice(1):e["@type"];-1===i.indexOf("/")&&(i="/"+i);var o=void 0===t?1:t+1;return this.create({type_url:i,value:r.encode(r.fromObject(e,o)).finish()})}}return this.fromObject(e,t)},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(5572),d=n(1299),f=n(2795),g=n(9293),h=n(2008),y=n(4098),m=n(8995),b=n(1287),v=n(3162),O=i(n(2545)),T=n(2545),w=n(2628),j=n(5379),x={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 T.ResolvableMap,this.init(e,t,n)}init(e,t,n){this.rootDir=e,this.projectConfig=j.sqlanvil.ProjectConfig.create(t||x),this.canonicalProjectConfig=function(e){return j.sqlanvil.ProjectConfig.create({warehouse:e.warehouse,defaultSchema:e.defaultSchema,defaultDatabase:e.defaultDatabase,assertionSchema:e.assertionSchema})}(j.sqlanvil.ProjectConfig.create(n||t||x)),this.actions=[],this.foreignServers=new Set,this.tests=[],this.graphErrors={compilationErrors:[]},this.jitContextData=new j.google.protobuf.Struct}compilationSql(){return new b.CompilationSql(this.projectConfig,w.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=O.getCallerFile(this.rootDir)),n){case"view":const n=new m.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 d.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 h.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 g.Operation(this,t).queries(e.sqlContextable));break;case"export":this.actions.push(new p.Export(this,t).query((t=>e.sqlContextable(t)[0])));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=T.toResolvable(e,t);const n=this.findActions(O.resolvableAsTarget(e));if(n.length>1)return this.compileError(new Error(O.ambiguousActionNameMsg(e,n))),"";const r=n.length>0?n[0]:void 0;return r&&r instanceof g.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=O.getCallerFile(this.rootDir);let r;return t&&"object"==typeof t?r=new g.Operation(this,Object.assign({name:e,filename:n},t)):(r=new g.Operation(this,{name:e,filename:n}),t&&r.queries(t)),this.actions.push(r),r}rlsPolicy(e){const t=O.getCallerFile(this.rootDir),n=new s.RlsPolicy(this,Object.assign({filename:t},e));return this.actions.push(n),n}realtimePublication(e){const t=O.getCallerFile(this.rootDir),n=new s.RealtimePublication(this,Object.assign({filename:t},e));return this.actions.push(n),n}wrapper(e){const t=O.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=O.getCallerFile(this.rootDir),n=new s.VectorIndex(this,Object.assign({filename:t},e));return this.actions.push(n),n}publish(e,t){const n=O.getCallerFile(this.rootDir);let r=new m.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 m.View(this,Object.assign({type:"view",name:e,filename:n},t));else if("incremental"===(null==t?void 0:t.type))r=new d.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 h.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=O.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||O.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 y.Test(this,{name:e});return t.session=this,t.setFilename(O.getCallerFile(this.rootDir)),this.tests.push(t),t}notebook(e){const t=O.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||O.getCallerFile(this.rootDir)||__filename,i=j.sqlanvil.CompilationError.create({fileName:r,actionName:n?v.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 T.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=j.sqlanvil.CompiledGraph.create({projectConfig:this.projectConfig,tables:this.compileGraphChunk(this.actions.filter((e=>e instanceof h.Table||e instanceof m.View||e instanceof d.IncrementalTable))),operations:this.compileGraphChunk(this.actions.filter((e=>e instanceof g.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 y.Test))),notebooks:this.compileGraphChunk(this.actions.filter((e=>e instanceof f.Notebook))),dataPreparations:this.compileGraphChunk(this.actions.filter((e=>e instanceof c.DataPreparation))),exports:this.compileGraphChunk(this.actions.filter((e=>e instanceof p.Export))),graphErrors:this.graphErrors,sqlanvilCoreVersion:w.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.exports,e.tests)),this.alterActionName([].concat(e.tables,e.assertions,e.operations,e.notebooks,e.dataPreparations,e.exports,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.exports,e.tests)),a.verifyObjectMatchesProto(j.sqlanvil.CompiledGraph,e,a.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM),e}compileToBase64(){return a.encode64(j.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 j.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 "${v.targetAsReadableString(e.target)}" depends on "${O.stringifyResolvable(n)}" which does not exist`),e.fileName,e.target);else if(1===r.length){const e=r[0].getTarget();t[v.targetAsReadableString(e)]=e,n.includeDependentAssertions&&this.actionAssertionMap.find(n).forEach((e=>t[v.targetAsReadableString(e.getTarget())]=e.getTarget()))}else this.compileError(new Error(O.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(v.targetStringifier.stringify(e),e))),e.forEach((e=>{o.set(v.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(v.targetStringifier.stringify(e.target))}));const a=e=>o.has(v.targetStringifier.stringify(e))?o.get(v.targetStringifier.stringify(e)):e;e.forEach((e=>{e instanceof j.sqlanvil.Declaration||(e.dependencyTargets=(e.dependencyTargets||[]).map(a)),e instanceof j.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=>[v.targetStringifier.stringify(e.target),e]))),n=new o.default;e.forEach((e=>{const r=(e instanceof j.sqlanvil.Declaration||!e.dependencyTargets?[]:e.dependencyTargets).filter((e=>!!t.get(v.targetStringifier.stringify(e))));n.add(v.targetStringifier.stringify(e.target),r.map((e=>v.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(" > ")} > ${v.targetAsReadableString(n.target)}]`;this.compileError(new Error(r),n.fileName,n.target)}))}addTestsToCompiledGraph(e){e.filter((e=>e instanceof y.Test)).map((e=>e)).forEach((e=>{const t=this.indexedActions.find(e.getTestTarget());t.forEach((e=>{e instanceof h.Table||e instanceof m.View||this.compileError(new Error(`Tests are only supported for Tables and Views. Action "${v.targetAsReadableString(e.getTarget())}" is not a table or view".`),e.getFileName(),e.getTarget())})),t.map((e=>e)).forEach((t=>t.dependencies(O.resolvableAsTarget(e.getTarget()))))}))}removeNonUniqueActionsFromCompiledGraph(e){function t(e){const t=new Set,n=new Set;return e.forEach((e=>{t.has(v.targetStringifier.stringify(e))&&n.add(v.targetStringifier.stringify(e)),t.add(v.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(v.targetStringifier.stringify(e.target)),n=i.has(v.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"__proto__"===e||(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){if("__proto__"===e)return this;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","n"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("if(n===undefined)n=0")("if(n>Reader.recursionLimit)")('throw Error("maximum nesting depth exceeded")')("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(),undefined,n+1)",n):t("value=r.%s()",l),t("break")("default:")("r.skipType(tag2&7,n)")("break")("}")("}"),void 0!==i.long[s.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',c):("string"===s.keyType&&t('if(k==="__proto__")')("util.makeProp(%s,k)",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),n+1))":"%s.push(types[%i].decode(r,r.uint32(),undefined,n+1))",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),n+1)":"%s=types[%i].decode(r,r.uint32(),undefined,n+1)",c,n):t("%s=r.%s()",c,l),t("break")("}")}for(t("default:")("r.skipType(t&7,n)")("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),r.metadata&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.metadata=r.metadata),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),d=n(3262),f=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=d.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=d.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,d.merge(e.prototype,t)),e.$type=e.prototype.$type=this,d.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:d.oneOfGetter(this._oneofsArray[n].oneof),set:d.oneOfSetter(this._oneofsArray[n].oneof)};n&&Object.defineProperties(e.prototype,r)}}}),b.generateConstructor=function(e){for(var t,n=d.codegen(["p"],e.name),r=0;r<e.fieldsArray.length;++r)(t=e._fieldsArray[r]).map?n("this%s={}",d.safeProp(t.name)):t.repeated&&n("this%s=[]",d.safeProp(t.name));return n('if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null&&ks[i]!=="__proto__")')("this[ks[i]]=p[ks[i]]")},b.fromJSON=function(e,t,n){n=d.checkDepth(n);var c=new b(e,t.options);c.extensions=t.extensions,c.reserved=t.reserved;for(var u=Object.keys(t.fields),p=0;p<u.length;++p)c.add((void 0!==t.fields[u[p]].keyType?s.fromJSON:a.fromJSON)(u[p],t.fields[u[p]]));if(t.oneofs)for(u=Object.keys(t.oneofs),p=0;p<u.length;++p)c.add(o.fromJSON(u[p],t.oneofs[u[p]]));if(t.nested)for(u=Object.keys(t.nested),p=0;p<u.length;++p){var f=t.nested[u[p]];c.add((void 0!==f.id?a.fromJSON:void 0!==f.fields?b.fromJSON:void 0!==f.values?i.fromJSON:void 0!==f.methods?l.fromJSON:r.fromJSON)(u[p],f,n+1))}return t.extensions&&t.extensions.length&&(c.extensions=t.extensions),t.reserved&&t.reserved.length&&(c.reserved=t.reserved),t.group&&(c.group=!0),t.comment&&(c.comment=t.comment),t.edition&&(c._edition=t.edition),c._defaultEdition="proto3",c},b.prototype.toJSON=function(e){var t=r.prototype.toJSON.call(this,e),n=!!e&&Boolean(e.keepComments);return d.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 Object.prototype.hasOwnProperty.call(this.fields,e)?this.fields[e]:this.oneofs&&Object.prototype.hasOwnProperty.call(this.oneofs,e)?this.oneofs[e]:this.nested&&Object.prototype.hasOwnProperty.call(this.nested,e)?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"__proto__"===e.name?this:(e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),v(this))}return e instanceof o?"__proto__"===e.name?this:(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=f(this)({Writer:p,types:t,util:d}),this.decode=g(this)({Reader:u,types:t,util:d}),this.verify=h(this)({types:t,util:d}),this.fromObject=y.fromObject(this)({types:t,util:d}),this.toObject=y.toObject(this)({types:t,util:d});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,n,r){return this.setup().decode(e,t,n,r)},b.prototype.decodeDelimited=function(e){return e instanceof u||(e=u.create(e)),this.decode(e,e.uint32())},b.prototype.verify=function(e,t){return this.setup().verify(e,t)},b.prototype.fromObject=function(e,t){return this.setup().fromObject(e,t)},b.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},b.d=function(e){return function(t){d.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),d=n(8995),f=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 x=g.nativeRequire("@sqlanvil/core").session;x.init(O.compileConfig.projectDir,w,w),b.sqlanvil=x,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,x),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${f.separator}`))).filter((e=>2===e.split(f.separator).length)).filter((e=>"js"===f.fileExtension(e))).forEach((e=>{try{r[f.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${f.separator}`)&&"actions"===f.basename(e)&&"yaml"===f.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 d.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${f.separator}`))).filter((e=>"js"===f.fileExtension(e)||"sqlx"===f.fileExtension(e))).sort().forEach((e=>{try{g.nativeRequire(e)}catch(n){t.compileError(n,e)}}))}(e,t):m(e,t)}(O,x);const q=y.sqlanvil.CoreExecutionResponse.create({compile:{compiledGraph:x.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,d="",f=Math.min(e.line+t.linesAfter,l.length).toString().length,g=t.maxLength-(t.indent+f+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),d=r.repeat(" ",t.indent)+o((e.line-u+1).toString(),f)+" | "+p.str+"\n"+d;for(p=i(e.buffer,s[c],l[c],e.position,g),d+=r.repeat(" ",t.indent)+o((e.line+1).toString(),f)+" | "+p.str+"\n",d+=r.repeat("-",t.indent+f+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),d+=r.repeat(" ",t.indent)+o((e.line+u+1).toString(),f)+" | "+p.str+"\n";return d.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";e.exports=n;var t=/^(?: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)$/;function n(e,r){"string"==typeof e&&(r=e,e=void 0);var i=[];function o(e){if("string"!=typeof e){var t=a();if(n.verbose&&console.log("codegen: "+t),t="return "+t,e){for(var r=Object.keys(e),s=new Array(r.length+1),l=new Array(r.length),c=0;c<r.length;)s[c]=r[c],l[c]=e[r[c++]];return s[c]=t,Function.apply(null,s).apply(null,l)}return Function(t)()}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 i.push(e),o}function a(n){return"function "+(((o=n||r)&&(o=String(o).replace(/[^\w$]/g,""))?(/^\d/.test(o)&&(o="_"+o),t.test(o)?o+"_":o):"")+"(")+(e&&e.join(",")||"")+"){\n "+i.join("\n ")+"\n}";var o}return o.toString=a,o}n.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=Object.create(null),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0}function d(e){e._nestedArray=null,e._lookupCache=Object.create(null);for(var t=e;t=t.parent;)t._lookupCache=Object.create(null);return e}p.fromJSON=function(e,t,n){return n=l.checkDepth(n),new p(e,t.options).addJSON(t.nested,n)},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,t){if(t=l.checkDepth(t),e)for(var n,r=Object.keys(e),c=0;c<r.length;++c)n=e[r[c]],this.add((void 0!==n.fields?i.fromJSON:void 0!==n.values?a.fromJSON:void 0!==n.methods?o.fromJSON:void 0!==n.id?s.fromJSON:p.fromJSON)(r[c],n,t+1));return this},p.prototype.get=function(e){return this.nested&&Object.prototype.hasOwnProperty.call(this.nested,e)?this.nested[e]:null},p.prototype.getEnum=function(e){if(this.nested&&Object.prototype.hasOwnProperty.call(this.nested,e)&&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("__proto__"===e.name)return this;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),d(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),d(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)if(this._nestedArray[i]instanceof p&&(n=this._nestedArray[i]._lookupImpl(e,t))){r=n;break}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 d 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 f(this),t=new f(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=d;class f{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=f},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,d=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function f(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),x=0;x<256;x++)w[x]=v(x)?1:0,j[x]=v(x);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 P(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 A(e,t){throw P(e,t)}function C(e,t){e.onWarning&&e.onWarning.call(null,P(e,t))}var S={YAML:function(e,t,n){var r,i,o;null!==e.version&&A(e,"duplication of %YAML directive"),1!==n.length&&A(e,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&A(e,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),o=parseInt(r[2],10),1!==i&&A(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,1!==o&&2!==o&&C(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var r,i;2!==n.length&&A(e,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],p.test(r)||A(e,"ill-formed tag handle (first argument) of the TAG directive"),s.call(e.tagMap,r)&&A(e,'there is a previously declared suffix for "'+r+'" tag handle'),d.test(i)||A(e,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch(t){A(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||A(e,"expected valid JSON character");else l.test(s)&&A(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)||A(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 _(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])&&A(e,"nested arrays are not supported inside keys"),"object"==typeof i&&"[object Object]"===f(i[u])&&(i[u]="[object Object]");if("object"==typeof i&&"[object Object]"===f(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,A(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++):A(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function N(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&&C(e,"deficient indentation"),r}function L(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 R(e,t){1===t?e.result+=" ":t>1&&(e.result+=r.repeat("\n",t-1))}function I(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,A(e,"tab characters must not be used in indentation")),45===r)&&y(e.input.charCodeAt(e.position+1));)if(s=!0,e.position++,N(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),N(e,!0,-1),r=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==r)A(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&&A(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)):A(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==i&&!y(i);)33===i&&(a?A(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),p.test(n)||A(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)&&A(e,"tag suffix cannot contain flow indicator characters")}r&&!d.test(r)&&A(e,"tag name cannot contain such characters: "+r);try{r=decodeURIComponent(r)}catch(t){A(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:A(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&&A(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&&A(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,d,f,v,T,x=1,q=!1,P=!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&&N(e,!0,-1)&&(q=!0,e.lineIndent>t?x=1:e.lineIndent===t?x=0:e.lineIndent<t&&(x=-1)),1===x)for(;M(e)||B(e);)N(e,!0,-1)?(q=!0,c=a,e.lineIndent>t?x=1:e.lineIndent===t?x=0:e.lineIndent<t&&(x=-1)):c=!1;if(c&&(c=q||o),1!==x&&4!==n||(v=1===n||2===n?t:t+1,T=e.position-e.lineStart,1===x?c&&(I(e,T)||function(e,t,n){var r,i,o,a,s,l,c,u=e.tag,p=e.anchor,d={},f=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]=d),c=e.input.charCodeAt(e.position);0!==c;){if(v||-1===e.firstTabInLine||(e.position=e.firstTabInLine,A(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))||A(e,"a whitespace character is expected after the key-value separator within a block mapping"),v&&(_(e,d,f,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;A(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!O)return e.tag=u,e.anchor=p,!0;A(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===c?(v&&(_(e,d,f,g,m,null,a,s,l),g=m=b=null),O=!0,v=!0,i=!0):v?(v=!1,i=!0):A(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||(_(e,d,f,g,m,b,a,s,l),g=m=b=null),N(e,!0,-1),c=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&0!==c)A(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return v&&_(e,d,f,g,m,null,a,s,l),O&&(e.tag=u,e.anchor=p,e.kind="mapping",e.result=d),O}(e,T,v))||function(e,t){var n,r,i,o,a,s,l,c,u,p,d,f,g=!0,h=e.tag,m=e.anchor,b=Object.create(null);if(91===(f=e.input.charCodeAt(e.position)))a=93,c=!1,o=[];else{if(123!==f)return!1;a=125,c=!0,o={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=o),f=e.input.charCodeAt(++e.position);0!==f;){if(N(e,!0,t),(f=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===f&&A(e,"expected the node content, but found ','"):A(e,"missed comma between flow collection entries"),d=null,s=l=!1,63===f&&y(e.input.charCodeAt(e.position+1))&&(s=l=!0,e.position++,N(e,!0,t)),n=e.line,r=e.lineStart,i=e.position,F(e,t,1,!1,!0),p=e.tag,u=e.result,N(e,!0,t),f=e.input.charCodeAt(e.position),!l&&e.line!==n||58!==f||(s=!0,f=e.input.charCodeAt(++e.position),N(e,!0,t),F(e,t,1,!1,!0),d=e.result),c?_(e,o,b,p,u,d,n,r,i):s?o.push(_(e,null,b,p,u,d,n,r,i)):o.push(u),N(e,!0,t),44===(f=e.input.charCodeAt(e.position))?(g=!0,f=e.input.charCodeAt(++e.position)):g=!1}A(e,"unexpected end of the stream within a flow collection")}(e,v)?P=!0:(l&&function(e,t){var n,i,o,a,s,l=1,c=!1,u=!1,p=t,d=0,f=!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:A(e,"repeat of a chomping mode identifier");else{if(!((o=48<=(s=a)&&s<=57?s-48:-1)>=0))break;0===o?A(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):u?A(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))d++;else{if(e.lineIndent<p){3===l?e.result+=r.repeat("\n",c?1+d:d):1===l&&c&&(e.result+="\n");break}for(i?h(a)?(f=!0,e.result+=r.repeat("\n",c?1+d:d)):f?(f=!1,e.result+=r.repeat("\n",d+1)):0===d?c&&(e.result+=" "):e.result+=r.repeat("\n",d):e.result+=r.repeat("\n",c?1+d:d),c=!0,u=!0,d=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),R(e,N(e,!1,t)),r=i=e.position):e.position===e.lineStart&&L(e)?A(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);A(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)))N(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:A(e,"expected hexadecimal character");e.result+=O(o),e.position++}else A(e,"unknown escape sequence");n=r=e.position}else g(s)?(k(e,n,r,!0),R(e,N(e,!1,t)),n=r=e.position):e.position===e.lineStart&&L(e)?A(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}A(e,"unexpected end of the stream within a double quoted scalar")}(e,v)?P=!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&&A(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),s.call(e.anchorMap,n)||A(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],N(e,!0,-1),!0}(e)?(P=!0,null===e.tag&&null===e.anchor||A(e,"alias node should not have any properties")):function(e,t,n){var r,i,o,a,s,l,c,u,p=e.kind,d=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&&L(e)||n&&m(u))break;if(g(u)){if(s=e.line,l=e.lineStart,c=e.lineIndent,N(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),R(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=d,!1)}(e,v,1===n)&&(P=!0,null===e.tag&&(e.tag="?")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===x&&(P=c&&I(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&&A(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),u=0,p=e.implicitTypes.length;u<p;u+=1)if((f=e.implicitTypes[u]).resolve(e.result)){e.result=f.construct(e.result),e.tag=f.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))f=e.typeMap[e.kind||"fallback"][e.tag];else for(f=null,u=0,p=(d=e.typeMap.multi[e.kind||"fallback"]).length;u<p;u+=1)if(e.tag.slice(0,d[u].tag.length)===d[u].tag){f=d[u];break}f||A(e,"unknown tag !<"+e.tag+">"),null!==e.result&&f.kind!==e.kind&&A(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+f.kind+'", not "'+e.kind+'"'),f.resolve(e.result,e.tag)?(e.result=f.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):A(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||P}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))&&(N(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&&A(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(S,n)?S[n](e,n,r):C(e,'unknown document directive "'+n+'"')}N(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,N(e,!0,-1)):a&&A(e,"directives end mark is expected"),F(e,e.lineIndent-1,4,!1,!0),N(e,!0,-1),e.checkLineBreaks&&c.test(e.input.slice(o,e.position))&&C(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&L(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,N(e,!0,-1)):e.position<e.length-1&&A(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,A(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=l;var r=n(8923);((l.prototype=Object.create(r.prototype)).constructor=l).className="Service";var i=n(8811),o=n(3262),a=n(5047),s=o.patterns.reservedRe;function l(e,t){r.call(this,e,t),this.methods={},this._methodsArray=null}function c(e){return e._methodsArray=null,e}l.fromJSON=function(e,t,n){n=o.checkDepth(n);var r=new l(e,t.options);if(t.methods)for(var a=Object.keys(t.methods),s=0;s<a.length;++s)r.add(i.fromJSON(a[s],t.methods[a[s]]));return t.nested&&r.addJSON(t.nested,n),t.edition&&(r._edition=t.edition),r.comment=t.comment,r._defaultEdition="proto3",r},l.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(l.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=o.toArray(this.methods))}}),l.prototype.get=function(e){return Object.prototype.hasOwnProperty.call(this.methods,e)?this.methods[e]:r.prototype.get.call(this,e)},l.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},l.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},l.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof i?"__proto__"===e.name?this:(this.methods[e.name]=e,e.parent=this,c(this)):r.prototype.add.call(this,e)},l.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,c(this)}return r.prototype.remove.call(this,e)},l.prototype.create=function(e,t,n){for(var r,i=new a.Service(e,t,n),l=0;l<this.methodsArray.length;++l){var c=o.lcFirst((r=this._methodsArray[l]).resolve().name).replace(/[^$\w_]/g,"");i[c]=o.codegen(["r","c"],s.test(c)?c+"_":c)("return this.rpcCall(m,q,s,r,c)")({m:r,q:r.resolvedRequestType.ctor,s:r.resolvedResponseType.ctor})}return i}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};(()=>{"use strict";var e=r;Object.defineProperty(e,"__esModule",{value:!0});var t=n(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=r})();
|
|
15
|
+
(()=>{var e={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,d=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]&&(d=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(d=-d)),u=new Date(Date.UTC(n,r,a,s,l,c,p)),d&&u.setTime(u.getTime()-d),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=Object.create(null);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:d,inputs:f}=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: ${d.length>0?`(ctx) => {\n ${s}\n ${l}\n ${r}\n return [${d.map((e=>`\`${e}\``))}];\n }`:"undefined"},\n inputContextables: [\n ${f.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","n"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected")("if(n===undefined)n=0")("if(n>util.recursionLimit)")("return%j","maximum nesting depth exceeded"),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+1);",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,d=1,f=0,g={},h=[],y=null;function m(e){return Error("illegal "+e+" (line "+d+")")}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[d]=c,f=d}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,f,g,w=0===c;do{if(c===p)return null;for(i=!1;s.test(a=b(c));)if("\n"===a&&(w=!0,++d),++c===p)return null;if("/"===b(c)){if(++c===p)throw m("comment");if("/"===b(c))if(l){if(f=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(f,c,w),w=!0),d++,i=!0}else{for(g="/"===b(f=c+1);"\n"!==b(++c);)if(c===p)return null;++c,g&&(v(f,c-1,w),w=!0),++d,i=!0}else{if("*"!==(a=b(c)))return"/";f=c+1,g=l||"*"===b(f);do{if("\n"===a&&++d,++c===p)throw m("comment");o=a,a=b(c)}while("*"!==o||"/"!==a);++c,g&&(v(f,c-2,w),w=!0),i=!0}}}while(i);var x=c;if(t.lastIndex=0,!t.test(b(x++)))for(;x<p&&!t.test(b(x));)++x;var q=e.substring(c,c=x);return'"'!==q&&"'"!==q||(y=q),q}function j(e){h.push(e)}function x(){if(!h.length){var e=w();if(null===e)return null;j(e)}return h[0]}return Object.defineProperty({next:w,peek:x,push:j,skip:function(e,t){var n=x();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[d-1],delete g[d-1],t&&(l||"*"===t.type||t.lineEmpty)&&(n=t.leading?t.text:null)):(f<e&&x(),t=g[e],delete g[e],!t||t.lineEmpty||!l&&"/"!==t.type||(n=t.leading?null:t.text)),n}},"line",{get:function(){return d}})}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,n+1)",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","n"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d")("if(n===undefined)n=0")("if(n>util.recursionLimit)")('throw Error("maximum nesting depth exceeded")');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),n('if(ks[i]==="__proto__")')("util.makeProp(m%s,ks[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 d=Array.prototype.slice.call(u.typeDefault);n("if(o.bytes===String)d%s=%j",p,String.fromCharCode.apply(String,u.typeDefault))("else{")("d%s=%j",p,d)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",p,p)("}")}else n("d%s=%j",p,u.typeDefault)}n("}")}var f=!1;for(c=0;c<t.length;++c){u=t[c];var g=e._fieldsArray.indexOf(u);p=o.safeProp(u.name),u.map?(f||(f=!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){"),n('if(ks2[j]==="__proto__")')("util.makeProp(d%s,ks2[j])",p),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()},876(e){function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=876,e.exports=t},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,d=[],f=[],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,d.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);f.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(f)+j,w),groups:d,fast:l,error:i||u}}function d(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 f=function(e,t){this.startState=t,this.states=e,this.buffer="",this.stack=[],this.reset()};f.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},f.prototype.save=function(){return{line:this.line,col:this.col,state:this.state,stack:this.stack.slice(),queuedToken:this.queuedToken,queuedThrow:this.queuedThrow}},f.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}},f.prototype.popState=function(){this.setState(this.stack.pop())},f.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(f.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")},f.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)}},f.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},f.prototype[Symbol.iterator]=function(){return new y(this)}}return f.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(" ")+"^"},f.prototype.clone=function(){return new f(this.states,this.state)},f.prototype.has=function(e){return!0},{compile:function(e){var t=p(c(e));return new f({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++)d(w[l],O,b);var j=Object.getOwnPropertyNames(T.fast);for(l=0;l<j.length;l++)d(T.fast[j[l]],O,b)}return new f(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,d=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===d?n("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",u,t):n(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|d,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===d?a(n,c,u,t+"[i]"):n("w.uint32(%i).%s(%s[i])",(c.id<<3|d)>>>0,p,t)),n("}")):(c.optional&&n("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,c.name),void 0===d?a(n,c,u,t):n("w.uint32(%i).%s(%s)",(c.id<<3|d)>>>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,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r")}'`}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 d 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 d=this.verifyConfig(t);d.name||(d.name=c.basename(d.filename));const f=u.actionConfigToCompiledGraphTarget(d);return this.proto.target=this.applySessionToTarget(f,e.projectConfig,d.filename,{validateTarget:!0}),this.proto.canonicalTarget=this.applySessionToTarget(f,e.canonicalProjectConfig),n&&(d.filename=u.resolveActionsConfigFilename(d.filename,n),this.query(u.nativeRequire(d.filename).query)),d.filename&&(this.proto.fileName=d.filename),d.dependOnDependencyAssertions&&this.setDependOnDependencyAssertions(d.dependOnDependencyAssertions),d.dependencyTargets&&this.dependencies(d.dependencyTargets.map((e=>u.configTargetToCompiledGraphTarget(p.sqlanvil.ActionConfig.Target.create(e))))),void 0!==d.hermetic&&this.hermetic(d.hermetic),d.disabled&&this.disabled(),d.tags&&this.tags(d.tags),d.description&&this.description(d.description),d.metadata&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.metadata=d.metadata),(null===(r=d.columns)||void 0===r?void 0:r.length)&&this.columns(d.columns.map((e=>p.sqlanvil.ActionConfig.ColumnDescriptor.create(e)))),d.project&&this.database(d.project),d.dataset&&this.schema(d.dataset),d.assertions&&this.assertions(p.sqlanvil.ActionConfig.TableAssertionsConfig.create(d.assertions)),d.uniqueKey&&this.uniqueKey(d.uniqueKey),this.protected(d.protected),d.preOperations&&this.preOps(d.preOperations),d.postOperations&&this.postOps(d.postOperations),this.bigquery(Object.assign({partitionBy:d.partitionBy,clusterBy:d.clusterBy,updatePartitionFilter:d.updatePartitionFilter,labels:d.labels,partitionExpirationDays:d.partitionExpirationDays,requirePartitionFilter:d.requirePartitionFilter,additionalOptions:d.additionalOptions},d.iceberg?{connection:u.getConnectionForIcebergTable(d.iceberg.connection,null===(i=e.projectConfig.defaultIcebergConfig)||void 0===i?void 0:i.connection),fileFormat:u.getFileFormatValueForIcebergTable(null===(o=d.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,d.iceberg.bucketName),u.getEffectiveTableFolderRoot(null===(s=e.projectConfig.defaultIcebergConfig)||void 0===s?void 0:s.tableFolderRoot,d.iceberg.tableFolderRoot),u.getEffectiveTableFolderSubpath(this.proto.target.schema,this.proto.target.name,null===(l=e.projectConfig.defaultIcebergConfig)||void 0===l?void 0:l.tableFolderSubpath,d.iceberg.tableFolderSubpath))}:{})),d.postgres&&this.postgres(d.postgres),d.supabase&&this.supabase(d.supabase),d.mysql&&this.mysql(d.mysql),this.proto.onSchemaChange=this.mapOnSchemaChange(d.onSchemaChange),d.reservation&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.reservation=d.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 f(this),t=new f(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=d;class f{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=f},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=t;i<n;){var o=e[i++];if(o<=127)r+=String.fromCharCode(o);else if(o>=192&&o<224){var a=(31&o)<<6|63&e[i++];r+=a>=128?String.fromCharCode(a):"�"}else if(o>=224&&o<240){var s=(15&o)<<12|(63&e[i++])<<6|63&e[i++];r+=s>=2048?String.fromCharCode(s):"�"}else if(o>=240){var l=(7&o)<<18|(63&e[i++])<<12|(63&e[i++])<<6|63&e[i++];l<65536||l>1114111?r+="�":(l-=65536,r+=String.fromCharCode(55296+(l>>10)),r+=String.fromCharCode(56320+(1023&l)))}}return r},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 d 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 d=this.verifyConfig(t);d.name||(d.name=c.basename(d.filename));const f=u.actionConfigToCompiledGraphTarget(d);return this.proto.target=this.applySessionToTarget(f,e.projectConfig,d.filename,{validateTarget:!0}),this.proto.canonicalTarget=this.applySessionToTarget(f,e.canonicalProjectConfig),n&&(d.filename=u.resolveActionsConfigFilename(d.filename,n),this.query(u.nativeRequire(d.filename).query)),d.filename&&(this.proto.fileName=d.filename),d.dependOnDependencyAssertions&&this.setDependOnDependencyAssertions(d.dependOnDependencyAssertions),d.dependencyTargets&&this.dependencies(d.dependencyTargets),void 0!==d.hermetic&&this.hermetic(d.hermetic),d.disabled&&this.disabled(),d.tags&&this.tags(d.tags),d.description&&this.description(d.description),d.metadata&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.metadata=d.metadata),(null===(r=d.columns)||void 0===r?void 0:r.length)&&this.columns(d.columns.map((e=>p.sqlanvil.ActionConfig.ColumnDescriptor.create(e)))),d.assertions&&this.assertions(p.sqlanvil.ActionConfig.TableAssertionsConfig.create(d.assertions)),d.preOperations&&this.preOps(d.preOperations),d.postOperations&&this.postOps(d.postOperations),this.bigquery(Object.assign({partitionBy:d.partitionBy,clusterBy:d.clusterBy,labels:d.labels,partitionExpirationDays:d.partitionExpirationDays,requirePartitionFilter:d.requirePartitionFilter,additionalOptions:d.additionalOptions},d.iceberg?{connection:u.getConnectionForIcebergTable(d.iceberg.connection,null===(i=e.projectConfig.defaultIcebergConfig)||void 0===i?void 0:i.connection),fileFormat:u.getFileFormatValueForIcebergTable(null===(o=d.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,d.iceberg.bucketName),u.getEffectiveTableFolderRoot(null===(s=e.projectConfig.defaultIcebergConfig)||void 0===s?void 0:s.tableFolderRoot,d.iceberg.tableFolderRoot),u.getEffectiveTableFolderSubpath(this.proto.target.schema,this.proto.target.name,null===(l=e.projectConfig.defaultIcebergConfig)||void 0===l?void 0:l.tableFolderSubpath,d.iceberg.tableFolderSubpath))}:{})),d.postgres&&this.postgres(d.postgres),d.supabase&&this.supabase(d.supabase),d.mysql&&this.mysql(d.mysql),d.reservation&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.reservation=d.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 f(this),t=new f(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=d;class f{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=f},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 d(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 f(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=d,t.tableTypeEnumToString=f,t.setOrValidateTableEnumType=function(e){let t=null;if(""!==e.type&&void 0!==e.type&&(t=d(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 "${f(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.9.0",t.dataformVersion="3.0.60"},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",d="innerTripleDoubleQuote",f={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:d+"_escapedBackslash",START_JS_PLACEHOLDER:d+"_startJsPlaceholder",CLOSE_QUOTE:d+"_closeTripleQuoteDouble",CAPTURE_EVERYTHING_ELSE:d+"_captureEverythingElse"},T=i.states(function(){const e={};e[f.START_CONFIG]={match:"config {",push:a},e[f.START_JS]={match:"js {",push:a},e[f.START_INCREMENTAL]={match:"incremental_where {",push:l},e[f.START_PRE_OPERATIONS]={match:"pre_operations {",push:l},e[f.START_POST_OPERATIONS]={match:"post_operations {",push:l},e[f.START_INPUT]={match:/input "[a-zA-Z0-9_-]+"(?:,\s*"[a-zA-Z0-9_-]+")* {/,push:l},e[f.STATEMENT_SEPERATOR]=/[^\S\r\n]*---[^\S\r\n]*$/,e[f.SINGLE_LINE_COMMENT]=/--.*?$/,e[f.MULTI_LINE_COMMENT]=/\/\*[\s\S]*?\*\//,e[f.START_JS_PLACEHOLDER]={match:"${",push:a},e[f.BACKTICK]="`",e[f.START_TRIPLE_QUOTE_SINGLE]={match:"'''",push:p},e[f.START_TRIPLE_QUOTE_DOUBLE]={match:'"""',push:d},e[f.START_QUOTE_SINGLE]={match:"'",push:c},e[f.START_QUOTE_DOUBLE]={match:'"',push:u},e[f.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:d},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 x={};return x[o]=e,x[a]=t,x[s]=n,x[l]=r,x[c]=i,x[u]=T,x[p]=w,x[d]=j,x}());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([[f.START_CONFIG,w.JAVASCRIPT],[f.START_INCREMENTAL,w.SQL],[f.START_INPUT,w.SQL],[f.START_JS,w.JAVASCRIPT],[f.START_JS_PLACEHOLDER,w.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER],[f.START_POST_OPERATIONS,w.SQL],[f.START_PRE_OPERATIONS,w.SQL],[f.START_QUOTE_SINGLE,w.SQL_LITERAL_STRING],[f.START_QUOTE_DOUBLE,w.SQL_LITERAL_STRING],[f.START_TRIPLE_QUOTE_SINGLE,w.SQL_LITERAL_MULTILINE_STRING],[f.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]]),x=new Set([g.CLOSE_BLOCK,y.CLOSE_BLOCK,m.CLOSE_QUOTE,b.CLOSE_QUOTE,v.CLOSE_QUOTE,O.CLOSE_QUOTE]),q=new Map([[f.MULTI_LINE_COMMENT,w.SQL_COMMENT],[f.SINGLE_LINE_COMMENT,w.SQL_COMMENT],[f.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 P{constructor(e,t=[]){this.type=e,this.allChildren=t}static create(e){const t=new P(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 P(t,[e.value]);r.push(i),n.push(i),n=i}else x.has(e.type)?(n.push(e.value),r.pop(),n=r[r.length-1]):q.has(e.type)?n.push(new P(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=P},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.patterns=n(4854);var s=o.patterns.reservedRe,l=o.patterns.unsafePropertyRe;o.fs=o.inquire("fs"),o.checkDepth=function(e){if(void 0===e&&(e=0),e>o.recursionLimit)throw Error("max depth exceeded");return e},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},o.isReserved=function(e){return s.test(e)},o.safeProp=function(e){return!/^[$\w_]+$/.test(e)||s.test(e)?"["+JSON.stringify(e)+"]":"."+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(l.test(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 d=function(){return i.Buffer?function(){return(p.create=function(){return new r})()}:function(){return new p}};function f(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=d(),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(f,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(f,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(f,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=d(),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||"__proto__"!==r[i]&&(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.recursionLimit=100,r.makeProp=function(e,t){Object.defineProperty(e,t,{enumerable:!0,configurable:!0,writable:!0})},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 d 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 f(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=d;class f{constructor(e){this.test=e}apply(e){return"function"==typeof e?e(this):e}}t.TestContext=f;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(e,t,n){"use strict";e.exports=function(e){try{var t=n(876)(e);return t&&(t.length||Object.keys(t).length)?t:null}catch(e){return null}}},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 d(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 f(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),f=r||e.flowLevel>-1&&n>=e.flowLevel;switch(function(e,t,n,r,i,o,a,s){var c,u,p=0,d=null,f=!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,d,s),d=p}else{for(c=0;c<e.length;p>=65536?c+=2:c++){if(10===(p=O(e,c)))f=!0,h&&(g=g||c-b-1>r&&" "!==e[b+1],b=c);else if(!m(p))return 5;w=w&&v(p,d,s),d=p}g=g||h&&c-b-1>r&&" "!==e[b+1]}return f||g?n>9&&T(e)?5:a?2===o?5:2:g?4:3:!w||a||i(e)?2===o?5:2:1}(t,f,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)+x(g(t,a));case 4:return">"+j(t,e.indent)+x(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])&&m(r)?(n+=e[i],r>=65536&&(n+=e[i+1])):n+=t||d(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 x(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 P(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)),(C(e,t+1,a,!0,!0,!1,!0)||void 0===a&&C(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 A(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 C(e,t,n,r,o,s,l){e.tag=null,e.dump=n,A(e,n,!1)||A(e,n,!0);var c,u=a.call(e.dump),p=r;r&&(r=e.flowLevel<0||e.flowLevel>t);var d,f,g="[object Object]"===u||"[object Array]"===u;if(g&&(f=-1!==(d=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||f||2!==e.indent&&t>0)&&(o=!1),f&&e.usedDuplicates[d])e.dump="*ref_"+d;else{if(g&&f&&!e.usedDuplicates[d]&&(e.usedDuplicates[d]=!0),"[object Object]"===u)r&&0!==Object.keys(e.dump).length?(function(e,t,n,r){var o,a,s,l,c,u,p="",d=e.tag,f=Object.keys(n);if(!0===e.sortKeys)f.sort();else if("function"==typeof e.sortKeys)f.sort(e.sortKeys);else if(e.sortKeys)throw new i("sortKeys must be a boolean or a function");for(o=0,a=f.length;o<a;o+=1)u="",r&&""===p||(u+=h(e,t)),l=n[s=f[o]],e.replacer&&(l=e.replacer.call(n,s,l)),C(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)),C(e,t+1,l,!0,c)&&(e.dump&&10===e.dump.charCodeAt(0)?u+=":":u+=": ",p+=u+=e.dump));e.tag=d,e.dump=p||"{}"}(e,t,e.dump,o),f&&(e.dump="&ref_"+d+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)),C(e,t,o,!1,!1)&&(e.dump.length>1024&&(s+="? "),s+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),C(e,t,a,!1,!1)&&(l+=s+=e.dump));e.tag=c,e.dump="{"+l+"}"}(e,t,e.dump),f&&(e.dump="&ref_"+d+" "+e.dump));else if("[object Array]"===u)r&&0!==e.dump.length?(e.noArrayIndent&&!l&&t>0?P(e,t-1,e.dump,o):P(e,t,e.dump,o),f&&(e.dump="&ref_"+d+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)),(C(e,t,o,!1,!1)||void 0===o&&C(e,t,null,!1,!1))&&(""!==a&&(a+=","+(e.condenseFlow?"":" ")),a+=e.dump);e.tag=s,e.dump="["+a+"]"}(e,t,e.dump),f&&(e.dump="&ref_"+d+" "+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 S(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 f(t=t||{});n.noRefs||S(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},"",r)),C(n,0,r,!0,!0)?n.dump+"\n":""}},4854(e,t){"use strict";var n=t;n.numberRe=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,n.typeRefRe=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,n.reservedRe=/^(?: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)$/,n.unsafePropertyRe=/^(?:__proto__|prototype|constructor)$/},4863(e,t,n){"use strict";e.exports=x,x.filename=null,x.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),d=n(7209),f=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=g.patterns.numberRe,w=/^[a-zA-Z_][a-zA-Z_0-9]*$/,j=g.patterns.typeRefRe;function x(e,t,n){t instanceof i||(n=t,t=new i),n||(n=x.defaults);var q,P,A,C,S=n.preferTrailingComment||!1,k=r(e,n.alternateCommentMode||!1),E=k.next,_=k.push,D=k.peek,N=k.skip,L=k.cmnt,R=!0,I="proto2",M=t,B=[],F={},U=n.keepCase?function(e){return e}:g.camelCase;function J(e,t,n){var r=x.filename;return n||(x.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()),N(e),e=D()}while('"'===e||"'"===e);return t.join("")}function K(e){var t=E();switch(t){case"'":case'"':return _(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=D())&&"'"!==n)try{e.push([r=Q(E()),N("to",!0)?Q(E()):r])}catch(r){if(!(t&&j.test(n)&&I>=2023))throw r;e.push(n)}else{var i=V();if(e.push(i),I>=2023)throw J(i,"id")}}while(N(",",!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),N(";")}),(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!==q)throw J("package");if(q=E(),!j.test(q))throw J(q,"name");M=M.define(q),N(";")}function W(){var e,t=D();switch(t){case"weak":e=A||(A=[]),E();break;case"public":E();default:e=P||(P=[])}t=V(),N(";"),e.push(t)}function H(){if(N("="),(I=V())<2023)throw J(I,"syntax");N(";")}function z(){if(N("="),I=V(),!["2023"].includes(I))throw J(I,"edition");N(";")}function Y(e,t,n){switch(n=g.checkDepth(n),t){case"option":return ne(e,t),N(";"),!0;case"message":return X(e,t,n+1),!0;case"enum":return te(e,t),!0;case"service":return function(e,t,n){if(n=g.checkDepth(n),!w.test(t=E()))throw J(t,"service name");var r=new u(t);Z(r,(function(e){if(!Y(r,e,n)){if("rpc"!==e)throw J(e);!function(e,t){var n=L(),r=t;if(!w.test(t=E()))throw J(t,"name");var i,o,a,s,l=t;if(N("("),N("stream",!0)&&(o=!0),!j.test(t=E()))throw J(t);if(i=t,N(")"),N("returns"),N("("),N("stream",!0)&&(s=!0),!j.test(t=E()))throw J(t);a=t,N(")");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),N(";")})),e.add(c)}(r,e)}})),e.add(r),e===M&&B.push(r)}(e,t,n+1),!0;case"extend":return function(e,t,n){if(!j.test(t=E()))throw J(t,"reference");var r=t;Z(null,(function(t){switch(t){case"required":case"repeated":ee(e,t,r,n+1);break;case"optional":ee(e,"proto3"===I?"proto3_optional":"optional",r,n+1);break;default:if("proto2"===I||!j.test(t))throw J(t);_(t),ee(e,"optional",r,n+1)}}))}(e,t,n),!0}return!1}function Z(e,t,n){var r=k.line;if(e&&("string"!=typeof e.comment&&(e.comment=L()),e.filename=x.filename),N("{",!0)){for(var i;"}"!==(i=E());)t(i);N(";",!0)}else n&&n(),N(";"),e&&("string"!=typeof e.comment||S)&&(e.comment=L(r)||e.comment)}function X(e,t,n){if(n=g.checkDepth(n),!w.test(t=E()))throw J(t,"type name");var r=new o(t);Z(r,(function(e){if(!Y(r,e,n))switch(e){case"map":!function(e){N("<");var t=E();if(void 0===f.mapKey[t])throw J(t,"type");N(",");var n=E();if(!j.test(n))throw J(n,"type");N(">");var r=E();if(!w.test(r))throw J(r,"name");N("=");var i=new s(U(r),Q(E()),t,n);Z(i,(function(e){if("option"!==e)throw J(e);ne(i,e),N(";")}),(function(){oe(i)})),e.add(i)}(r);break;case"required":if("proto2"!==I)throw J(e);case"repeated":ee(r,e,void 0,n+1);break;case"optional":if("proto3"===I)ee(r,"proto3_optional",void 0,n+1);else{if("proto2"!==I)throw J(e);ee(r,"optional",void 0,n+1)}break;case"oneof":!function(e,t,n){if(!w.test(t=E()))throw J(t,"name");var r=new l(U(t));Z(r,(function(e){"option"===e?(ne(r,e),N(";")):(_(e),ee(r,"optional",void 0,n))})),e.add(r)}(r,e,n+1);break;case"extensions":G(r.extensions||(r.extensions=[]));break;case"reserved":G(r.reserved||(r.reserved=[]),!0);break;default:if("proto2"===I||!j.test(e))throw J(e);_(e),ee(r,"optional",void 0,n+1)}})),e.add(r),e===M&&B.push(r)}function ee(e,t,n,r){var i=E();if("group"!==i){for(;i.endsWith(".")||D().startsWith(".");)i+=E();if(!j.test(i))throw J(i,"type");var s=E();if(!w.test(s))throw J(s,"name");s=U(s),N("=");var c=new a(s,Q(E()),i,t,n);if(Z(c,(function(e){if("option"!==e)throw J(e);ne(c,e),N(";")}),(function(){oe(c)})),"proto3_optional"===t){var u=new l("_"+s);c.setOption("proto3_optional",!0),u.add(c),e.add(u)}else e.add(c);e===M&&B.push(c)}else!function(e,t,n){if(n=g.checkDepth(n),I>=2023)throw J("group");var r=E();if(!w.test(r))throw J(r,"name");var i=g.lcFirst(r);r===i&&(r=g.ucFirst(r)),N("=");var s=Q(E()),l=new o(r);l.group=!0;var c=new a(i,s,r,t);c.filename=x.filename,Z(l,(function(e){switch(e){case"option":ne(l,e),N(";");break;case"required":case"repeated":ee(l,e,void 0,n+1);break;case"optional":ee(l,"proto3"===I?"proto3_optional":"optional",void 0,n+1);break;case"message":X(l,e,n+1);break;case"enum":te(l,e);break;case"reserved":G(l.reserved||(l.reserved=[]),!0);break;default:throw J(e)}})),e.add(l).add(c)}(e,t,r)}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),N(";");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");N("=");var n=Q(E(),!0),r={options:void 0,getOption:function(e){return this.options[e]},setOption:function(e,t){d.prototype.setOption.call(r,e,t)},setParsedOption:function(){}};Z(r,(function(e){if("option"!==e)throw J(e);ne(r,e),N(";")}),(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();N(")"),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,n){if(n=g.checkDepth(n),N("{",!0)){for(var r={};!N("}",!0);){if(!w.test(C=E()))throw J(C,"name");if(null===C)throw J(C,"end of input");var i,o=C;if(N(":",!0),"{"===D())i=re(e,t+"."+C,n+1);else if("["===D()){var a;if(i=[],N("[",!0)){do{a=K(!0),i.push(a)}while(N(",",!0));N("]"),void 0!==a&&ie(e,t+"."+C,a)}}else i=K(!0),ie(e,t+"."+C,i);var s=r[o];s&&(i=[].concat(s).concat(i)),"__proto__"!==o&&(r[o]=i),N(",",!0),N(";",!0)}return r}var l=K(!0);return ie(e,t,l),l}function ie(e,t,n){M===e&&/^features\./.test(t)?F[t]=n:e.setOption&&e.setOption(t,n)}function oe(e){if(N("[",!0)){do{ne(e,"option")}while(N(",",!0));N("]")}return e}for(;null!==(C=E());)switch(C){case"package":if(!R)throw J(C);$();break;case"import":if(!R)throw J(C);W();break;case"syntax":if(!R)throw J(C);H();break;case"edition":if(!R)throw J(C);z();break;case"option":ne(M,C),N(";",!0);break;default:if(Y(M,C,0)){R=!1;continue}throw J(C)}return B.forEach((e=>{e._edition=I,Object.keys(F).forEach((t=>{void 0===e.getOption(t)&&e.setOption(t,F[t],!0)}))})),x.filename=null,{package:q,imports:P,weakImports:A,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 d(){}p.fromJSON=function(e,t,n){return n=u.checkDepth(n),t||(t=new p),e.options&&t.setOptions(e.options),t.addJSON(e.nested,n).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===d;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]))&&f(r);if(a.weakImports)for(p=0;p<a.weakImports.length;++p)(r=c(a.weakImports[p])||i.resolvePath(e,a.weakImports[p]))&&f(r,!0)}else i.setOptions(t.options).addJSON(t.nested)}catch(e){l(e)}s||g||l(null,i)}function f(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]))&&f(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,d)},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 f=/^[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)f.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]);f.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)f.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]);f.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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.WorkflowSettings;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.sqlanvilCoreVersion=e.string();break;case 2:u.defaultProject=e.string();break;case 3:u.defaultDataset=e.string();break;case 4:u.defaultLocation=e.string();break;case 5:u.defaultAssertionDataset=e.string();break;case 6:u.vars===a.emptyObject&&(u.vars={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;)switch((f=e.uint32())>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}"__proto__"===o&&a.makeProp(u.vars,o),u.vars[o]=l;break;case 7:u.projectSuffix=e.string();break;case 8:u.datasetSuffix=e.string();break;case 9:u.namePrefix=e.string();break;case 10:u.defaultNotebookRuntimeOptions=s.sqlanvil.NotebookRuntimeOptionsConfig.decode(e,e.uint32(),void 0,r+1);break;case 11:u.builtinAssertionNamePrefix=e.string();break;case 12:u.defaultIcebergConfig=s.sqlanvil.DefaultIcebergConfig.decode(e,e.uint32(),void 0,r+1);break;case 13:u.disableAssertions=e.bool();break;case 14:u.defaultReservation=e.string();break;case 15:u.extension=s.sqlanvil.Extension.decode(e,e.uint32(),void 0,r+1);break;case 16:u.includeTestsInCompiledGraph=e.bool();break;case 17:u.warehouse=e.string();break;case 18:for(u.connections===a.emptyObject&&(u.connections={}),d=e.uint32()+e.pos,o="",l=null;e.pos<d;)switch((f=e.uint32())>>>3){case 1:o=e.string();break;case 2:l=s.sqlanvil.ConnectionConfig.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&f,r)}"__proto__"===o&&a.makeProp(u.connections,o),u.connections[o]=l;break;case 19:for(u.environments===a.emptyObject&&(u.environments={}),d=e.uint32()+e.pos,o="",l=null;e.pos<d;){var f;switch((f=e.uint32())>>>3){case 1:o=e.string();break;case 2:l=s.sqlanvil.Environment.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.environments,o),u.environments[o]=l;break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=Object.keys(e.vars),r=0;r<n.length;++r)if(!a.isString(e.vars[n[r]]))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")&&(i=s.sqlanvil.NotebookRuntimeOptionsConfig.verify(e.defaultNotebookRuntimeOptions,t+1)))return"defaultNotebookRuntimeOptions."+i;if(null!=e.builtinAssertionNamePrefix&&e.hasOwnProperty("builtinAssertionNamePrefix")&&!a.isString(e.builtinAssertionNamePrefix))return"builtinAssertionNamePrefix: string expected";if(null!=e.defaultIcebergConfig&&e.hasOwnProperty("defaultIcebergConfig")&&(i=s.sqlanvil.DefaultIcebergConfig.verify(e.defaultIcebergConfig,t+1)))return"defaultIcebergConfig."+i;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")&&(i=s.sqlanvil.Extension.verify(e.extension,t+1)))return"extension."+i;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(n=Object.keys(e.connections),r=0;r<n.length;++r)if(i=s.sqlanvil.ConnectionConfig.verify(e.connections[n[r]],t+1))return"connections."+i}if(null!=e.environments&&e.hasOwnProperty("environments")){if(!a.isObject(e.environments))return"environments: object expected";for(n=Object.keys(e.environments),r=0;r<n.length;++r){var i;if(i=s.sqlanvil.Environment.verify(e.environments[n[r]],t+1))return"environments."+i}}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.WorkflowSettings)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.WorkflowSettings;if(null!=e.sqlanvilCoreVersion&&(n.sqlanvilCoreVersion=String(e.sqlanvilCoreVersion)),null!=e.defaultProject&&(n.defaultProject=String(e.defaultProject)),null!=e.defaultDataset&&(n.defaultDataset=String(e.defaultDataset)),null!=e.defaultLocation&&(n.defaultLocation=String(e.defaultLocation)),null!=e.defaultAssertionDataset&&(n.defaultAssertionDataset=String(e.defaultAssertionDataset)),e.vars){if("object"!=typeof e.vars)throw TypeError(".sqlanvil.WorkflowSettings.vars: object expected");n.vars={};for(var r=Object.keys(e.vars),i=0;i<r.length;++i)"__proto__"===r[i]&&a.makeProp(n.vars,r[i]),n.vars[r[i]]=String(e.vars[r[i]])}if(null!=e.projectSuffix&&(n.projectSuffix=String(e.projectSuffix)),null!=e.datasetSuffix&&(n.datasetSuffix=String(e.datasetSuffix)),null!=e.namePrefix&&(n.namePrefix=String(e.namePrefix)),null!=e.defaultNotebookRuntimeOptions){if("object"!=typeof e.defaultNotebookRuntimeOptions)throw TypeError(".sqlanvil.WorkflowSettings.defaultNotebookRuntimeOptions: object expected");n.defaultNotebookRuntimeOptions=s.sqlanvil.NotebookRuntimeOptionsConfig.fromObject(e.defaultNotebookRuntimeOptions,t+1)}if(null!=e.builtinAssertionNamePrefix&&(n.builtinAssertionNamePrefix=String(e.builtinAssertionNamePrefix)),null!=e.defaultIcebergConfig){if("object"!=typeof e.defaultIcebergConfig)throw TypeError(".sqlanvil.WorkflowSettings.defaultIcebergConfig: object expected");n.defaultIcebergConfig=s.sqlanvil.DefaultIcebergConfig.fromObject(e.defaultIcebergConfig,t+1)}if(null!=e.disableAssertions&&(n.disableAssertions=Boolean(e.disableAssertions)),null!=e.defaultReservation&&(n.defaultReservation=String(e.defaultReservation)),null!=e.extension){if("object"!=typeof e.extension)throw TypeError(".sqlanvil.WorkflowSettings.extension: object expected");n.extension=s.sqlanvil.Extension.fromObject(e.extension,t+1)}if(null!=e.includeTestsInCompiledGraph&&(n.includeTestsInCompiledGraph=Boolean(e.includeTestsInCompiledGraph)),null!=e.warehouse&&(n.warehouse=String(e.warehouse)),e.connections){if("object"!=typeof e.connections)throw TypeError(".sqlanvil.WorkflowSettings.connections: object expected");for(n.connections={},r=Object.keys(e.connections),i=0;i<r.length;++i){if("__proto__"===r[i]&&a.makeProp(n.connections,r[i]),"object"!=typeof e.connections[r[i]])throw TypeError(".sqlanvil.WorkflowSettings.connections: object expected");n.connections[r[i]]=s.sqlanvil.ConnectionConfig.fromObject(e.connections[r[i]],t+1)}}if(e.environments){if("object"!=typeof e.environments)throw TypeError(".sqlanvil.WorkflowSettings.environments: object expected");for(n.environments={},r=Object.keys(e.environments),i=0;i<r.length;++i){if("__proto__"===r[i]&&a.makeProp(n.environments,r[i]),"object"!=typeof e.environments[r[i]])throw TypeError(".sqlanvil.WorkflowSettings.environments: object expected");n.environments[r[i]]=s.sqlanvil.Environment.fromObject(e.environments[r[i]],t+1)}}return n},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)"__proto__"===n[i]&&a.makeProp(r.vars,n[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)"__proto__"===n[i]&&a.makeProp(r.connections,n[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)"__proto__"===n[i]&&a.makeProp(r.environments,n[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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.Environment;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.schemaSuffix=e.string();break;case 2:u.vars===a.emptyObject&&(u.vars={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;){var f=e.uint32();switch(f>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.vars,o),u.vars[o]=l;break;case 3:u.defaultDatabase=e.string();break;case 4:u.defaultLocation=e.string();break;case 5:u.credentials=e.string();break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=Object.keys(e.vars),r=0;r<n.length;++r)if(!a.isString(e.vars[n[r]]))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,t){if(e instanceof s.sqlanvil.Environment)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.Environment;if(null!=e.schemaSuffix&&(n.schemaSuffix=String(e.schemaSuffix)),e.vars){if("object"!=typeof e.vars)throw TypeError(".sqlanvil.Environment.vars: object expected");n.vars={};for(var r=Object.keys(e.vars),i=0;i<r.length;++i)"__proto__"===r[i]&&a.makeProp(n.vars,r[i]),n.vars[r[i]]=String(e.vars[r[i]])}return null!=e.defaultDatabase&&(n.defaultDatabase=String(e.defaultDatabase)),null!=e.defaultLocation&&(n.defaultLocation=String(e.defaultLocation)),null!=e.credentials&&(n.credentials=String(e.credentials)),n},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)"__proto__"===n[i]&&a.makeProp(r.vars,n[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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ConnectionConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.platform=e.string();break;case 2:a.project=e.string();break;case 3:a.dataset=e.string();break;case 4:a.saKeyId=e.string();break;case 5:a.host=e.string();break;case 6:a.port=e.uint32();break;case 7:a.database=e.string();break;case 8:a.defaultSchema=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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,t){if(e instanceof s.sqlanvil.ConnectionConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ConnectionConfig;return null!=e.platform&&(n.platform=String(e.platform)),null!=e.project&&(n.project=String(e.project)),null!=e.dataset&&(n.dataset=String(e.dataset)),null!=e.saKeyId&&(n.saKeyId=String(e.saKeyId)),null!=e.host&&(n.host=String(e.host)),null!=e.port&&(n.port=e.port>>>0),null!=e.database&&(n.database=String(e.database)),null!=e.defaultSchema&&(n.defaultSchema=String(e.defaultSchema)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.DefaultIcebergConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.bucketName=e.string();break;case 2:a.tableFolderRoot=e.string();break;case 3:a.tableFolderSubpath=e.string();break;case 4:a.connection=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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,t){if(e instanceof s.sqlanvil.DefaultIcebergConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.DefaultIcebergConfig;return null!=e.bucketName&&(n.bucketName=String(e.bucketName)),null!=e.tableFolderRoot&&(n.tableFolderRoot=String(e.tableFolderRoot)),null!=e.tableFolderSubpath&&(n.tableFolderSubpath=String(e.tableFolderSubpath)),null!=e.connection&&(n.connection=String(e.connection)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfigs;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?(a.actions&&a.actions.length||(a.actions=[]),a.actions.push(s.sqlanvil.ActionConfig.decode(e,e.uint32(),void 0,r+1))):e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.actions&&e.hasOwnProperty("actions")){if(!Array.isArray(e.actions))return"actions: array expected";for(var n=0;n<e.actions.length;++n){var r=s.sqlanvil.ActionConfig.verify(e.actions[n],t+1);if(r)return"actions."+r}}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfigs)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfigs;if(e.actions){if(!Array.isArray(e.actions))throw TypeError(".sqlanvil.ActionConfigs.actions: array expected");n.actions=[];for(var r=0;r<e.actions.length;++r){if("object"!=typeof e.actions[r])throw TypeError(".sqlanvil.ActionConfigs.actions: object expected");n.actions[r]=s.sqlanvil.ActionConfig.fromObject(e.actions[r],t+1)}}return n},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]]&&"__proto__"!==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,t.prototype.export=null,Object.defineProperty(t.prototype,"action",{get:a.oneOfGetter(n=["table","view","incrementalTable","assertion","operation","declaration","notebook","dataPreparation","rlsPolicy","realtimePublication","foreignWrapper","vectorIndex","export"]),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(),null!=e.export&&Object.hasOwnProperty.call(e,"export")&&s.sqlanvil.ActionConfig.ExportConfig.encode(e.export,t.uint32(106).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.table=s.sqlanvil.ActionConfig.TableConfig.decode(e,e.uint32(),void 0,r+1);break;case 2:a.view=s.sqlanvil.ActionConfig.ViewConfig.decode(e,e.uint32(),void 0,r+1);break;case 3:a.incrementalTable=s.sqlanvil.ActionConfig.IncrementalTableConfig.decode(e,e.uint32(),void 0,r+1);break;case 4:a.assertion=s.sqlanvil.ActionConfig.AssertionConfig.decode(e,e.uint32(),void 0,r+1);break;case 5:a.operation=s.sqlanvil.ActionConfig.OperationConfig.decode(e,e.uint32(),void 0,r+1);break;case 6:a.declaration=s.sqlanvil.ActionConfig.DeclarationConfig.decode(e,e.uint32(),void 0,r+1);break;case 7:a.notebook=s.sqlanvil.ActionConfig.NotebookConfig.decode(e,e.uint32(),void 0,r+1);break;case 8:a.dataPreparation=s.sqlanvil.ActionConfig.DataPreparationConfig.decode(e,e.uint32(),void 0,r+1);break;case 9:a.rlsPolicy=s.sqlanvil.ActionConfig.RlsPolicyConfig.decode(e,e.uint32(),void 0,r+1);break;case 10:a.realtimePublication=s.sqlanvil.ActionConfig.RealtimePublicationConfig.decode(e,e.uint32(),void 0,r+1);break;case 11:a.foreignWrapper=s.sqlanvil.ActionConfig.ForeignWrapperConfig.decode(e,e.uint32(),void 0,r+1);break;case 12:a.vectorIndex=s.sqlanvil.ActionConfig.VectorIndexConfig.decode(e,e.uint32(),void 0,r+1);break;case 13:a.export=s.sqlanvil.ActionConfig.ExportConfig.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";var n={};if(null!=e.table&&e.hasOwnProperty("table")&&(n.action=1,r=s.sqlanvil.ActionConfig.TableConfig.verify(e.table,t+1)))return"table."+r;if(null!=e.view&&e.hasOwnProperty("view")){if(1===n.action)return"action: multiple values";if(n.action=1,r=s.sqlanvil.ActionConfig.ViewConfig.verify(e.view,t+1))return"view."+r}if(null!=e.incrementalTable&&e.hasOwnProperty("incrementalTable")){if(1===n.action)return"action: multiple values";if(n.action=1,r=s.sqlanvil.ActionConfig.IncrementalTableConfig.verify(e.incrementalTable,t+1))return"incrementalTable."+r}if(null!=e.assertion&&e.hasOwnProperty("assertion")){if(1===n.action)return"action: multiple values";if(n.action=1,r=s.sqlanvil.ActionConfig.AssertionConfig.verify(e.assertion,t+1))return"assertion."+r}if(null!=e.operation&&e.hasOwnProperty("operation")){if(1===n.action)return"action: multiple values";if(n.action=1,r=s.sqlanvil.ActionConfig.OperationConfig.verify(e.operation,t+1))return"operation."+r}if(null!=e.declaration&&e.hasOwnProperty("declaration")){if(1===n.action)return"action: multiple values";if(n.action=1,r=s.sqlanvil.ActionConfig.DeclarationConfig.verify(e.declaration,t+1))return"declaration."+r}if(null!=e.notebook&&e.hasOwnProperty("notebook")){if(1===n.action)return"action: multiple values";if(n.action=1,r=s.sqlanvil.ActionConfig.NotebookConfig.verify(e.notebook,t+1))return"notebook."+r}if(null!=e.dataPreparation&&e.hasOwnProperty("dataPreparation")){if(1===n.action)return"action: multiple values";if(n.action=1,r=s.sqlanvil.ActionConfig.DataPreparationConfig.verify(e.dataPreparation,t+1))return"dataPreparation."+r}if(null!=e.rlsPolicy&&e.hasOwnProperty("rlsPolicy")){if(1===n.action)return"action: multiple values";if(n.action=1,r=s.sqlanvil.ActionConfig.RlsPolicyConfig.verify(e.rlsPolicy,t+1))return"rlsPolicy."+r}if(null!=e.realtimePublication&&e.hasOwnProperty("realtimePublication")){if(1===n.action)return"action: multiple values";if(n.action=1,r=s.sqlanvil.ActionConfig.RealtimePublicationConfig.verify(e.realtimePublication,t+1))return"realtimePublication."+r}if(null!=e.foreignWrapper&&e.hasOwnProperty("foreignWrapper")){if(1===n.action)return"action: multiple values";if(n.action=1,r=s.sqlanvil.ActionConfig.ForeignWrapperConfig.verify(e.foreignWrapper,t+1))return"foreignWrapper."+r}if(null!=e.vectorIndex&&e.hasOwnProperty("vectorIndex")){if(1===n.action)return"action: multiple values";if(n.action=1,r=s.sqlanvil.ActionConfig.VectorIndexConfig.verify(e.vectorIndex,t+1))return"vectorIndex."+r}if(null!=e.export&&e.hasOwnProperty("export")){if(1===n.action)return"action: multiple values";var r;if(n.action=1,r=s.sqlanvil.ActionConfig.ExportConfig.verify(e.export,t+1))return"export."+r}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig;if(null!=e.table){if("object"!=typeof e.table)throw TypeError(".sqlanvil.ActionConfig.table: object expected");n.table=s.sqlanvil.ActionConfig.TableConfig.fromObject(e.table,t+1)}if(null!=e.view){if("object"!=typeof e.view)throw TypeError(".sqlanvil.ActionConfig.view: object expected");n.view=s.sqlanvil.ActionConfig.ViewConfig.fromObject(e.view,t+1)}if(null!=e.incrementalTable){if("object"!=typeof e.incrementalTable)throw TypeError(".sqlanvil.ActionConfig.incrementalTable: object expected");n.incrementalTable=s.sqlanvil.ActionConfig.IncrementalTableConfig.fromObject(e.incrementalTable,t+1)}if(null!=e.assertion){if("object"!=typeof e.assertion)throw TypeError(".sqlanvil.ActionConfig.assertion: object expected");n.assertion=s.sqlanvil.ActionConfig.AssertionConfig.fromObject(e.assertion,t+1)}if(null!=e.operation){if("object"!=typeof e.operation)throw TypeError(".sqlanvil.ActionConfig.operation: object expected");n.operation=s.sqlanvil.ActionConfig.OperationConfig.fromObject(e.operation,t+1)}if(null!=e.declaration){if("object"!=typeof e.declaration)throw TypeError(".sqlanvil.ActionConfig.declaration: object expected");n.declaration=s.sqlanvil.ActionConfig.DeclarationConfig.fromObject(e.declaration,t+1)}if(null!=e.notebook){if("object"!=typeof e.notebook)throw TypeError(".sqlanvil.ActionConfig.notebook: object expected");n.notebook=s.sqlanvil.ActionConfig.NotebookConfig.fromObject(e.notebook,t+1)}if(null!=e.dataPreparation){if("object"!=typeof e.dataPreparation)throw TypeError(".sqlanvil.ActionConfig.dataPreparation: object expected");n.dataPreparation=s.sqlanvil.ActionConfig.DataPreparationConfig.fromObject(e.dataPreparation,t+1)}if(null!=e.rlsPolicy){if("object"!=typeof e.rlsPolicy)throw TypeError(".sqlanvil.ActionConfig.rlsPolicy: object expected");n.rlsPolicy=s.sqlanvil.ActionConfig.RlsPolicyConfig.fromObject(e.rlsPolicy,t+1)}if(null!=e.realtimePublication){if("object"!=typeof e.realtimePublication)throw TypeError(".sqlanvil.ActionConfig.realtimePublication: object expected");n.realtimePublication=s.sqlanvil.ActionConfig.RealtimePublicationConfig.fromObject(e.realtimePublication,t+1)}if(null!=e.foreignWrapper){if("object"!=typeof e.foreignWrapper)throw TypeError(".sqlanvil.ActionConfig.foreignWrapper: object expected");n.foreignWrapper=s.sqlanvil.ActionConfig.ForeignWrapperConfig.fromObject(e.foreignWrapper,t+1)}if(null!=e.vectorIndex){if("object"!=typeof e.vectorIndex)throw TypeError(".sqlanvil.ActionConfig.vectorIndex: object expected");n.vectorIndex=s.sqlanvil.ActionConfig.VectorIndexConfig.fromObject(e.vectorIndex,t+1)}if(null!=e.export){if("object"!=typeof e.export)throw TypeError(".sqlanvil.ActionConfig.export: object expected");n.export=s.sqlanvil.ActionConfig.ExportConfig.fromObject(e.export,t+1)}return n},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")),null!=e.export&&e.hasOwnProperty("export")&&(n.export=s.sqlanvil.ActionConfig.ExportConfig.toObject(e.export,t),t.oneofs&&(n.action="export")),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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfig.Target;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.project=e.string();break;case 2:a.dataset=e.string();break;case 4:a.name=e.string();break;case 5:a.includeDependentAssertions=e.bool();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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,t){if(e instanceof s.sqlanvil.ActionConfig.Target)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.Target;return null!=e.project&&(n.project=String(e.project)),null!=e.dataset&&(n.dataset=String(e.dataset)),null!=e.name&&(n.name=String(e.name)),null!=e.includeDependentAssertions&&(n.includeDependentAssertions=Boolean(e.includeDependentAssertions)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfig.ColumnDescriptor;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.path&&a.path.length||(a.path=[]),a.path.push(e.string());break;case 2:a.description=e.string();break;case 3:a.bigqueryPolicyTags&&a.bigqueryPolicyTags.length||(a.bigqueryPolicyTags=[]),a.bigqueryPolicyTags.push(e.string());break;case 4:a.tags&&a.tags.length||(a.tags=[]),a.tags.push(e.string());break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.path&&e.hasOwnProperty("path")){if(!Array.isArray(e.path))return"path: array expected";for(var n=0;n<e.path.length;++n)if(!a.isString(e.path[n]))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(n=0;n<e.bigqueryPolicyTags.length;++n)if(!a.isString(e.bigqueryPolicyTags[n]))return"bigqueryPolicyTags: string[] expected"}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"}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.ColumnDescriptor)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.ColumnDescriptor;if(e.path){if(!Array.isArray(e.path))throw TypeError(".sqlanvil.ActionConfig.ColumnDescriptor.path: array expected");n.path=[];for(var r=0;r<e.path.length;++r)n.path[r]=String(e.path[r])}if(null!=e.description&&(n.description=String(e.description)),e.bigqueryPolicyTags){if(!Array.isArray(e.bigqueryPolicyTags))throw TypeError(".sqlanvil.ActionConfig.ColumnDescriptor.bigqueryPolicyTags: array expected");for(n.bigqueryPolicyTags=[],r=0;r<e.bigqueryPolicyTags.length;++r)n.bigqueryPolicyTags[r]=String(e.bigqueryPolicyTags[r])}if(e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.ColumnDescriptor.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfig.TableAssertionsConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.uniqueKey&&a.uniqueKey.length||(a.uniqueKey=[]),a.uniqueKey.push(e.string());break;case 2:a.uniqueKeys&&a.uniqueKeys.length||(a.uniqueKeys=[]),a.uniqueKeys.push(s.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey.decode(e,e.uint32(),void 0,r+1));break;case 3:a.nonNull&&a.nonNull.length||(a.nonNull=[]),a.nonNull.push(e.string());break;case 4:a.rowConditions&&a.rowConditions.length||(a.rowConditions=[]),a.rowConditions.push(e.string());break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.uniqueKey&&e.hasOwnProperty("uniqueKey")){if(!Array.isArray(e.uniqueKey))return"uniqueKey: array expected";for(var n=0;n<e.uniqueKey.length;++n)if(!a.isString(e.uniqueKey[n]))return"uniqueKey: string[] expected"}if(null!=e.uniqueKeys&&e.hasOwnProperty("uniqueKeys")){if(!Array.isArray(e.uniqueKeys))return"uniqueKeys: array expected";for(n=0;n<e.uniqueKeys.length;++n){var r=s.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey.verify(e.uniqueKeys[n],t+1);if(r)return"uniqueKeys."+r}}if(null!=e.nonNull&&e.hasOwnProperty("nonNull")){if(!Array.isArray(e.nonNull))return"nonNull: array expected";for(n=0;n<e.nonNull.length;++n)if(!a.isString(e.nonNull[n]))return"nonNull: string[] expected"}if(null!=e.rowConditions&&e.hasOwnProperty("rowConditions")){if(!Array.isArray(e.rowConditions))return"rowConditions: array expected";for(n=0;n<e.rowConditions.length;++n)if(!a.isString(e.rowConditions[n]))return"rowConditions: string[] expected"}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.TableAssertionsConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.TableAssertionsConfig;if(e.uniqueKey){if(!Array.isArray(e.uniqueKey))throw TypeError(".sqlanvil.ActionConfig.TableAssertionsConfig.uniqueKey: array expected");n.uniqueKey=[];for(var r=0;r<e.uniqueKey.length;++r)n.uniqueKey[r]=String(e.uniqueKey[r])}if(e.uniqueKeys){if(!Array.isArray(e.uniqueKeys))throw TypeError(".sqlanvil.ActionConfig.TableAssertionsConfig.uniqueKeys: array expected");for(n.uniqueKeys=[],r=0;r<e.uniqueKeys.length;++r){if("object"!=typeof e.uniqueKeys[r])throw TypeError(".sqlanvil.ActionConfig.TableAssertionsConfig.uniqueKeys: object expected");n.uniqueKeys[r]=s.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey.fromObject(e.uniqueKeys[r],t+1)}}if(e.nonNull){if(!Array.isArray(e.nonNull))throw TypeError(".sqlanvil.ActionConfig.TableAssertionsConfig.nonNull: array expected");for(n.nonNull=[],r=0;r<e.nonNull.length;++r)n.nonNull[r]=String(e.nonNull[r])}if(e.rowConditions){if(!Array.isArray(e.rowConditions))throw TypeError(".sqlanvil.ActionConfig.TableAssertionsConfig.rowConditions: array expected");for(n.rowConditions=[],r=0;r<e.rowConditions.length;++r)n.rowConditions[r]=String(e.rowConditions[r])}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?(a.uniqueKey&&a.uniqueKey.length||(a.uniqueKey=[]),a.uniqueKey.push(e.string())):e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.uniqueKey&&e.hasOwnProperty("uniqueKey")){if(!Array.isArray(e.uniqueKey))return"uniqueKey: array expected";for(var n=0;n<e.uniqueKey.length;++n)if(!a.isString(e.uniqueKey[n]))return"uniqueKey: string[] expected"}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey;if(e.uniqueKey){if(!Array.isArray(e.uniqueKey))throw TypeError(".sqlanvil.ActionConfig.TableAssertionsConfig.UniqueKey.uniqueKey: array expected");n.uniqueKey=[];for(var r=0;r<e.uniqueKey.length;++r)n.uniqueKey[r]=String(e.uniqueKey[r])}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfig.IcebergTableConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.fileFormat=e.int32();break;case 2:a.connection=e.string();break;case 3:a.bucketName=e.string();break;case 4:a.tableFolderRoot=e.string();break;case 5:a.tableFolderSubpath=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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,t){if(e instanceof s.sqlanvil.ActionConfig.IcebergTableConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.IcebergTableConfig;switch(e.fileFormat){default:if("number"==typeof e.fileFormat){n.fileFormat=e.fileFormat;break}break;case"FILE_FORMAT_UNSPECIFIED":case 0:n.fileFormat=0;break;case"PARQUET":case 1:n.fileFormat=1}return null!=e.connection&&(n.connection=String(e.connection)),null!=e.bucketName&&(n.bucketName=String(e.bucketName)),null!=e.tableFolderRoot&&(n.tableFolderRoot=String(e.tableFolderRoot)),null!=e.tableFolderSubpath&&(n.tableFolderSubpath=String(e.tableFolderSubpath)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.ActionConfig.TableConfig;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.name=e.string();break;case 2:u.dataset=e.string();break;case 3:u.project=e.string();break;case 4:u.dependencyTargets&&u.dependencyTargets.length||(u.dependencyTargets=[]),u.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32(),void 0,r+1));break;case 5:u.filename=e.string();break;case 6:u.tags&&u.tags.length||(u.tags=[]),u.tags.push(e.string());break;case 7:u.disabled=e.bool();break;case 8:u.preOperations&&u.preOperations.length||(u.preOperations=[]),u.preOperations.push(e.string());break;case 9:u.postOperations&&u.postOperations.length||(u.postOperations=[]),u.postOperations.push(e.string());break;case 10:u.description=e.string();break;case 11:u.columns&&u.columns.length||(u.columns=[]),u.columns.push(s.sqlanvil.ActionConfig.ColumnDescriptor.decode(e,e.uint32(),void 0,r+1));break;case 12:u.partitionBy=e.string();break;case 13:u.partitionExpirationDays=e.int32();break;case 14:u.requirePartitionFilter=e.bool();break;case 15:u.clusterBy&&u.clusterBy.length||(u.clusterBy=[]),u.clusterBy.push(e.string());break;case 16:u.labels===a.emptyObject&&(u.labels={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;)switch((f=e.uint32())>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}"__proto__"===o&&a.makeProp(u.labels,o),u.labels[o]=l;break;case 17:for(u.additionalOptions===a.emptyObject&&(u.additionalOptions={}),d=e.uint32()+e.pos,o="",l="";e.pos<d;){var f;switch((f=e.uint32())>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.additionalOptions,o),u.additionalOptions[o]=l;break;case 18:u.dependOnDependencyAssertions=e.bool();break;case 19:u.assertions=s.sqlanvil.ActionConfig.TableAssertionsConfig.decode(e,e.uint32(),void 0,r+1);break;case 20:u.hermetic=e.bool();break;case 22:u.iceberg=s.sqlanvil.ActionConfig.IcebergTableConfig.decode(e,e.uint32(),void 0,r+1);break;case 23:u.metadata=s.sqlanvil.ActionConfig.Metadata.decode(e,e.uint32(),void 0,r+1);break;case 24:u.reservation=e.string();break;case 25:u.postgres=s.sqlanvil.PostgresOptions.decode(e,e.uint32(),void 0,r+1);break;case 26:u.supabase=s.sqlanvil.SupabaseOptions.decode(e,e.uint32(),void 0,r+1);break;case 27:u.mysql=s.sqlanvil.MysqlOptions.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.dependencyTargets.length;++n)if(i=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[n],t+1))return"dependencyTargets."+i}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(n=0;n<e.tags.length;++n)if(!a.isString(e.tags[n]))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(n=0;n<e.preOperations.length;++n)if(!a.isString(e.preOperations[n]))return"preOperations: string[] expected"}if(null!=e.postOperations&&e.hasOwnProperty("postOperations")){if(!Array.isArray(e.postOperations))return"postOperations: array expected";for(n=0;n<e.postOperations.length;++n)if(!a.isString(e.postOperations[n]))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(n=0;n<e.columns.length;++n)if(i=s.sqlanvil.ActionConfig.ColumnDescriptor.verify(e.columns[n],t+1))return"columns."+i}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(n=0;n<e.clusterBy.length;++n)if(!a.isString(e.clusterBy[n]))return"clusterBy: 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(n=0;n<r.length;++n)if(!a.isString(e.labels[r[n]]))return"labels: string{k:string} expected"}if(null!=e.additionalOptions&&e.hasOwnProperty("additionalOptions")){if(!a.isObject(e.additionalOptions))return"additionalOptions: object expected";for(r=Object.keys(e.additionalOptions),n=0;n<r.length;++n)if(!a.isString(e.additionalOptions[r[n]]))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")&&(i=s.sqlanvil.ActionConfig.TableAssertionsConfig.verify(e.assertions,t+1))?"assertions."+i:null!=e.hermetic&&e.hasOwnProperty("hermetic")&&"boolean"!=typeof e.hermetic?"hermetic: boolean expected":null!=e.iceberg&&e.hasOwnProperty("iceberg")&&(i=s.sqlanvil.ActionConfig.IcebergTableConfig.verify(e.iceberg,t+1))?"iceberg."+i:null!=e.metadata&&e.hasOwnProperty("metadata")&&(i=s.sqlanvil.ActionConfig.Metadata.verify(e.metadata,t+1))?"metadata."+i:null!=e.reservation&&e.hasOwnProperty("reservation")&&!a.isString(e.reservation)?"reservation: string expected":null!=e.postgres&&e.hasOwnProperty("postgres")&&(i=s.sqlanvil.PostgresOptions.verify(e.postgres,t+1))?"postgres."+i:null!=e.supabase&&e.hasOwnProperty("supabase")&&(i=s.sqlanvil.SupabaseOptions.verify(e.supabase,t+1))?"supabase."+i:null!=e.mysql&&e.hasOwnProperty("mysql")&&(i=s.sqlanvil.MysqlOptions.verify(e.mysql,t+1))?"mysql."+i:null;var i},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.TableConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.TableConfig;if(null!=e.name&&(n.name=String(e.name)),null!=e.dataset&&(n.dataset=String(e.dataset)),null!=e.project&&(n.project=String(e.project)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.TableConfig.dependencyTargets: array expected");n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.ActionConfig.TableConfig.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[r],t+1)}}if(null!=e.filename&&(n.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.TableConfig.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}if(null!=e.disabled&&(n.disabled=Boolean(e.disabled)),e.preOperations){if(!Array.isArray(e.preOperations))throw TypeError(".sqlanvil.ActionConfig.TableConfig.preOperations: array expected");for(n.preOperations=[],r=0;r<e.preOperations.length;++r)n.preOperations[r]=String(e.preOperations[r])}if(e.postOperations){if(!Array.isArray(e.postOperations))throw TypeError(".sqlanvil.ActionConfig.TableConfig.postOperations: array expected");for(n.postOperations=[],r=0;r<e.postOperations.length;++r)n.postOperations[r]=String(e.postOperations[r])}if(null!=e.description&&(n.description=String(e.description)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.ActionConfig.TableConfig.columns: array expected");for(n.columns=[],r=0;r<e.columns.length;++r){if("object"!=typeof e.columns[r])throw TypeError(".sqlanvil.ActionConfig.TableConfig.columns: object expected");n.columns[r]=s.sqlanvil.ActionConfig.ColumnDescriptor.fromObject(e.columns[r],t+1)}}if(null!=e.partitionBy&&(n.partitionBy=String(e.partitionBy)),null!=e.partitionExpirationDays&&(n.partitionExpirationDays=0|e.partitionExpirationDays),null!=e.requirePartitionFilter&&(n.requirePartitionFilter=Boolean(e.requirePartitionFilter)),e.clusterBy){if(!Array.isArray(e.clusterBy))throw TypeError(".sqlanvil.ActionConfig.TableConfig.clusterBy: array expected");for(n.clusterBy=[],r=0;r<e.clusterBy.length;++r)n.clusterBy[r]=String(e.clusterBy[r])}if(e.labels){if("object"!=typeof e.labels)throw TypeError(".sqlanvil.ActionConfig.TableConfig.labels: object expected");n.labels={};var i=Object.keys(e.labels);for(r=0;r<i.length;++r)"__proto__"===i[r]&&a.makeProp(n.labels,i[r]),n.labels[i[r]]=String(e.labels[i[r]])}if(e.additionalOptions){if("object"!=typeof e.additionalOptions)throw TypeError(".sqlanvil.ActionConfig.TableConfig.additionalOptions: object expected");for(n.additionalOptions={},i=Object.keys(e.additionalOptions),r=0;r<i.length;++r)"__proto__"===i[r]&&a.makeProp(n.additionalOptions,i[r]),n.additionalOptions[i[r]]=String(e.additionalOptions[i[r]])}if(null!=e.dependOnDependencyAssertions&&(n.dependOnDependencyAssertions=Boolean(e.dependOnDependencyAssertions)),null!=e.assertions){if("object"!=typeof e.assertions)throw TypeError(".sqlanvil.ActionConfig.TableConfig.assertions: object expected");n.assertions=s.sqlanvil.ActionConfig.TableAssertionsConfig.fromObject(e.assertions,t+1)}if(null!=e.hermetic&&(n.hermetic=Boolean(e.hermetic)),null!=e.iceberg){if("object"!=typeof e.iceberg)throw TypeError(".sqlanvil.ActionConfig.TableConfig.iceberg: object expected");n.iceberg=s.sqlanvil.ActionConfig.IcebergTableConfig.fromObject(e.iceberg,t+1)}if(null!=e.metadata){if("object"!=typeof e.metadata)throw TypeError(".sqlanvil.ActionConfig.TableConfig.metadata: object expected");n.metadata=s.sqlanvil.ActionConfig.Metadata.fromObject(e.metadata,t+1)}if(null!=e.reservation&&(n.reservation=String(e.reservation)),null!=e.postgres){if("object"!=typeof e.postgres)throw TypeError(".sqlanvil.ActionConfig.TableConfig.postgres: object expected");n.postgres=s.sqlanvil.PostgresOptions.fromObject(e.postgres,t+1)}if(null!=e.supabase){if("object"!=typeof e.supabase)throw TypeError(".sqlanvil.ActionConfig.TableConfig.supabase: object expected");n.supabase=s.sqlanvil.SupabaseOptions.fromObject(e.supabase,t+1)}if(null!=e.mysql){if("object"!=typeof e.mysql)throw TypeError(".sqlanvil.ActionConfig.TableConfig.mysql: object expected");n.mysql=s.sqlanvil.MysqlOptions.fromObject(e.mysql,t+1)}return n},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)"__proto__"===n[i]&&a.makeProp(r.labels,n[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)"__proto__"===n[i]&&a.makeProp(r.additionalOptions,n[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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfig.Metadata;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.overview=e.string();break;case 2:a.extraProperties=s.google.protobuf.Struct.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.overview&&e.hasOwnProperty("overview")&&!a.isString(e.overview))return"overview: string expected";if(null!=e.extraProperties&&e.hasOwnProperty("extraProperties")){var n=s.google.protobuf.Struct.verify(e.extraProperties,t+1);if(n)return"extraProperties."+n}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.Metadata)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.Metadata;if(null!=e.overview&&(n.overview=String(e.overview)),null!=e.extraProperties){if("object"!=typeof e.extraProperties)throw TypeError(".sqlanvil.ActionConfig.Metadata.extraProperties: object expected");n.extraProperties=s.google.protobuf.Struct.fromObject(e.extraProperties,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.ActionConfig.ViewConfig;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.name=e.string();break;case 2:u.dataset=e.string();break;case 3:u.project=e.string();break;case 4:u.dependencyTargets&&u.dependencyTargets.length||(u.dependencyTargets=[]),u.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32(),void 0,r+1));break;case 5:u.filename=e.string();break;case 6:u.tags&&u.tags.length||(u.tags=[]),u.tags.push(e.string());break;case 7:u.disabled=e.bool();break;case 8:u.preOperations&&u.preOperations.length||(u.preOperations=[]),u.preOperations.push(e.string());break;case 9:u.postOperations&&u.postOperations.length||(u.postOperations=[]),u.postOperations.push(e.string());break;case 10:u.materialized=e.bool();break;case 18:u.partitionBy=e.string();break;case 19:u.clusterBy&&u.clusterBy.length||(u.clusterBy=[]),u.clusterBy.push(e.string());break;case 11:u.description=e.string();break;case 12:u.columns&&u.columns.length||(u.columns=[]),u.columns.push(s.sqlanvil.ActionConfig.ColumnDescriptor.decode(e,e.uint32(),void 0,r+1));break;case 13:u.labels===a.emptyObject&&(u.labels={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;)switch((f=e.uint32())>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}"__proto__"===o&&a.makeProp(u.labels,o),u.labels[o]=l;break;case 14:for(u.additionalOptions===a.emptyObject&&(u.additionalOptions={}),d=e.uint32()+e.pos,o="",l="";e.pos<d;){var f;switch((f=e.uint32())>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.additionalOptions,o),u.additionalOptions[o]=l;break;case 15:u.dependOnDependencyAssertions=e.bool();break;case 16:u.hermetic=e.bool();break;case 17:u.assertions=s.sqlanvil.ActionConfig.TableAssertionsConfig.decode(e,e.uint32(),void 0,r+1);break;case 20:u.metadata=s.sqlanvil.ActionConfig.Metadata.decode(e,e.uint32(),void 0,r+1);break;case 21:u.reservation=e.string();break;case 22:u.postgres=s.sqlanvil.PostgresOptions.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.dependencyTargets.length;++n)if(i=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[n],t+1))return"dependencyTargets."+i}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(n=0;n<e.tags.length;++n)if(!a.isString(e.tags[n]))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(n=0;n<e.preOperations.length;++n)if(!a.isString(e.preOperations[n]))return"preOperations: string[] expected"}if(null!=e.postOperations&&e.hasOwnProperty("postOperations")){if(!Array.isArray(e.postOperations))return"postOperations: array expected";for(n=0;n<e.postOperations.length;++n)if(!a.isString(e.postOperations[n]))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(n=0;n<e.clusterBy.length;++n)if(!a.isString(e.clusterBy[n]))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(n=0;n<e.columns.length;++n)if(i=s.sqlanvil.ActionConfig.ColumnDescriptor.verify(e.columns[n],t+1))return"columns."+i}if(null!=e.labels&&e.hasOwnProperty("labels")){if(!a.isObject(e.labels))return"labels: object expected";var r=Object.keys(e.labels);for(n=0;n<r.length;++n)if(!a.isString(e.labels[r[n]]))return"labels: string{k:string} expected"}if(null!=e.additionalOptions&&e.hasOwnProperty("additionalOptions")){if(!a.isObject(e.additionalOptions))return"additionalOptions: object expected";for(r=Object.keys(e.additionalOptions),n=0;n<r.length;++n)if(!a.isString(e.additionalOptions[r[n]]))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")&&(i=s.sqlanvil.ActionConfig.TableAssertionsConfig.verify(e.assertions,t+1))?"assertions."+i:null!=e.metadata&&e.hasOwnProperty("metadata")&&(i=s.sqlanvil.ActionConfig.Metadata.verify(e.metadata,t+1))?"metadata."+i:null!=e.reservation&&e.hasOwnProperty("reservation")&&!a.isString(e.reservation)?"reservation: string expected":null!=e.postgres&&e.hasOwnProperty("postgres")&&(i=s.sqlanvil.PostgresOptions.verify(e.postgres,t+1))?"postgres."+i:null;var i},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.ViewConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.ViewConfig;if(null!=e.name&&(n.name=String(e.name)),null!=e.dataset&&(n.dataset=String(e.dataset)),null!=e.project&&(n.project=String(e.project)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.ViewConfig.dependencyTargets: array expected");n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.ActionConfig.ViewConfig.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[r],t+1)}}if(null!=e.filename&&(n.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.ViewConfig.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}if(null!=e.disabled&&(n.disabled=Boolean(e.disabled)),e.preOperations){if(!Array.isArray(e.preOperations))throw TypeError(".sqlanvil.ActionConfig.ViewConfig.preOperations: array expected");for(n.preOperations=[],r=0;r<e.preOperations.length;++r)n.preOperations[r]=String(e.preOperations[r])}if(e.postOperations){if(!Array.isArray(e.postOperations))throw TypeError(".sqlanvil.ActionConfig.ViewConfig.postOperations: array expected");for(n.postOperations=[],r=0;r<e.postOperations.length;++r)n.postOperations[r]=String(e.postOperations[r])}if(null!=e.materialized&&(n.materialized=Boolean(e.materialized)),null!=e.partitionBy&&(n.partitionBy=String(e.partitionBy)),e.clusterBy){if(!Array.isArray(e.clusterBy))throw TypeError(".sqlanvil.ActionConfig.ViewConfig.clusterBy: array expected");for(n.clusterBy=[],r=0;r<e.clusterBy.length;++r)n.clusterBy[r]=String(e.clusterBy[r])}if(null!=e.description&&(n.description=String(e.description)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.ActionConfig.ViewConfig.columns: array expected");for(n.columns=[],r=0;r<e.columns.length;++r){if("object"!=typeof e.columns[r])throw TypeError(".sqlanvil.ActionConfig.ViewConfig.columns: object expected");n.columns[r]=s.sqlanvil.ActionConfig.ColumnDescriptor.fromObject(e.columns[r],t+1)}}if(e.labels){if("object"!=typeof e.labels)throw TypeError(".sqlanvil.ActionConfig.ViewConfig.labels: object expected");n.labels={};var i=Object.keys(e.labels);for(r=0;r<i.length;++r)"__proto__"===i[r]&&a.makeProp(n.labels,i[r]),n.labels[i[r]]=String(e.labels[i[r]])}if(e.additionalOptions){if("object"!=typeof e.additionalOptions)throw TypeError(".sqlanvil.ActionConfig.ViewConfig.additionalOptions: object expected");for(n.additionalOptions={},i=Object.keys(e.additionalOptions),r=0;r<i.length;++r)"__proto__"===i[r]&&a.makeProp(n.additionalOptions,i[r]),n.additionalOptions[i[r]]=String(e.additionalOptions[i[r]])}if(null!=e.dependOnDependencyAssertions&&(n.dependOnDependencyAssertions=Boolean(e.dependOnDependencyAssertions)),null!=e.hermetic&&(n.hermetic=Boolean(e.hermetic)),null!=e.assertions){if("object"!=typeof e.assertions)throw TypeError(".sqlanvil.ActionConfig.ViewConfig.assertions: object expected");n.assertions=s.sqlanvil.ActionConfig.TableAssertionsConfig.fromObject(e.assertions,t+1)}if(null!=e.metadata){if("object"!=typeof e.metadata)throw TypeError(".sqlanvil.ActionConfig.ViewConfig.metadata: object expected");n.metadata=s.sqlanvil.ActionConfig.Metadata.fromObject(e.metadata,t+1)}if(null!=e.reservation&&(n.reservation=String(e.reservation)),null!=e.postgres){if("object"!=typeof e.postgres)throw TypeError(".sqlanvil.ActionConfig.ViewConfig.postgres: object expected");n.postgres=s.sqlanvil.PostgresOptions.fromObject(e.postgres,t+1)}return n},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)"__proto__"===n[i]&&a.makeProp(r.labels,n[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)"__proto__"===n[i]&&a.makeProp(r.additionalOptions,n[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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.ActionConfig.IncrementalTableConfig;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.name=e.string();break;case 2:u.dataset=e.string();break;case 3:u.project=e.string();break;case 4:u.dependencyTargets&&u.dependencyTargets.length||(u.dependencyTargets=[]),u.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32(),void 0,r+1));break;case 5:u.filename=e.string();break;case 6:u.tags&&u.tags.length||(u.tags=[]),u.tags.push(e.string());break;case 7:u.disabled=e.bool();break;case 8:u.preOperations&&u.preOperations.length||(u.preOperations=[]),u.preOperations.push(e.string());break;case 9:u.postOperations&&u.postOperations.length||(u.postOperations=[]),u.postOperations.push(e.string());break;case 10:u.protected=e.bool();break;case 11:u.uniqueKey&&u.uniqueKey.length||(u.uniqueKey=[]),u.uniqueKey.push(e.string());break;case 12:u.description=e.string();break;case 13:u.columns&&u.columns.length||(u.columns=[]),u.columns.push(s.sqlanvil.ActionConfig.ColumnDescriptor.decode(e,e.uint32(),void 0,r+1));break;case 14:u.partitionBy=e.string();break;case 15:u.partitionExpirationDays=e.int32();break;case 16:u.requirePartitionFilter=e.bool();break;case 17:u.updatePartitionFilter=e.string();break;case 18:u.clusterBy&&u.clusterBy.length||(u.clusterBy=[]),u.clusterBy.push(e.string());break;case 19:u.labels===a.emptyObject&&(u.labels={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;)switch((f=e.uint32())>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}"__proto__"===o&&a.makeProp(u.labels,o),u.labels[o]=l;break;case 20:for(u.additionalOptions===a.emptyObject&&(u.additionalOptions={}),d=e.uint32()+e.pos,o="",l="";e.pos<d;){var f;switch((f=e.uint32())>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.additionalOptions,o),u.additionalOptions[o]=l;break;case 21:u.dependOnDependencyAssertions=e.bool();break;case 22:u.assertions=s.sqlanvil.ActionConfig.TableAssertionsConfig.decode(e,e.uint32(),void 0,r+1);break;case 23:u.hermetic=e.bool();break;case 24:u.onSchemaChange=e.int32();break;case 25:u.iceberg=s.sqlanvil.ActionConfig.IcebergTableConfig.decode(e,e.uint32(),void 0,r+1);break;case 26:u.metadata=s.sqlanvil.ActionConfig.Metadata.decode(e,e.uint32(),void 0,r+1);break;case 27:u.reservation=e.string();break;case 28:u.postgres=s.sqlanvil.PostgresOptions.decode(e,e.uint32(),void 0,r+1);break;case 29:u.supabase=s.sqlanvil.SupabaseOptions.decode(e,e.uint32(),void 0,r+1);break;case 30:u.mysql=s.sqlanvil.MysqlOptions.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.dependencyTargets.length;++n)if(i=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[n],t+1))return"dependencyTargets."+i}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(n=0;n<e.tags.length;++n)if(!a.isString(e.tags[n]))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(n=0;n<e.preOperations.length;++n)if(!a.isString(e.preOperations[n]))return"preOperations: string[] expected"}if(null!=e.postOperations&&e.hasOwnProperty("postOperations")){if(!Array.isArray(e.postOperations))return"postOperations: array expected";for(n=0;n<e.postOperations.length;++n)if(!a.isString(e.postOperations[n]))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(n=0;n<e.uniqueKey.length;++n)if(!a.isString(e.uniqueKey[n]))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(n=0;n<e.columns.length;++n)if(i=s.sqlanvil.ActionConfig.ColumnDescriptor.verify(e.columns[n],t+1))return"columns."+i}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(n=0;n<e.clusterBy.length;++n)if(!a.isString(e.clusterBy[n]))return"clusterBy: 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(n=0;n<r.length;++n)if(!a.isString(e.labels[r[n]]))return"labels: string{k:string} expected"}if(null!=e.additionalOptions&&e.hasOwnProperty("additionalOptions")){if(!a.isObject(e.additionalOptions))return"additionalOptions: object expected";for(r=Object.keys(e.additionalOptions),n=0;n<r.length;++n)if(!a.isString(e.additionalOptions[r[n]]))return"additionalOptions: string{k:string} expected"}if(null!=e.dependOnDependencyAssertions&&e.hasOwnProperty("dependOnDependencyAssertions")&&"boolean"!=typeof e.dependOnDependencyAssertions)return"dependOnDependencyAssertions: boolean expected";var i;if(null!=e.assertions&&e.hasOwnProperty("assertions")&&(i=s.sqlanvil.ActionConfig.TableAssertionsConfig.verify(e.assertions,t+1)))return"assertions."+i;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")&&(i=s.sqlanvil.ActionConfig.IcebergTableConfig.verify(e.iceberg,t+1))?"iceberg."+i:null!=e.metadata&&e.hasOwnProperty("metadata")&&(i=s.sqlanvil.ActionConfig.Metadata.verify(e.metadata,t+1))?"metadata."+i:null!=e.reservation&&e.hasOwnProperty("reservation")&&!a.isString(e.reservation)?"reservation: string expected":null!=e.postgres&&e.hasOwnProperty("postgres")&&(i=s.sqlanvil.PostgresOptions.verify(e.postgres,t+1))?"postgres."+i:null!=e.supabase&&e.hasOwnProperty("supabase")&&(i=s.sqlanvil.SupabaseOptions.verify(e.supabase,t+1))?"supabase."+i:null!=e.mysql&&e.hasOwnProperty("mysql")&&(i=s.sqlanvil.MysqlOptions.verify(e.mysql,t+1))?"mysql."+i:null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.IncrementalTableConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.IncrementalTableConfig;if(null!=e.name&&(n.name=String(e.name)),null!=e.dataset&&(n.dataset=String(e.dataset)),null!=e.project&&(n.project=String(e.project)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.dependencyTargets: array expected");n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[r],t+1)}}if(null!=e.filename&&(n.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}if(null!=e.disabled&&(n.disabled=Boolean(e.disabled)),e.preOperations){if(!Array.isArray(e.preOperations))throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.preOperations: array expected");for(n.preOperations=[],r=0;r<e.preOperations.length;++r)n.preOperations[r]=String(e.preOperations[r])}if(e.postOperations){if(!Array.isArray(e.postOperations))throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.postOperations: array expected");for(n.postOperations=[],r=0;r<e.postOperations.length;++r)n.postOperations[r]=String(e.postOperations[r])}if(null!=e.protected&&(n.protected=Boolean(e.protected)),e.uniqueKey){if(!Array.isArray(e.uniqueKey))throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.uniqueKey: array expected");for(n.uniqueKey=[],r=0;r<e.uniqueKey.length;++r)n.uniqueKey[r]=String(e.uniqueKey[r])}if(null!=e.description&&(n.description=String(e.description)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.columns: array expected");for(n.columns=[],r=0;r<e.columns.length;++r){if("object"!=typeof e.columns[r])throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.columns: object expected");n.columns[r]=s.sqlanvil.ActionConfig.ColumnDescriptor.fromObject(e.columns[r],t+1)}}if(null!=e.partitionBy&&(n.partitionBy=String(e.partitionBy)),null!=e.partitionExpirationDays&&(n.partitionExpirationDays=0|e.partitionExpirationDays),null!=e.requirePartitionFilter&&(n.requirePartitionFilter=Boolean(e.requirePartitionFilter)),null!=e.updatePartitionFilter&&(n.updatePartitionFilter=String(e.updatePartitionFilter)),e.clusterBy){if(!Array.isArray(e.clusterBy))throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.clusterBy: array expected");for(n.clusterBy=[],r=0;r<e.clusterBy.length;++r)n.clusterBy[r]=String(e.clusterBy[r])}if(e.labels){if("object"!=typeof e.labels)throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.labels: object expected");n.labels={};var i=Object.keys(e.labels);for(r=0;r<i.length;++r)"__proto__"===i[r]&&a.makeProp(n.labels,i[r]),n.labels[i[r]]=String(e.labels[i[r]])}if(e.additionalOptions){if("object"!=typeof e.additionalOptions)throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.additionalOptions: object expected");for(n.additionalOptions={},i=Object.keys(e.additionalOptions),r=0;r<i.length;++r)"__proto__"===i[r]&&a.makeProp(n.additionalOptions,i[r]),n.additionalOptions[i[r]]=String(e.additionalOptions[i[r]])}if(null!=e.dependOnDependencyAssertions&&(n.dependOnDependencyAssertions=Boolean(e.dependOnDependencyAssertions)),null!=e.assertions){if("object"!=typeof e.assertions)throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.assertions: object expected");n.assertions=s.sqlanvil.ActionConfig.TableAssertionsConfig.fromObject(e.assertions,t+1)}switch(null!=e.hermetic&&(n.hermetic=Boolean(e.hermetic)),e.onSchemaChange){default:if("number"==typeof e.onSchemaChange){n.onSchemaChange=e.onSchemaChange;break}break;case"IGNORE":case 0:n.onSchemaChange=0;break;case"FAIL":case 1:n.onSchemaChange=1;break;case"EXTEND":case 2:n.onSchemaChange=2;break;case"SYNCHRONIZE":case 3:n.onSchemaChange=3}if(null!=e.iceberg){if("object"!=typeof e.iceberg)throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.iceberg: object expected");n.iceberg=s.sqlanvil.ActionConfig.IcebergTableConfig.fromObject(e.iceberg,t+1)}if(null!=e.metadata){if("object"!=typeof e.metadata)throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.metadata: object expected");n.metadata=s.sqlanvil.ActionConfig.Metadata.fromObject(e.metadata,t+1)}if(null!=e.reservation&&(n.reservation=String(e.reservation)),null!=e.postgres){if("object"!=typeof e.postgres)throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.postgres: object expected");n.postgres=s.sqlanvil.PostgresOptions.fromObject(e.postgres,t+1)}if(null!=e.supabase){if("object"!=typeof e.supabase)throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.supabase: object expected");n.supabase=s.sqlanvil.SupabaseOptions.fromObject(e.supabase,t+1)}if(null!=e.mysql){if("object"!=typeof e.mysql)throw TypeError(".sqlanvil.ActionConfig.IncrementalTableConfig.mysql: object expected");n.mysql=s.sqlanvil.MysqlOptions.fromObject(e.mysql,t+1)}return n},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)"__proto__"===n[i]&&a.makeProp(r.labels,n[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)"__proto__"===n[i]&&a.makeProp(r.additionalOptions,n[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]]&&"__proto__"!==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.prototype.metadata=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]);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),null!=e.metadata&&Object.hasOwnProperty.call(e,"metadata")&&s.sqlanvil.ActionConfig.Metadata.encode(e.metadata,t.uint32(98).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfig.AssertionConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.name=e.string();break;case 2:a.dataset=e.string();break;case 3:a.project=e.string();break;case 4:a.dependencyTargets&&a.dependencyTargets.length||(a.dependencyTargets=[]),a.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32(),void 0,r+1));break;case 5:a.filename=e.string();break;case 6:a.tags&&a.tags.length||(a.tags=[]),a.tags.push(e.string());break;case 7:a.disabled=e.bool();break;case 8:a.description=e.string();break;case 9:a.hermetic=e.bool();break;case 10:a.dependOnDependencyAssertions=e.bool();break;case 11:a.reservation=e.string();break;case 12:a.metadata=s.sqlanvil.ActionConfig.Metadata.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.dependencyTargets.length;++n)if(r=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[n],t+1))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(n=0;n<e.tags.length;++n)if(!a.isString(e.tags[n]))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!=e.metadata&&e.hasOwnProperty("metadata")&&(r=s.sqlanvil.ActionConfig.Metadata.verify(e.metadata,t+1))?"metadata."+r:null;var r},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.AssertionConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.AssertionConfig;if(null!=e.name&&(n.name=String(e.name)),null!=e.dataset&&(n.dataset=String(e.dataset)),null!=e.project&&(n.project=String(e.project)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.AssertionConfig.dependencyTargets: array expected");n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.ActionConfig.AssertionConfig.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[r],t+1)}}if(null!=e.filename&&(n.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.AssertionConfig.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}if(null!=e.disabled&&(n.disabled=Boolean(e.disabled)),null!=e.description&&(n.description=String(e.description)),null!=e.hermetic&&(n.hermetic=Boolean(e.hermetic)),null!=e.dependOnDependencyAssertions&&(n.dependOnDependencyAssertions=Boolean(e.dependOnDependencyAssertions)),null!=e.reservation&&(n.reservation=String(e.reservation)),null!=e.metadata){if("object"!=typeof e.metadata)throw TypeError(".sqlanvil.ActionConfig.AssertionConfig.metadata: object expected");n.metadata=s.sqlanvil.ActionConfig.Metadata.fromObject(e.metadata,t+1)}return n},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="",n.metadata=null),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),null!=e.metadata&&e.hasOwnProperty("metadata")&&(n.metadata=s.sqlanvil.ActionConfig.Metadata.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.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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfig.OperationConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.name=e.string();break;case 2:a.dataset=e.string();break;case 3:a.project=e.string();break;case 4:a.dependencyTargets&&a.dependencyTargets.length||(a.dependencyTargets=[]),a.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32(),void 0,r+1));break;case 5:a.filename=e.string();break;case 6:a.tags&&a.tags.length||(a.tags=[]),a.tags.push(e.string());break;case 7:a.disabled=e.bool();break;case 8:a.hasOutput=e.bool();break;case 9:a.description=e.string();break;case 10:a.columns&&a.columns.length||(a.columns=[]),a.columns.push(s.sqlanvil.ActionConfig.ColumnDescriptor.decode(e,e.uint32(),void 0,r+1));break;case 11:a.dependOnDependencyAssertions=e.bool();break;case 12:a.hermetic=e.bool();break;case 13:a.reservation=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.dependencyTargets.length;++n)if(r=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[n],t+1))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(n=0;n<e.tags.length;++n)if(!a.isString(e.tags[n]))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(n=0;n<e.columns.length;++n){var r;if(r=s.sqlanvil.ActionConfig.ColumnDescriptor.verify(e.columns[n],t+1))return"columns."+r}}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,t){if(e instanceof s.sqlanvil.ActionConfig.OperationConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.OperationConfig;if(null!=e.name&&(n.name=String(e.name)),null!=e.dataset&&(n.dataset=String(e.dataset)),null!=e.project&&(n.project=String(e.project)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.OperationConfig.dependencyTargets: array expected");n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.ActionConfig.OperationConfig.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[r],t+1)}}if(null!=e.filename&&(n.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.OperationConfig.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}if(null!=e.disabled&&(n.disabled=Boolean(e.disabled)),null!=e.hasOutput&&(n.hasOutput=Boolean(e.hasOutput)),null!=e.description&&(n.description=String(e.description)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.ActionConfig.OperationConfig.columns: array expected");for(n.columns=[],r=0;r<e.columns.length;++r){if("object"!=typeof e.columns[r])throw TypeError(".sqlanvil.ActionConfig.OperationConfig.columns: object expected");n.columns[r]=s.sqlanvil.ActionConfig.ColumnDescriptor.fromObject(e.columns[r],t+1)}}return null!=e.dependOnDependencyAssertions&&(n.dependOnDependencyAssertions=Boolean(e.dependOnDependencyAssertions)),null!=e.hermetic&&(n.hermetic=Boolean(e.hermetic)),null!=e.reservation&&(n.reservation=String(e.reservation)),n},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.ExportOptions=function(){function t(e){if(this.options={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&"__proto__"!==t[n]&&(this[t[n]]=e[t[n]])}return t.prototype.location="",t.prototype.format="",t.prototype.overwrite=!1,t.prototype.filename="",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.location&&Object.hasOwnProperty.call(e,"location")&&t.uint32(10).string(e.location),null!=e.format&&Object.hasOwnProperty.call(e,"format")&&t.uint32(18).string(e.format),null!=e.overwrite&&Object.hasOwnProperty.call(e,"overwrite")&&t.uint32(24).bool(e.overwrite),null!=e.filename&&Object.hasOwnProperty.call(e,"filename")&&t.uint32(34).string(e.filename),null!=e.options&&Object.hasOwnProperty.call(e,"options"))for(var n=Object.keys(e.options),r=0;r<n.length;++r)t.uint32(42).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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.ActionConfig.ExportOptions;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.location=e.string();break;case 2:u.format=e.string();break;case 3:u.overwrite=e.bool();break;case 4:u.filename=e.string();break;case 5:u.options===a.emptyObject&&(u.options={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;){var f=e.uint32();switch(f>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.options,o),u.options[o]=l;break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.location&&e.hasOwnProperty("location")&&!a.isString(e.location))return"location: string expected";if(null!=e.format&&e.hasOwnProperty("format")&&!a.isString(e.format))return"format: string expected";if(null!=e.overwrite&&e.hasOwnProperty("overwrite")&&"boolean"!=typeof e.overwrite)return"overwrite: boolean expected";if(null!=e.filename&&e.hasOwnProperty("filename")&&!a.isString(e.filename))return"filename: string expected";if(null!=e.options&&e.hasOwnProperty("options")){if(!a.isObject(e.options))return"options: object expected";for(var n=Object.keys(e.options),r=0;r<n.length;++r)if(!a.isString(e.options[n[r]]))return"options: string{k:string} expected"}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.ExportOptions)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.ExportOptions;if(null!=e.location&&(n.location=String(e.location)),null!=e.format&&(n.format=String(e.format)),null!=e.overwrite&&(n.overwrite=Boolean(e.overwrite)),null!=e.filename&&(n.filename=String(e.filename)),e.options){if("object"!=typeof e.options)throw TypeError(".sqlanvil.ActionConfig.ExportOptions.options: object expected");n.options={};for(var r=Object.keys(e.options),i=0;i<r.length;++i)"__proto__"===r[i]&&a.makeProp(n.options,r[i]),n.options[r[i]]=String(e.options[r[i]])}return n},t.toObject=function(e,t){t||(t={});var n,r={};if((t.objects||t.defaults)&&(r.options={}),t.defaults&&(r.location="",r.format="",r.overwrite=!1,r.filename=""),null!=e.location&&e.hasOwnProperty("location")&&(r.location=e.location),null!=e.format&&e.hasOwnProperty("format")&&(r.format=e.format),null!=e.overwrite&&e.hasOwnProperty("overwrite")&&(r.overwrite=e.overwrite),null!=e.filename&&e.hasOwnProperty("filename")&&(r.filename=e.filename),e.options&&(n=Object.keys(e.options)).length){r.options={};for(var i=0;i<n.length;++i)"__proto__"===n[i]&&a.makeProp(r.options,n[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.ActionConfig.ExportOptions"},t}(),t.ExportConfig=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]]&&"__proto__"!==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.export=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]);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.export&&Object.hasOwnProperty.call(e,"export")&&s.sqlanvil.ActionConfig.ExportOptions.encode(e.export,t.uint32(82).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfig.ExportConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.name=e.string();break;case 2:a.dataset=e.string();break;case 3:a.project=e.string();break;case 4:a.dependencyTargets&&a.dependencyTargets.length||(a.dependencyTargets=[]),a.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32(),void 0,r+1));break;case 5:a.filename=e.string();break;case 6:a.tags&&a.tags.length||(a.tags=[]),a.tags.push(e.string());break;case 7:a.disabled=e.bool();break;case 8:a.description=e.string();break;case 9:a.hermetic=e.bool();break;case 10:a.export=s.sqlanvil.ActionConfig.ExportOptions.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.dependencyTargets.length;++n)if(r=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[n],t+1))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(n=0;n<e.tags.length;++n)if(!a.isString(e.tags[n]))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.export&&e.hasOwnProperty("export")&&(r=s.sqlanvil.ActionConfig.ExportOptions.verify(e.export,t+1))?"export."+r:null;var r},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.ExportConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.ExportConfig;if(null!=e.name&&(n.name=String(e.name)),null!=e.dataset&&(n.dataset=String(e.dataset)),null!=e.project&&(n.project=String(e.project)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.ExportConfig.dependencyTargets: array expected");n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.ActionConfig.ExportConfig.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[r],t+1)}}if(null!=e.filename&&(n.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.ExportConfig.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}if(null!=e.disabled&&(n.disabled=Boolean(e.disabled)),null!=e.description&&(n.description=String(e.description)),null!=e.hermetic&&(n.hermetic=Boolean(e.hermetic)),null!=e.export){if("object"!=typeof e.export)throw TypeError(".sqlanvil.ActionConfig.ExportConfig.export: object expected");n.export=s.sqlanvil.ActionConfig.ExportOptions.fromObject(e.export,t+1)}return n},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.export=null),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.export&&e.hasOwnProperty("export")&&(n.export=s.sqlanvil.ActionConfig.ExportOptions.toObject(e.export,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.ExportConfig"},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.ActionConfig.DeclarationConfig;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.name=e.string();break;case 2:u.dataset=e.string();break;case 3:u.project=e.string();break;case 4:u.description=e.string();break;case 5:u.columns&&u.columns.length||(u.columns=[]),u.columns.push(s.sqlanvil.ActionConfig.ColumnDescriptor.decode(e,e.uint32(),void 0,r+1));break;case 6:u.filename=e.string();break;case 7:u.tags&&u.tags.length||(u.tags=[]),u.tags.push(e.string());break;case 8:u.connection=e.string();break;case 9:u.columnTypes===a.emptyObject&&(u.columnTypes={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;){var f=e.uint32();switch(f>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.columnTypes,o),u.columnTypes[o]=l;break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.columns.length;++n){var r=s.sqlanvil.ActionConfig.ColumnDescriptor.verify(e.columns[n],t+1);if(r)return"columns."+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(n=0;n<e.tags.length;++n)if(!a.isString(e.tags[n]))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 i=Object.keys(e.columnTypes);for(n=0;n<i.length;++n)if(!a.isString(e.columnTypes[i[n]]))return"columnTypes: string{k:string} expected"}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.DeclarationConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.DeclarationConfig;if(null!=e.name&&(n.name=String(e.name)),null!=e.dataset&&(n.dataset=String(e.dataset)),null!=e.project&&(n.project=String(e.project)),null!=e.description&&(n.description=String(e.description)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.ActionConfig.DeclarationConfig.columns: array expected");n.columns=[];for(var r=0;r<e.columns.length;++r){if("object"!=typeof e.columns[r])throw TypeError(".sqlanvil.ActionConfig.DeclarationConfig.columns: object expected");n.columns[r]=s.sqlanvil.ActionConfig.ColumnDescriptor.fromObject(e.columns[r],t+1)}}if(null!=e.filename&&(n.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.DeclarationConfig.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}if(null!=e.connection&&(n.connection=String(e.connection)),e.columnTypes){if("object"!=typeof e.columnTypes)throw TypeError(".sqlanvil.ActionConfig.DeclarationConfig.columnTypes: object expected");n.columnTypes={};var i=Object.keys(e.columnTypes);for(r=0;r<i.length;++r)"__proto__"===i[r]&&a.makeProp(n.columnTypes,i[r]),n.columnTypes[i[r]]=String(e.columnTypes[i[r]])}return n},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)"__proto__"===n[i]&&a.makeProp(r.columnTypes,n[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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfig.NotebookConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.name=e.string();break;case 2:a.location=e.string();break;case 3:a.project=e.string();break;case 4:a.dependencyTargets&&a.dependencyTargets.length||(a.dependencyTargets=[]),a.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32(),void 0,r+1));break;case 5:a.filename=e.string();break;case 6:a.tags&&a.tags.length||(a.tags=[]),a.tags.push(e.string());break;case 7:a.disabled=e.bool();break;case 8:a.description=e.string();break;case 9:a.dependOnDependencyAssertions=e.bool();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.dependencyTargets.length;++n){var r=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[n],t+1);if(r)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(n=0;n<e.tags.length;++n)if(!a.isString(e.tags[n]))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,t){if(e instanceof s.sqlanvil.ActionConfig.NotebookConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.NotebookConfig;if(null!=e.name&&(n.name=String(e.name)),null!=e.location&&(n.location=String(e.location)),null!=e.project&&(n.project=String(e.project)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.NotebookConfig.dependencyTargets: array expected");n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.ActionConfig.NotebookConfig.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[r],t+1)}}if(null!=e.filename&&(n.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.NotebookConfig.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}return null!=e.disabled&&(n.disabled=Boolean(e.disabled)),null!=e.description&&(n.description=String(e.description)),null!=e.dependOnDependencyAssertions&&(n.dependOnDependencyAssertions=Boolean(e.dependOnDependencyAssertions)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfig.DataPreparationConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.name=e.string();break;case 13:a.dataset=e.string();break;case 14:a.project=e.string();break;case 2:a.dependencyTargets&&a.dependencyTargets.length||(a.dependencyTargets=[]),a.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32(),void 0,r+1));break;case 3:a.filename=e.string();break;case 4:a.tags&&a.tags.length||(a.tags=[]),a.tags.push(e.string());break;case 7:a.disabled=e.bool();break;case 8:a.description=e.string();break;case 11:a.errorTable=s.sqlanvil.ActionConfig.DataPreparationConfig.ErrorTableConfig.decode(e,e.uint32(),void 0,r+1);break;case 12:a.loadMode=s.sqlanvil.ActionConfig.LoadModeConfig.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.dependencyTargets.length;++n)if(r=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[n],t+1))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(n=0;n<e.tags.length;++n)if(!a.isString(e.tags[n]))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")&&(r=s.sqlanvil.ActionConfig.DataPreparationConfig.ErrorTableConfig.verify(e.errorTable,t+1))?"errorTable."+r:null!=e.loadMode&&e.hasOwnProperty("loadMode")&&(r=s.sqlanvil.ActionConfig.LoadModeConfig.verify(e.loadMode,t+1))?"loadMode."+r:null;var r},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.DataPreparationConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.DataPreparationConfig;if(null!=e.name&&(n.name=String(e.name)),null!=e.dataset&&(n.dataset=String(e.dataset)),null!=e.project&&(n.project=String(e.project)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.DataPreparationConfig.dependencyTargets: array expected");n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.ActionConfig.DataPreparationConfig.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[r],t+1)}}if(null!=e.filename&&(n.filename=String(e.filename)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ActionConfig.DataPreparationConfig.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}if(null!=e.disabled&&(n.disabled=Boolean(e.disabled)),null!=e.description&&(n.description=String(e.description)),null!=e.errorTable){if("object"!=typeof e.errorTable)throw TypeError(".sqlanvil.ActionConfig.DataPreparationConfig.errorTable: object expected");n.errorTable=s.sqlanvil.ActionConfig.DataPreparationConfig.ErrorTableConfig.fromObject(e.errorTable,t+1)}if(null!=e.loadMode){if("object"!=typeof e.loadMode)throw TypeError(".sqlanvil.ActionConfig.DataPreparationConfig.loadMode: object expected");n.loadMode=s.sqlanvil.ActionConfig.LoadModeConfig.fromObject(e.loadMode,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfig.DataPreparationConfig.ErrorTableConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.name=e.string();break;case 2:a.dataset=e.string();break;case 3:a.project=e.string();break;case 4:a.retentionDays=e.int32();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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,t){if(e instanceof s.sqlanvil.ActionConfig.DataPreparationConfig.ErrorTableConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.DataPreparationConfig.ErrorTableConfig;return null!=e.name&&(n.name=String(e.name)),null!=e.dataset&&(n.dataset=String(e.dataset)),null!=e.project&&(n.project=String(e.project)),null!=e.retentionDays&&(n.retentionDays=0|e.retentionDays),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfig.RlsPolicyConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.name=e.string();break;case 2:a.table=e.string();break;case 3:a.command=e.string();break;case 4:a.roles&&a.roles.length||(a.roles=[]),a.roles.push(e.string());break;case 5:a.using=e.string();break;case 6:a.withCheck=e.string();break;case 7:a.filename=e.string();break;case 8:a.dependencyTargets&&a.dependencyTargets.length||(a.dependencyTargets=[]),a.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32(),void 0,r+1));break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.roles.length;++n)if(!a.isString(e.roles[n]))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(n=0;n<e.dependencyTargets.length;++n){var r=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[n],t+1);if(r)return"dependencyTargets."+r}}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.RlsPolicyConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.RlsPolicyConfig;if(null!=e.name&&(n.name=String(e.name)),null!=e.table&&(n.table=String(e.table)),null!=e.command&&(n.command=String(e.command)),e.roles){if(!Array.isArray(e.roles))throw TypeError(".sqlanvil.ActionConfig.RlsPolicyConfig.roles: array expected");n.roles=[];for(var r=0;r<e.roles.length;++r)n.roles[r]=String(e.roles[r])}if(null!=e.using&&(n.using=String(e.using)),null!=e.withCheck&&(n.withCheck=String(e.withCheck)),null!=e.filename&&(n.filename=String(e.filename)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.RlsPolicyConfig.dependencyTargets: array expected");for(n.dependencyTargets=[],r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.ActionConfig.RlsPolicyConfig.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[r],t+1)}}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfig.RealtimePublicationConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.name=e.string();break;case 2:a.table=e.string();break;case 3:a.events&&a.events.length||(a.events=[]),a.events.push(e.string());break;case 4:a.filename=e.string();break;case 5:a.dependencyTargets&&a.dependencyTargets.length||(a.dependencyTargets=[]),a.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32(),void 0,r+1));break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.events.length;++n)if(!a.isString(e.events[n]))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(n=0;n<e.dependencyTargets.length;++n){var r=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[n],t+1);if(r)return"dependencyTargets."+r}}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.RealtimePublicationConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.RealtimePublicationConfig;if(null!=e.name&&(n.name=String(e.name)),null!=e.table&&(n.table=String(e.table)),e.events){if(!Array.isArray(e.events))throw TypeError(".sqlanvil.ActionConfig.RealtimePublicationConfig.events: array expected");n.events=[];for(var r=0;r<e.events.length;++r)n.events[r]=String(e.events[r])}if(null!=e.filename&&(n.filename=String(e.filename)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.RealtimePublicationConfig.dependencyTargets: array expected");for(n.dependencyTargets=[],r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.ActionConfig.RealtimePublicationConfig.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[r],t+1)}}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.ActionConfig.ForeignWrapperConfig;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.name=e.string();break;case 2:u.wrapper=e.string();break;case 3:u.server=e.string();break;case 4:u.options===a.emptyObject&&(u.options={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;){var f=e.uint32();switch(f>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.options,o),u.options[o]=l;break;case 5:u.filename=e.string();break;case 6:u.dependencyTargets&&u.dependencyTargets.length||(u.dependencyTargets=[]),u.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32(),void 0,r+1));break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=Object.keys(e.options),r=0;r<n.length;++r)if(!a.isString(e.options[n[r]]))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(r=0;r<e.dependencyTargets.length;++r){var i=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[r],t+1);if(i)return"dependencyTargets."+i}}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.ForeignWrapperConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.ForeignWrapperConfig;if(null!=e.name&&(n.name=String(e.name)),null!=e.wrapper&&(n.wrapper=String(e.wrapper)),null!=e.server&&(n.server=String(e.server)),e.options){if("object"!=typeof e.options)throw TypeError(".sqlanvil.ActionConfig.ForeignWrapperConfig.options: object expected");n.options={};for(var r=Object.keys(e.options),i=0;i<r.length;++i)"__proto__"===r[i]&&a.makeProp(n.options,r[i]),n.options[r[i]]=String(e.options[r[i]])}if(null!=e.filename&&(n.filename=String(e.filename)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.ForeignWrapperConfig.dependencyTargets: array expected");for(n.dependencyTargets=[],i=0;i<e.dependencyTargets.length;++i){if("object"!=typeof e.dependencyTargets[i])throw TypeError(".sqlanvil.ActionConfig.ForeignWrapperConfig.dependencyTargets: object expected");n.dependencyTargets[i]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[i],t+1)}}return n},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)"__proto__"===n[i]&&a.makeProp(r.options,n[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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.ActionConfig.VectorIndexConfig;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.name=e.string();break;case 2:u.table=e.string();break;case 3:u.column=e.string();break;case 4:u.dimensions=e.uint32();break;case 5:u.indexType=e.string();break;case 6:u.params===a.emptyObject&&(u.params={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;){var f=e.uint32();switch(f>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.params,o),u.params[o]=l;break;case 7:u.filename=e.string();break;case 8:u.dependencyTargets&&u.dependencyTargets.length||(u.dependencyTargets=[]),u.dependencyTargets.push(s.sqlanvil.ActionConfig.Target.decode(e,e.uint32(),void 0,r+1));break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=Object.keys(e.params),r=0;r<n.length;++r)if(!a.isString(e.params[n[r]]))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(r=0;r<e.dependencyTargets.length;++r){var i=s.sqlanvil.ActionConfig.Target.verify(e.dependencyTargets[r],t+1);if(i)return"dependencyTargets."+i}}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.VectorIndexConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.VectorIndexConfig;if(null!=e.name&&(n.name=String(e.name)),null!=e.table&&(n.table=String(e.table)),null!=e.column&&(n.column=String(e.column)),null!=e.dimensions&&(n.dimensions=e.dimensions>>>0),null!=e.indexType&&(n.indexType=String(e.indexType)),e.params){if("object"!=typeof e.params)throw TypeError(".sqlanvil.ActionConfig.VectorIndexConfig.params: object expected");n.params={};for(var r=Object.keys(e.params),i=0;i<r.length;++i)"__proto__"===r[i]&&a.makeProp(n.params,r[i]),n.params[r[i]]=String(e.params[r[i]])}if(null!=e.filename&&(n.filename=String(e.filename)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ActionConfig.VectorIndexConfig.dependencyTargets: array expected");for(n.dependencyTargets=[],i=0;i<e.dependencyTargets.length;++i){if("object"!=typeof e.dependencyTargets[i])throw TypeError(".sqlanvil.ActionConfig.VectorIndexConfig.dependencyTargets: object expected");n.dependencyTargets[i]=s.sqlanvil.ActionConfig.Target.fromObject(e.dependencyTargets[i],t+1)}}return n},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)"__proto__"===n[i]&&a.makeProp(r.params,n[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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionConfig.LoadModeConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.mode=e.int32();break;case 2:a.incrementalColumn=e.string();break;case 3:a.uniqueKey&&a.uniqueKey.length||(a.uniqueKey=[]),a.uniqueKey.push(e.string());break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.uniqueKey.length;++n)if(!a.isString(e.uniqueKey[n]))return"uniqueKey: string[] expected"}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionConfig.LoadModeConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionConfig.LoadModeConfig;switch(e.mode){default:if("number"==typeof e.mode){n.mode=e.mode;break}break;case"REPLACE_TABLE":case 0:n.mode=0;break;case"APPEND":case 1:n.mode=1;break;case"MAXIMUM":case 2:n.mode=2;break;case"UNIQUE":case 3:n.mode=3;break;case"MERGE":case 4:n.mode=4}if(null!=e.incrementalColumn&&(n.incrementalColumn=String(e.incrementalColumn)),e.uniqueKey){if(!Array.isArray(e.uniqueKey))throw TypeError(".sqlanvil.ActionConfig.LoadModeConfig.uniqueKey: array expected");n.uniqueKey=[];for(var r=0;r<e.uniqueKey.length;++r)n.uniqueKey[r]=String(e.uniqueKey[r])}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.RepositorySnapshotDestinationConfig;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?a.repositorySnapshotUri=e.string():e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":null!=e.repositorySnapshotUri&&e.hasOwnProperty("repositorySnapshotUri")&&!a.isString(e.repositorySnapshotUri)?"repositorySnapshotUri: string expected":null)},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.RepositorySnapshotDestinationConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.RepositorySnapshotDestinationConfig;return null!=e.repositorySnapshotUri&&(n.repositorySnapshotUri=String(e.repositorySnapshotUri)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.NotebookRuntimeOptionsConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.outputBucket=e.string();break;case 2:a.runtimeTemplateName=e.string();break;case 3:a.repositorySnapshotDestination=s.sqlanvil.RepositorySnapshotDestinationConfig.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";var n={};if(null!=e.outputBucket&&e.hasOwnProperty("outputBucket")&&(n.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")){n.repositorySnapshotStorage=1;var r=s.sqlanvil.RepositorySnapshotDestinationConfig.verify(e.repositorySnapshotDestination,t+1);if(r)return"repositorySnapshotDestination."+r}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.NotebookRuntimeOptionsConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.NotebookRuntimeOptionsConfig;if(null!=e.outputBucket&&(n.outputBucket=String(e.outputBucket)),null!=e.runtimeTemplateName&&(n.runtimeTemplateName=String(e.runtimeTemplateName)),null!=e.repositorySnapshotDestination){if("object"!=typeof e.repositorySnapshotDestination)throw TypeError(".sqlanvil.NotebookRuntimeOptionsConfig.repositorySnapshotDestination: object expected");n.repositorySnapshotDestination=s.sqlanvil.RepositorySnapshotDestinationConfig.fromObject(e.repositorySnapshotDestination,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.PostgresOptions;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.tablespace=e.string();break;case 2:a.fillfactor=e.uint32();break;case 3:a.unlogged=e.bool();break;case 4:a.partition=s.sqlanvil.PostgresOptions.Partition.decode(e,e.uint32(),void 0,r+1);break;case 5:a.indexes&&a.indexes.length||(a.indexes=[]),a.indexes.push(s.sqlanvil.PostgresOptions.Index.decode(e,e.uint32(),void 0,r+1));break;case 6:a.noData=e.bool();break;case 7:a.refreshPolicy=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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")&&(r=s.sqlanvil.PostgresOptions.Partition.verify(e.partition,t+1)))return"partition."+r;if(null!=e.indexes&&e.hasOwnProperty("indexes")){if(!Array.isArray(e.indexes))return"indexes: array expected";for(var n=0;n<e.indexes.length;++n){var r;if(r=s.sqlanvil.PostgresOptions.Index.verify(e.indexes[n],t+1))return"indexes."+r}}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,t){if(e instanceof s.sqlanvil.PostgresOptions)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.PostgresOptions;if(null!=e.tablespace&&(n.tablespace=String(e.tablespace)),null!=e.fillfactor&&(n.fillfactor=e.fillfactor>>>0),null!=e.unlogged&&(n.unlogged=Boolean(e.unlogged)),null!=e.partition){if("object"!=typeof e.partition)throw TypeError(".sqlanvil.PostgresOptions.partition: object expected");n.partition=s.sqlanvil.PostgresOptions.Partition.fromObject(e.partition,t+1)}if(e.indexes){if(!Array.isArray(e.indexes))throw TypeError(".sqlanvil.PostgresOptions.indexes: array expected");n.indexes=[];for(var r=0;r<e.indexes.length;++r){if("object"!=typeof e.indexes[r])throw TypeError(".sqlanvil.PostgresOptions.indexes: object expected");n.indexes[r]=s.sqlanvil.PostgresOptions.Index.fromObject(e.indexes[r],t+1)}}return null!=e.noData&&(n.noData=Boolean(e.noData)),null!=e.refreshPolicy&&(n.refreshPolicy=String(e.refreshPolicy)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.PostgresOptions.Partition;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.kind=e.int32();break;case 2:a.columns&&a.columns.length||(a.columns=[]),a.columns.push(e.string());break;case 3:a.partitions&&a.partitions.length||(a.partitions=[]),a.partitions.push(s.sqlanvil.PostgresOptions.Partition.Bound.decode(e,e.uint32(),void 0,r+1));break;case 4:a.includeDefault=e.bool();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.columns.length;++n)if(!a.isString(e.columns[n]))return"columns: string[] expected"}if(null!=e.partitions&&e.hasOwnProperty("partitions")){if(!Array.isArray(e.partitions))return"partitions: array expected";for(n=0;n<e.partitions.length;++n){var r=s.sqlanvil.PostgresOptions.Partition.Bound.verify(e.partitions[n],t+1);if(r)return"partitions."+r}}return null!=e.includeDefault&&e.hasOwnProperty("includeDefault")&&"boolean"!=typeof e.includeDefault?"includeDefault: boolean expected":null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.PostgresOptions.Partition)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.PostgresOptions.Partition;switch(e.kind){default:if("number"==typeof e.kind){n.kind=e.kind;break}break;case"RANGE":case 0:n.kind=0;break;case"LIST":case 1:n.kind=1;break;case"HASH":case 2:n.kind=2}if(e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.PostgresOptions.Partition.columns: array expected");n.columns=[];for(var r=0;r<e.columns.length;++r)n.columns[r]=String(e.columns[r])}if(e.partitions){if(!Array.isArray(e.partitions))throw TypeError(".sqlanvil.PostgresOptions.Partition.partitions: array expected");for(n.partitions=[],r=0;r<e.partitions.length;++r){if("object"!=typeof e.partitions[r])throw TypeError(".sqlanvil.PostgresOptions.Partition.partitions: object expected");n.partitions[r]=s.sqlanvil.PostgresOptions.Partition.Bound.fromObject(e.partitions[r],t+1)}}return null!=e.includeDefault&&(n.includeDefault=Boolean(e.includeDefault)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.PostgresOptions.Partition.Bound;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.name=e.string();break;case 2:a.values=e.string();break;case 3:a.subPartition=s.sqlanvil.PostgresOptions.Partition.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=s.sqlanvil.PostgresOptions.Partition.verify(e.subPartition,t+1);if(n)return"subPartition."+n}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.PostgresOptions.Partition.Bound)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.PostgresOptions.Partition.Bound;if(null!=e.name&&(n.name=String(e.name)),null!=e.values&&(n.values=String(e.values)),null!=e.subPartition){if("object"!=typeof e.subPartition)throw TypeError(".sqlanvil.PostgresOptions.Partition.Bound.subPartition: object expected");n.subPartition=s.sqlanvil.PostgresOptions.Partition.fromObject(e.subPartition,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.PostgresOptions.Index;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.name=e.string();break;case 2:a.columns&&a.columns.length||(a.columns=[]),a.columns.push(e.string());break;case 3:a.method=e.int32();break;case 4:a.where=e.string();break;case 5:a.unique=e.bool();break;case 6:a.include&&a.include.length||(a.include=[]),a.include.push(e.string());break;case 7:a.opclass=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.columns.length;++n)if(!a.isString(e.columns[n]))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(n=0;n<e.include.length;++n)if(!a.isString(e.include[n]))return"include: string[] expected"}return null!=e.opclass&&e.hasOwnProperty("opclass")&&!a.isString(e.opclass)?"opclass: string expected":null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.PostgresOptions.Index)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.PostgresOptions.Index;if(null!=e.name&&(n.name=String(e.name)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.PostgresOptions.Index.columns: array expected");n.columns=[];for(var r=0;r<e.columns.length;++r)n.columns[r]=String(e.columns[r])}switch(e.method){default:if("number"==typeof e.method){n.method=e.method;break}break;case"BTREE":case 0:n.method=0;break;case"HASH":case 1:n.method=1;break;case"GIN":case 2:n.method=2;break;case"GIST":case 3:n.method=3;break;case"BRIN":case 4:n.method=4}if(null!=e.where&&(n.where=String(e.where)),null!=e.unique&&(n.unique=Boolean(e.unique)),e.include){if(!Array.isArray(e.include))throw TypeError(".sqlanvil.PostgresOptions.Index.include: array expected");for(n.include=[],r=0;r<e.include.length;++r)n.include[r]=String(e.include[r])}return null!=e.opclass&&(n.opclass=String(e.opclass)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.MysqlOptions;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.engine=e.string();break;case 2:a.charset=e.string();break;case 3:a.collation=e.string();break;case 4:a.indexes&&a.indexes.length||(a.indexes=[]),a.indexes.push(s.sqlanvil.MysqlOptions.Index.decode(e,e.uint32(),void 0,r+1));break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.indexes.length;++n){var r=s.sqlanvil.MysqlOptions.Index.verify(e.indexes[n],t+1);if(r)return"indexes."+r}}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.MysqlOptions)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.MysqlOptions;if(null!=e.engine&&(n.engine=String(e.engine)),null!=e.charset&&(n.charset=String(e.charset)),null!=e.collation&&(n.collation=String(e.collation)),e.indexes){if(!Array.isArray(e.indexes))throw TypeError(".sqlanvil.MysqlOptions.indexes: array expected");n.indexes=[];for(var r=0;r<e.indexes.length;++r){if("object"!=typeof e.indexes[r])throw TypeError(".sqlanvil.MysqlOptions.indexes: object expected");n.indexes[r]=s.sqlanvil.MysqlOptions.Index.fromObject(e.indexes[r],t+1)}}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.MysqlOptions.Index;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.name=e.string();break;case 2:a.columns&&a.columns.length||(a.columns=[]),a.columns.push(e.string());break;case 3:a.unique=e.bool();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.columns.length;++n)if(!a.isString(e.columns[n]))return"columns: string[] expected"}return null!=e.unique&&e.hasOwnProperty("unique")&&"boolean"!=typeof e.unique?"unique: boolean expected":null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.MysqlOptions.Index)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.MysqlOptions.Index;if(null!=e.name&&(n.name=String(e.name)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.MysqlOptions.Index.columns: array expected");n.columns=[];for(var r=0;r<e.columns.length;++r)n.columns[r]=String(e.columns[r])}return null!=e.unique&&(n.unique=Boolean(e.unique)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.SupabaseOptions;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.postgres=s.sqlanvil.PostgresOptions.decode(e,e.uint32(),void 0,r+1);break;case 2:a.publishToRealtime=e.bool();break;case 3:a.enableRls=e.bool();break;case 4:a.ownerRole=e.string();break;case 5:a.vectors&&a.vectors.length||(a.vectors=[]),a.vectors.push(s.sqlanvil.SupabaseOptions.VectorConfig.decode(e,e.uint32(),void 0,r+1));break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.postgres&&e.hasOwnProperty("postgres")&&(r=s.sqlanvil.PostgresOptions.verify(e.postgres,t+1)))return"postgres."+r;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 n=0;n<e.vectors.length;++n){var r;if(r=s.sqlanvil.SupabaseOptions.VectorConfig.verify(e.vectors[n],t+1))return"vectors."+r}}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.SupabaseOptions)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.SupabaseOptions;if(null!=e.postgres){if("object"!=typeof e.postgres)throw TypeError(".sqlanvil.SupabaseOptions.postgres: object expected");n.postgres=s.sqlanvil.PostgresOptions.fromObject(e.postgres,t+1)}if(null!=e.publishToRealtime&&(n.publishToRealtime=Boolean(e.publishToRealtime)),null!=e.enableRls&&(n.enableRls=Boolean(e.enableRls)),null!=e.ownerRole&&(n.ownerRole=String(e.ownerRole)),e.vectors){if(!Array.isArray(e.vectors))throw TypeError(".sqlanvil.SupabaseOptions.vectors: array expected");n.vectors=[];for(var r=0;r<e.vectors.length;++r){if("object"!=typeof e.vectors[r])throw TypeError(".sqlanvil.SupabaseOptions.vectors: object expected");n.vectors[r]=s.sqlanvil.SupabaseOptions.VectorConfig.fromObject(e.vectors[r],t+1)}}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.SupabaseOptions.VectorConfig;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.column=e.string();break;case 2:u.dimensions=e.uint32();break;case 3:u.indexType=e.int32();break;case 4:u.params===a.emptyObject&&(u.params={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;){var f=e.uint32();switch(f>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.params,o),u.params[o]=l;break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=Object.keys(e.params),r=0;r<n.length;++r)if(!a.isString(e.params[n[r]]))return"params: string{k:string} expected"}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.SupabaseOptions.VectorConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.SupabaseOptions.VectorConfig;switch(null!=e.column&&(n.column=String(e.column)),null!=e.dimensions&&(n.dimensions=e.dimensions>>>0),e.indexType){default:if("number"==typeof e.indexType){n.indexType=e.indexType;break}break;case"IVFFLAT":case 0:n.indexType=0;break;case"HNSW":case 1:n.indexType=1}if(e.params){if("object"!=typeof e.params)throw TypeError(".sqlanvil.SupabaseOptions.VectorConfig.params: object expected");n.params={};for(var r=Object.keys(e.params),i=0;i<r.length;++i)"__proto__"===r[i]&&a.makeProp(n.params,r[i]),n.params[r[i]]=String(e.params[r[i]])}return n},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)"__proto__"===n[i]&&a.makeProp(r.params,n[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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.BigQueryConnection;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.project=e.string();break;case 2:a.location=e.string();break;case 3:a.defaultDataset=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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,t){if(e instanceof s.sqlanvil.BigQueryConnection)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.BigQueryConnection;return null!=e.project&&(n.project=String(e.project)),null!=e.location&&(n.location=String(e.location)),null!=e.defaultDataset&&(n.defaultDataset=String(e.defaultDataset)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.PostgresConnection;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.host=e.string();break;case 2:a.port=e.uint32();break;case 3:a.database=e.string();break;case 4:a.user=e.string();break;case 5:a.password=e.string();break;case 6:a.sslMode=e.string();break;case 7:a.defaultSchema=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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,t){if(e instanceof s.sqlanvil.PostgresConnection)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.PostgresConnection;return null!=e.host&&(n.host=String(e.host)),null!=e.port&&(n.port=e.port>>>0),null!=e.database&&(n.database=String(e.database)),null!=e.user&&(n.user=String(e.user)),null!=e.password&&(n.password=String(e.password)),null!=e.sslMode&&(n.sslMode=String(e.sslMode)),null!=e.defaultSchema&&(n.defaultSchema=String(e.defaultSchema)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.SupabaseConnection;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.projectRef=e.string();break;case 2:a.serviceRoleKey=e.string();break;case 3:a.defaultSchema=e.string();break;case 4:a.connectionString=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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,t){if(e instanceof s.sqlanvil.SupabaseConnection)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.SupabaseConnection;return null!=e.projectRef&&(n.projectRef=String(e.projectRef)),null!=e.serviceRoleKey&&(n.serviceRoleKey=String(e.serviceRoleKey)),null!=e.defaultSchema&&(n.defaultSchema=String(e.defaultSchema)),null!=e.connectionString&&(n.connectionString=String(e.connectionString)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.MysqlConnection;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.host=e.string();break;case 2:a.port=e.uint32();break;case 3:a.database=e.string();break;case 4:a.user=e.string();break;case 5:a.password=e.string();break;case 6:a.sslMode=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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,t){if(e instanceof s.sqlanvil.MysqlConnection)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.MysqlConnection;return null!=e.host&&(n.host=String(e.host)),null!=e.port&&(n.port=e.port>>>0),null!=e.database&&(n.database=String(e.database)),null!=e.user&&(n.user=String(e.user)),null!=e.password&&(n.password=String(e.password)),null!=e.sslMode&&(n.sslMode=String(e.sslMode)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.WarehouseConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.bigquery=s.sqlanvil.BigQueryConnection.decode(e,e.uint32(),void 0,r+1);break;case 2:a.postgres=s.sqlanvil.PostgresConnection.decode(e,e.uint32(),void 0,r+1);break;case 3:a.supabase=s.sqlanvil.SupabaseConnection.decode(e,e.uint32(),void 0,r+1);break;case 4:a.mysql=s.sqlanvil.MysqlConnection.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";var n={};if(null!=e.bigquery&&e.hasOwnProperty("bigquery")&&(n.connection=1,r=s.sqlanvil.BigQueryConnection.verify(e.bigquery,t+1)))return"bigquery."+r;if(null!=e.postgres&&e.hasOwnProperty("postgres")){if(1===n.connection)return"connection: multiple values";if(n.connection=1,r=s.sqlanvil.PostgresConnection.verify(e.postgres,t+1))return"postgres."+r}if(null!=e.supabase&&e.hasOwnProperty("supabase")){if(1===n.connection)return"connection: multiple values";if(n.connection=1,r=s.sqlanvil.SupabaseConnection.verify(e.supabase,t+1))return"supabase."+r}if(null!=e.mysql&&e.hasOwnProperty("mysql")){if(1===n.connection)return"connection: multiple values";var r;if(n.connection=1,r=s.sqlanvil.MysqlConnection.verify(e.mysql,t+1))return"mysql."+r}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.WarehouseConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.WarehouseConfig;if(null!=e.bigquery){if("object"!=typeof e.bigquery)throw TypeError(".sqlanvil.WarehouseConfig.bigquery: object expected");n.bigquery=s.sqlanvil.BigQueryConnection.fromObject(e.bigquery,t+1)}if(null!=e.postgres){if("object"!=typeof e.postgres)throw TypeError(".sqlanvil.WarehouseConfig.postgres: object expected");n.postgres=s.sqlanvil.PostgresConnection.fromObject(e.postgres,t+1)}if(null!=e.supabase){if("object"!=typeof e.supabase)throw TypeError(".sqlanvil.WarehouseConfig.supabase: object expected");n.supabase=s.sqlanvil.SupabaseConnection.fromObject(e.supabase,t+1)}if(null!=e.mysql){if("object"!=typeof e.mysql)throw TypeError(".sqlanvil.WarehouseConfig.mysql: object expected");n.mysql=s.sqlanvil.MysqlConnection.fromObject(e.mysql,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.Extension;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.name=e.string();break;case 2:u.compilationMode=e.int32();break;case 3:u.options===a.emptyObject&&(u.options={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;){var f=e.uint32();switch(f>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.options,o),u.options[o]=l;break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=Object.keys(e.options),r=0;r<n.length;++r)if(!a.isString(e.options[n[r]]))return"options: string{k:string} expected"}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.Extension)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.Extension;switch(null!=e.name&&(n.name=String(e.name)),e.compilationMode){default:if("number"==typeof e.compilationMode){n.compilationMode=e.compilationMode;break}break;case"COMPILATION_MODE_UNSPECIFIED":case 0:n.compilationMode=0;break;case"PROLOGUE":case 1:n.compilationMode=1;break;case"APPLICATION_CODE":case 2:n.compilationMode=2}if(e.options){if("object"!=typeof e.options)throw TypeError(".sqlanvil.Extension.options: object expected");n.options={};for(var r=Object.keys(e.options),i=0;i<r.length;++i)"__proto__"===r[i]&&a.makeProp(n.options,r[i]),n.options[r[i]]=String(e.options[r[i]])}return n},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)"__proto__"===n[i]&&a.makeProp(r.options,n[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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.ProjectConfig;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.warehouse=e.string();break;case 9:u.defaultDatabase=e.string();break;case 2:u.defaultSchema=e.string();break;case 16:u.defaultLocation=e.string();break;case 5:u.assertionSchema=e.string();break;case 14:u.vars===a.emptyObject&&(u.vars={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;)switch((f=e.uint32())>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}"__proto__"===o&&a.makeProp(u.vars,o),u.vars[o]=l;break;case 15:u.databaseSuffix=e.string();break;case 7:u.schemaSuffix=e.string();break;case 11:u.tablePrefix=e.string();break;case 18:u.builtinAssertionNamePrefix=e.string();break;case 17:u.defaultNotebookRuntimeOptions=s.sqlanvil.NotebookRuntimeOptions.decode(e,e.uint32(),void 0,r+1);break;case 19:u.defaultIcebergConfig=s.sqlanvil.DefaultIcebergConfig.decode(e,e.uint32(),void 0,r+1);break;case 20:u.disableAssertions=e.bool();break;case 21:u.defaultReservation=e.string();break;case 22:u.includeTestsInCompiledGraph=e.bool();break;case 23:for(u.connections===a.emptyObject&&(u.connections={}),d=e.uint32()+e.pos,o="",l=null;e.pos<d;){var f;switch((f=e.uint32())>>>3){case 1:o=e.string();break;case 2:l=s.sqlanvil.ConnectionConfig.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.connections,o),u.connections[o]=l;break;case 24:u.warehouseConnection=e.string();break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=Object.keys(e.vars),r=0;r<n.length;++r)if(!a.isString(e.vars[n[r]]))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")&&(i=s.sqlanvil.NotebookRuntimeOptions.verify(e.defaultNotebookRuntimeOptions,t+1)))return"defaultNotebookRuntimeOptions."+i;if(null!=e.defaultIcebergConfig&&e.hasOwnProperty("defaultIcebergConfig")&&(i=s.sqlanvil.DefaultIcebergConfig.verify(e.defaultIcebergConfig,t+1)))return"defaultIcebergConfig."+i;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(n=Object.keys(e.connections),r=0;r<n.length;++r){var i;if(i=s.sqlanvil.ConnectionConfig.verify(e.connections[n[r]],t+1))return"connections."+i}}return null!=e.warehouseConnection&&e.hasOwnProperty("warehouseConnection")&&!a.isString(e.warehouseConnection)?"warehouseConnection: string expected":null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ProjectConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ProjectConfig;if(null!=e.warehouse&&(n.warehouse=String(e.warehouse)),null!=e.defaultDatabase&&(n.defaultDatabase=String(e.defaultDatabase)),null!=e.defaultSchema&&(n.defaultSchema=String(e.defaultSchema)),null!=e.defaultLocation&&(n.defaultLocation=String(e.defaultLocation)),null!=e.assertionSchema&&(n.assertionSchema=String(e.assertionSchema)),e.vars){if("object"!=typeof e.vars)throw TypeError(".sqlanvil.ProjectConfig.vars: object expected");n.vars={};for(var r=Object.keys(e.vars),i=0;i<r.length;++i)"__proto__"===r[i]&&a.makeProp(n.vars,r[i]),n.vars[r[i]]=String(e.vars[r[i]])}if(null!=e.databaseSuffix&&(n.databaseSuffix=String(e.databaseSuffix)),null!=e.schemaSuffix&&(n.schemaSuffix=String(e.schemaSuffix)),null!=e.tablePrefix&&(n.tablePrefix=String(e.tablePrefix)),null!=e.builtinAssertionNamePrefix&&(n.builtinAssertionNamePrefix=String(e.builtinAssertionNamePrefix)),null!=e.defaultNotebookRuntimeOptions){if("object"!=typeof e.defaultNotebookRuntimeOptions)throw TypeError(".sqlanvil.ProjectConfig.defaultNotebookRuntimeOptions: object expected");n.defaultNotebookRuntimeOptions=s.sqlanvil.NotebookRuntimeOptions.fromObject(e.defaultNotebookRuntimeOptions,t+1)}if(null!=e.defaultIcebergConfig){if("object"!=typeof e.defaultIcebergConfig)throw TypeError(".sqlanvil.ProjectConfig.defaultIcebergConfig: object expected");n.defaultIcebergConfig=s.sqlanvil.DefaultIcebergConfig.fromObject(e.defaultIcebergConfig,t+1)}if(null!=e.disableAssertions&&(n.disableAssertions=Boolean(e.disableAssertions)),null!=e.defaultReservation&&(n.defaultReservation=String(e.defaultReservation)),null!=e.includeTestsInCompiledGraph&&(n.includeTestsInCompiledGraph=Boolean(e.includeTestsInCompiledGraph)),e.connections){if("object"!=typeof e.connections)throw TypeError(".sqlanvil.ProjectConfig.connections: object expected");for(n.connections={},r=Object.keys(e.connections),i=0;i<r.length;++i){if("__proto__"===r[i]&&a.makeProp(n.connections,r[i]),"object"!=typeof e.connections[r[i]])throw TypeError(".sqlanvil.ProjectConfig.connections: object expected");n.connections[r[i]]=s.sqlanvil.ConnectionConfig.fromObject(e.connections[r[i]],t+1)}}return null!=e.warehouseConnection&&(n.warehouseConnection=String(e.warehouseConnection)),n},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)"__proto__"===n[i]&&a.makeProp(r.vars,n[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)"__proto__"===n[i]&&a.makeProp(r.connections,n[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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.CompileConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.projectDir=e.string();break;case 8:a.filePaths&&a.filePaths.length||(a.filePaths=[]),a.filePaths.push(e.string());break;case 3:a.projectConfigOverride=s.sqlanvil.ProjectConfig.decode(e,e.uint32(),void 0,r+1);break;case 6:a.timeoutMillis=e.int32();break;case 10:a.extension=s.sqlanvil.Extension.decode(e,e.uint32(),void 0,r+1);break;case 11:a.verbose=e.bool();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.filePaths.length;++n)if(!a.isString(e.filePaths[n]))return"filePaths: string[] expected"}var r;return null!=e.projectConfigOverride&&e.hasOwnProperty("projectConfigOverride")&&(r=s.sqlanvil.ProjectConfig.verify(e.projectConfigOverride,t+1))?"projectConfigOverride."+r:null!=e.timeoutMillis&&e.hasOwnProperty("timeoutMillis")&&!a.isInteger(e.timeoutMillis)?"timeoutMillis: integer expected":null!=e.extension&&e.hasOwnProperty("extension")&&(r=s.sqlanvil.Extension.verify(e.extension,t+1))?"extension."+r:null!=e.verbose&&e.hasOwnProperty("verbose")&&"boolean"!=typeof e.verbose?"verbose: boolean expected":null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.CompileConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.CompileConfig;if(null!=e.projectDir&&(n.projectDir=String(e.projectDir)),e.filePaths){if(!Array.isArray(e.filePaths))throw TypeError(".sqlanvil.CompileConfig.filePaths: array expected");n.filePaths=[];for(var r=0;r<e.filePaths.length;++r)n.filePaths[r]=String(e.filePaths[r])}if(null!=e.projectConfigOverride){if("object"!=typeof e.projectConfigOverride)throw TypeError(".sqlanvil.CompileConfig.projectConfigOverride: object expected");n.projectConfigOverride=s.sqlanvil.ProjectConfig.fromObject(e.projectConfigOverride,t+1)}if(null!=e.timeoutMillis&&(n.timeoutMillis=0|e.timeoutMillis),null!=e.extension){if("object"!=typeof e.extension)throw TypeError(".sqlanvil.CompileConfig.extension: object expected");n.extension=s.sqlanvil.Extension.fromObject(e.extension,t+1)}return null!=e.verbose&&(n.verbose=Boolean(e.verbose)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.Target;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 3:a.database=e.string();break;case 1:a.schema=e.string();break;case 2:a.name=e.string();break;case 4:a.includeDependentAssertions=e.bool();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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,t){if(e instanceof s.sqlanvil.Target)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.Target;return null!=e.database&&(n.database=String(e.database)),null!=e.schema&&(n.schema=String(e.schema)),null!=e.name&&(n.name=String(e.name)),null!=e.includeDependentAssertions&&(n.includeDependentAssertions=Boolean(e.includeDependentAssertions)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.BigQueryOptions;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.partitionBy=e.string();break;case 2:u.clusterBy&&u.clusterBy.length||(u.clusterBy=[]),u.clusterBy.push(e.string());break;case 3:u.updatePartitionFilter=e.string();break;case 4:u.labels===a.emptyObject&&(u.labels={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;)switch((f=e.uint32())>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}"__proto__"===o&&a.makeProp(u.labels,o),u.labels[o]=l;break;case 5:u.partitionExpirationDays=e.int32();break;case 6:u.requirePartitionFilter=e.bool();break;case 7:for(u.additionalOptions===a.emptyObject&&(u.additionalOptions={}),d=e.uint32()+e.pos,o="",l="";e.pos<d;){var f;switch((f=e.uint32())>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.additionalOptions,o),u.additionalOptions[o]=l;break;case 8:u.connection=e.string();break;case 9:u.tableFormat=e.int32();break;case 10:u.fileFormat=e.int32();break;case 11:u.storageUri=e.string();break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.clusterBy.length;++n)if(!a.isString(e.clusterBy[n]))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 r=Object.keys(e.labels);for(n=0;n<r.length;++n)if(!a.isString(e.labels[r[n]]))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(r=Object.keys(e.additionalOptions),n=0;n<r.length;++n)if(!a.isString(e.additionalOptions[r[n]]))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,t){if(e instanceof s.sqlanvil.BigQueryOptions)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.BigQueryOptions;if(null!=e.partitionBy&&(n.partitionBy=String(e.partitionBy)),e.clusterBy){if(!Array.isArray(e.clusterBy))throw TypeError(".sqlanvil.BigQueryOptions.clusterBy: array expected");n.clusterBy=[];for(var r=0;r<e.clusterBy.length;++r)n.clusterBy[r]=String(e.clusterBy[r])}if(null!=e.updatePartitionFilter&&(n.updatePartitionFilter=String(e.updatePartitionFilter)),e.labels){if("object"!=typeof e.labels)throw TypeError(".sqlanvil.BigQueryOptions.labels: object expected");n.labels={};var i=Object.keys(e.labels);for(r=0;r<i.length;++r)"__proto__"===i[r]&&a.makeProp(n.labels,i[r]),n.labels[i[r]]=String(e.labels[i[r]])}if(null!=e.partitionExpirationDays&&(n.partitionExpirationDays=0|e.partitionExpirationDays),null!=e.requirePartitionFilter&&(n.requirePartitionFilter=Boolean(e.requirePartitionFilter)),e.additionalOptions){if("object"!=typeof e.additionalOptions)throw TypeError(".sqlanvil.BigQueryOptions.additionalOptions: object expected");for(n.additionalOptions={},i=Object.keys(e.additionalOptions),r=0;r<i.length;++r)"__proto__"===i[r]&&a.makeProp(n.additionalOptions,i[r]),n.additionalOptions[i[r]]=String(e.additionalOptions[i[r]])}switch(null!=e.connection&&(n.connection=String(e.connection)),e.tableFormat){default:if("number"==typeof e.tableFormat){n.tableFormat=e.tableFormat;break}break;case"TABLE_FORMAT_UNSPECIFIED":case 0:n.tableFormat=0;break;case"ICEBERG":case 1:n.tableFormat=1}switch(e.fileFormat){default:if("number"==typeof e.fileFormat){n.fileFormat=e.fileFormat;break}break;case"FILE_FORMAT_UNSPECIFIED":case 0:n.fileFormat=0;break;case"PARQUET":case 1:n.fileFormat=1}return null!=e.storageUri&&(n.storageUri=String(e.storageUri)),n},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)"__proto__"===n[i]&&a.makeProp(r.labels,n[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)"__proto__"===n[i]&&a.makeProp(r.additionalOptions,n[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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.GraphErrors;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?(a.compilationErrors&&a.compilationErrors.length||(a.compilationErrors=[]),a.compilationErrors.push(s.sqlanvil.CompilationError.decode(e,e.uint32(),void 0,r+1))):e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.compilationErrors&&e.hasOwnProperty("compilationErrors")){if(!Array.isArray(e.compilationErrors))return"compilationErrors: array expected";for(var n=0;n<e.compilationErrors.length;++n){var r=s.sqlanvil.CompilationError.verify(e.compilationErrors[n],t+1);if(r)return"compilationErrors."+r}}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.GraphErrors)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.GraphErrors;if(e.compilationErrors){if(!Array.isArray(e.compilationErrors))throw TypeError(".sqlanvil.GraphErrors.compilationErrors: array expected");n.compilationErrors=[];for(var r=0;r<e.compilationErrors.length;++r){if("object"!=typeof e.compilationErrors[r])throw TypeError(".sqlanvil.GraphErrors.compilationErrors: object expected");n.compilationErrors[r]=s.sqlanvil.CompilationError.fromObject(e.compilationErrors[r],t+1)}}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.CompilationError;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.fileName=e.string();break;case 4:a.actionName=e.string();break;case 5:a.actionTarget=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 2:a.message=e.string();break;case 3:a.stack=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=s.sqlanvil.Target.verify(e.actionTarget,t+1);if(n)return"actionTarget."+n}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,t){if(e instanceof s.sqlanvil.CompilationError)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.CompilationError;if(null!=e.fileName&&(n.fileName=String(e.fileName)),null!=e.actionName&&(n.actionName=String(e.actionName)),null!=e.actionTarget){if("object"!=typeof e.actionTarget)throw TypeError(".sqlanvil.CompilationError.actionTarget: object expected");n.actionTarget=s.sqlanvil.Target.fromObject(e.actionTarget,t+1)}return null!=e.message&&(n.message=String(e.message)),null!=e.stack&&(n.stack=String(e.stack)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.ActionDescriptor;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.description=e.string();break;case 2:u.columns&&u.columns.length||(u.columns=[]),u.columns.push(s.sqlanvil.ColumnDescriptor.decode(e,e.uint32(),void 0,r+1));break;case 3:u.bigqueryLabels===a.emptyObject&&(u.bigqueryLabels={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;){var f=e.uint32();switch(f>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.bigqueryLabels,o),u.bigqueryLabels[o]=l;break;case 4:u.metadata=s.sqlanvil.Metadata.decode(e,e.uint32(),void 0,r+1);break;case 5:u.compilationMode=e.int32();break;case 6:u.reservation=e.string();break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.columns.length;++n)if(i=s.sqlanvil.ColumnDescriptor.verify(e.columns[n],t+1))return"columns."+i}if(null!=e.bigqueryLabels&&e.hasOwnProperty("bigqueryLabels")){if(!a.isObject(e.bigqueryLabels))return"bigqueryLabels: object expected";var r=Object.keys(e.bigqueryLabels);for(n=0;n<r.length;++n)if(!a.isString(e.bigqueryLabels[r[n]]))return"bigqueryLabels: string{k:string} expected"}var i;if(null!=e.metadata&&e.hasOwnProperty("metadata")&&(i=s.sqlanvil.Metadata.verify(e.metadata,t+1)))return"metadata."+i;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,t){if(e instanceof s.sqlanvil.ActionDescriptor)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionDescriptor;if(null!=e.description&&(n.description=String(e.description)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".sqlanvil.ActionDescriptor.columns: array expected");n.columns=[];for(var r=0;r<e.columns.length;++r){if("object"!=typeof e.columns[r])throw TypeError(".sqlanvil.ActionDescriptor.columns: object expected");n.columns[r]=s.sqlanvil.ColumnDescriptor.fromObject(e.columns[r],t+1)}}if(e.bigqueryLabels){if("object"!=typeof e.bigqueryLabels)throw TypeError(".sqlanvil.ActionDescriptor.bigqueryLabels: object expected");n.bigqueryLabels={};var i=Object.keys(e.bigqueryLabels);for(r=0;r<i.length;++r)"__proto__"===i[r]&&a.makeProp(n.bigqueryLabels,i[r]),n.bigqueryLabels[i[r]]=String(e.bigqueryLabels[i[r]])}if(null!=e.metadata){if("object"!=typeof e.metadata)throw TypeError(".sqlanvil.ActionDescriptor.metadata: object expected");n.metadata=s.sqlanvil.Metadata.fromObject(e.metadata,t+1)}switch(e.compilationMode){default:if("number"==typeof e.compilationMode){n.compilationMode=e.compilationMode;break}break;case"ACTION_COMPILATION_MODE_UNSPECIFIED":case 0:n.compilationMode=0;break;case"ACTION_COMPILATION_MODE_AOT":case 1:n.compilationMode=1;break;case"ACTION_COMPILATION_MODE_JIT":case 2:n.compilationMode=2}return null!=e.reservation&&(n.reservation=String(e.reservation)),n},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)"__proto__"===n[i]&&a.makeProp(r.bigqueryLabels,n[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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.Metadata;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.overview=e.string();break;case 2:a.extraProperties=s.google.protobuf.Struct.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.overview&&e.hasOwnProperty("overview")&&!a.isString(e.overview))return"overview: string expected";if(null!=e.extraProperties&&e.hasOwnProperty("extraProperties")){var n=s.google.protobuf.Struct.verify(e.extraProperties,t+1);if(n)return"extraProperties."+n}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.Metadata)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.Metadata;if(null!=e.overview&&(n.overview=String(e.overview)),null!=e.extraProperties){if("object"!=typeof e.extraProperties)throw TypeError(".sqlanvil.Metadata.extraProperties: object expected");n.extraProperties=s.google.protobuf.Struct.fromObject(e.extraProperties,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ColumnDescriptor;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.description=e.string();break;case 2:a.path&&a.path.length||(a.path=[]),a.path.push(e.string());break;case 3:a.displayName=e.string();break;case 7:a.tags&&a.tags.length||(a.tags=[]),a.tags.push(e.string());break;case 8:a.bigqueryPolicyTags&&a.bigqueryPolicyTags.length||(a.bigqueryPolicyTags=[]),a.bigqueryPolicyTags.push(e.string());break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.path.length;++n)if(!a.isString(e.path[n]))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(n=0;n<e.tags.length;++n)if(!a.isString(e.tags[n]))return"tags: string[] expected"}if(null!=e.bigqueryPolicyTags&&e.hasOwnProperty("bigqueryPolicyTags")){if(!Array.isArray(e.bigqueryPolicyTags))return"bigqueryPolicyTags: array expected";for(n=0;n<e.bigqueryPolicyTags.length;++n)if(!a.isString(e.bigqueryPolicyTags[n]))return"bigqueryPolicyTags: string[] expected"}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ColumnDescriptor)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ColumnDescriptor;if(null!=e.description&&(n.description=String(e.description)),e.path){if(!Array.isArray(e.path))throw TypeError(".sqlanvil.ColumnDescriptor.path: array expected");n.path=[];for(var r=0;r<e.path.length;++r)n.path[r]=String(e.path[r])}if(null!=e.displayName&&(n.displayName=String(e.displayName)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.ColumnDescriptor.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}if(e.bigqueryPolicyTags){if(!Array.isArray(e.bigqueryPolicyTags))throw TypeError(".sqlanvil.ColumnDescriptor.bigqueryPolicyTags: array expected");for(n.bigqueryPolicyTags=[],r=0;r<e.bigqueryPolicyTags.length;++r)n.bigqueryPolicyTags[r]=String(e.bigqueryPolicyTags[r])}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.Table;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 36:a.enumType=e.int32();break;case 4:a.target=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 32:a.canonicalTarget=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 27:a.dependencyTargets&&a.dependencyTargets.length||(a.dependencyTargets=[]),a.dependencyTargets.push(s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1));break;case 31:a.hermeticity=e.int32();break;case 6:a.disabled=e.bool();break;case 3:a.type=e.string();break;case 5:a.query=e.string();break;case 9:a.protected=e.bool();break;case 35:a.materialized=e.bool();break;case 24:a.actionDescriptor=s.sqlanvil.ActionDescriptor.decode(e,e.uint32(),void 0,r+1);break;case 23:a.tags&&a.tags.length||(a.tags=[]),a.tags.push(e.string());break;case 8:a.where=e.string();break;case 26:a.incrementalQuery=e.string();break;case 30:a.uniqueKey&&a.uniqueKey.length||(a.uniqueKey=[]),a.uniqueKey.push(e.string());break;case 37:a.onSchemaChange=e.int32();break;case 13:a.preOps&&a.preOps.length||(a.preOps=[]),a.preOps.push(e.string());break;case 14:a.postOps&&a.postOps.length||(a.postOps=[]),a.postOps.push(e.string());break;case 28:a.incrementalPreOps&&a.incrementalPreOps.length||(a.incrementalPreOps=[]),a.incrementalPreOps.push(e.string());break;case 29:a.incrementalPostOps&&a.incrementalPostOps.length||(a.incrementalPostOps=[]),a.incrementalPostOps.push(e.string());break;case 38:a.jitCode=e.string();break;case 22:a.bigquery=s.sqlanvil.BigQueryOptions.decode(e,e.uint32(),void 0,r+1);break;case 39:a.postgres=s.sqlanvil.PostgresOptions.decode(e,e.uint32(),void 0,r+1);break;case 40:a.supabase=s.sqlanvil.SupabaseOptions.decode(e,e.uint32(),void 0,r+1);break;case 41:a.mysql=s.sqlanvil.MysqlOptions.decode(e,e.uint32(),void 0,r+1);break;case 18:a.fileName=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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")&&(r=s.sqlanvil.Target.verify(e.target,t+1)))return"target."+r;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(r=s.sqlanvil.Target.verify(e.canonicalTarget,t+1)))return"canonicalTarget."+r;if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var n=0;n<e.dependencyTargets.length;++n){var r;if(r=s.sqlanvil.Target.verify(e.dependencyTargets[n],t+1))return"dependencyTargets."+r}}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")&&(r=s.sqlanvil.ActionDescriptor.verify(e.actionDescriptor,t+1)))return"actionDescriptor."+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.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(n=0;n<e.uniqueKey.length;++n)if(!a.isString(e.uniqueKey[n]))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(n=0;n<e.preOps.length;++n)if(!a.isString(e.preOps[n]))return"preOps: string[] expected"}if(null!=e.postOps&&e.hasOwnProperty("postOps")){if(!Array.isArray(e.postOps))return"postOps: array expected";for(n=0;n<e.postOps.length;++n)if(!a.isString(e.postOps[n]))return"postOps: string[] expected"}if(null!=e.incrementalPreOps&&e.hasOwnProperty("incrementalPreOps")){if(!Array.isArray(e.incrementalPreOps))return"incrementalPreOps: array expected";for(n=0;n<e.incrementalPreOps.length;++n)if(!a.isString(e.incrementalPreOps[n]))return"incrementalPreOps: string[] expected"}if(null!=e.incrementalPostOps&&e.hasOwnProperty("incrementalPostOps")){if(!Array.isArray(e.incrementalPostOps))return"incrementalPostOps: array expected";for(n=0;n<e.incrementalPostOps.length;++n)if(!a.isString(e.incrementalPostOps[n]))return"incrementalPostOps: string[] expected"}return null!=e.jitCode&&e.hasOwnProperty("jitCode")&&!a.isString(e.jitCode)?"jitCode: string expected":null!=e.bigquery&&e.hasOwnProperty("bigquery")&&(r=s.sqlanvil.BigQueryOptions.verify(e.bigquery,t+1))?"bigquery."+r:null!=e.postgres&&e.hasOwnProperty("postgres")&&(r=s.sqlanvil.PostgresOptions.verify(e.postgres,t+1))?"postgres."+r:null!=e.supabase&&e.hasOwnProperty("supabase")&&(r=s.sqlanvil.SupabaseOptions.verify(e.supabase,t+1))?"supabase."+r:null!=e.mysql&&e.hasOwnProperty("mysql")&&(r=s.sqlanvil.MysqlOptions.verify(e.mysql,t+1))?"mysql."+r:null!=e.fileName&&e.hasOwnProperty("fileName")&&!a.isString(e.fileName)?"fileName: string expected":null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.Table)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.Table;switch(e.enumType){default:if("number"==typeof e.enumType){n.enumType=e.enumType;break}break;case"UNKNOWN_TYPE":case 0:n.enumType=0;break;case"TABLE":case 1:n.enumType=1;break;case"INCREMENTAL":case 2:n.enumType=2;break;case"VIEW":case 3:n.enumType=3}if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.Table.target: object expected");n.target=s.sqlanvil.Target.fromObject(e.target,t+1)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".sqlanvil.Table.canonicalTarget: object expected");n.canonicalTarget=s.sqlanvil.Target.fromObject(e.canonicalTarget,t+1)}if(e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.Table.dependencyTargets: array expected");n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.Table.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.Target.fromObject(e.dependencyTargets[r],t+1)}}switch(e.hermeticity){default:if("number"==typeof e.hermeticity){n.hermeticity=e.hermeticity;break}break;case"UNKNOWN":case 0:n.hermeticity=0;break;case"HERMETIC":case 1:n.hermeticity=1;break;case"NON_HERMETIC":case 2:n.hermeticity=2}if(null!=e.disabled&&(n.disabled=Boolean(e.disabled)),null!=e.type&&(n.type=String(e.type)),null!=e.query&&(n.query=String(e.query)),null!=e.protected&&(n.protected=Boolean(e.protected)),null!=e.materialized&&(n.materialized=Boolean(e.materialized)),null!=e.actionDescriptor){if("object"!=typeof e.actionDescriptor)throw TypeError(".sqlanvil.Table.actionDescriptor: object expected");n.actionDescriptor=s.sqlanvil.ActionDescriptor.fromObject(e.actionDescriptor,t+1)}if(e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.Table.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}if(null!=e.where&&(n.where=String(e.where)),null!=e.incrementalQuery&&(n.incrementalQuery=String(e.incrementalQuery)),e.uniqueKey){if(!Array.isArray(e.uniqueKey))throw TypeError(".sqlanvil.Table.uniqueKey: array expected");for(n.uniqueKey=[],r=0;r<e.uniqueKey.length;++r)n.uniqueKey[r]=String(e.uniqueKey[r])}switch(e.onSchemaChange){default:if("number"==typeof e.onSchemaChange){n.onSchemaChange=e.onSchemaChange;break}break;case"IGNORE":case 0:n.onSchemaChange=0;break;case"FAIL":case 1:n.onSchemaChange=1;break;case"EXTEND":case 2:n.onSchemaChange=2;break;case"SYNCHRONIZE":case 3:n.onSchemaChange=3}if(e.preOps){if(!Array.isArray(e.preOps))throw TypeError(".sqlanvil.Table.preOps: array expected");for(n.preOps=[],r=0;r<e.preOps.length;++r)n.preOps[r]=String(e.preOps[r])}if(e.postOps){if(!Array.isArray(e.postOps))throw TypeError(".sqlanvil.Table.postOps: array expected");for(n.postOps=[],r=0;r<e.postOps.length;++r)n.postOps[r]=String(e.postOps[r])}if(e.incrementalPreOps){if(!Array.isArray(e.incrementalPreOps))throw TypeError(".sqlanvil.Table.incrementalPreOps: array expected");for(n.incrementalPreOps=[],r=0;r<e.incrementalPreOps.length;++r)n.incrementalPreOps[r]=String(e.incrementalPreOps[r])}if(e.incrementalPostOps){if(!Array.isArray(e.incrementalPostOps))throw TypeError(".sqlanvil.Table.incrementalPostOps: array expected");for(n.incrementalPostOps=[],r=0;r<e.incrementalPostOps.length;++r)n.incrementalPostOps[r]=String(e.incrementalPostOps[r])}if(null!=e.jitCode&&(n.jitCode=String(e.jitCode)),null!=e.bigquery){if("object"!=typeof e.bigquery)throw TypeError(".sqlanvil.Table.bigquery: object expected");n.bigquery=s.sqlanvil.BigQueryOptions.fromObject(e.bigquery,t+1)}if(null!=e.postgres){if("object"!=typeof e.postgres)throw TypeError(".sqlanvil.Table.postgres: object expected");n.postgres=s.sqlanvil.PostgresOptions.fromObject(e.postgres,t+1)}if(null!=e.supabase){if("object"!=typeof e.supabase)throw TypeError(".sqlanvil.Table.supabase: object expected");n.supabase=s.sqlanvil.SupabaseOptions.fromObject(e.supabase,t+1)}if(null!=e.mysql){if("object"!=typeof e.mysql)throw TypeError(".sqlanvil.Table.mysql: object expected");n.mysql=s.sqlanvil.MysqlOptions.fromObject(e.mysql,t+1)}return null!=e.fileName&&(n.fileName=String(e.fileName)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.Operation;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 3:a.target=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 13:a.canonicalTarget=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 11:a.dependencyTargets&&a.dependencyTargets.length||(a.dependencyTargets=[]),a.dependencyTargets.push(s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1));break;case 12:a.hermeticity=e.int32();break;case 14:a.disabled=e.bool();break;case 6:a.queries&&a.queries.length||(a.queries=[]),a.queries.push(e.string());break;case 15:a.jitCode=e.string();break;case 8:a.hasOutput=e.bool();break;case 9:a.tags&&a.tags.length||(a.tags=[]),a.tags.push(e.string());break;case 10:a.actionDescriptor=s.sqlanvil.ActionDescriptor.decode(e,e.uint32(),void 0,r+1);break;case 7:a.fileName=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.target&&e.hasOwnProperty("target")&&(r=s.sqlanvil.Target.verify(e.target,t+1)))return"target."+r;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(r=s.sqlanvil.Target.verify(e.canonicalTarget,t+1)))return"canonicalTarget."+r;if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var n=0;n<e.dependencyTargets.length;++n){var r;if(r=s.sqlanvil.Target.verify(e.dependencyTargets[n],t+1))return"dependencyTargets."+r}}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(n=0;n<e.queries.length;++n)if(!a.isString(e.queries[n]))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(n=0;n<e.tags.length;++n)if(!a.isString(e.tags[n]))return"tags: string[] expected"}return null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(r=s.sqlanvil.ActionDescriptor.verify(e.actionDescriptor,t+1))?"actionDescriptor."+r:null!=e.fileName&&e.hasOwnProperty("fileName")&&!a.isString(e.fileName)?"fileName: string expected":null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.Operation)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.Operation;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.Operation.target: object expected");n.target=s.sqlanvil.Target.fromObject(e.target,t+1)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".sqlanvil.Operation.canonicalTarget: object expected");n.canonicalTarget=s.sqlanvil.Target.fromObject(e.canonicalTarget,t+1)}if(e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.Operation.dependencyTargets: array expected");n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.Operation.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.Target.fromObject(e.dependencyTargets[r],t+1)}}switch(e.hermeticity){default:if("number"==typeof e.hermeticity){n.hermeticity=e.hermeticity;break}break;case"UNKNOWN":case 0:n.hermeticity=0;break;case"HERMETIC":case 1:n.hermeticity=1;break;case"NON_HERMETIC":case 2:n.hermeticity=2}if(null!=e.disabled&&(n.disabled=Boolean(e.disabled)),e.queries){if(!Array.isArray(e.queries))throw TypeError(".sqlanvil.Operation.queries: array expected");for(n.queries=[],r=0;r<e.queries.length;++r)n.queries[r]=String(e.queries[r])}if(null!=e.jitCode&&(n.jitCode=String(e.jitCode)),null!=e.hasOutput&&(n.hasOutput=Boolean(e.hasOutput)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.Operation.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}if(null!=e.actionDescriptor){if("object"!=typeof e.actionDescriptor)throw TypeError(".sqlanvil.Operation.actionDescriptor: object expected");n.actionDescriptor=s.sqlanvil.ActionDescriptor.fromObject(e.actionDescriptor,t+1)}return null!=e.fileName&&(n.fileName=String(e.fileName)),n},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.Export=function(){function t(e){if(this.dependencyTargets=[],this.tags=[],this.options={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&"__proto__"!==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.tags=a.emptyArray,t.prototype.actionDescriptor=null,t.prototype.query="",t.prototype.location="",t.prototype.format="",t.prototype.overwrite=!1,t.prototype.filename="",t.prototype.options=a.emptyObject,t.prototype.fileName="",t.prototype.jitCode="",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.dependencyTargets&&e.dependencyTargets.length)for(var n=0;n<e.dependencyTargets.length;++n)s.sqlanvil.Target.encode(e.dependencyTargets[n],t.uint32(26).fork()).ldelim();if(null!=e.hermeticity&&Object.hasOwnProperty.call(e,"hermeticity")&&t.uint32(32).int32(e.hermeticity),null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(40).bool(e.disabled),null!=e.tags&&e.tags.length)for(n=0;n<e.tags.length;++n)t.uint32(50).string(e.tags[n]);if(null!=e.actionDescriptor&&Object.hasOwnProperty.call(e,"actionDescriptor")&&s.sqlanvil.ActionDescriptor.encode(e.actionDescriptor,t.uint32(58).fork()).ldelim(),null!=e.query&&Object.hasOwnProperty.call(e,"query")&&t.uint32(66).string(e.query),null!=e.location&&Object.hasOwnProperty.call(e,"location")&&t.uint32(74).string(e.location),null!=e.format&&Object.hasOwnProperty.call(e,"format")&&t.uint32(82).string(e.format),null!=e.overwrite&&Object.hasOwnProperty.call(e,"overwrite")&&t.uint32(88).bool(e.overwrite),null!=e.filename&&Object.hasOwnProperty.call(e,"filename")&&t.uint32(98).string(e.filename),null!=e.options&&Object.hasOwnProperty.call(e,"options")){var r=Object.keys(e.options);for(n=0;n<r.length;++n)t.uint32(106).fork().uint32(10).string(r[n]).uint32(18).string(e.options[r[n]]).ldelim()}return null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(114).string(e.fileName),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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.Export;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.target=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 2:u.canonicalTarget=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 3:u.dependencyTargets&&u.dependencyTargets.length||(u.dependencyTargets=[]),u.dependencyTargets.push(s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1));break;case 4:u.hermeticity=e.int32();break;case 5:u.disabled=e.bool();break;case 6:u.tags&&u.tags.length||(u.tags=[]),u.tags.push(e.string());break;case 7:u.actionDescriptor=s.sqlanvil.ActionDescriptor.decode(e,e.uint32(),void 0,r+1);break;case 8:u.query=e.string();break;case 9:u.location=e.string();break;case 10:u.format=e.string();break;case 11:u.overwrite=e.bool();break;case 12:u.filename=e.string();break;case 13:u.options===a.emptyObject&&(u.options={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;){var f=e.uint32();switch(f>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.options,o),u.options[o]=l;break;case 14:u.fileName=e.string();break;case 15:u.jitCode=e.string();break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.target&&e.hasOwnProperty("target")&&(r=s.sqlanvil.Target.verify(e.target,t+1)))return"target."+r;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(r=s.sqlanvil.Target.verify(e.canonicalTarget,t+1)))return"canonicalTarget."+r;if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var n=0;n<e.dependencyTargets.length;++n){var r;if(r=s.sqlanvil.Target.verify(e.dependencyTargets[n],t+1))return"dependencyTargets."+r}}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.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.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(r=s.sqlanvil.ActionDescriptor.verify(e.actionDescriptor,t+1)))return"actionDescriptor."+r;if(null!=e.query&&e.hasOwnProperty("query")&&!a.isString(e.query))return"query: string expected";if(null!=e.location&&e.hasOwnProperty("location")&&!a.isString(e.location))return"location: string expected";if(null!=e.format&&e.hasOwnProperty("format")&&!a.isString(e.format))return"format: string expected";if(null!=e.overwrite&&e.hasOwnProperty("overwrite")&&"boolean"!=typeof e.overwrite)return"overwrite: boolean expected";if(null!=e.filename&&e.hasOwnProperty("filename")&&!a.isString(e.filename))return"filename: string expected";if(null!=e.options&&e.hasOwnProperty("options")){if(!a.isObject(e.options))return"options: object expected";var i=Object.keys(e.options);for(n=0;n<i.length;++n)if(!a.isString(e.options[i[n]]))return"options: string{k:string} expected"}return null!=e.fileName&&e.hasOwnProperty("fileName")&&!a.isString(e.fileName)?"fileName: string expected":null!=e.jitCode&&e.hasOwnProperty("jitCode")&&!a.isString(e.jitCode)?"jitCode: string expected":null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.Export)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.Export;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.Export.target: object expected");n.target=s.sqlanvil.Target.fromObject(e.target,t+1)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".sqlanvil.Export.canonicalTarget: object expected");n.canonicalTarget=s.sqlanvil.Target.fromObject(e.canonicalTarget,t+1)}if(e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.Export.dependencyTargets: array expected");n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.Export.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.Target.fromObject(e.dependencyTargets[r],t+1)}}switch(e.hermeticity){default:if("number"==typeof e.hermeticity){n.hermeticity=e.hermeticity;break}break;case"UNKNOWN":case 0:n.hermeticity=0;break;case"HERMETIC":case 1:n.hermeticity=1;break;case"NON_HERMETIC":case 2:n.hermeticity=2}if(null!=e.disabled&&(n.disabled=Boolean(e.disabled)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.Export.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}if(null!=e.actionDescriptor){if("object"!=typeof e.actionDescriptor)throw TypeError(".sqlanvil.Export.actionDescriptor: object expected");n.actionDescriptor=s.sqlanvil.ActionDescriptor.fromObject(e.actionDescriptor,t+1)}if(null!=e.query&&(n.query=String(e.query)),null!=e.location&&(n.location=String(e.location)),null!=e.format&&(n.format=String(e.format)),null!=e.overwrite&&(n.overwrite=Boolean(e.overwrite)),null!=e.filename&&(n.filename=String(e.filename)),e.options){if("object"!=typeof e.options)throw TypeError(".sqlanvil.Export.options: object expected");n.options={};var i=Object.keys(e.options);for(r=0;r<i.length;++r)"__proto__"===i[r]&&a.makeProp(n.options,i[r]),n.options[i[r]]=String(e.options[i[r]])}return null!=e.fileName&&(n.fileName=String(e.fileName)),null!=e.jitCode&&(n.jitCode=String(e.jitCode)),n},t.toObject=function(e,t){t||(t={});var n,r={};if((t.arrays||t.defaults)&&(r.dependencyTargets=[],r.tags=[]),(t.objects||t.defaults)&&(r.options={}),t.defaults&&(r.target=null,r.canonicalTarget=null,r.hermeticity=t.enums===String?"UNKNOWN":0,r.disabled=!1,r.actionDescriptor=null,r.query="",r.location="",r.format="",r.overwrite=!1,r.filename="",r.fileName="",r.jitCode=""),null!=e.target&&e.hasOwnProperty("target")&&(r.target=s.sqlanvil.Target.toObject(e.target,t)),null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(r.canonicalTarget=s.sqlanvil.Target.toObject(e.canonicalTarget,t)),e.dependencyTargets&&e.dependencyTargets.length){r.dependencyTargets=[];for(var i=0;i<e.dependencyTargets.length;++i)r.dependencyTargets[i]=s.sqlanvil.Target.toObject(e.dependencyTargets[i],t)}if(null!=e.hermeticity&&e.hasOwnProperty("hermeticity")&&(r.hermeticity=t.enums===String?void 0===s.sqlanvil.ActionHermeticity[e.hermeticity]?e.hermeticity:s.sqlanvil.ActionHermeticity[e.hermeticity]:e.hermeticity),null!=e.disabled&&e.hasOwnProperty("disabled")&&(r.disabled=e.disabled),e.tags&&e.tags.length)for(r.tags=[],i=0;i<e.tags.length;++i)r.tags[i]=e.tags[i];if(null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(r.actionDescriptor=s.sqlanvil.ActionDescriptor.toObject(e.actionDescriptor,t)),null!=e.query&&e.hasOwnProperty("query")&&(r.query=e.query),null!=e.location&&e.hasOwnProperty("location")&&(r.location=e.location),null!=e.format&&e.hasOwnProperty("format")&&(r.format=e.format),null!=e.overwrite&&e.hasOwnProperty("overwrite")&&(r.overwrite=e.overwrite),null!=e.filename&&e.hasOwnProperty("filename")&&(r.filename=e.filename),e.options&&(n=Object.keys(e.options)).length)for(r.options={},i=0;i<n.length;++i)"__proto__"===n[i]&&a.makeProp(r.options,n[i]),r.options[n[i]]=e.options[n[i]];return null!=e.fileName&&e.hasOwnProperty("fileName")&&(r.fileName=e.fileName),null!=e.jitCode&&e.hasOwnProperty("jitCode")&&(r.jitCode=e.jitCode),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.Export"},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.Assertion;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 8:a.target=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 13:a.canonicalTarget=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 11:a.dependencyTargets&&a.dependencyTargets.length||(a.dependencyTargets=[]),a.dependencyTargets.push(s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1));break;case 12:a.hermeticity=e.int32();break;case 14:a.disabled=e.bool();break;case 3:a.query=e.string();break;case 9:a.tags&&a.tags.length||(a.tags=[]),a.tags.push(e.string());break;case 10:a.actionDescriptor=s.sqlanvil.ActionDescriptor.decode(e,e.uint32(),void 0,r+1);break;case 15:a.parentAction=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 16:a.jitCode=e.string();break;case 7:a.fileName=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.target&&e.hasOwnProperty("target")&&(r=s.sqlanvil.Target.verify(e.target,t+1)))return"target."+r;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(r=s.sqlanvil.Target.verify(e.canonicalTarget,t+1)))return"canonicalTarget."+r;if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var n=0;n<e.dependencyTargets.length;++n){var r;if(r=s.sqlanvil.Target.verify(e.dependencyTargets[n],t+1))return"dependencyTargets."+r}}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(n=0;n<e.tags.length;++n)if(!a.isString(e.tags[n]))return"tags: string[] expected"}return null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(r=s.sqlanvil.ActionDescriptor.verify(e.actionDescriptor,t+1))?"actionDescriptor."+r:null!=e.parentAction&&e.hasOwnProperty("parentAction")&&(r=s.sqlanvil.Target.verify(e.parentAction,t+1))?"parentAction."+r: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,t){if(e instanceof s.sqlanvil.Assertion)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.Assertion;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.Assertion.target: object expected");n.target=s.sqlanvil.Target.fromObject(e.target,t+1)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".sqlanvil.Assertion.canonicalTarget: object expected");n.canonicalTarget=s.sqlanvil.Target.fromObject(e.canonicalTarget,t+1)}if(e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.Assertion.dependencyTargets: array expected");n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.Assertion.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.Target.fromObject(e.dependencyTargets[r],t+1)}}switch(e.hermeticity){default:if("number"==typeof e.hermeticity){n.hermeticity=e.hermeticity;break}break;case"UNKNOWN":case 0:n.hermeticity=0;break;case"HERMETIC":case 1:n.hermeticity=1;break;case"NON_HERMETIC":case 2:n.hermeticity=2}if(null!=e.disabled&&(n.disabled=Boolean(e.disabled)),null!=e.query&&(n.query=String(e.query)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.Assertion.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}if(null!=e.actionDescriptor){if("object"!=typeof e.actionDescriptor)throw TypeError(".sqlanvil.Assertion.actionDescriptor: object expected");n.actionDescriptor=s.sqlanvil.ActionDescriptor.fromObject(e.actionDescriptor,t+1)}if(null!=e.parentAction){if("object"!=typeof e.parentAction)throw TypeError(".sqlanvil.Assertion.parentAction: object expected");n.parentAction=s.sqlanvil.Target.fromObject(e.parentAction,t+1)}return null!=e.jitCode&&(n.jitCode=String(e.jitCode)),null!=e.fileName&&(n.fileName=String(e.fileName)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.Declaration;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 2:a.target=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 5:a.canonicalTarget=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 3:a.actionDescriptor=s.sqlanvil.ActionDescriptor.decode(e,e.uint32(),void 0,r+1);break;case 4:a.fileName=e.string();break;case 6:a.tags&&a.tags.length||(a.tags=[]),a.tags.push(e.string());break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";var n;if(null!=e.target&&e.hasOwnProperty("target")&&(n=s.sqlanvil.Target.verify(e.target,t+1)))return"target."+n;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(n=s.sqlanvil.Target.verify(e.canonicalTarget,t+1)))return"canonicalTarget."+n;if(null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(n=s.sqlanvil.ActionDescriptor.verify(e.actionDescriptor,t+1)))return"actionDescriptor."+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(var r=0;r<e.tags.length;++r)if(!a.isString(e.tags[r]))return"tags: string[] expected"}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.Declaration)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.Declaration;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.Declaration.target: object expected");n.target=s.sqlanvil.Target.fromObject(e.target,t+1)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".sqlanvil.Declaration.canonicalTarget: object expected");n.canonicalTarget=s.sqlanvil.Target.fromObject(e.canonicalTarget,t+1)}if(null!=e.actionDescriptor){if("object"!=typeof e.actionDescriptor)throw TypeError(".sqlanvil.Declaration.actionDescriptor: object expected");n.actionDescriptor=s.sqlanvil.ActionDescriptor.fromObject(e.actionDescriptor,t+1)}if(null!=e.fileName&&(n.fileName=String(e.fileName)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.Declaration.tags: array expected");n.tags=[];for(var r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.Test;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.name=e.string();break;case 2:a.testQuery=e.string();break;case 3:a.expectedOutputQuery=e.string();break;case 10:a.jitCode=e.string();break;case 4:a.fileName=e.string();break;case 5:a.disabled=e.bool();break;case 6:a.tags&&a.tags.length||(a.tags=[]),a.tags.push(e.string());break;case 7:a.target=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 8:a.canonicalTarget=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 9:a.dependencyTargets&&a.dependencyTargets.length||(a.dependencyTargets=[]),a.dependencyTargets.push(s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1));break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.tags.length;++n)if(!a.isString(e.tags[n]))return"tags: string[] expected"}if(null!=e.target&&e.hasOwnProperty("target")&&(r=s.sqlanvil.Target.verify(e.target,t+1)))return"target."+r;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(r=s.sqlanvil.Target.verify(e.canonicalTarget,t+1)))return"canonicalTarget."+r;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],t+1))return"dependencyTargets."+r}}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.Test)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.Test;if(null!=e.name&&(n.name=String(e.name)),null!=e.testQuery&&(n.testQuery=String(e.testQuery)),null!=e.expectedOutputQuery&&(n.expectedOutputQuery=String(e.expectedOutputQuery)),null!=e.jitCode&&(n.jitCode=String(e.jitCode)),null!=e.fileName&&(n.fileName=String(e.fileName)),null!=e.disabled&&(n.disabled=Boolean(e.disabled)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.Test.tags: array expected");n.tags=[];for(var r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.Test.target: object expected");n.target=s.sqlanvil.Target.fromObject(e.target,t+1)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".sqlanvil.Test.canonicalTarget: object expected");n.canonicalTarget=s.sqlanvil.Target.fromObject(e.canonicalTarget,t+1)}if(e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.Test.dependencyTargets: array expected");for(n.dependencyTargets=[],r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.Test.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.Target.fromObject(e.dependencyTargets[r],t+1)}}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.Notebook;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.target=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 2:a.canonicalTarget=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 3:a.tags&&a.tags.length||(a.tags=[]),a.tags.push(e.string());break;case 4:a.dependencyTargets&&a.dependencyTargets.length||(a.dependencyTargets=[]),a.dependencyTargets.push(s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1));break;case 5:a.fileName=e.string();break;case 6:a.disabled=e.bool();break;case 7:a.notebookContents=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.target&&e.hasOwnProperty("target")&&(r=s.sqlanvil.Target.verify(e.target,t+1)))return"target."+r;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(r=s.sqlanvil.Target.verify(e.canonicalTarget,t+1)))return"canonicalTarget."+r;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"}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],t+1))return"dependencyTargets."+r}}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,t){if(e instanceof s.sqlanvil.Notebook)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.Notebook;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.Notebook.target: object expected");n.target=s.sqlanvil.Target.fromObject(e.target,t+1)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".sqlanvil.Notebook.canonicalTarget: object expected");n.canonicalTarget=s.sqlanvil.Target.fromObject(e.canonicalTarget,t+1)}if(e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.Notebook.tags: array expected");n.tags=[];for(var r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}if(e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.Notebook.dependencyTargets: array expected");for(n.dependencyTargets=[],r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.Notebook.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.Target.fromObject(e.dependencyTargets[r],t+1)}}return null!=e.fileName&&(n.fileName=String(e.fileName)),null!=e.disabled&&(n.disabled=Boolean(e.disabled)),null!=e.notebookContents&&(n.notebookContents=String(e.notebookContents)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.RepositorySnapshotDestination;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?a.repositorySnapshotUri=e.string():e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":null!=e.repositorySnapshotUri&&e.hasOwnProperty("repositorySnapshotUri")&&!a.isString(e.repositorySnapshotUri)?"repositorySnapshotUri: string expected":null)},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.RepositorySnapshotDestination)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.RepositorySnapshotDestination;return null!=e.repositorySnapshotUri&&(n.repositorySnapshotUri=String(e.repositorySnapshotUri)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.NotebookRuntimeOptions;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.outputBucket=e.string();break;case 2:a.runtimeTemplateName=e.string();break;case 3:a.repositorySnapshotDestination=s.sqlanvil.RepositorySnapshotDestination.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";var n={};if(null!=e.outputBucket&&e.hasOwnProperty("outputBucket")&&(n.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")){n.repositorySnapshotStorage=1;var r=s.sqlanvil.RepositorySnapshotDestination.verify(e.repositorySnapshotDestination,t+1);if(r)return"repositorySnapshotDestination."+r}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.NotebookRuntimeOptions)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.NotebookRuntimeOptions;if(null!=e.outputBucket&&(n.outputBucket=String(e.outputBucket)),null!=e.runtimeTemplateName&&(n.runtimeTemplateName=String(e.runtimeTemplateName)),null!=e.repositorySnapshotDestination){if("object"!=typeof e.repositorySnapshotDestination)throw TypeError(".sqlanvil.NotebookRuntimeOptions.repositorySnapshotDestination: object expected");n.repositorySnapshotDestination=s.sqlanvil.RepositorySnapshotDestination.fromObject(e.repositorySnapshotDestination,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.DataPreparation;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 8:a.target=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 9:a.canonicalTarget=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 1:a.targets&&a.targets.length||(a.targets=[]),a.targets.push(s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1));break;case 2:a.canonicalTargets&&a.canonicalTargets.length||(a.canonicalTargets=[]),a.canonicalTargets.push(s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1));break;case 3:a.tags&&a.tags.length||(a.tags=[]),a.tags.push(e.string());break;case 4:a.dependencyTargets&&a.dependencyTargets.length||(a.dependencyTargets=[]),a.dependencyTargets.push(s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1));break;case 5:a.fileName=e.string();break;case 6:a.disabled=e.bool();break;case 11:a.dataPreparationYaml=e.string();break;case 15:a.query=e.string();break;case 12:a.errorTable=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 13:a.errorTableRetentionDays=e.int32();break;case 16:a.load=s.sqlanvil.LoadConfiguration.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";var n={};if(null!=e.target&&e.hasOwnProperty("target")&&(i=s.sqlanvil.Target.verify(e.target,t+1)))return"target."+i;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(i=s.sqlanvil.Target.verify(e.canonicalTarget,t+1)))return"canonicalTarget."+i;if(null!=e.targets&&e.hasOwnProperty("targets")){if(!Array.isArray(e.targets))return"targets: array expected";for(var r=0;r<e.targets.length;++r)if(i=s.sqlanvil.Target.verify(e.targets[r],t+1))return"targets."+i}if(null!=e.canonicalTargets&&e.hasOwnProperty("canonicalTargets")){if(!Array.isArray(e.canonicalTargets))return"canonicalTargets: array expected";for(r=0;r<e.canonicalTargets.length;++r)if(i=s.sqlanvil.Target.verify(e.canonicalTargets[r],t+1))return"canonicalTargets."+i}if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(r=0;r<e.tags.length;++r)if(!a.isString(e.tags[r]))return"tags: string[] expected"}if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(r=0;r<e.dependencyTargets.length;++r){var i;if(i=s.sqlanvil.Target.verify(e.dependencyTargets[r],t+1))return"dependencyTargets."+i}}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")&&(n.definition=1,!a.isString(e.dataPreparationYaml)))return"dataPreparationYaml: string expected";if(null!=e.query&&e.hasOwnProperty("query")){if(1===n.definition)return"definition: multiple values";if(n.definition=1,!a.isString(e.query))return"query: string expected"}return null!=e.errorTable&&e.hasOwnProperty("errorTable")&&(i=s.sqlanvil.Target.verify(e.errorTable,t+1))?"errorTable."+i:null!=e.errorTableRetentionDays&&e.hasOwnProperty("errorTableRetentionDays")&&!a.isInteger(e.errorTableRetentionDays)?"errorTableRetentionDays: integer expected":null!=e.load&&e.hasOwnProperty("load")&&(i=s.sqlanvil.LoadConfiguration.verify(e.load,t+1))?"load."+i:null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.DataPreparation)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.DataPreparation;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.DataPreparation.target: object expected");n.target=s.sqlanvil.Target.fromObject(e.target,t+1)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".sqlanvil.DataPreparation.canonicalTarget: object expected");n.canonicalTarget=s.sqlanvil.Target.fromObject(e.canonicalTarget,t+1)}if(e.targets){if(!Array.isArray(e.targets))throw TypeError(".sqlanvil.DataPreparation.targets: array expected");n.targets=[];for(var r=0;r<e.targets.length;++r){if("object"!=typeof e.targets[r])throw TypeError(".sqlanvil.DataPreparation.targets: object expected");n.targets[r]=s.sqlanvil.Target.fromObject(e.targets[r],t+1)}}if(e.canonicalTargets){if(!Array.isArray(e.canonicalTargets))throw TypeError(".sqlanvil.DataPreparation.canonicalTargets: array expected");for(n.canonicalTargets=[],r=0;r<e.canonicalTargets.length;++r){if("object"!=typeof e.canonicalTargets[r])throw TypeError(".sqlanvil.DataPreparation.canonicalTargets: object expected");n.canonicalTargets[r]=s.sqlanvil.Target.fromObject(e.canonicalTargets[r],t+1)}}if(e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.DataPreparation.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}if(e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.DataPreparation.dependencyTargets: array expected");for(n.dependencyTargets=[],r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.DataPreparation.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.Target.fromObject(e.dependencyTargets[r],t+1)}}if(null!=e.fileName&&(n.fileName=String(e.fileName)),null!=e.disabled&&(n.disabled=Boolean(e.disabled)),null!=e.dataPreparationYaml&&(n.dataPreparationYaml=String(e.dataPreparationYaml)),null!=e.query&&(n.query=String(e.query)),null!=e.errorTable){if("object"!=typeof e.errorTable)throw TypeError(".sqlanvil.DataPreparation.errorTable: object expected");n.errorTable=s.sqlanvil.Target.fromObject(e.errorTable,t+1)}if(null!=e.errorTableRetentionDays&&(n.errorTableRetentionDays=0|e.errorTableRetentionDays),null!=e.load){if("object"!=typeof e.load)throw TypeError(".sqlanvil.DataPreparation.load: object expected");n.load=s.sqlanvil.LoadConfiguration.fromObject(e.load,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.LoadConfiguration;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.replace=s.sqlanvil.SimpleLoadMode.decode(e,e.uint32(),void 0,r+1);break;case 2:a.append=s.sqlanvil.SimpleLoadMode.decode(e,e.uint32(),void 0,r+1);break;case 3:a.maximum=s.sqlanvil.IncrementalLoadMode.decode(e,e.uint32(),void 0,r+1);break;case 4:a.unique=s.sqlanvil.IncrementalLoadMode.decode(e,e.uint32(),void 0,r+1);break;case 5:a.automatic=s.sqlanvil.IncrementalLoadMode.decode(e,e.uint32(),void 0,r+1);break;case 6:a.merge=s.sqlanvil.MergeLoadMode.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";var n={};if(null!=e.replace&&e.hasOwnProperty("replace")&&(n.mode=1,r=s.sqlanvil.SimpleLoadMode.verify(e.replace,t+1)))return"replace."+r;if(null!=e.append&&e.hasOwnProperty("append")){if(1===n.mode)return"mode: multiple values";if(n.mode=1,r=s.sqlanvil.SimpleLoadMode.verify(e.append,t+1))return"append."+r}if(null!=e.maximum&&e.hasOwnProperty("maximum")){if(1===n.mode)return"mode: multiple values";if(n.mode=1,r=s.sqlanvil.IncrementalLoadMode.verify(e.maximum,t+1))return"maximum."+r}if(null!=e.unique&&e.hasOwnProperty("unique")){if(1===n.mode)return"mode: multiple values";if(n.mode=1,r=s.sqlanvil.IncrementalLoadMode.verify(e.unique,t+1))return"unique."+r}if(null!=e.automatic&&e.hasOwnProperty("automatic")){if(1===n.mode)return"mode: multiple values";if(n.mode=1,r=s.sqlanvil.IncrementalLoadMode.verify(e.automatic,t+1))return"automatic."+r}if(null!=e.merge&&e.hasOwnProperty("merge")){if(1===n.mode)return"mode: multiple values";var r;if(n.mode=1,r=s.sqlanvil.MergeLoadMode.verify(e.merge,t+1))return"merge."+r}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.LoadConfiguration)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.LoadConfiguration;if(null!=e.replace){if("object"!=typeof e.replace)throw TypeError(".sqlanvil.LoadConfiguration.replace: object expected");n.replace=s.sqlanvil.SimpleLoadMode.fromObject(e.replace,t+1)}if(null!=e.append){if("object"!=typeof e.append)throw TypeError(".sqlanvil.LoadConfiguration.append: object expected");n.append=s.sqlanvil.SimpleLoadMode.fromObject(e.append,t+1)}if(null!=e.maximum){if("object"!=typeof e.maximum)throw TypeError(".sqlanvil.LoadConfiguration.maximum: object expected");n.maximum=s.sqlanvil.IncrementalLoadMode.fromObject(e.maximum,t+1)}if(null!=e.unique){if("object"!=typeof e.unique)throw TypeError(".sqlanvil.LoadConfiguration.unique: object expected");n.unique=s.sqlanvil.IncrementalLoadMode.fromObject(e.unique,t+1)}if(null!=e.automatic){if("object"!=typeof e.automatic)throw TypeError(".sqlanvil.LoadConfiguration.automatic: object expected");n.automatic=s.sqlanvil.IncrementalLoadMode.fromObject(e.automatic,t+1)}if(null!=e.merge){if("object"!=typeof e.merge)throw TypeError(".sqlanvil.LoadConfiguration.merge: object expected");n.merge=s.sqlanvil.MergeLoadMode.fromObject(e.merge,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.SimpleLoadMode;e.pos<o;){var l=e.uint32();if(l===n)break;e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":null)},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.SimpleLoadMode)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");return 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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.IncrementalLoadMode;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?a.columnName=e.string():e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":null!=e.columnName&&e.hasOwnProperty("columnName")&&!a.isString(e.columnName)?"columnName: string expected":null)},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.IncrementalLoadMode)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.IncrementalLoadMode;return null!=e.columnName&&(n.columnName=String(e.columnName)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.MergeLoadMode;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?(a.uniqueKey&&a.uniqueKey.length||(a.uniqueKey=[]),a.uniqueKey.push(e.string())):e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.uniqueKey&&e.hasOwnProperty("uniqueKey")){if(!Array.isArray(e.uniqueKey))return"uniqueKey: array expected";for(var n=0;n<e.uniqueKey.length;++n)if(!a.isString(e.uniqueKey[n]))return"uniqueKey: string[] expected"}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.MergeLoadMode)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.MergeLoadMode;if(e.uniqueKey){if(!Array.isArray(e.uniqueKey))throw TypeError(".sqlanvil.MergeLoadMode.uniqueKey: array expected");n.uniqueKey=[];for(var r=0;r<e.uniqueKey.length;++r)n.uniqueKey[r]=String(e.uniqueKey[r])}return n},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.exports=[],this.targets=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&"__proto__"!==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.exports=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();if(null!=e.exports&&e.exports.length)for(n=0;n<e.exports.length;++n)s.sqlanvil.Export.encode(e.exports[n],t.uint32(114).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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.CompiledGraph;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 4:a.projectConfig=s.sqlanvil.ProjectConfig.decode(e,e.uint32(),void 0,r+1);break;case 1:a.tables&&a.tables.length||(a.tables=[]),a.tables.push(s.sqlanvil.Table.decode(e,e.uint32(),void 0,r+1));break;case 2:a.operations&&a.operations.length||(a.operations=[]),a.operations.push(s.sqlanvil.Operation.decode(e,e.uint32(),void 0,r+1));break;case 3:a.assertions&&a.assertions.length||(a.assertions=[]),a.assertions.push(s.sqlanvil.Assertion.decode(e,e.uint32(),void 0,r+1));break;case 9:a.declarations&&a.declarations.length||(a.declarations=[]),a.declarations.push(s.sqlanvil.Declaration.decode(e,e.uint32(),void 0,r+1));break;case 8:a.tests&&a.tests.length||(a.tests=[]),a.tests.push(s.sqlanvil.Test.decode(e,e.uint32(),void 0,r+1));break;case 12:a.notebooks&&a.notebooks.length||(a.notebooks=[]),a.notebooks.push(s.sqlanvil.Notebook.decode(e,e.uint32(),void 0,r+1));break;case 13:a.dataPreparations&&a.dataPreparations.length||(a.dataPreparations=[]),a.dataPreparations.push(s.sqlanvil.DataPreparation.decode(e,e.uint32(),void 0,r+1));break;case 14:a.exports&&a.exports.length||(a.exports=[]),a.exports.push(s.sqlanvil.Export.decode(e,e.uint32(),void 0,r+1));break;case 7:a.graphErrors=s.sqlanvil.GraphErrors.decode(e,e.uint32(),void 0,r+1);break;case 10:a.sqlanvilCoreVersion=e.string();break;case 11:a.targets&&a.targets.length||(a.targets=[]),a.targets.push(s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1));break;case 15:a.jitData=s.google.protobuf.Struct.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.projectConfig&&e.hasOwnProperty("projectConfig")&&(r=s.sqlanvil.ProjectConfig.verify(e.projectConfig,t+1)))return"projectConfig."+r;if(null!=e.tables&&e.hasOwnProperty("tables")){if(!Array.isArray(e.tables))return"tables: array expected";for(var n=0;n<e.tables.length;++n)if(r=s.sqlanvil.Table.verify(e.tables[n],t+1))return"tables."+r}if(null!=e.operations&&e.hasOwnProperty("operations")){if(!Array.isArray(e.operations))return"operations: array expected";for(n=0;n<e.operations.length;++n)if(r=s.sqlanvil.Operation.verify(e.operations[n],t+1))return"operations."+r}if(null!=e.assertions&&e.hasOwnProperty("assertions")){if(!Array.isArray(e.assertions))return"assertions: array expected";for(n=0;n<e.assertions.length;++n)if(r=s.sqlanvil.Assertion.verify(e.assertions[n],t+1))return"assertions."+r}if(null!=e.declarations&&e.hasOwnProperty("declarations")){if(!Array.isArray(e.declarations))return"declarations: array expected";for(n=0;n<e.declarations.length;++n)if(r=s.sqlanvil.Declaration.verify(e.declarations[n],t+1))return"declarations."+r}if(null!=e.tests&&e.hasOwnProperty("tests")){if(!Array.isArray(e.tests))return"tests: array expected";for(n=0;n<e.tests.length;++n)if(r=s.sqlanvil.Test.verify(e.tests[n],t+1))return"tests."+r}if(null!=e.notebooks&&e.hasOwnProperty("notebooks")){if(!Array.isArray(e.notebooks))return"notebooks: array expected";for(n=0;n<e.notebooks.length;++n)if(r=s.sqlanvil.Notebook.verify(e.notebooks[n],t+1))return"notebooks."+r}if(null!=e.dataPreparations&&e.hasOwnProperty("dataPreparations")){if(!Array.isArray(e.dataPreparations))return"dataPreparations: array expected";for(n=0;n<e.dataPreparations.length;++n)if(r=s.sqlanvil.DataPreparation.verify(e.dataPreparations[n],t+1))return"dataPreparations."+r}if(null!=e.exports&&e.hasOwnProperty("exports")){if(!Array.isArray(e.exports))return"exports: array expected";for(n=0;n<e.exports.length;++n)if(r=s.sqlanvil.Export.verify(e.exports[n],t+1))return"exports."+r}if(null!=e.graphErrors&&e.hasOwnProperty("graphErrors")&&(r=s.sqlanvil.GraphErrors.verify(e.graphErrors,t+1)))return"graphErrors."+r;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(n=0;n<e.targets.length;++n){var r;if(r=s.sqlanvil.Target.verify(e.targets[n],t+1))return"targets."+r}}return null!=e.jitData&&e.hasOwnProperty("jitData")&&(r=s.google.protobuf.Struct.verify(e.jitData,t+1))?"jitData."+r:null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.CompiledGraph)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.CompiledGraph;if(null!=e.projectConfig){if("object"!=typeof e.projectConfig)throw TypeError(".sqlanvil.CompiledGraph.projectConfig: object expected");n.projectConfig=s.sqlanvil.ProjectConfig.fromObject(e.projectConfig,t+1)}if(e.tables){if(!Array.isArray(e.tables))throw TypeError(".sqlanvil.CompiledGraph.tables: array expected");n.tables=[];for(var r=0;r<e.tables.length;++r){if("object"!=typeof e.tables[r])throw TypeError(".sqlanvil.CompiledGraph.tables: object expected");n.tables[r]=s.sqlanvil.Table.fromObject(e.tables[r],t+1)}}if(e.operations){if(!Array.isArray(e.operations))throw TypeError(".sqlanvil.CompiledGraph.operations: array expected");for(n.operations=[],r=0;r<e.operations.length;++r){if("object"!=typeof e.operations[r])throw TypeError(".sqlanvil.CompiledGraph.operations: object expected");n.operations[r]=s.sqlanvil.Operation.fromObject(e.operations[r],t+1)}}if(e.assertions){if(!Array.isArray(e.assertions))throw TypeError(".sqlanvil.CompiledGraph.assertions: array expected");for(n.assertions=[],r=0;r<e.assertions.length;++r){if("object"!=typeof e.assertions[r])throw TypeError(".sqlanvil.CompiledGraph.assertions: object expected");n.assertions[r]=s.sqlanvil.Assertion.fromObject(e.assertions[r],t+1)}}if(e.declarations){if(!Array.isArray(e.declarations))throw TypeError(".sqlanvil.CompiledGraph.declarations: array expected");for(n.declarations=[],r=0;r<e.declarations.length;++r){if("object"!=typeof e.declarations[r])throw TypeError(".sqlanvil.CompiledGraph.declarations: object expected");n.declarations[r]=s.sqlanvil.Declaration.fromObject(e.declarations[r],t+1)}}if(e.tests){if(!Array.isArray(e.tests))throw TypeError(".sqlanvil.CompiledGraph.tests: array expected");for(n.tests=[],r=0;r<e.tests.length;++r){if("object"!=typeof e.tests[r])throw TypeError(".sqlanvil.CompiledGraph.tests: object expected");n.tests[r]=s.sqlanvil.Test.fromObject(e.tests[r],t+1)}}if(e.notebooks){if(!Array.isArray(e.notebooks))throw TypeError(".sqlanvil.CompiledGraph.notebooks: array expected");for(n.notebooks=[],r=0;r<e.notebooks.length;++r){if("object"!=typeof e.notebooks[r])throw TypeError(".sqlanvil.CompiledGraph.notebooks: object expected");n.notebooks[r]=s.sqlanvil.Notebook.fromObject(e.notebooks[r],t+1)}}if(e.dataPreparations){if(!Array.isArray(e.dataPreparations))throw TypeError(".sqlanvil.CompiledGraph.dataPreparations: array expected");for(n.dataPreparations=[],r=0;r<e.dataPreparations.length;++r){if("object"!=typeof e.dataPreparations[r])throw TypeError(".sqlanvil.CompiledGraph.dataPreparations: object expected");n.dataPreparations[r]=s.sqlanvil.DataPreparation.fromObject(e.dataPreparations[r],t+1)}}if(e.exports){if(!Array.isArray(e.exports))throw TypeError(".sqlanvil.CompiledGraph.exports: array expected");for(n.exports=[],r=0;r<e.exports.length;++r){if("object"!=typeof e.exports[r])throw TypeError(".sqlanvil.CompiledGraph.exports: object expected");n.exports[r]=s.sqlanvil.Export.fromObject(e.exports[r],t+1)}}if(null!=e.graphErrors){if("object"!=typeof e.graphErrors)throw TypeError(".sqlanvil.CompiledGraph.graphErrors: object expected");n.graphErrors=s.sqlanvil.GraphErrors.fromObject(e.graphErrors,t+1)}if(null!=e.sqlanvilCoreVersion&&(n.sqlanvilCoreVersion=String(e.sqlanvilCoreVersion)),e.targets){if(!Array.isArray(e.targets))throw TypeError(".sqlanvil.CompiledGraph.targets: array expected");for(n.targets=[],r=0;r<e.targets.length;++r){if("object"!=typeof e.targets[r])throw TypeError(".sqlanvil.CompiledGraph.targets: object expected");n.targets[r]=s.sqlanvil.Target.fromObject(e.targets[r],t+1)}}if(null!=e.jitData){if("object"!=typeof e.jitData)throw TypeError(".sqlanvil.CompiledGraph.jitData: object expected");n.jitData=s.google.protobuf.Struct.fromObject(e.jitData,t+1)}return n},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=[],n.exports=[]),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);if(e.exports&&e.exports.length)for(n.exports=[],r=0;r<e.exports.length;++r)n.exports[r]=s.sqlanvil.Export.toObject(e.exports[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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.CoreExecutionRequest;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?a.compile=s.sqlanvil.CompileExecutionRequest.decode(e,e.uint32(),void 0,r+1):e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.compile&&e.hasOwnProperty("compile")){var n=s.sqlanvil.CompileExecutionRequest.verify(e.compile,t+1);if(n)return"compile."+n}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.CoreExecutionRequest)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.CoreExecutionRequest;if(null!=e.compile){if("object"!=typeof e.compile)throw TypeError(".sqlanvil.CoreExecutionRequest.compile: object expected");n.compile=s.sqlanvil.CompileExecutionRequest.fromObject(e.compile,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.CoreExecutionResponse;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?a.compile=s.sqlanvil.CompileExecutionResponse.decode(e,e.uint32(),void 0,r+1):e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.compile&&e.hasOwnProperty("compile")){var n=s.sqlanvil.CompileExecutionResponse.verify(e.compile,t+1);if(n)return"compile."+n}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.CoreExecutionResponse)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.CoreExecutionResponse;if(null!=e.compile){if("object"!=typeof e.compile)throw TypeError(".sqlanvil.CoreExecutionResponse.compile: object expected");n.compile=s.sqlanvil.CompileExecutionResponse.fromObject(e.compile,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.CompileExecutionRequest;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?a.compileConfig=s.sqlanvil.CompileConfig.decode(e,e.uint32(),void 0,r+1):e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.compileConfig&&e.hasOwnProperty("compileConfig")){var n=s.sqlanvil.CompileConfig.verify(e.compileConfig,t+1);if(n)return"compileConfig."+n}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.CompileExecutionRequest)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.CompileExecutionRequest;if(null!=e.compileConfig){if("object"!=typeof e.compileConfig)throw TypeError(".sqlanvil.CompileExecutionRequest.compileConfig: object expected");n.compileConfig=s.sqlanvil.CompileConfig.fromObject(e.compileConfig,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.CompileExecutionResponse;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?a.compiledGraph=s.sqlanvil.CompiledGraph.decode(e,e.uint32(),void 0,r+1):e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.compiledGraph&&e.hasOwnProperty("compiledGraph")){var n=s.sqlanvil.CompiledGraph.verify(e.compiledGraph,t+1);if(n)return"compiledGraph."+n}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.CompileExecutionResponse)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.CompileExecutionResponse;if(null!=e.compiledGraph){if("object"!=typeof e.compiledGraph)throw TypeError(".sqlanvil.CompileExecutionResponse.compiledGraph: object expected");n.compiledGraph=s.sqlanvil.CompiledGraph.fromObject(e.compiledGraph,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.Field;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.name=e.string();break;case 6:if(a.flags&&a.flags.length||(a.flags=[]),2==(7&l))for(var c=e.uint32()+e.pos;e.pos<c;)a.flags.push(e.int32());else a.flags.push(e.int32());break;case 7:a.primitive=e.int32();break;case 3:a.struct=s.sqlanvil.Fields.decode(e,e.uint32(),void 0,r+1);break;case 5:a.description=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";var n={};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 r=0;r<e.flags.length;++r)switch(e.flags[r]){default:return"flags: enum value[] expected";case 0:case 1:}}if(null!=e.primitive&&e.hasOwnProperty("primitive"))switch(n.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===n.type)return"type: multiple values";n.type=1;var i=s.sqlanvil.Fields.verify(e.struct,t+1);if(i)return"struct."+i}return null!=e.description&&e.hasOwnProperty("description")&&!a.isString(e.description)?"description: string expected":null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.Field)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.Field;if(null!=e.name&&(n.name=String(e.name)),e.flags){if(!Array.isArray(e.flags))throw TypeError(".sqlanvil.Field.flags: array expected");n.flags=[];for(var r=0;r<e.flags.length;++r)switch(e.flags[r]){default:if("number"==typeof e.flags[r]){n.flags[r]=e.flags[r];break}case"UNKNOWN_FLAG":case 0:n.flags[r]=0;break;case"REPEATED":case 1:n.flags[r]=1}}switch(e.primitive){default:if("number"==typeof e.primitive){n.primitive=e.primitive;break}break;case"UNKNOWN":case 0:n.primitive=0;break;case"INTEGER":case 1:n.primitive=1;break;case"FLOAT":case 2:n.primitive=2;break;case"NUMERIC":case 5:n.primitive=5;break;case"BOOLEAN":case 3:n.primitive=3;break;case"STRING":case 4:n.primitive=4;break;case"DATE":case 6:n.primitive=6;break;case"DATETIME":case 7:n.primitive=7;break;case"TIMESTAMP":case 8:n.primitive=8;break;case"TIME":case 9:n.primitive=9;break;case"BYTES":case 10:n.primitive=10;break;case"ANY":case 11:n.primitive=11;break;case"GEOGRAPHY":case 12:n.primitive=12;break;case"BIGNUMERIC":case 13:n.primitive=13;break;case"JSON":case 14:n.primitive=14;break;case"INTERVAL":case 15:n.primitive=15}if(null!=e.struct){if("object"!=typeof e.struct)throw TypeError(".sqlanvil.Field.struct: object expected");n.struct=s.sqlanvil.Fields.fromObject(e.struct,t+1)}return null!=e.description&&(n.description=String(e.description)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.Fields;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?(a.fields&&a.fields.length||(a.fields=[]),a.fields.push(s.sqlanvil.Field.decode(e,e.uint32(),void 0,r+1))):e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.fields&&e.hasOwnProperty("fields")){if(!Array.isArray(e.fields))return"fields: array expected";for(var n=0;n<e.fields.length;++n){var r=s.sqlanvil.Field.verify(e.fields[n],t+1);if(r)return"fields."+r}}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.Fields)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.Fields;if(e.fields){if(!Array.isArray(e.fields))throw TypeError(".sqlanvil.Fields.fields: array expected");n.fields=[];for(var r=0;r<e.fields.length;++r){if("object"!=typeof e.fields[r])throw TypeError(".sqlanvil.Fields.fields: object expected");n.fields[r]=s.sqlanvil.Field.fromObject(e.fields[r],t+1)}}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.TableMetadata;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.target=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 6:u.type=e.int32();break;case 3:u.fields&&u.fields.length||(u.fields=[]),u.fields.push(s.sqlanvil.Field.decode(e,e.uint32(),void 0,r+1));break;case 5:u.description=e.string();break;case 7:u.labels===a.emptyObject&&(u.labels={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;){var f=e.uint32();switch(f>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.labels,o),u.labels[o]=l;break;case 4:u.lastUpdatedMillis=e.int64();break;case 8:u.bigquery=s.sqlanvil.TableMetadata.BigQuery.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.target&&e.hasOwnProperty("target")&&(r=s.sqlanvil.Target.verify(e.target,t+1)))return"target."+r;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 n=0;n<e.fields.length;++n){var r;if(r=s.sqlanvil.Field.verify(e.fields[n],t+1))return"fields."+r}}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 i=Object.keys(e.labels);for(n=0;n<i.length;++n)if(!a.isString(e.labels[i[n]]))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")&&(r=s.sqlanvil.TableMetadata.BigQuery.verify(e.bigquery,t+1))?"bigquery."+r:null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.TableMetadata)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.TableMetadata;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.TableMetadata.target: object expected");n.target=s.sqlanvil.Target.fromObject(e.target,t+1)}switch(e.type){default:if("number"==typeof e.type){n.type=e.type;break}break;case"UNKNOWN":case 0:n.type=0;break;case"TABLE":case 1:n.type=1;break;case"VIEW":case 2:n.type=2;break;case"MATERIALIZED_VIEW":case 3:n.type=3}if(e.fields){if(!Array.isArray(e.fields))throw TypeError(".sqlanvil.TableMetadata.fields: array expected");n.fields=[];for(var r=0;r<e.fields.length;++r){if("object"!=typeof e.fields[r])throw TypeError(".sqlanvil.TableMetadata.fields: object expected");n.fields[r]=s.sqlanvil.Field.fromObject(e.fields[r],t+1)}}if(null!=e.description&&(n.description=String(e.description)),e.labels){if("object"!=typeof e.labels)throw TypeError(".sqlanvil.TableMetadata.labels: object expected");n.labels={};var i=Object.keys(e.labels);for(r=0;r<i.length;++r)"__proto__"===i[r]&&a.makeProp(n.labels,i[r]),n.labels[i[r]]=String(e.labels[i[r]])}if(null!=e.lastUpdatedMillis&&(a.Long?(n.lastUpdatedMillis=a.Long.fromValue(e.lastUpdatedMillis)).unsigned=!1:"string"==typeof e.lastUpdatedMillis?n.lastUpdatedMillis=parseInt(e.lastUpdatedMillis,10):"number"==typeof e.lastUpdatedMillis?n.lastUpdatedMillis=e.lastUpdatedMillis:"object"==typeof e.lastUpdatedMillis&&(n.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");n.bigquery=s.sqlanvil.TableMetadata.BigQuery.fromObject(e.bigquery,t+1)}return n},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)"__proto__"===n[i]&&a.makeProp(r.labels,n[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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.TableMetadata.BigQuery;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?a.hasStreamingBuffer=e.bool():e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":null!=e.hasStreamingBuffer&&e.hasOwnProperty("hasStreamingBuffer")&&"boolean"!=typeof e.hasStreamingBuffer?"hasStreamingBuffer: boolean expected":null)},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.TableMetadata.BigQuery)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.TableMetadata.BigQuery;return null!=e.hasStreamingBuffer&&(n.hasStreamingBuffer=Boolean(e.hasStreamingBuffer)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ExecutionMetadata;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?a.bigquery=s.sqlanvil.ExecutionMetadata.BigqueryMetadata.decode(e,e.uint32(),void 0,r+1):e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.bigquery&&e.hasOwnProperty("bigquery")){var n=s.sqlanvil.ExecutionMetadata.BigqueryMetadata.verify(e.bigquery,t+1);if(n)return"bigquery."+n}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ExecutionMetadata)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ExecutionMetadata;if(null!=e.bigquery){if("object"!=typeof e.bigquery)throw TypeError(".sqlanvil.ExecutionMetadata.bigquery: object expected");n.bigquery=s.sqlanvil.ExecutionMetadata.BigqueryMetadata.fromObject(e.bigquery,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ExecutionMetadata.BigqueryMetadata;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.jobId=e.string();break;case 2:a.totalBytesProcessed=e.int64();break;case 3:a.totalBytesBilled=e.int64();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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,t){if(e instanceof s.sqlanvil.ExecutionMetadata.BigqueryMetadata)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ExecutionMetadata.BigqueryMetadata;return null!=e.jobId&&(n.jobId=String(e.jobId)),null!=e.totalBytesProcessed&&(a.Long?(n.totalBytesProcessed=a.Long.fromValue(e.totalBytesProcessed)).unsigned=!1:"string"==typeof e.totalBytesProcessed?n.totalBytesProcessed=parseInt(e.totalBytesProcessed,10):"number"==typeof e.totalBytesProcessed?n.totalBytesProcessed=e.totalBytesProcessed:"object"==typeof e.totalBytesProcessed&&(n.totalBytesProcessed=new a.LongBits(e.totalBytesProcessed.low>>>0,e.totalBytesProcessed.high>>>0).toNumber())),null!=e.totalBytesBilled&&(a.Long?(n.totalBytesBilled=a.Long.fromValue(e.totalBytesBilled)).unsigned=!1:"string"==typeof e.totalBytesBilled?n.totalBytesBilled=parseInt(e.totalBytesBilled,10):"number"==typeof e.totalBytesBilled?n.totalBytesBilled=e.totalBytesBilled:"object"==typeof e.totalBytesBilled&&(n.totalBytesBilled=new a.LongBits(e.totalBytesBilled.low>>>0,e.totalBytesBilled.high>>>0).toNumber())),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.QueryEvaluationError;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.message=e.string();break;case 2:a.errorLocation=s.sqlanvil.QueryEvaluationError.ErrorLocation.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.message&&e.hasOwnProperty("message")&&!a.isString(e.message))return"message: string expected";if(null!=e.errorLocation&&e.hasOwnProperty("errorLocation")){var n=s.sqlanvil.QueryEvaluationError.ErrorLocation.verify(e.errorLocation,t+1);if(n)return"errorLocation."+n}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.QueryEvaluationError)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.QueryEvaluationError;if(null!=e.message&&(n.message=String(e.message)),null!=e.errorLocation){if("object"!=typeof e.errorLocation)throw TypeError(".sqlanvil.QueryEvaluationError.errorLocation: object expected");n.errorLocation=s.sqlanvil.QueryEvaluationError.ErrorLocation.fromObject(e.errorLocation,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.QueryEvaluationError.ErrorLocation;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.line=e.int32();break;case 2:a.column=e.int32();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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,t){if(e instanceof s.sqlanvil.QueryEvaluationError.ErrorLocation)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.QueryEvaluationError.ErrorLocation;return null!=e.line&&(n.line=0|e.line),null!=e.column&&(n.column=0|e.column),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.QueryEvaluation;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.status=e.int32();break;case 2:a.error=s.sqlanvil.QueryEvaluationError.decode(e,e.uint32(),void 0,r+1);break;case 3:a.incremental=e.bool();break;case 4:a.query=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=s.sqlanvil.QueryEvaluationError.verify(e.error,t+1);if(n)return"error."+n}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,t){if(e instanceof s.sqlanvil.QueryEvaluation)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.QueryEvaluation;switch(e.status){default:if("number"==typeof e.status){n.status=e.status;break}break;case"SUCCESS":case 0:n.status=0;break;case"FAILURE":case 1:n.status=1}if(null!=e.error){if("object"!=typeof e.error)throw TypeError(".sqlanvil.QueryEvaluation.error: object expected");n.error=s.sqlanvil.QueryEvaluationError.fromObject(e.error,t+1)}return null!=e.incremental&&(n.incremental=Boolean(e.incremental)),null!=e.query&&(n.query=String(e.query)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.RunConfig;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.actions&&a.actions.length||(a.actions=[]),a.actions.push(e.string());break;case 5:a.tags&&a.tags.length||(a.tags=[]),a.tags.push(e.string());break;case 3:a.includeDependencies=e.bool();break;case 11:a.includeDependents=e.bool();break;case 2:a.fullRefresh=e.bool();break;case 7:a.timeoutMillis=e.int32();break;case 9:a.disableSetMetadata=e.bool();break;case 8:a.useRunCache=e.bool();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.actions&&e.hasOwnProperty("actions")){if(!Array.isArray(e.actions))return"actions: array expected";for(var n=0;n<e.actions.length;++n)if(!a.isString(e.actions[n]))return"actions: string[] expected"}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"}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,t){if(e instanceof s.sqlanvil.RunConfig)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.RunConfig;if(e.actions){if(!Array.isArray(e.actions))throw TypeError(".sqlanvil.RunConfig.actions: array expected");n.actions=[];for(var r=0;r<e.actions.length;++r)n.actions[r]=String(e.actions[r])}if(e.tags){if(!Array.isArray(e.tags))throw TypeError(".sqlanvil.RunConfig.tags: array expected");for(n.tags=[],r=0;r<e.tags.length;++r)n.tags[r]=String(e.tags[r])}return null!=e.includeDependencies&&(n.includeDependencies=Boolean(e.includeDependencies)),null!=e.includeDependents&&(n.includeDependents=Boolean(e.includeDependents)),null!=e.fullRefresh&&(n.fullRefresh=Boolean(e.fullRefresh)),null!=e.timeoutMillis&&(n.timeoutMillis=0|e.timeoutMillis),null!=e.disableSetMetadata&&(n.disableSetMetadata=Boolean(e.disableSetMetadata)),null!=e.useRunCache&&(n.useRunCache=Boolean(e.useRunCache)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ExecutionTask;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.type=e.string();break;case 2:a.statement=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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,t){if(e instanceof s.sqlanvil.ExecutionTask)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ExecutionTask;return null!=e.type&&(n.type=String(e.type)),null!=e.statement&&(n.statement=String(e.statement)),n},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.ExportSpec=function(){function t(e){if(this.options={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&"__proto__"!==t[n]&&(this[t[n]]=e[t[n]])}return t.prototype.query="",t.prototype.location="",t.prototype.format="",t.prototype.overwrite=!1,t.prototype.filename="",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.query&&Object.hasOwnProperty.call(e,"query")&&t.uint32(10).string(e.query),null!=e.location&&Object.hasOwnProperty.call(e,"location")&&t.uint32(18).string(e.location),null!=e.format&&Object.hasOwnProperty.call(e,"format")&&t.uint32(26).string(e.format),null!=e.overwrite&&Object.hasOwnProperty.call(e,"overwrite")&&t.uint32(32).bool(e.overwrite),null!=e.filename&&Object.hasOwnProperty.call(e,"filename")&&t.uint32(42).string(e.filename),null!=e.options&&Object.hasOwnProperty.call(e,"options"))for(var n=Object.keys(e.options),r=0;r<n.length;++r)t.uint32(50).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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.ExportSpec;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.query=e.string();break;case 2:u.location=e.string();break;case 3:u.format=e.string();break;case 4:u.overwrite=e.bool();break;case 5:u.filename=e.string();break;case 6:u.options===a.emptyObject&&(u.options={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;){var f=e.uint32();switch(f>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.options,o),u.options[o]=l;break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.query&&e.hasOwnProperty("query")&&!a.isString(e.query))return"query: string expected";if(null!=e.location&&e.hasOwnProperty("location")&&!a.isString(e.location))return"location: string expected";if(null!=e.format&&e.hasOwnProperty("format")&&!a.isString(e.format))return"format: string expected";if(null!=e.overwrite&&e.hasOwnProperty("overwrite")&&"boolean"!=typeof e.overwrite)return"overwrite: boolean expected";if(null!=e.filename&&e.hasOwnProperty("filename")&&!a.isString(e.filename))return"filename: string expected";if(null!=e.options&&e.hasOwnProperty("options")){if(!a.isObject(e.options))return"options: object expected";for(var n=Object.keys(e.options),r=0;r<n.length;++r)if(!a.isString(e.options[n[r]]))return"options: string{k:string} expected"}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ExportSpec)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ExportSpec;if(null!=e.query&&(n.query=String(e.query)),null!=e.location&&(n.location=String(e.location)),null!=e.format&&(n.format=String(e.format)),null!=e.overwrite&&(n.overwrite=Boolean(e.overwrite)),null!=e.filename&&(n.filename=String(e.filename)),e.options){if("object"!=typeof e.options)throw TypeError(".sqlanvil.ExportSpec.options: object expected");n.options={};for(var r=Object.keys(e.options),i=0;i<r.length;++i)"__proto__"===r[i]&&a.makeProp(n.options,r[i]),n.options[r[i]]=String(e.options[r[i]])}return n},t.toObject=function(e,t){t||(t={});var n,r={};if((t.objects||t.defaults)&&(r.options={}),t.defaults&&(r.query="",r.location="",r.format="",r.overwrite=!1,r.filename=""),null!=e.query&&e.hasOwnProperty("query")&&(r.query=e.query),null!=e.location&&e.hasOwnProperty("location")&&(r.location=e.location),null!=e.format&&e.hasOwnProperty("format")&&(r.format=e.format),null!=e.overwrite&&e.hasOwnProperty("overwrite")&&(r.overwrite=e.overwrite),null!=e.filename&&e.hasOwnProperty("filename")&&(r.filename=e.filename),e.options&&(n=Object.keys(e.options)).length){r.options={};for(var i=0;i<n.length;++i)"__proto__"===n[i]&&a.makeProp(r.options,n[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.ExportSpec"},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]]&&"__proto__"!==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.prototype.export=null,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),null!=e.export&&Object.hasOwnProperty.call(e,"export")&&s.sqlanvil.ExportSpec.encode(e.export,t.uint32(106).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t,n,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ExecutionAction;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 5:a.target=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 8:a.fileName=e.string();break;case 4:a.type=e.string();break;case 6:a.tableType=e.string();break;case 11:a.dependencyTargets&&a.dependencyTargets.length||(a.dependencyTargets=[]),a.dependencyTargets.push(s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1));break;case 10:a.hermeticity=e.int32();break;case 2:a.tasks&&a.tasks.length||(a.tasks=[]),a.tasks.push(s.sqlanvil.ExecutionTask.decode(e,e.uint32(),void 0,r+1));break;case 9:a.actionDescriptor=s.sqlanvil.ActionDescriptor.decode(e,e.uint32(),void 0,r+1);break;case 12:a.jitCode=e.string();break;case 13:a.export=s.sqlanvil.ExportSpec.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.target&&e.hasOwnProperty("target")&&(r=s.sqlanvil.Target.verify(e.target,t+1)))return"target."+r;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 n=0;n<e.dependencyTargets.length;++n)if(r=s.sqlanvil.Target.verify(e.dependencyTargets[n],t+1))return"dependencyTargets."+r}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(n=0;n<e.tasks.length;++n){var r;if(r=s.sqlanvil.ExecutionTask.verify(e.tasks[n],t+1))return"tasks."+r}}return null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(r=s.sqlanvil.ActionDescriptor.verify(e.actionDescriptor,t+1))?"actionDescriptor."+r:null!=e.jitCode&&e.hasOwnProperty("jitCode")&&!a.isString(e.jitCode)?"jitCode: string expected":null!=e.export&&e.hasOwnProperty("export")&&(r=s.sqlanvil.ExportSpec.verify(e.export,t+1))?"export."+r:null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ExecutionAction)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ExecutionAction;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.ExecutionAction.target: object expected");n.target=s.sqlanvil.Target.fromObject(e.target,t+1)}if(null!=e.fileName&&(n.fileName=String(e.fileName)),null!=e.type&&(n.type=String(e.type)),null!=e.tableType&&(n.tableType=String(e.tableType)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".sqlanvil.ExecutionAction.dependencyTargets: array expected");n.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".sqlanvil.ExecutionAction.dependencyTargets: object expected");n.dependencyTargets[r]=s.sqlanvil.Target.fromObject(e.dependencyTargets[r],t+1)}}switch(e.hermeticity){default:if("number"==typeof e.hermeticity){n.hermeticity=e.hermeticity;break}break;case"UNKNOWN":case 0:n.hermeticity=0;break;case"HERMETIC":case 1:n.hermeticity=1;break;case"NON_HERMETIC":case 2:n.hermeticity=2}if(e.tasks){if(!Array.isArray(e.tasks))throw TypeError(".sqlanvil.ExecutionAction.tasks: array expected");for(n.tasks=[],r=0;r<e.tasks.length;++r){if("object"!=typeof e.tasks[r])throw TypeError(".sqlanvil.ExecutionAction.tasks: object expected");n.tasks[r]=s.sqlanvil.ExecutionTask.fromObject(e.tasks[r],t+1)}}if(null!=e.actionDescriptor){if("object"!=typeof e.actionDescriptor)throw TypeError(".sqlanvil.ExecutionAction.actionDescriptor: object expected");n.actionDescriptor=s.sqlanvil.ActionDescriptor.fromObject(e.actionDescriptor,t+1)}if(null!=e.jitCode&&(n.jitCode=String(e.jitCode)),null!=e.export){if("object"!=typeof e.export)throw TypeError(".sqlanvil.ExecutionAction.export: object expected");n.export=s.sqlanvil.ExportSpec.fromObject(e.export,t+1)}return n},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="",n.export=null),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),null!=e.export&&e.hasOwnProperty("export")&&(n.export=s.sqlanvil.ExportSpec.toObject(e.export,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.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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.WarehouseState;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?(a.tables&&a.tables.length||(a.tables=[]),a.tables.push(s.sqlanvil.TableMetadata.decode(e,e.uint32(),void 0,r+1))):e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.tables&&e.hasOwnProperty("tables")){if(!Array.isArray(e.tables))return"tables: array expected";for(var n=0;n<e.tables.length;++n){var r=s.sqlanvil.TableMetadata.verify(e.tables[n],t+1);if(r)return"tables."+r}}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.WarehouseState)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.WarehouseState;if(e.tables){if(!Array.isArray(e.tables))throw TypeError(".sqlanvil.WarehouseState.tables: array expected");n.tables=[];for(var r=0;r<e.tables.length;++r){if("object"!=typeof e.tables[r])throw TypeError(".sqlanvil.WarehouseState.tables: object expected");n.tables[r]=s.sqlanvil.TableMetadata.fromObject(e.tables[r],t+1)}}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ExecutionGraph;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.projectConfig=s.sqlanvil.ProjectConfig.decode(e,e.uint32(),void 0,r+1);break;case 2:a.runConfig=s.sqlanvil.RunConfig.decode(e,e.uint32(),void 0,r+1);break;case 4:a.warehouseState=s.sqlanvil.WarehouseState.decode(e,e.uint32(),void 0,r+1);break;case 5:a.declarationTargets&&a.declarationTargets.length||(a.declarationTargets=[]),a.declarationTargets.push(s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1));break;case 3:a.actions&&a.actions.length||(a.actions=[]),a.actions.push(s.sqlanvil.ExecutionAction.decode(e,e.uint32(),void 0,r+1));break;case 7:a.jitData=s.google.protobuf.Struct.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.projectConfig&&e.hasOwnProperty("projectConfig")&&(r=s.sqlanvil.ProjectConfig.verify(e.projectConfig,t+1)))return"projectConfig."+r;if(null!=e.runConfig&&e.hasOwnProperty("runConfig")&&(r=s.sqlanvil.RunConfig.verify(e.runConfig,t+1)))return"runConfig."+r;if(null!=e.warehouseState&&e.hasOwnProperty("warehouseState")&&(r=s.sqlanvil.WarehouseState.verify(e.warehouseState,t+1)))return"warehouseState."+r;if(null!=e.declarationTargets&&e.hasOwnProperty("declarationTargets")){if(!Array.isArray(e.declarationTargets))return"declarationTargets: array expected";for(var n=0;n<e.declarationTargets.length;++n)if(r=s.sqlanvil.Target.verify(e.declarationTargets[n],t+1))return"declarationTargets."+r}if(null!=e.actions&&e.hasOwnProperty("actions")){if(!Array.isArray(e.actions))return"actions: array expected";for(n=0;n<e.actions.length;++n){var r;if(r=s.sqlanvil.ExecutionAction.verify(e.actions[n],t+1))return"actions."+r}}return null!=e.jitData&&e.hasOwnProperty("jitData")&&(r=s.google.protobuf.Struct.verify(e.jitData,t+1))?"jitData."+r:null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ExecutionGraph)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ExecutionGraph;if(null!=e.projectConfig){if("object"!=typeof e.projectConfig)throw TypeError(".sqlanvil.ExecutionGraph.projectConfig: object expected");n.projectConfig=s.sqlanvil.ProjectConfig.fromObject(e.projectConfig,t+1)}if(null!=e.runConfig){if("object"!=typeof e.runConfig)throw TypeError(".sqlanvil.ExecutionGraph.runConfig: object expected");n.runConfig=s.sqlanvil.RunConfig.fromObject(e.runConfig,t+1)}if(null!=e.warehouseState){if("object"!=typeof e.warehouseState)throw TypeError(".sqlanvil.ExecutionGraph.warehouseState: object expected");n.warehouseState=s.sqlanvil.WarehouseState.fromObject(e.warehouseState,t+1)}if(e.declarationTargets){if(!Array.isArray(e.declarationTargets))throw TypeError(".sqlanvil.ExecutionGraph.declarationTargets: array expected");n.declarationTargets=[];for(var r=0;r<e.declarationTargets.length;++r){if("object"!=typeof e.declarationTargets[r])throw TypeError(".sqlanvil.ExecutionGraph.declarationTargets: object expected");n.declarationTargets[r]=s.sqlanvil.Target.fromObject(e.declarationTargets[r],t+1)}}if(e.actions){if(!Array.isArray(e.actions))throw TypeError(".sqlanvil.ExecutionGraph.actions: array expected");for(n.actions=[],r=0;r<e.actions.length;++r){if("object"!=typeof e.actions[r])throw TypeError(".sqlanvil.ExecutionGraph.actions: object expected");n.actions[r]=s.sqlanvil.ExecutionAction.fromObject(e.actions[r],t+1)}}if(null!=e.jitData){if("object"!=typeof e.jitData)throw TypeError(".sqlanvil.ExecutionGraph.jitData: object expected");n.jitData=s.google.protobuf.Struct.fromObject(e.jitData,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.Timing;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.startTimeMillis=e.int64();break;case 2:a.endTimeMillis=e.int64();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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,t){if(e instanceof s.sqlanvil.Timing)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.Timing;return null!=e.startTimeMillis&&(a.Long?(n.startTimeMillis=a.Long.fromValue(e.startTimeMillis)).unsigned=!1:"string"==typeof e.startTimeMillis?n.startTimeMillis=parseInt(e.startTimeMillis,10):"number"==typeof e.startTimeMillis?n.startTimeMillis=e.startTimeMillis:"object"==typeof e.startTimeMillis&&(n.startTimeMillis=new a.LongBits(e.startTimeMillis.low>>>0,e.startTimeMillis.high>>>0).toNumber())),null!=e.endTimeMillis&&(a.Long?(n.endTimeMillis=a.Long.fromValue(e.endTimeMillis)).unsigned=!1:"string"==typeof e.endTimeMillis?n.endTimeMillis=parseInt(e.endTimeMillis,10):"number"==typeof e.endTimeMillis?n.endTimeMillis=e.endTimeMillis:"object"==typeof e.endTimeMillis&&(n.endTimeMillis=new a.LongBits(e.endTimeMillis.low>>>0,e.endTimeMillis.high>>>0).toNumber())),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.RunResult;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.status=e.int32();break;case 2:a.actions&&a.actions.length||(a.actions=[]),a.actions.push(s.sqlanvil.ActionResult.decode(e,e.uint32(),void 0,r+1));break;case 3:a.timing=s.sqlanvil.Timing.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.actions.length;++n)if(r=s.sqlanvil.ActionResult.verify(e.actions[n],t+1))return"actions."+r}var r;return null!=e.timing&&e.hasOwnProperty("timing")&&(r=s.sqlanvil.Timing.verify(e.timing,t+1))?"timing."+r:null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.RunResult)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.RunResult;switch(e.status){default:if("number"==typeof e.status){n.status=e.status;break}break;case"UNKNOWN":case 0:n.status=0;break;case"RUNNING":case 1:n.status=1;break;case"SUCCESSFUL":case 2:n.status=2;break;case"FAILED":case 3:n.status=3;break;case"CANCELLED":case 4:n.status=4;break;case"TIMED_OUT":case 5:n.status=5}if(e.actions){if(!Array.isArray(e.actions))throw TypeError(".sqlanvil.RunResult.actions: array expected");n.actions=[];for(var r=0;r<e.actions.length;++r){if("object"!=typeof e.actions[r])throw TypeError(".sqlanvil.RunResult.actions: object expected");n.actions[r]=s.sqlanvil.ActionResult.fromObject(e.actions[r],t+1)}}if(null!=e.timing){if("object"!=typeof e.timing)throw TypeError(".sqlanvil.RunResult.timing: object expected");n.timing=s.sqlanvil.Timing.fromObject(e.timing,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ActionResult;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 5:a.target=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 2:a.status=e.int32();break;case 3:a.tasks&&a.tasks.length||(a.tasks=[]),a.tasks.push(s.sqlanvil.TaskResult.decode(e,e.uint32(),void 0,r+1));break;case 4:a.timing=s.sqlanvil.Timing.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.target&&e.hasOwnProperty("target")&&(r=s.sqlanvil.Target.verify(e.target,t+1)))return"target."+r;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 n=0;n<e.tasks.length;++n){var r;if(r=s.sqlanvil.TaskResult.verify(e.tasks[n],t+1))return"tasks."+r}}return null!=e.timing&&e.hasOwnProperty("timing")&&(r=s.sqlanvil.Timing.verify(e.timing,t+1))?"timing."+r:null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ActionResult)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ActionResult;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.ActionResult.target: object expected");n.target=s.sqlanvil.Target.fromObject(e.target,t+1)}switch(e.status){default:if("number"==typeof e.status){n.status=e.status;break}break;case"UNKNOWN":case 0:n.status=0;break;case"RUNNING":case 1:n.status=1;break;case"SUCCESSFUL":case 2:n.status=2;break;case"FAILED":case 3:n.status=3;break;case"SKIPPED":case 4:n.status=4;break;case"DISABLED":case 5:n.status=5;break;case"CANCELLED":case 6:n.status=6}if(e.tasks){if(!Array.isArray(e.tasks))throw TypeError(".sqlanvil.ActionResult.tasks: array expected");n.tasks=[];for(var r=0;r<e.tasks.length;++r){if("object"!=typeof e.tasks[r])throw TypeError(".sqlanvil.ActionResult.tasks: object expected");n.tasks[r]=s.sqlanvil.TaskResult.fromObject(e.tasks[r],t+1)}}if(null!=e.timing){if("object"!=typeof e.timing)throw TypeError(".sqlanvil.ActionResult.timing: object expected");n.timing=s.sqlanvil.Timing.fromObject(e.timing,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.TaskResult;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.status=e.int32();break;case 2:a.errorMessage=e.string();break;case 3:a.timing=s.sqlanvil.Timing.decode(e,e.uint32(),void 0,r+1);break;case 4:a.metadata=s.sqlanvil.ExecutionMetadata.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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")&&(n=s.sqlanvil.Timing.verify(e.timing,t+1))?"timing."+n:null!=e.metadata&&e.hasOwnProperty("metadata")&&(n=s.sqlanvil.ExecutionMetadata.verify(e.metadata,t+1))?"metadata."+n:null;var n},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.TaskResult)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.TaskResult;switch(e.status){default:if("number"==typeof e.status){n.status=e.status;break}break;case"UNKNOWN":case 0:n.status=0;break;case"RUNNING":case 1:n.status=1;break;case"SUCCESSFUL":case 2:n.status=2;break;case"FAILED":case 3:n.status=3;break;case"SKIPPED":case 4:n.status=4;break;case"CANCELLED":case 5:n.status=5}if(null!=e.errorMessage&&(n.errorMessage=String(e.errorMessage)),null!=e.timing){if("object"!=typeof e.timing)throw TypeError(".sqlanvil.TaskResult.timing: object expected");n.timing=s.sqlanvil.Timing.fromObject(e.timing,t+1)}if(null!=e.metadata){if("object"!=typeof e.metadata)throw TypeError(".sqlanvil.TaskResult.metadata: object expected");n.metadata=s.sqlanvil.ExecutionMetadata.fromObject(e.metadata,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.TestResult;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.name=e.string();break;case 2:a.successful=e.bool();break;case 3:a.messages&&a.messages.length||(a.messages=[]),a.messages.push(e.string());break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.messages.length;++n)if(!a.isString(e.messages[n]))return"messages: string[] expected"}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.TestResult)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.TestResult;if(null!=e.name&&(n.name=String(e.name)),null!=e.successful&&(n.successful=Boolean(e.successful)),e.messages){if(!Array.isArray(e.messages))throw TypeError(".sqlanvil.TestResult.messages: array expected");n.messages=[];for(var r=0;r<e.messages.length;++r)n.messages[r]=String(e.messages[r])}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ExecuteRequest;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.statement=e.string();break;case 2:a.rowLimit=e.int64();break;case 3:a.byteLimit=e.int64();break;case 4:a.fetchResults=e.bool();break;case 5:a.bigQueryOptions=s.sqlanvil.BigQueryExecuteOptions.decode(e,e.uint32(),void 0,r+1);break;case 6:a.params=s.google.protobuf.Struct.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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")&&(n=s.sqlanvil.BigQueryExecuteOptions.verify(e.bigQueryOptions,t+1))?"bigQueryOptions."+n:null!=e.params&&e.hasOwnProperty("params")&&(n=s.google.protobuf.Struct.verify(e.params,t+1))?"params."+n:null);var n},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ExecuteRequest)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ExecuteRequest;if(null!=e.statement&&(n.statement=String(e.statement)),null!=e.rowLimit&&(a.Long?(n.rowLimit=a.Long.fromValue(e.rowLimit)).unsigned=!1:"string"==typeof e.rowLimit?n.rowLimit=parseInt(e.rowLimit,10):"number"==typeof e.rowLimit?n.rowLimit=e.rowLimit:"object"==typeof e.rowLimit&&(n.rowLimit=new a.LongBits(e.rowLimit.low>>>0,e.rowLimit.high>>>0).toNumber())),null!=e.byteLimit&&(a.Long?(n.byteLimit=a.Long.fromValue(e.byteLimit)).unsigned=!1:"string"==typeof e.byteLimit?n.byteLimit=parseInt(e.byteLimit,10):"number"==typeof e.byteLimit?n.byteLimit=e.byteLimit:"object"==typeof e.byteLimit&&(n.byteLimit=new a.LongBits(e.byteLimit.low>>>0,e.byteLimit.high>>>0).toNumber())),null!=e.fetchResults&&(n.fetchResults=Boolean(e.fetchResults)),null!=e.bigQueryOptions){if("object"!=typeof e.bigQueryOptions)throw TypeError(".sqlanvil.ExecuteRequest.bigQueryOptions: object expected");n.bigQueryOptions=s.sqlanvil.BigQueryExecuteOptions.fromObject(e.bigQueryOptions,t+1)}if(null!=e.params){if("object"!=typeof e.params)throw TypeError(".sqlanvil.ExecuteRequest.params: object expected");n.params=s.google.protobuf.Struct.fromObject(e.params,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.sqlanvil.BigQueryExecuteOptions;e.pos<c;){var p=e.uint32();if(p===n)break;switch(p>>>3){case 1:u.interactive=e.bool();break;case 2:u.useLegacySql=e.bool();break;case 3:u.labels===a.emptyObject&&(u.labels={});var d=e.uint32()+e.pos;for(o="",l="";e.pos<d;){var f=e.uint32();switch(f>>>3){case 1:o=e.string();break;case 2:l=e.string();break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.labels,o),u.labels[o]=l;break;case 4:u.location=e.string();break;case 5:u.jobPrefix=e.string();break;case 6:u.dryRun=e.bool();break;case 7:u.reservation=e.string();break;default:e.skipType(7&p,r)}}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=Object.keys(e.labels),r=0;r<n.length;++r)if(!a.isString(e.labels[n[r]]))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,t){if(e instanceof s.sqlanvil.BigQueryExecuteOptions)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.BigQueryExecuteOptions;if(null!=e.interactive&&(n.interactive=Boolean(e.interactive)),null!=e.useLegacySql&&(n.useLegacySql=Boolean(e.useLegacySql)),e.labels){if("object"!=typeof e.labels)throw TypeError(".sqlanvil.BigQueryExecuteOptions.labels: object expected");n.labels={};for(var r=Object.keys(e.labels),i=0;i<r.length;++i)"__proto__"===r[i]&&a.makeProp(n.labels,r[i]),n.labels[r[i]]=String(e.labels[r[i]])}return null!=e.location&&(n.location=String(e.location)),null!=e.jobPrefix&&(n.jobPrefix=String(e.jobPrefix)),null!=e.dryRun&&(n.dryRun=Boolean(e.dryRun)),null!=e.reservation&&(n.reservation=String(e.reservation)),n},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)"__proto__"===n[i]&&a.makeProp(r.labels,n[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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ExecuteResponse;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.executionMetadata=s.sqlanvil.ExecutionMetadata.decode(e,e.uint32(),void 0,r+1);break;case 2:a.rows&&a.rows.length||(a.rows=[]),a.rows.push(s.google.protobuf.Struct.decode(e,e.uint32(),void 0,r+1));break;case 3:a.errors&&a.errors.length||(a.errors=[]),a.errors.push(e.string());break;case 4:a.schemaFields&&a.schemaFields.length||(a.schemaFields=[]),a.schemaFields.push(s.sqlanvil.Field.decode(e,e.uint32(),void 0,r+1));break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.executionMetadata&&e.hasOwnProperty("executionMetadata")&&(r=s.sqlanvil.ExecutionMetadata.verify(e.executionMetadata,t+1)))return"executionMetadata."+r;if(null!=e.rows&&e.hasOwnProperty("rows")){if(!Array.isArray(e.rows))return"rows: array expected";for(var n=0;n<e.rows.length;++n)if(r=s.google.protobuf.Struct.verify(e.rows[n],t+1))return"rows."+r}if(null!=e.errors&&e.hasOwnProperty("errors")){if(!Array.isArray(e.errors))return"errors: array expected";for(n=0;n<e.errors.length;++n)if(!a.isString(e.errors[n]))return"errors: string[] expected"}if(null!=e.schemaFields&&e.hasOwnProperty("schemaFields")){if(!Array.isArray(e.schemaFields))return"schemaFields: array expected";for(n=0;n<e.schemaFields.length;++n){var r;if(r=s.sqlanvil.Field.verify(e.schemaFields[n],t+1))return"schemaFields."+r}}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ExecuteResponse)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ExecuteResponse;if(null!=e.executionMetadata){if("object"!=typeof e.executionMetadata)throw TypeError(".sqlanvil.ExecuteResponse.executionMetadata: object expected");n.executionMetadata=s.sqlanvil.ExecutionMetadata.fromObject(e.executionMetadata,t+1)}if(e.rows){if(!Array.isArray(e.rows))throw TypeError(".sqlanvil.ExecuteResponse.rows: array expected");n.rows=[];for(var r=0;r<e.rows.length;++r){if("object"!=typeof e.rows[r])throw TypeError(".sqlanvil.ExecuteResponse.rows: object expected");n.rows[r]=s.google.protobuf.Struct.fromObject(e.rows[r],t+1)}}if(e.errors){if(!Array.isArray(e.errors))throw TypeError(".sqlanvil.ExecuteResponse.errors: array expected");for(n.errors=[],r=0;r<e.errors.length;++r)n.errors[r]=String(e.errors[r])}if(e.schemaFields){if(!Array.isArray(e.schemaFields))throw TypeError(".sqlanvil.ExecuteResponse.schemaFields: array expected");for(n.schemaFields=[],r=0;r<e.schemaFields.length;++r){if("object"!=typeof e.schemaFields[r])throw TypeError(".sqlanvil.ExecuteResponse.schemaFields: object expected");n.schemaFields[r]=s.sqlanvil.Field.fromObject(e.schemaFields[r],t+1)}}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ListTablesRequest;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.database=e.string();break;case 2:a.schema=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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,t){if(e instanceof s.sqlanvil.ListTablesRequest)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ListTablesRequest;return null!=e.database&&(n.database=String(e.database)),null!=e.schema&&(n.schema=String(e.schema)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.ListTablesResponse;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?(a.tables&&a.tables.length||(a.tables=[]),a.tables.push(s.sqlanvil.TableMetadata.decode(e,e.uint32(),void 0,r+1))):e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.tables&&e.hasOwnProperty("tables")){if(!Array.isArray(e.tables))return"tables: array expected";for(var n=0;n<e.tables.length;++n){var r=s.sqlanvil.TableMetadata.verify(e.tables[n],t+1);if(r)return"tables."+r}}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.ListTablesResponse)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.ListTablesResponse;if(e.tables){if(!Array.isArray(e.tables))throw TypeError(".sqlanvil.ListTablesResponse.tables: array expected");n.tables=[];for(var r=0;r<e.tables.length;++r){if("object"!=typeof e.tables[r])throw TypeError(".sqlanvil.ListTablesResponse.tables: object expected");n.tables[r]=s.sqlanvil.TableMetadata.fromObject(e.tables[r],t+1)}}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.GetTableRequest;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?a.target=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1):e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.target&&e.hasOwnProperty("target")){var n=s.sqlanvil.Target.verify(e.target,t+1);if(n)return"target."+n}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.GetTableRequest)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.GetTableRequest;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.GetTableRequest.target: object expected");n.target=s.sqlanvil.Target.fromObject(e.target,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.DeleteTableRequest;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?a.target=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1):e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.target&&e.hasOwnProperty("target")){var n=s.sqlanvil.Target.verify(e.target,t+1);if(n)return"target."+n}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.DeleteTableRequest)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.DeleteTableRequest;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.DeleteTableRequest.target: object expected");n.target=s.sqlanvil.Target.fromObject(e.target,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.RunningExecutionData;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.runTargets&&a.runTargets.length||(a.runTargets=[]),a.runTargets.push(s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1));break;case 2:a.executionId=e.string();break;case 3:a.executionStartTime=s.google.protobuf.Timestamp.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.runTargets&&e.hasOwnProperty("runTargets")){if(!Array.isArray(e.runTargets))return"runTargets: array expected";for(var n=0;n<e.runTargets.length;++n)if(r=s.sqlanvil.Target.verify(e.runTargets[n],t+1))return"runTargets."+r}return null!=e.executionId&&e.hasOwnProperty("executionId")&&!a.isString(e.executionId)?"executionId: string expected":null!=e.executionStartTime&&e.hasOwnProperty("executionStartTime")&&(r=s.google.protobuf.Timestamp.verify(e.executionStartTime,t+1))?"executionStartTime."+r:null;var r},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.RunningExecutionData)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.RunningExecutionData;if(e.runTargets){if(!Array.isArray(e.runTargets))throw TypeError(".sqlanvil.RunningExecutionData.runTargets: array expected");n.runTargets=[];for(var r=0;r<e.runTargets.length;++r){if("object"!=typeof e.runTargets[r])throw TypeError(".sqlanvil.RunningExecutionData.runTargets: object expected");n.runTargets[r]=s.sqlanvil.Target.fromObject(e.runTargets[r],t+1)}}if(null!=e.executionId&&(n.executionId=String(e.executionId)),null!=e.executionStartTime){if("object"!=typeof e.executionStartTime)throw TypeError(".sqlanvil.RunningExecutionData.executionStartTime: object expected");n.executionStartTime=s.google.protobuf.Timestamp.fromObject(e.executionStartTime,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.JitCompilationRequest;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.target=s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1);break;case 2:a.dependencies&&a.dependencies.length||(a.dependencies=[]),a.dependencies.push(s.sqlanvil.Target.decode(e,e.uint32(),void 0,r+1));break;case 3:a.jitCode=e.string();break;case 4:a.jitData=s.google.protobuf.Struct.decode(e,e.uint32(),void 0,r+1);break;case 5:a.compilationTargetType=e.int32();break;case 6:a.filePaths&&a.filePaths.length||(a.filePaths=[]),a.filePaths.push(e.string());break;case 7:a.executionData=s.sqlanvil.RunningExecutionData.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.target&&e.hasOwnProperty("target")&&(r=s.sqlanvil.Target.verify(e.target,t+1)))return"target."+r;if(null!=e.dependencies&&e.hasOwnProperty("dependencies")){if(!Array.isArray(e.dependencies))return"dependencies: array expected";for(var n=0;n<e.dependencies.length;++n){var r;if(r=s.sqlanvil.Target.verify(e.dependencies[n],t+1))return"dependencies."+r}}if(null!=e.jitCode&&e.hasOwnProperty("jitCode")&&!a.isString(e.jitCode))return"jitCode: string expected";if(null!=e.jitData&&e.hasOwnProperty("jitData")&&(r=s.google.protobuf.Struct.verify(e.jitData,t+1)))return"jitData."+r;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(n=0;n<e.filePaths.length;++n)if(!a.isString(e.filePaths[n]))return"filePaths: string[] expected"}return null!=e.executionData&&e.hasOwnProperty("executionData")&&(r=s.sqlanvil.RunningExecutionData.verify(e.executionData,t+1))?"executionData."+r:null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.JitCompilationRequest)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.JitCompilationRequest;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".sqlanvil.JitCompilationRequest.target: object expected");n.target=s.sqlanvil.Target.fromObject(e.target,t+1)}if(e.dependencies){if(!Array.isArray(e.dependencies))throw TypeError(".sqlanvil.JitCompilationRequest.dependencies: array expected");n.dependencies=[];for(var r=0;r<e.dependencies.length;++r){if("object"!=typeof e.dependencies[r])throw TypeError(".sqlanvil.JitCompilationRequest.dependencies: object expected");n.dependencies[r]=s.sqlanvil.Target.fromObject(e.dependencies[r],t+1)}}if(null!=e.jitCode&&(n.jitCode=String(e.jitCode)),null!=e.jitData){if("object"!=typeof e.jitData)throw TypeError(".sqlanvil.JitCompilationRequest.jitData: object expected");n.jitData=s.google.protobuf.Struct.fromObject(e.jitData,t+1)}switch(e.compilationTargetType){default:if("number"==typeof e.compilationTargetType){n.compilationTargetType=e.compilationTargetType;break}break;case"JIT_COMPILATION_TARGET_TYPE_UNSPECIFIED":case 0:n.compilationTargetType=0;break;case"JIT_COMPILATION_TARGET_TYPE_TABLE":case 1:n.compilationTargetType=1;break;case"JIT_COMPILATION_TARGET_TYPE_OPERATION":case 2:n.compilationTargetType=2;break;case"JIT_COMPILATION_TARGET_TYPE_INCREMENTAL_TABLE":case 3:n.compilationTargetType=3;break;case"JIT_COMPILATION_TARGET_TYPE_ASSERTION":case 4:n.compilationTargetType=4}if(e.filePaths){if(!Array.isArray(e.filePaths))throw TypeError(".sqlanvil.JitCompilationRequest.filePaths: array expected");for(n.filePaths=[],r=0;r<e.filePaths.length;++r)n.filePaths[r]=String(e.filePaths[r])}if(null!=e.executionData){if("object"!=typeof e.executionData)throw TypeError(".sqlanvil.JitCompilationRequest.executionData: object expected");n.executionData=s.sqlanvil.RunningExecutionData.fromObject(e.executionData,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.JitCompilationResponse;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.table=s.sqlanvil.JitTableResult.decode(e,e.uint32(),void 0,r+1);break;case 2:a.operation=s.sqlanvil.JitOperationResult.decode(e,e.uint32(),void 0,r+1);break;case 3:a.incrementalTable=s.sqlanvil.JitIncrementalTableResult.decode(e,e.uint32(),void 0,r+1);break;case 4:a.assertion=s.sqlanvil.JitAssertionResult.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";var n={};if(null!=e.table&&e.hasOwnProperty("table")&&(n.response=1,r=s.sqlanvil.JitTableResult.verify(e.table,t+1)))return"table."+r;if(null!=e.operation&&e.hasOwnProperty("operation")){if(1===n.response)return"response: multiple values";if(n.response=1,r=s.sqlanvil.JitOperationResult.verify(e.operation,t+1))return"operation."+r}if(null!=e.incrementalTable&&e.hasOwnProperty("incrementalTable")){if(1===n.response)return"response: multiple values";if(n.response=1,r=s.sqlanvil.JitIncrementalTableResult.verify(e.incrementalTable,t+1))return"incrementalTable."+r}if(null!=e.assertion&&e.hasOwnProperty("assertion")){if(1===n.response)return"response: multiple values";var r;if(n.response=1,r=s.sqlanvil.JitAssertionResult.verify(e.assertion,t+1))return"assertion."+r}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.JitCompilationResponse)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.JitCompilationResponse;if(null!=e.table){if("object"!=typeof e.table)throw TypeError(".sqlanvil.JitCompilationResponse.table: object expected");n.table=s.sqlanvil.JitTableResult.fromObject(e.table,t+1)}if(null!=e.operation){if("object"!=typeof e.operation)throw TypeError(".sqlanvil.JitCompilationResponse.operation: object expected");n.operation=s.sqlanvil.JitOperationResult.fromObject(e.operation,t+1)}if(null!=e.incrementalTable){if("object"!=typeof e.incrementalTable)throw TypeError(".sqlanvil.JitCompilationResponse.incrementalTable: object expected");n.incrementalTable=s.sqlanvil.JitIncrementalTableResult.fromObject(e.incrementalTable,t+1)}if(null!=e.assertion){if("object"!=typeof e.assertion)throw TypeError(".sqlanvil.JitCompilationResponse.assertion: object expected");n.assertion=s.sqlanvil.JitAssertionResult.fromObject(e.assertion,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.JitTableResult;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.query=e.string();break;case 3:a.preOps&&a.preOps.length||(a.preOps=[]),a.preOps.push(e.string());break;case 4:a.postOps&&a.postOps.length||(a.postOps=[]),a.postOps.push(e.string());break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";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 n=0;n<e.preOps.length;++n)if(!a.isString(e.preOps[n]))return"preOps: string[] expected"}if(null!=e.postOps&&e.hasOwnProperty("postOps")){if(!Array.isArray(e.postOps))return"postOps: array expected";for(n=0;n<e.postOps.length;++n)if(!a.isString(e.postOps[n]))return"postOps: string[] expected"}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.JitTableResult)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.JitTableResult;if(null!=e.query&&(n.query=String(e.query)),e.preOps){if(!Array.isArray(e.preOps))throw TypeError(".sqlanvil.JitTableResult.preOps: array expected");n.preOps=[];for(var r=0;r<e.preOps.length;++r)n.preOps[r]=String(e.preOps[r])}if(e.postOps){if(!Array.isArray(e.postOps))throw TypeError(".sqlanvil.JitTableResult.postOps: array expected");for(n.postOps=[],r=0;r<e.postOps.length;++r)n.postOps[r]=String(e.postOps[r])}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.JitIncrementalTableResult;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.regular=s.sqlanvil.JitTableResult.decode(e,e.uint32(),void 0,r+1);break;case 2:a.incremental=s.sqlanvil.JitTableResult.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":null!=e.regular&&e.hasOwnProperty("regular")&&(n=s.sqlanvil.JitTableResult.verify(e.regular,t+1))?"regular."+n:null!=e.incremental&&e.hasOwnProperty("incremental")&&(n=s.sqlanvil.JitTableResult.verify(e.incremental,t+1))?"incremental."+n:null);var n},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.JitIncrementalTableResult)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.JitIncrementalTableResult;if(null!=e.regular){if("object"!=typeof e.regular)throw TypeError(".sqlanvil.JitIncrementalTableResult.regular: object expected");n.regular=s.sqlanvil.JitTableResult.fromObject(e.regular,t+1)}if(null!=e.incremental){if("object"!=typeof e.incremental)throw TypeError(".sqlanvil.JitIncrementalTableResult.incremental: object expected");n.incremental=s.sqlanvil.JitTableResult.fromObject(e.incremental,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.JitOperationResult;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?(a.queries&&a.queries.length||(a.queries=[]),a.queries.push(e.string())):e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.queries&&e.hasOwnProperty("queries")){if(!Array.isArray(e.queries))return"queries: array expected";for(var n=0;n<e.queries.length;++n)if(!a.isString(e.queries[n]))return"queries: string[] expected"}return null},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.JitOperationResult)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.JitOperationResult;if(e.queries){if(!Array.isArray(e.queries))throw TypeError(".sqlanvil.JitOperationResult.queries: array expected");n.queries=[];for(var r=0;r<e.queries.length;++r)n.queries[r]=String(e.queries[r])}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.JitAssertionResult;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?a.query=e.string():e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":null!=e.query&&e.hasOwnProperty("query")&&!a.isString(e.query)?"query: string expected":null)},t.fromObject=function(e,t){if(e instanceof s.sqlanvil.JitAssertionResult)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.JitAssertionResult;return null!=e.query&&(n.query=String(e.query)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.sqlanvil.BigQuery;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.projectId=e.string();break;case 3:a.credentials=e.string();break;case 4:a.location=e.string();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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,t){if(e instanceof s.sqlanvil.BigQuery)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.sqlanvil.BigQuery;return null!=e.projectId&&(n.projectId=String(e.projectId)),null!=e.credentials&&(n.credentials=String(e.credentials)),null!=e.location&&(n.location=String(e.location)),n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o,l,c=void 0===t?e.len:e.pos+t,u=new s.google.protobuf.Struct;e.pos<c;){var p=e.uint32();if(p===n)break;if(p>>>3==1){u.fields===a.emptyObject&&(u.fields={});var d=e.uint32()+e.pos;for(o="",l=null;e.pos<d;){var f=e.uint32();switch(f>>>3){case 1:o=e.string();break;case 2:l=s.google.protobuf.Value.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&f,r)}}"__proto__"===o&&a.makeProp(u.fields,o),u.fields[o]=l}else e.skipType(7&p,r)}return u},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.fields&&e.hasOwnProperty("fields")){if(!a.isObject(e.fields))return"fields: object expected";for(var n=Object.keys(e.fields),r=0;r<n.length;++r){var i=s.google.protobuf.Value.verify(e.fields[n[r]],t+1);if(i)return"fields."+i}}return null},t.fromObject=function(e,t){if(e instanceof s.google.protobuf.Struct)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.google.protobuf.Struct;if(e.fields){if("object"!=typeof e.fields)throw TypeError(".google.protobuf.Struct.fields: object expected");n.fields={};for(var r=Object.keys(e.fields),i=0;i<r.length;++i){if("__proto__"===r[i]&&a.makeProp(n.fields,r[i]),"object"!=typeof e.fields[r[i]])throw TypeError(".google.protobuf.Struct.fields: object expected");n.fields[r[i]]=s.google.protobuf.Value.fromObject(e.fields[r[i]],t+1)}}return n},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)"__proto__"===n[i]&&a.makeProp(r.fields,n[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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.google.protobuf.Value;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.nullValue=e.int32();break;case 2:a.numberValue=e.double();break;case 3:a.stringValue=e.string();break;case 4:a.boolValue=e.bool();break;case 5:a.structValue=s.google.protobuf.Struct.decode(e,e.uint32(),void 0,r+1);break;case 6:a.listValue=s.google.protobuf.ListValue.decode(e,e.uint32(),void 0,r+1);break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";var n={};if(null!=e.nullValue&&e.hasOwnProperty("nullValue")&&(n.kind=1,0!==e.nullValue))return"nullValue: enum value expected";if(null!=e.numberValue&&e.hasOwnProperty("numberValue")){if(1===n.kind)return"kind: multiple values";if(n.kind=1,"number"!=typeof e.numberValue)return"numberValue: number expected"}if(null!=e.stringValue&&e.hasOwnProperty("stringValue")){if(1===n.kind)return"kind: multiple values";if(n.kind=1,!a.isString(e.stringValue))return"stringValue: string expected"}if(null!=e.boolValue&&e.hasOwnProperty("boolValue")){if(1===n.kind)return"kind: multiple values";if(n.kind=1,"boolean"!=typeof e.boolValue)return"boolValue: boolean expected"}if(null!=e.structValue&&e.hasOwnProperty("structValue")){if(1===n.kind)return"kind: multiple values";if(n.kind=1,r=s.google.protobuf.Struct.verify(e.structValue,t+1))return"structValue."+r}if(null!=e.listValue&&e.hasOwnProperty("listValue")){if(1===n.kind)return"kind: multiple values";var r;if(n.kind=1,r=s.google.protobuf.ListValue.verify(e.listValue,t+1))return"listValue."+r}return null},t.fromObject=function(e,t){if(e instanceof s.google.protobuf.Value)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.google.protobuf.Value;switch(e.nullValue){default:if("number"==typeof e.nullValue){n.nullValue=e.nullValue;break}break;case"NULL_VALUE":case 0:n.nullValue=0}if(null!=e.numberValue&&(n.numberValue=Number(e.numberValue)),null!=e.stringValue&&(n.stringValue=String(e.stringValue)),null!=e.boolValue&&(n.boolValue=Boolean(e.boolValue)),null!=e.structValue){if("object"!=typeof e.structValue)throw TypeError(".google.protobuf.Value.structValue: object expected");n.structValue=s.google.protobuf.Struct.fromObject(e.structValue,t+1)}if(null!=e.listValue){if("object"!=typeof e.listValue)throw TypeError(".google.protobuf.Value.listValue: object expected");n.listValue=s.google.protobuf.ListValue.fromObject(e.listValue,t+1)}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.google.protobuf.ListValue;e.pos<o;){var l=e.uint32();if(l===n)break;l>>>3==1?(a.values&&a.values.length||(a.values=[]),a.values.push(s.google.protobuf.Value.decode(e,e.uint32(),void 0,r+1))):e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){if("object"!=typeof e||null===e)return"object expected";if(void 0===t&&(t=0),t>a.recursionLimit)return"maximum nesting depth exceeded";if(null!=e.values&&e.hasOwnProperty("values")){if(!Array.isArray(e.values))return"values: array expected";for(var n=0;n<e.values.length;++n){var r=s.google.protobuf.Value.verify(e.values[n],t+1);if(r)return"values."+r}}return null},t.fromObject=function(e,t){if(e instanceof s.google.protobuf.ListValue)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.google.protobuf.ListValue;if(e.values){if(!Array.isArray(e.values))throw TypeError(".google.protobuf.ListValue.values: array expected");n.values=[];for(var r=0;r<e.values.length;++r){if("object"!=typeof e.values[r])throw TypeError(".google.protobuf.ListValue.values: object expected");n.values[r]=s.google.protobuf.Value.fromObject(e.values[r],t+1)}}return n},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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.google.protobuf.Empty;e.pos<o;){var l=e.uint32();if(l===n)break;e.skipType(7&l,r)}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":null)},t.fromObject=function(e,t){if(e instanceof s.google.protobuf.Empty)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");return 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]]&&"__proto__"!==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,r){if(e instanceof i||(e=i.create(e)),void 0===r&&(r=0),r>i.recursionLimit)throw Error("maximum nesting depth exceeded");for(var o=void 0===t?e.len:e.pos+t,a=new s.google.protobuf.Timestamp;e.pos<o;){var l=e.uint32();if(l===n)break;switch(l>>>3){case 1:a.seconds=e.int64();break;case 2:a.nanos=e.int32();break;default:e.skipType(7&l,r)}}return a},t.decodeDelimited=function(e){return e instanceof i||(e=new i(e)),this.decode(e,e.uint32())},t.verify=function(e,t){return"object"!=typeof e||null===e?"object expected":(void 0===t&&(t=0),t>a.recursionLimit?"maximum nesting depth exceeded":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,t){if(e instanceof s.google.protobuf.Timestamp)return e;if(void 0===t&&(t=0),t>a.recursionLimit)throw Error("maximum nesting depth exceeded");var n=new s.google.protobuf.Timestamp;return null!=e.seconds&&(a.Long?(n.seconds=a.Long.fromValue(e.seconds)).unsigned=!1:"string"==typeof e.seconds?n.seconds=parseInt(e.seconds,10):"number"==typeof e.seconds?n.seconds=e.seconds:"object"==typeof e.seconds&&(n.seconds=new a.LongBits(e.seconds.low>>>0,e.seconds.high>>>0).toNumber())),null!=e.nanos&&(n.nanos=0|e.nanos),n},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)]})},5572(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),c=["parquet","csv","json"];class u extends o.ActionBuilder{constructor(e,t,n){if(super(e),this.dependOnDependencyAssertions=!1,this.proto=l.sqlanvil.Export.create(),this.session=e,!t)return;const r=this.verifyConfig(t);r.name||(r.name=a.basename(r.filename));const i=s.actionConfigToCompiledGraphTarget(r);this.proto.target=this.applySessionToTarget(i,e.projectConfig,r.filename,{validateTarget:!0}),this.proto.canonicalTarget=this.applySessionToTarget(i,e.canonicalProjectConfig),r.dependencyTargets&&this.dependencies(r.dependencyTargets.map((e=>s.configTargetToCompiledGraphTarget(l.sqlanvil.ActionConfig.Target.create(e))))),void 0!==r.hermetic&&this.hermetic(r.hermetic),r.disabled&&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);const o=r.export||l.sqlanvil.ActionConfig.ExportOptions.create();return this.proto.location=o.location||"",this.proto.format=(o.format||"").toLowerCase(),this.proto.overwrite=!t.export||!t.export.hasOwnProperty("overwrite")||!!o.overwrite,this.proto.filename=o.filename||this.proto.target.name,o.options&&(this.proto.options=o.options),this}query(e){return this.contextableQuery=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}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||(this.proto.actionDescriptor={}),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}),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}),this}getFileName(){return this.proto.fileName}getTarget(){return l.sqlanvil.Target.create(this.proto.target)}compile(){const e=new p(this);return this.proto.query=e.apply(this.contextableQuery),this.validate(),i.verifyObjectMatchesProto(l.sqlanvil.Export,this.proto,i.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM)}validate(){const e=this.proto.fileName;if(this.proto.location){if(c.includes(this.proto.format)||this.session.compileError(new Error(`Invalid export format "${this.proto.format}". Valid formats: ${c.join(", ")}.`),e),"bigquery"===(this.session.projectConfig.warehouse||"bigquery").toLowerCase()&&!this.proto.location.startsWith("gs://")){const t=this.proto.location.includes("://")?`${this.proto.location.split("://")[0]}://`:"a local path";this.session.compileError(new Error(`BigQuery exports support only gs:// destinations; got ${t}.`),e)}}else this.session.compileError(new Error("Export actions require a `location` in the export config."),e)}verifyConfig(e){return e.type&&delete e.type,i.verifyObjectMatchesProto(l.sqlanvil.ActionConfig.ExportConfig,e,i.VerifyProtoErrorBehaviour.SHOW_DOCS_LINK)}}t.Export=u;class p{constructor(e){this.exportAction=e}self(){return this.resolve(this.exportAction.getTarget())}name(){return this.exportAction.session.finalizeName(this.exportAction.getTarget().name)}ref(e,...t){return e=s.toResolvable(e,t),s.resolvableAsTarget(e)?(this.exportAction.dependencies(e),this.resolve(e)):(this.exportAction.session.compileError(new Error("Action name is not specified")),"")}resolve(e,...t){return this.exportAction.session.resolve(e,...t)}schema(){return this.exportAction.session.finalizeSchema(this.exportAction.getTarget().schema)}database(){return this.exportAction.getTarget().database?this.exportAction.session.finalizeDatabase(this.exportAction.getTarget().database):(this.exportAction.session.compileError(new Error("Warehouse does not support multiple databases")),"")}dependencies(e){return this.exportAction.dependencies(e),""}tags(e){return this.exportAction.tags(e),""}hasOutput(e){return""}when(e,t,n=""){return e?t:n}apply(e){return"function"==typeof e?e(this):e}}t.ExportContext=p},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)"__proto__"!==s[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("__proto__"===e)return this;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 d(){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 f(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(f(this.buf,this.pos+=4),f(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 f(this.buf,this.pos+=4)},l.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|f(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.recursionLimit=i.recursionLimit,l.prototype.skipType=function(e,t){if(void 0===t&&(t=0),t>l.recursionLimit)throw Error("maximum nesting depth exceeded");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,t+1);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 d.call(this)[t](!1)},uint64:function(){return d.call(this)[t](!0)},sint64:function(){return d.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,t){if(e&&e["@type"]){var n=e["@type"].substring(e["@type"].lastIndexOf("/")+1),r=this.lookup(n);if(r){var i="."===e["@type"].charAt(0)?e["@type"].slice(1):e["@type"];-1===i.indexOf("/")&&(i="/"+i);var o=void 0===t?1:t+1;return this.create({type_url:i,value:r.encode(r.fromObject(e,o)).finish()})}}return this.fromObject(e,t)},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(5572),d=n(1299),f=n(2795),g=n(9293),h=n(2008),y=n(4098),m=n(8995),b=n(1287),v=n(3162),O=i(n(2545)),T=n(2545),w=n(2628),j=n(5379),x={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 T.ResolvableMap,this.init(e,t,n)}init(e,t,n){this.rootDir=e,this.projectConfig=j.sqlanvil.ProjectConfig.create(t||x),this.canonicalProjectConfig=function(e){return j.sqlanvil.ProjectConfig.create({warehouse:e.warehouse,defaultSchema:e.defaultSchema,defaultDatabase:e.defaultDatabase,assertionSchema:e.assertionSchema})}(j.sqlanvil.ProjectConfig.create(n||t||x)),this.actions=[],this.foreignServers=new Set,this.tests=[],this.graphErrors={compilationErrors:[]},this.jitContextData=new j.google.protobuf.Struct}compilationSql(){return new b.CompilationSql(this.projectConfig,w.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=O.getCallerFile(this.rootDir)),n){case"view":const n=new m.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 d.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 h.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 g.Operation(this,t).queries(e.sqlContextable));break;case"export":this.actions.push(new p.Export(this,t).query((t=>e.sqlContextable(t)[0])));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=T.toResolvable(e,t);const n=this.findActions(O.resolvableAsTarget(e));if(n.length>1)return this.compileError(new Error(O.ambiguousActionNameMsg(e,n))),"";const r=n.length>0?n[0]:void 0;return r&&r instanceof g.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=O.getCallerFile(this.rootDir);let r;return t&&"object"==typeof t?r=new g.Operation(this,Object.assign({name:e,filename:n},t)):(r=new g.Operation(this,{name:e,filename:n}),t&&r.queries(t)),this.actions.push(r),r}rlsPolicy(e){const t=O.getCallerFile(this.rootDir),n=new s.RlsPolicy(this,Object.assign({filename:t},e));return this.actions.push(n),n}realtimePublication(e){const t=O.getCallerFile(this.rootDir),n=new s.RealtimePublication(this,Object.assign({filename:t},e));return this.actions.push(n),n}wrapper(e){const t=O.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=O.getCallerFile(this.rootDir),n=new s.VectorIndex(this,Object.assign({filename:t},e));return this.actions.push(n),n}publish(e,t){const n=O.getCallerFile(this.rootDir);let r=new m.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 m.View(this,Object.assign({type:"view",name:e,filename:n},t));else if("incremental"===(null==t?void 0:t.type))r=new d.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 h.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=O.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||O.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 y.Test(this,{name:e});return t.session=this,t.setFilename(O.getCallerFile(this.rootDir)),this.tests.push(t),t}notebook(e){const t=O.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||O.getCallerFile(this.rootDir)||__filename,i=j.sqlanvil.CompilationError.create({fileName:r,actionName:n?v.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 T.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=j.sqlanvil.CompiledGraph.create({projectConfig:this.projectConfig,tables:this.compileGraphChunk(this.actions.filter((e=>e instanceof h.Table||e instanceof m.View||e instanceof d.IncrementalTable))),operations:this.compileGraphChunk(this.actions.filter((e=>e instanceof g.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 y.Test))),notebooks:this.compileGraphChunk(this.actions.filter((e=>e instanceof f.Notebook))),dataPreparations:this.compileGraphChunk(this.actions.filter((e=>e instanceof c.DataPreparation))),exports:this.compileGraphChunk(this.actions.filter((e=>e instanceof p.Export))),graphErrors:this.graphErrors,sqlanvilCoreVersion:w.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.exports,e.tests)),this.alterActionName([].concat(e.tables,e.assertions,e.operations,e.notebooks,e.dataPreparations,e.exports,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.exports,e.tests)),a.verifyObjectMatchesProto(j.sqlanvil.CompiledGraph,e,a.VerifyProtoErrorBehaviour.SUGGEST_REPORTING_TO_DATAFORM_TEAM),e}compileToBase64(){return a.encode64(j.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 j.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 "${v.targetAsReadableString(e.target)}" depends on "${O.stringifyResolvable(n)}" which does not exist`),e.fileName,e.target);else if(1===r.length){const e=r[0].getTarget();t[v.targetAsReadableString(e)]=e,n.includeDependentAssertions&&this.actionAssertionMap.find(n).forEach((e=>t[v.targetAsReadableString(e.getTarget())]=e.getTarget()))}else this.compileError(new Error(O.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(v.targetStringifier.stringify(e),e))),e.forEach((e=>{o.set(v.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(v.targetStringifier.stringify(e.target))}));const a=e=>o.has(v.targetStringifier.stringify(e))?o.get(v.targetStringifier.stringify(e)):e;e.forEach((e=>{e instanceof j.sqlanvil.Declaration||(e.dependencyTargets=(e.dependencyTargets||[]).map(a)),e instanceof j.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=>[v.targetStringifier.stringify(e.target),e]))),n=new o.default;e.forEach((e=>{const r=(e instanceof j.sqlanvil.Declaration||!e.dependencyTargets?[]:e.dependencyTargets).filter((e=>!!t.get(v.targetStringifier.stringify(e))));n.add(v.targetStringifier.stringify(e.target),r.map((e=>v.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(" > ")} > ${v.targetAsReadableString(n.target)}]`;this.compileError(new Error(r),n.fileName,n.target)}))}addTestsToCompiledGraph(e){e.filter((e=>e instanceof y.Test)).map((e=>e)).forEach((e=>{const t=this.indexedActions.find(e.getTestTarget());t.forEach((e=>{e instanceof h.Table||e instanceof m.View||this.compileError(new Error(`Tests are only supported for Tables and Views. Action "${v.targetAsReadableString(e.getTarget())}" is not a table or view".`),e.getFileName(),e.getTarget())})),t.map((e=>e)).forEach((t=>t.dependencies(O.resolvableAsTarget(e.getTarget()))))}))}removeNonUniqueActionsFromCompiledGraph(e){function t(e){const t=new Set,n=new Set;return e.forEach((e=>{t.has(v.targetStringifier.stringify(e))&&n.add(v.targetStringifier.stringify(e)),t.add(v.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(v.targetStringifier.stringify(e.target)),n=i.has(v.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"__proto__"===e||(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){if("__proto__"===e)return this;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","n"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("if(n===undefined)n=0")("if(n>Reader.recursionLimit)")('throw Error("maximum nesting depth exceeded")')("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(),undefined,n+1)",n):t("value=r.%s()",l),t("break")("default:")("r.skipType(tag2&7,n)")("break")("}")("}"),void 0!==i.long[s.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',c):("string"===s.keyType&&t('if(k==="__proto__")')("util.makeProp(%s,k)",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),n+1))":"%s.push(types[%i].decode(r,r.uint32(),undefined,n+1))",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),n+1)":"%s=types[%i].decode(r,r.uint32(),undefined,n+1)",c,n):t("%s=r.%s()",c,l),t("break")("}")}for(t("default:")("r.skipType(t&7,n)")("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),r.metadata&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.metadata=r.metadata),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),d=n(3262),f=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=d.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=d.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,d.merge(e.prototype,t)),e.$type=e.prototype.$type=this,d.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:d.oneOfGetter(this._oneofsArray[n].oneof),set:d.oneOfSetter(this._oneofsArray[n].oneof)};n&&Object.defineProperties(e.prototype,r)}}}),b.generateConstructor=function(e){for(var t,n=d.codegen(["p"],e.name),r=0;r<e.fieldsArray.length;++r)(t=e._fieldsArray[r]).map?n("this%s={}",d.safeProp(t.name)):t.repeated&&n("this%s=[]",d.safeProp(t.name));return n('if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null&&ks[i]!=="__proto__")')("this[ks[i]]=p[ks[i]]")},b.fromJSON=function(e,t,n){n=d.checkDepth(n);var c=new b(e,t.options);c.extensions=t.extensions,c.reserved=t.reserved;for(var u=Object.keys(t.fields),p=0;p<u.length;++p)c.add((void 0!==t.fields[u[p]].keyType?s.fromJSON:a.fromJSON)(u[p],t.fields[u[p]]));if(t.oneofs)for(u=Object.keys(t.oneofs),p=0;p<u.length;++p)c.add(o.fromJSON(u[p],t.oneofs[u[p]]));if(t.nested)for(u=Object.keys(t.nested),p=0;p<u.length;++p){var f=t.nested[u[p]];c.add((void 0!==f.id?a.fromJSON:void 0!==f.fields?b.fromJSON:void 0!==f.values?i.fromJSON:void 0!==f.methods?l.fromJSON:r.fromJSON)(u[p],f,n+1))}return t.extensions&&t.extensions.length&&(c.extensions=t.extensions),t.reserved&&t.reserved.length&&(c.reserved=t.reserved),t.group&&(c.group=!0),t.comment&&(c.comment=t.comment),t.edition&&(c._edition=t.edition),c._defaultEdition="proto3",c},b.prototype.toJSON=function(e){var t=r.prototype.toJSON.call(this,e),n=!!e&&Boolean(e.keepComments);return d.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 Object.prototype.hasOwnProperty.call(this.fields,e)?this.fields[e]:this.oneofs&&Object.prototype.hasOwnProperty.call(this.oneofs,e)?this.oneofs[e]:this.nested&&Object.prototype.hasOwnProperty.call(this.nested,e)?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"__proto__"===e.name?this:(e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),v(this))}return e instanceof o?"__proto__"===e.name?this:(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=f(this)({Writer:p,types:t,util:d}),this.decode=g(this)({Reader:u,types:t,util:d}),this.verify=h(this)({types:t,util:d}),this.fromObject=y.fromObject(this)({types:t,util:d}),this.toObject=y.toObject(this)({types:t,util:d});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,n,r){return this.setup().decode(e,t,n,r)},b.prototype.decodeDelimited=function(e){return e instanceof u||(e=u.create(e)),this.decode(e,e.uint32())},b.prototype.verify=function(e,t){return this.setup().verify(e,t)},b.prototype.fromObject=function(e,t){return this.setup().fromObject(e,t)},b.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},b.d=function(e){return function(t){d.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),d=n(8995),f=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 x=g.nativeRequire("@sqlanvil/core").session;x.init(O.compileConfig.projectDir,w,w),b.sqlanvil=x,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,x),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${f.separator}`))).filter((e=>2===e.split(f.separator).length)).filter((e=>"js"===f.fileExtension(e))).forEach((e=>{try{r[f.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${f.separator}`)&&"actions"===f.basename(e)&&"yaml"===f.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 d.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${f.separator}`))).filter((e=>"js"===f.fileExtension(e)||"sqlx"===f.fileExtension(e))).sort().forEach((e=>{try{g.nativeRequire(e)}catch(n){t.compileError(n,e)}}))}(e,t):m(e,t)}(O,x);const q=y.sqlanvil.CoreExecutionResponse.create({compile:{compiledGraph:x.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,d="",f=Math.min(e.line+t.linesAfter,l.length).toString().length,g=t.maxLength-(t.indent+f+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),d=r.repeat(" ",t.indent)+o((e.line-u+1).toString(),f)+" | "+p.str+"\n"+d;for(p=i(e.buffer,s[c],l[c],e.position,g),d+=r.repeat(" ",t.indent)+o((e.line+1).toString(),f)+" | "+p.str+"\n",d+=r.repeat("-",t.indent+f+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),d+=r.repeat(" ",t.indent)+o((e.line+u+1).toString(),f)+" | "+p.str+"\n";return d.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";e.exports=n;var t=/^(?: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)$/;function n(e,r){"string"==typeof e&&(r=e,e=void 0);var i=[];function o(e){if("string"!=typeof e){var t=a();if(n.verbose&&console.log("codegen: "+t),t="return "+t,e){for(var r=Object.keys(e),s=new Array(r.length+1),l=new Array(r.length),c=0;c<r.length;)s[c]=r[c],l[c]=e[r[c++]];return s[c]=t,Function.apply(null,s).apply(null,l)}return Function(t)()}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 i.push(e),o}function a(n){return"function "+(((o=n||r)&&(o=String(o).replace(/[^\w$]/g,""))?(/^\d/.test(o)&&(o="_"+o),t.test(o)?o+"_":o):"")+"(")+(e&&e.join(",")||"")+"){\n "+i.join("\n ")+"\n}";var o}return o.toString=a,o}n.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=Object.create(null),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0}function d(e){e._nestedArray=null,e._lookupCache=Object.create(null);for(var t=e;t=t.parent;)t._lookupCache=Object.create(null);return e}p.fromJSON=function(e,t,n){return n=l.checkDepth(n),new p(e,t.options).addJSON(t.nested,n)},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,t){if(t=l.checkDepth(t),e)for(var n,r=Object.keys(e),c=0;c<r.length;++c)n=e[r[c]],this.add((void 0!==n.fields?i.fromJSON:void 0!==n.values?a.fromJSON:void 0!==n.methods?o.fromJSON:void 0!==n.id?s.fromJSON:p.fromJSON)(r[c],n,t+1));return this},p.prototype.get=function(e){return this.nested&&Object.prototype.hasOwnProperty.call(this.nested,e)?this.nested[e]:null},p.prototype.getEnum=function(e){if(this.nested&&Object.prototype.hasOwnProperty.call(this.nested,e)&&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("__proto__"===e.name)return this;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),d(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),d(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)if(this._nestedArray[i]instanceof p&&(n=this._nestedArray[i]._lookupImpl(e,t))){r=n;break}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 d 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 f(this),t=new f(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=d;class f{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=f},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,d=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function f(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),x=0;x<256;x++)w[x]=v(x)?1:0,j[x]=v(x);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 P(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 A(e,t){throw P(e,t)}function C(e,t){e.onWarning&&e.onWarning.call(null,P(e,t))}var S={YAML:function(e,t,n){var r,i,o;null!==e.version&&A(e,"duplication of %YAML directive"),1!==n.length&&A(e,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&A(e,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),o=parseInt(r[2],10),1!==i&&A(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,1!==o&&2!==o&&C(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var r,i;2!==n.length&&A(e,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],p.test(r)||A(e,"ill-formed tag handle (first argument) of the TAG directive"),s.call(e.tagMap,r)&&A(e,'there is a previously declared suffix for "'+r+'" tag handle'),d.test(i)||A(e,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch(t){A(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||A(e,"expected valid JSON character");else l.test(s)&&A(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)||A(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 _(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])&&A(e,"nested arrays are not supported inside keys"),"object"==typeof i&&"[object Object]"===f(i[u])&&(i[u]="[object Object]");if("object"==typeof i&&"[object Object]"===f(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,A(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++):A(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function N(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&&C(e,"deficient indentation"),r}function L(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 R(e,t){1===t?e.result+=" ":t>1&&(e.result+=r.repeat("\n",t-1))}function I(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,A(e,"tab characters must not be used in indentation")),45===r)&&y(e.input.charCodeAt(e.position+1));)if(s=!0,e.position++,N(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),N(e,!0,-1),r=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==r)A(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&&A(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)):A(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==i&&!y(i);)33===i&&(a?A(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),p.test(n)||A(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)&&A(e,"tag suffix cannot contain flow indicator characters")}r&&!d.test(r)&&A(e,"tag name cannot contain such characters: "+r);try{r=decodeURIComponent(r)}catch(t){A(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:A(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&&A(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&&A(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,d,f,v,T,x=1,q=!1,P=!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&&N(e,!0,-1)&&(q=!0,e.lineIndent>t?x=1:e.lineIndent===t?x=0:e.lineIndent<t&&(x=-1)),1===x)for(;M(e)||B(e);)N(e,!0,-1)?(q=!0,c=a,e.lineIndent>t?x=1:e.lineIndent===t?x=0:e.lineIndent<t&&(x=-1)):c=!1;if(c&&(c=q||o),1!==x&&4!==n||(v=1===n||2===n?t:t+1,T=e.position-e.lineStart,1===x?c&&(I(e,T)||function(e,t,n){var r,i,o,a,s,l,c,u=e.tag,p=e.anchor,d={},f=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]=d),c=e.input.charCodeAt(e.position);0!==c;){if(v||-1===e.firstTabInLine||(e.position=e.firstTabInLine,A(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))||A(e,"a whitespace character is expected after the key-value separator within a block mapping"),v&&(_(e,d,f,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;A(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!O)return e.tag=u,e.anchor=p,!0;A(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===c?(v&&(_(e,d,f,g,m,null,a,s,l),g=m=b=null),O=!0,v=!0,i=!0):v?(v=!1,i=!0):A(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||(_(e,d,f,g,m,b,a,s,l),g=m=b=null),N(e,!0,-1),c=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&0!==c)A(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return v&&_(e,d,f,g,m,null,a,s,l),O&&(e.tag=u,e.anchor=p,e.kind="mapping",e.result=d),O}(e,T,v))||function(e,t){var n,r,i,o,a,s,l,c,u,p,d,f,g=!0,h=e.tag,m=e.anchor,b=Object.create(null);if(91===(f=e.input.charCodeAt(e.position)))a=93,c=!1,o=[];else{if(123!==f)return!1;a=125,c=!0,o={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=o),f=e.input.charCodeAt(++e.position);0!==f;){if(N(e,!0,t),(f=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===f&&A(e,"expected the node content, but found ','"):A(e,"missed comma between flow collection entries"),d=null,s=l=!1,63===f&&y(e.input.charCodeAt(e.position+1))&&(s=l=!0,e.position++,N(e,!0,t)),n=e.line,r=e.lineStart,i=e.position,F(e,t,1,!1,!0),p=e.tag,u=e.result,N(e,!0,t),f=e.input.charCodeAt(e.position),!l&&e.line!==n||58!==f||(s=!0,f=e.input.charCodeAt(++e.position),N(e,!0,t),F(e,t,1,!1,!0),d=e.result),c?_(e,o,b,p,u,d,n,r,i):s?o.push(_(e,null,b,p,u,d,n,r,i)):o.push(u),N(e,!0,t),44===(f=e.input.charCodeAt(e.position))?(g=!0,f=e.input.charCodeAt(++e.position)):g=!1}A(e,"unexpected end of the stream within a flow collection")}(e,v)?P=!0:(l&&function(e,t){var n,i,o,a,s,l=1,c=!1,u=!1,p=t,d=0,f=!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:A(e,"repeat of a chomping mode identifier");else{if(!((o=48<=(s=a)&&s<=57?s-48:-1)>=0))break;0===o?A(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):u?A(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))d++;else{if(e.lineIndent<p){3===l?e.result+=r.repeat("\n",c?1+d:d):1===l&&c&&(e.result+="\n");break}for(i?h(a)?(f=!0,e.result+=r.repeat("\n",c?1+d:d)):f?(f=!1,e.result+=r.repeat("\n",d+1)):0===d?c&&(e.result+=" "):e.result+=r.repeat("\n",d):e.result+=r.repeat("\n",c?1+d:d),c=!0,u=!0,d=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),R(e,N(e,!1,t)),r=i=e.position):e.position===e.lineStart&&L(e)?A(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);A(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)))N(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:A(e,"expected hexadecimal character");e.result+=O(o),e.position++}else A(e,"unknown escape sequence");n=r=e.position}else g(s)?(k(e,n,r,!0),R(e,N(e,!1,t)),n=r=e.position):e.position===e.lineStart&&L(e)?A(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}A(e,"unexpected end of the stream within a double quoted scalar")}(e,v)?P=!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&&A(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),s.call(e.anchorMap,n)||A(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],N(e,!0,-1),!0}(e)?(P=!0,null===e.tag&&null===e.anchor||A(e,"alias node should not have any properties")):function(e,t,n){var r,i,o,a,s,l,c,u,p=e.kind,d=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&&L(e)||n&&m(u))break;if(g(u)){if(s=e.line,l=e.lineStart,c=e.lineIndent,N(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),R(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=d,!1)}(e,v,1===n)&&(P=!0,null===e.tag&&(e.tag="?")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===x&&(P=c&&I(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&&A(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),u=0,p=e.implicitTypes.length;u<p;u+=1)if((f=e.implicitTypes[u]).resolve(e.result)){e.result=f.construct(e.result),e.tag=f.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))f=e.typeMap[e.kind||"fallback"][e.tag];else for(f=null,u=0,p=(d=e.typeMap.multi[e.kind||"fallback"]).length;u<p;u+=1)if(e.tag.slice(0,d[u].tag.length)===d[u].tag){f=d[u];break}f||A(e,"unknown tag !<"+e.tag+">"),null!==e.result&&f.kind!==e.kind&&A(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+f.kind+'", not "'+e.kind+'"'),f.resolve(e.result,e.tag)?(e.result=f.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):A(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||P}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))&&(N(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&&A(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(S,n)?S[n](e,n,r):C(e,'unknown document directive "'+n+'"')}N(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,N(e,!0,-1)):a&&A(e,"directives end mark is expected"),F(e,e.lineIndent-1,4,!1,!0),N(e,!0,-1),e.checkLineBreaks&&c.test(e.input.slice(o,e.position))&&C(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&L(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,N(e,!0,-1)):e.position<e.length-1&&A(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,A(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=l;var r=n(8923);((l.prototype=Object.create(r.prototype)).constructor=l).className="Service";var i=n(8811),o=n(3262),a=n(5047),s=o.patterns.reservedRe;function l(e,t){r.call(this,e,t),this.methods={},this._methodsArray=null}function c(e){return e._methodsArray=null,e}l.fromJSON=function(e,t,n){n=o.checkDepth(n);var r=new l(e,t.options);if(t.methods)for(var a=Object.keys(t.methods),s=0;s<a.length;++s)r.add(i.fromJSON(a[s],t.methods[a[s]]));return t.nested&&r.addJSON(t.nested,n),t.edition&&(r._edition=t.edition),r.comment=t.comment,r._defaultEdition="proto3",r},l.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(l.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=o.toArray(this.methods))}}),l.prototype.get=function(e){return Object.prototype.hasOwnProperty.call(this.methods,e)?this.methods[e]:r.prototype.get.call(this,e)},l.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},l.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},l.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof i?"__proto__"===e.name?this:(this.methods[e.name]=e,e.parent=this,c(this)):r.prototype.add.call(this,e)},l.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,c(this)}return r.prototype.remove.call(this,e)},l.prototype.create=function(e,t,n){for(var r,i=new a.Service(e,t,n),l=0;l<this.methodsArray.length;++l){var c=o.lcFirst((r=this._methodsArray[l]).resolve().name).replace(/[^$\w_]/g,"");i[c]=o.codegen(["r","c"],s.test(c)?c+"_":c)("return this.rpcCall(m,q,s,r,c)")({m:r,q:r.resolvedRequestType.ctor,s:r.resolvedResponseType.ctor})}return i}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};(()=>{"use strict";var e=r;Object.defineProperty(e,"__esModule",{value:!0});var t=n(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=r})();
|