UNPKG

node-sql-parser

Version:
1 lines 194 kB
!function(r,t){for(var e in t)r[e]=t[e]}(exports,function(r){var t={};function e(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return r[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=r,e.c=t,e.d=function(r,t,n){e.o(r,t)||Object.defineProperty(r,t,{enumerable:!0,get:n})},e.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},e.t=function(r,t){if(1&t&&(r=e(r)),8&t)return r;if(4&t&&"object"==typeof r&&r&&r.__esModule)return r;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:r}),2&t&&"string"!=typeof r)for(var o in r)e.d(n,o,function(t){return r[t]}.bind(null,o));return n},e.n=function(r){var t=r&&r.__esModule?function(){return r.default}:function(){return r};return e.d(t,"a",t),t},e.o=function(r,t){return Object.prototype.hasOwnProperty.call(r,t)},e.p="",e(e.s=1)}([function(r,t,e){"use strict";var n=e(2);function o(r,t,e,n){this.message=r,this.expected=t,this.found=e,this.location=n,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,o)}!function(r,t){function e(){this.constructor=r}e.prototype=t.prototype,r.prototype=new e}(o,Error),o.buildMessage=function(r,t){var e={literal:function(r){return'"'+o(r.text)+'"'},class:function(r){var t,e="";for(t=0;t<r.parts.length;t++)e+=r.parts[t]instanceof Array?u(r.parts[t][0])+"-"+u(r.parts[t][1]):u(r.parts[t]);return"["+(r.inverted?"^":"")+e+"]"},any:function(r){return"any character"},end:function(r){return"end of input"},other:function(r){return r.description}};function n(r){return r.charCodeAt(0).toString(16).toUpperCase()}function o(r){return r.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(r){return"\\x0"+n(r)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(r){return"\\x"+n(r)}))}function u(r){return r.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(r){return"\\x0"+n(r)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(r){return"\\x"+n(r)}))}return"Expected "+function(r){var t,n,o,u=new Array(r.length);for(t=0;t<r.length;t++)u[t]=(o=r[t],e[o.type](o));if(u.sort(),u.length>0){for(t=1,n=1;t<u.length;t++)u[t-1]!==u[t]&&(u[n]=u[t],n++);u.length=n}switch(u.length){case 1:return u[0];case 2:return u[0]+" or "+u[1];default:return u.slice(0,-1).join(", ")+", or "+u[u.length-1]}}(r)+" but "+function(r){return r?'"'+o(r)+'"':"end of input"}(t)+" found."},r.exports={SyntaxError:o,parse:function(r,t){t=void 0!==t?t:{};var e,u={},a={start:du},s=du,i=function(r,t){return Tc(r,t,1)},c=lu("IF",!0),l=function(r,t){return Tc(r,t)},f=lu("AUTO_INCREMENT",!0),p=lu("UNIQUE",!0),v=lu("KEY",!0),b=lu("PRIMARY",!0),y=lu("COLUMN_FORMAT",!0),d=lu("FIXED",!0),h=lu("DYNAMIC",!0),m=lu("DEFAULT",!0),w=lu("STORAGE",!0),L=lu("DISK",!0),C=lu("MEMORY",!0),A=lu("ALGORITHM",!0),E=lu("INSTANT",!0),g=lu("INPLACE",!0),j=lu("COPY",!0),_=lu("LOCK",!0),T=lu("NONE",!0),S=lu("SHARED",!0),x=lu("EXCLUSIVE",!0),I=lu("PRIMARY KEY",!0),k=lu("FOREIGN KEY",!0),N=lu("MATCH FULL",!0),O=lu("MATCH PARTIAL",!0),R=lu("MATCH SIMPLE",!0),U=lu("RESTRICT",!0),M=lu("CASCADE",!0),D=lu("SET NULL",!0),P=lu("NO ACTION",!0),F=lu("SET DEFAULT",!0),H=lu("CHARACTER",!0),$=lu("SET",!0),W=lu("CHARSET",!0),q=lu("COLLATE",!0),G=lu("AVG_ROW_LENGTH",!0),B=lu("KEY_BLOCK_SIZE",!0),Y=lu("MAX_ROWS",!0),V=lu("MIN_ROWS",!0),Q=lu("STATS_SAMPLE_PAGES",!0),X=lu("CONNECTION",!0),K=lu("COMPRESSION",!0),z=lu("'",!1),Z=lu("ZLIB",!0),J=lu("LZ4",!0),rr=lu("ENGINE",!0),tr=lu("READ",!0),er=lu("LOCAL",!0),nr=lu("LOW_PRIORITY",!0),or=lu("WRITE",!0),ur=function(r,t){return Tc(r,t)},ar=lu("(",!1),sr=lu(")",!1),ir=lu(".",!1),cr=lu("UNNEST",!0),lr=lu("BTREE",!0),fr=lu("HASH",!0),pr=lu("WITH",!0),vr=lu("PARSER",!0),br=lu("VISIBLE",!0),yr=lu("INVISIBLE",!0),dr=function(r,t){return t.unshift(r),t.forEach(r=>{const{table:t,as:e}=r;Rc[t]=t,e&&(Rc[e]=t),function(r){const t=Ic(r);r.clear(),t.forEach(t=>r.add(t))}(Oc)}),t},hr=lu("FOLLOWING",!0),mr=lu("PRECEDING",!0),wr=lu("CURRENT",!0),Lr=lu("ROW",!0),Cr=lu("UNBOUNDED",!0),Ar=lu("=",!1),Er=function(r,t){return Sc(r,t)},gr=lu("!",!1),jr=function(r){return r[0]+" "+r[2]},_r=lu(">=",!1),Tr=lu(">",!1),Sr=lu("<=",!1),xr=lu("<>",!1),Ir=lu("<",!1),kr=lu("==",!1),Nr=lu("!=",!1),Or=function(r,t){return{op:r,right:t}},Rr=lu("+",!1),Ur=lu("-",!1),Mr=lu("*",!1),Dr=lu("/",!1),Pr=lu("%",!1),Fr=lu("~",!1),Hr=lu("?|",!1),$r=lu("?&",!1),Wr=lu("?",!1),qr=lu("#-",!1),Gr=lu("#>>",!1),Br=lu("#>",!1),Yr=lu("@>",!1),Vr=lu("<@",!1),Qr=function(r){return!0===Ac[r.toUpperCase()]},Xr=lu('"',!1),Kr=/^[^"]/,zr=fu(['"'],!0,!1),Zr=/^[^']/,Jr=fu(["'"],!0,!1),rt=lu("`",!1),tt=/^[^`]/,et=fu(["`"],!0,!1),nt=function(r,t){return r+t.join("")},ot=/^[A-Za-z_]/,ut=fu([["A","Z"],["a","z"],"_"],!1,!1),at=/^[A-Za-z0-9_]/,st=fu([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),it=/^[A-Za-z0-9_:\u4E00-\u9FA5\xC0-\u017F]/,ct=fu([["A","Z"],["a","z"],["0","9"],"_",":",["一","龥"],["À","ſ"]],!1,!1),lt=lu(":",!1),ft=lu("OVER",!0),pt=lu("filter",!0),vt=lu("BOTH",!0),bt=lu("LEADING",!0),yt=lu("TRAILING",!0),dt=lu("trim",!0),ht=lu("AT TIME ZONE",!0),mt=lu("CENTURY",!0),wt=lu("DAY",!0),Lt=lu("DATE",!0),Ct=lu("DECADE",!0),At=lu("DOW",!0),Et=lu("DOY",!0),gt=lu("EPOCH",!0),jt=lu("HOUR",!0),_t=lu("ISODOW",!0),Tt=lu("ISOYEAR",!0),St=lu("MICROSECONDS",!0),xt=lu("MILLENNIUM",!0),It=lu("MILLISECONDS",!0),kt=lu("MINUTE",!0),Nt=lu("MONTH",!0),Ot=lu("QUARTER",!0),Rt=lu("SECOND",!0),Ut=lu("TIMEZONE",!0),Mt=lu("TIMEZONE_HOUR",!0),Dt=lu("TIMEZONE_MINUTE",!0),Pt=lu("WEEK",!0),Ft=lu("YEAR",!0),Ht=lu("u&",!0),$t=function(r,t){return{type:r.toLowerCase(),value:t[1].join("")}},Wt=/^[^"\\\0-\x1F\x7F]/,qt=fu(['"',"\\",["\0",""],""],!0,!1),Gt=/^[^'\\]/,Bt=fu(["'","\\"],!0,!1),Yt=lu("\\'",!1),Vt=lu('\\"',!1),Qt=lu("\\\\",!1),Xt=lu("\\/",!1),Kt=lu("\\b",!1),zt=lu("\\f",!1),Zt=lu("\\n",!1),Jt=lu("\\r",!1),re=lu("\\t",!1),te=lu("\\u",!1),ee=lu("\\",!1),ne=lu("''",!1),oe=lu('""',!1),ue=lu("``",!1),ae=/^[\n\r]/,se=fu(["\n","\r"],!1,!1),ie=/^[0-9]/,ce=fu([["0","9"]],!1,!1),le=/^[0-9a-fA-F]/,fe=fu([["0","9"],["a","f"],["A","F"]],!1,!1),pe=/^[eE]/,ve=fu(["e","E"],!1,!1),be=/^[+\-]/,ye=fu(["+","-"],!1,!1),de=lu("NULL",!0),he=lu("NOT NULL",!0),me=lu("TRUE",!0),we=lu("TO",!0),Le=lu("FALSE",!0),Ce=(lu("SHOW",!0),lu("DROP",!0)),Ae=lu("USE",!0),Ee=lu("ALTER",!0),ge=lu("SELECT",!0),je=lu("UPDATE",!0),_e=lu("CREATE",!0),Te=lu("TEMPORARY",!0),Se=lu("DELETE",!0),xe=lu("INSERT",!0),Ie=lu("RECURSIVE",!0),ke=lu("REPLACE",!0),Ne=lu("RENAME",!0),Oe=lu("IGNORE",!0),Re=(lu("EXPLAIN",!0),lu("PARTITION",!0)),Ue=lu("INTO",!0),Me=lu("OVERWRITE",!0),De=lu("FROM",!0),Pe=lu("UNLOCK",!0),Fe=lu("AS",!0),He=lu("TABLE",!0),$e=lu("TABLES",!0),We=lu("DATABASE",!0),qe=lu("SCHEMA",!0),Ge=lu("ON",!0),Be=lu("LEFT",!0),Ye=lu("RIGHT",!0),Ve=lu("FULL",!0),Qe=lu("CROSS",!0),Xe=lu("INNER",!0),Ke=lu("JOIN",!0),ze=lu("OUTER",!0),Ze=lu("UNION",!0),Je=lu("VALUES",!0),rn=lu("USING",!0),tn=lu("WHERE",!0),en=lu("GROUP",!0),nn=lu("BY",!0),on=lu("ORDER",!0),un=lu("HAVING",!0),an=lu("LIMIT",!0),sn=lu("OFFSET",!0),cn=lu("ASC",!0),ln=lu("DESC",!0),fn=lu("ALL",!0),pn=lu("DISTINCT",!0),vn=lu("BETWEEN",!0),bn=lu("IN",!0),yn=lu("IS",!0),dn=lu("LIKE",!0),hn=lu("RLIKE",!0),mn=lu("EXISTS",!0),wn=lu("NOT",!0),Ln=lu("AND",!0),Cn=lu("OR",!0),An=lu("COUNT",!0),En=lu("MAX",!0),gn=lu("MIN",!0),jn=lu("SUM",!0),_n=lu("AVG",!0),Tn=lu("EXTRACT",!0),Sn=lu("CALL",!0),xn=lu("CASE",!0),In=lu("WHEN",!0),kn=lu("THEN",!0),Nn=lu("ELSE",!0),On=lu("END",!0),Rn=lu("CAST",!0),Un=lu("ARRAY",!0),Mn=lu("ARRAY_AGG",!0),Dn=lu("CHAR",!0),Pn=lu("VARCHAR",!0),Fn=lu("NUMERIC",!0),Hn=lu("DECIMAL",!0),$n=lu("SIGNED",!0),Wn=lu("STRING",!0),qn=lu("UNSIGNED",!0),Gn=lu("INT",!0),Bn=lu("ZEROFILL",!0),Yn=lu("INTEGER",!0),Vn=lu("JSON",!0),Qn=lu("SMALLINT",!0),Xn=lu("TINYINT",!0),Kn=lu("TINYTEXT",!0),zn=lu("TEXT",!0),Zn=lu("MEDIUMTEXT",!0),Jn=lu("LONGTEXT",!0),ro=lu("BIGINT",!0),to=lu("FLOAT",!0),eo=lu("REAL",!0),no=lu("DOUBLE",!0),oo=lu("DATETIME",!0),uo=lu("ROWS",!0),ao=lu("TIME",!0),so=lu("TIMESTAMP",!0),io=lu("TRUNCATE",!0),co=lu("USER",!0),lo=lu("CURRENT_DATE",!0),fo=(lu("ADDDATE",!0),lu("INTERVAL",!0)),po=lu("CURRENT_TIME",!0),vo=lu("CURRENT_TIMESTAMP",!0),bo=lu("CURRENT_USER",!0),yo=lu("SESSION_USER",!0),ho=lu("SYSTEM_USER",!0),mo=lu("GLOBAL",!0),wo=lu("SESSION",!0),Lo=lu("PERSIST",!0),Co=lu("PERSIST_ONLY",!0),Ao=lu("@",!1),Eo=lu("@@",!1),go=lu("$",!1),jo=lu("return",!0),_o=lu(":=",!1),To=lu("DUAL",!0),So=lu("ADD",!0),xo=lu("COLUMN",!0),Io=lu("INDEX",!0),ko=lu("FULLTEXT",!0),No=lu("SPATIAL",!0),Oo=lu("COMMENT",!0),Ro=lu("CONSTRAINT",!0),Uo=lu("REFERENCES",!0),Mo=lu("SQL_CALC_FOUND_ROWS",!0),Do=lu("SQL_CACHE",!0),Po=lu("SQL_NO_CACHE",!0),Fo=lu("SQL_SMALL_RESULT",!0),Ho=lu("SQL_BIG_RESULT",!0),$o=lu("SQL_BUFFER_RESULT",!0),Wo=lu(",",!1),qo=lu("[",!1),Go=lu("]",!1),Bo=lu(";",!1),Yo=lu("->",!1),Vo=lu("||",!1),Qo=lu("&&",!1),Xo=lu("/*",!1),Ko=lu("*/",!1),zo=lu("--",!1),Zo=lu("#",!1),Jo={type:"any"},ru=/^[ \t\n\r]/,tu=fu([" ","\t","\n","\r"],!1,!1),eu=function(r){return{dataType:r}},nu=lu("boolean",!0),ou=0,uu=0,au=[{line:1,column:1}],su=0,iu=[],cu=0;if("startRule"in t){if(!(t.startRule in a))throw new Error("Can't start parsing from rule \""+t.startRule+'".');s=a[t.startRule]}function lu(r,t){return{type:"literal",text:r,ignoreCase:t}}function fu(r,t,e){return{type:"class",parts:r,inverted:t,ignoreCase:e}}function pu(t){var e,n=au[t];if(n)return n;for(e=t-1;!au[e];)e--;for(n={line:(n=au[e]).line,column:n.column};e<t;)10===r.charCodeAt(e)?(n.line++,n.column=1):n.column++,e++;return au[t]=n,n}function vu(r,t){var e=pu(r),n=pu(t);return{start:{offset:r,line:e.line,column:e.column},end:{offset:t,line:n.line,column:n.column}}}function bu(r){ou<su||(ou>su&&(su=ou,iu=[]),iu.push(r))}function yu(r,t,e){return new o(o.buildMessage(r,t),r,t,e)}function du(){var r,t;return r=ou,rc()!==u&&(t=function(){var r,t,e,n,o,a,s,i;if(r=ou,(t=mu())!==u){for(e=[],n=ou,(o=rc())!==u&&(a=Ki())!==u&&(s=rc())!==u&&(i=mu())!==u?n=o=[o,a,s,i]:(ou=n,n=u);n!==u;)e.push(n),n=ou,(o=rc())!==u&&(a=Ki())!==u&&(s=rc())!==u&&(i=mu())!==u?n=o=[o,a,s,i]:(ou=n,n=u);e!==u?(uu=r,t=function(r,t){const e=r&&r.ast||r,n=t&&t.length&&t[0].length>=4?[e]:e;for(let r=0;r<t.length;r++)t[r][3]&&0!==t[r][3].length&&n.push(t[r][3]&&t[r][3].ast||t[r][3]);return{tableList:Array.from(Nc),columnList:Ic(Oc),ast:n}}(t,e),r=t):(ou=r,r=u)}else ou=r,r=u;return r}())!==u?(uu=r,r=t):(ou=r,r=u),r}function hu(){var t;return(t=function(){var r,t,e,n,o,a;r=ou,(t=ks())!==u&&rc()!==u&&(e=qs())!==u&&rc()!==u&&(n=ra())!==u?(uu=r,s=t,c=e,(l=n)&&l.forEach(r=>Nc.add(`${s}::${r.db}::${r.table}`)),t={tableList:Array.from(Nc),columnList:Ic(Oc),ast:{type:s.toLowerCase(),keyword:c.toLowerCase(),name:l}},r=t):(ou=r,r=u);var s,c,l;r===u&&(r=ou,(t=ks())!==u&&rc()!==u&&(e=Hi())!==u&&rc()!==u&&(n=Ga())!==u&&rc()!==u&&Ys()!==u&&rc()!==u&&(o=oa())!==u&&rc()!==u?((a=function(){var r,t,e,n,o,a;r=ou,(t=Tu())===u&&(t=Su());if(t!==u){for(e=[],n=ou,(o=rc())!==u?((a=Tu())===u&&(a=Su()),a!==u?n=o=[o,a]:(ou=n,n=u)):(ou=n,n=u);n!==u;)e.push(n),n=ou,(o=rc())!==u?((a=Tu())===u&&(a=Su()),a!==u?n=o=[o,a]:(ou=n,n=u)):(ou=n,n=u);e!==u?(uu=r,t=i(t,e),r=t):(ou=r,r=u)}else ou=r,r=u;return r}())===u&&(a=null),a!==u&&rc()!==u?(uu=r,t=function(r,t,e,n,o){return{tableList:Array.from(Nc),columnList:Ic(Oc),ast:{type:r.toLowerCase(),keyword:t.toLowerCase(),name:e,table:n,options:o}}}(t,e,n,o,a),r=t):(ou=r,r=u)):(ou=r,r=u));return r}())===u&&(t=function(){var t;(t=function(){var t,e,n,o,a,s,i,c,f,p;t=ou,(e=Os())!==u&&rc()!==u?((n=Rs())===u&&(n=null),n!==u&&rc()!==u&&qs()!==u&&rc()!==u?((o=Cu())===u&&(o=null),o!==u&&rc()!==u&&(a=ra())!==u&&rc()!==u&&(s=function(){var r,t,e,n,o,a,s,i,c;if(r=ou,(t=Yi())!==u)if(rc()!==u)if((e=Au())!==u){for(n=[],o=ou,(a=rc())!==u&&(s=Gi())!==u&&(i=rc())!==u&&(c=Au())!==u?o=a=[a,s,i,c]:(ou=o,o=u);o!==u;)n.push(o),o=ou,(a=rc())!==u&&(s=Gi())!==u&&(i=rc())!==u&&(c=Au())!==u?o=a=[a,s,i,c]:(ou=o,o=u);n!==u&&(o=rc())!==u&&(a=Vi())!==u?(uu=r,t=l(e,n),r=t):(ou=r,r=u)}else ou=r,r=u;else ou=r,r=u;else ou=r,r=u;return r}())!==u&&rc()!==u?((i=function(){var r,t,e,n,o,a,s,i;if(r=ou,(t=Uu())!==u){for(e=[],n=ou,(o=rc())!==u?((a=Gi())===u&&(a=null),a!==u&&(s=rc())!==u&&(i=Uu())!==u?n=o=[o,a,s,i]:(ou=n,n=u)):(ou=n,n=u);n!==u;)e.push(n),n=ou,(o=rc())!==u?((a=Gi())===u&&(a=null),a!==u&&(s=rc())!==u&&(i=Uu())!==u?n=o=[o,a,s,i]:(ou=n,n=u)):(ou=n,n=u);e!==u?(uu=r,t=Tc(t,e),r=t):(ou=r,r=u)}else ou=r,r=u;return r}())===u&&(i=null),i!==u&&rc()!==u?((c=function(){var t,e,n,o;t=ou,"ignore"===r.substr(ou,6).toLowerCase()?(e=r.substr(ou,6),ou+=6):(e=u,0===cu&&bu(Oe));e!==u?(n=ou,cu++,o=ns(),cu--,o===u?n=void 0:(ou=n,n=u),n!==u?t=e=[e,n]:(ou=t,t=u)):(ou=t,t=u);return t}())===u&&(c=Ms()),c===u&&(c=null),c!==u&&rc()!==u?((f=Ws())===u&&(f=null),f!==u&&rc()!==u?((p=Lu())===u&&(p=null),p!==u?(uu=t,v=e,b=n,y=o,h=s,m=i,w=c,L=f,C=p,(d=a)&&d.forEach(r=>Nc.add(`create::${r.db}::${r.table}`)),e={tableList:Array.from(Nc),columnList:Ic(Oc),ast:{type:v[0].toLowerCase(),keyword:"table",temporary:b&&b[0].toLowerCase(),if_not_exists:y,table:d,ignore_replace:w&&w[0].toLowerCase(),as:L&&L[0].toLowerCase(),query_expr:C&&C.ast,create_definitions:h,table_options:m}},t=e):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u);var v,b,y,d,h,m,w,L,C;t===u&&(t=ou,(e=Os())!==u&&rc()!==u?((n=Rs())===u&&(n=null),n!==u&&rc()!==u&&qs()!==u&&rc()!==u?((o=Cu())===u&&(o=null),o!==u&&rc()!==u&&(a=ra())!==u&&rc()!==u&&(s=function r(){var t,e;(t=function(){var r,t;r=ou,ui()!==u&&rc()!==u&&(t=ra())!==u?(uu=r,r={type:"like",table:t}):(ou=r,r=u);return r}())===u&&(t=ou,Yi()!==u&&rc()!==u&&(e=r())!==u&&rc()!==u&&Vi()!==u?(uu=t,(n=e).parentheses=!0,t=n):(ou=t,t=u));var n;return t}())!==u?(uu=t,e=function(r,t,e,n,o){return n&&n.forEach(r=>Nc.add(`create::${r.db}::${r.table}`)),{tableList:Array.from(Nc),columnList:Ic(Oc),ast:{type:r[0].toLowerCase(),keyword:"table",temporary:t&&t[0].toLowerCase(),if_not_exists:e,table:n,like:o}}}(e,n,o,a,s),t=e):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u));return t}())===u&&(t=function(){var t,e,n,o,a,s;t=ou,(e=Os())!==u&&rc()!==u?((n=function(){var t,e,n,o;t=ou,"database"===r.substr(ou,8).toLowerCase()?(e=r.substr(ou,8),ou+=8):(e=u,0===cu&&bu(We));e!==u?(n=ou,cu++,o=ns(),cu--,o===u?n=void 0:(ou=n,n=u),n!==u?(uu=t,t=e="DATABASE"):(ou=t,t=u)):(ou=t,t=u);return t}())===u&&(n=function(){var t,e,n,o;t=ou,"schema"===r.substr(ou,6).toLowerCase()?(e=r.substr(ou,6),ou+=6):(e=u,0===cu&&bu(qe));e!==u?(n=ou,cu++,o=ns(),cu--,o===u?n=void 0:(ou=n,n=u),n!==u?(uu=t,t=e="SCHEMA"):(ou=t,t=u)):(ou=t,t=u);return t}()),n!==u&&rc()!==u?((o=Cu())===u&&(o=null),o!==u&&rc()!==u&&(a=vc())!==u&&rc()!==u?((s=function(){var r,t,e,n,o,a;if(r=ou,(t=Ru())!==u){for(e=[],n=ou,(o=rc())!==u&&(a=Ru())!==u?n=o=[o,a]:(ou=n,n=u);n!==u;)e.push(n),n=ou,(o=rc())!==u&&(a=Ru())!==u?n=o=[o,a]:(ou=n,n=u);e!==u?(uu=r,t=i(t,e),r=t):(ou=r,r=u)}else ou=r,r=u;return r}())===u&&(s=null),s!==u?(uu=t,e=function(r,t,e,n,o){const u=t.toLowerCase();return{tableList:Array.from(Nc),columnList:Ic(Oc),ast:{type:r[0].toLowerCase(),keyword:u,if_not_exists:e,[u]:{db:n.schema,schema:n.name},create_definitions:o}}}(e,n,o,a,s),t=e):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u);return t}());return t}())===u&&(t=function(){var t,e,n,o;t=ou,(e=function(){var t,e,n,o;t=ou,"truncate"===r.substr(ou,8).toLowerCase()?(e=r.substr(ou,8),ou+=8):(e=u,0===cu&&bu(io));e!==u?(n=ou,cu++,o=ns(),cu--,o===u?n=void 0:(ou=n,n=u),n!==u?(uu=t,t=e="TRUNCATE"):(ou=t,t=u)):(ou=t,t=u);return t}())!==u&&rc()!==u?((n=qs())===u&&(n=null),n!==u&&rc()!==u&&(o=ra())!==u?(uu=t,a=e,s=n,(i=o)&&i.forEach(r=>Nc.add(`${a}::${r.db}::${r.table}`)),e={tableList:Array.from(Nc),columnList:Ic(Oc),ast:{type:a.toLowerCase(),keyword:s&&s.toLowerCase()||"table",name:i}},t=e):(ou=t,t=u)):(ou=t,t=u);var a,s,i;return t}())===u&&(t=function(){var r,t,e;r=ou,(t=Ds())!==u&&rc()!==u&&qs()!==u&&rc()!==u&&(e=function(){var r,t,e,n,o,a,s,i;if(r=ou,(t=Ku())!==u){for(e=[],n=ou,(o=rc())!==u&&(a=Gi())!==u&&(s=rc())!==u&&(i=Ku())!==u?n=o=[o,a,s,i]:(ou=n,n=u);n!==u;)e.push(n),n=ou,(o=rc())!==u&&(a=Gi())!==u&&(s=rc())!==u&&(i=Ku())!==u?n=o=[o,a,s,i]:(ou=n,n=u);e!==u?(uu=r,t=l(t,e),r=t):(ou=r,r=u)}else ou=r,r=u;return r}())!==u?(uu=r,(n=e).forEach(r=>r.forEach(r=>r.table&&Nc.add(`rename::${r.db}::${r.table}`))),t={tableList:Array.from(Nc),columnList:Ic(Oc),ast:{type:"rename",table:n}},r=t):(ou=r,r=u);var n;return r}())===u&&(t=function(){var t,e,n;t=ou,(e=function(){var t,e,n,o;t=ou,"call"===r.substr(ou,4).toLowerCase()?(e=r.substr(ou,4),ou+=4):(e=u,0===cu&&bu(Sn));e!==u?(n=ou,cu++,o=ns(),cu--,o===u?n=void 0:(ou=n,n=u),n!==u?(uu=t,t=e="CALL"):(ou=t,t=u)):(ou=t,t=u);return t}())!==u&&rc()!==u&&(n=bc())!==u?(uu=t,o=n,e={tableList:Array.from(Nc),columnList:Ic(Oc),ast:{type:"call",expr:o},...Ec()},t=e):(ou=t,t=u);var o;return t}())===u&&(t=function(){var t,e,n;t=ou,(e=function(){var t,e,n,o;t=ou,"use"===r.substr(ou,3).toLowerCase()?(e=r.substr(ou,3),ou+=3):(e=u,0===cu&&bu(Ae));e!==u?(n=ou,cu++,o=ns(),cu--,o===u?n=void 0:(ou=n,n=u),n!==u?t=e=[e,n]:(ou=t,t=u)):(ou=t,t=u);return t}())!==u&&rc()!==u&&(n=Ya())!==u?(uu=t,o=n,Nc.add(`use::${o}::null`),e={tableList:Array.from(Nc),columnList:Ic(Oc),ast:{type:"use",db:o}},t=e):(ou=t,t=u);var o;return t}())===u&&(t=function(){var t,e,n,o;t=ou,(e=function(){var t,e,n,o;t=ou,"alter"===r.substr(ou,5).toLowerCase()?(e=r.substr(ou,5),ou+=5):(e=u,0===cu&&bu(Ee));e!==u?(n=ou,cu++,o=ns(),cu--,o===u?n=void 0:(ou=n,n=u),n!==u?t=e=[e,n]:(ou=t,t=u)):(ou=t,t=u);return t}())!==u&&rc()!==u&&qs()!==u&&rc()!==u&&(n=ra())!==u&&rc()!==u&&(o=function(){var r,t,e,n,o,a,s,i;if(r=ou,(t=_u())!==u){for(e=[],n=ou,(o=rc())!==u&&(a=Gi())!==u&&(s=rc())!==u&&(i=_u())!==u?n=o=[o,a,s,i]:(ou=n,n=u);n!==u;)e.push(n),n=ou,(o=rc())!==u&&(a=Gi())!==u&&(s=rc())!==u&&(i=_u())!==u?n=o=[o,a,s,i]:(ou=n,n=u);e!==u?(uu=r,t=l(t,e),r=t):(ou=r,r=u)}else ou=r,r=u;return r}())!==u?(uu=t,s=o,(a=n)&&a.length>0&&a.forEach(r=>Nc.add(`alter::${r.db}::${r.table}`)),e={tableList:Array.from(Nc),columnList:Ic(Oc),ast:{type:"alter",table:a,expr:s}},t=e):(ou=t,t=u);var a,s;return t}())===u&&(t=function(){var t,e,n,o;t=ou,(e=$s())!==u&&rc()!==u?((n=function(){var t,e,n,o;t=ou,"global"===r.substr(ou,6).toLowerCase()?(e=r.substr(ou,6),ou+=6):(e=u,0===cu&&bu(mo));e!==u?(n=ou,cu++,o=ns(),cu--,o===u?n=void 0:(ou=n,n=u),n!==u?(uu=t,t=e="GLOBAL"):(ou=t,t=u)):(ou=t,t=u);return t}())===u&&(n=function(){var t,e,n,o;t=ou,"session"===r.substr(ou,7).toLowerCase()?(e=r.substr(ou,7),ou+=7):(e=u,0===cu&&bu(wo));e!==u?(n=ou,cu++,o=ns(),cu--,o===u?n=void 0:(ou=n,n=u),n!==u?(uu=t,t=e="SESSION"):(ou=t,t=u)):(ou=t,t=u);return t}())===u&&(n=function(){var t,e,n,o;t=ou,"local"===r.substr(ou,5).toLowerCase()?(e=r.substr(ou,5),ou+=5):(e=u,0===cu&&bu(er));e!==u?(n=ou,cu++,o=ns(),cu--,o===u?n=void 0:(ou=n,n=u),n!==u?(uu=t,t=e="LOCAL"):(ou=t,t=u)):(ou=t,t=u);return t}())===u&&(n=function(){var t,e,n,o;t=ou,"persist"===r.substr(ou,7).toLowerCase()?(e=r.substr(ou,7),ou+=7):(e=u,0===cu&&bu(Lo));e!==u?(n=ou,cu++,o=ns(),cu--,o===u?n=void 0:(ou=n,n=u),n!==u?(uu=t,t=e="PERSIST"):(ou=t,t=u)):(ou=t,t=u);return t}())===u&&(n=function(){var t,e,n,o;t=ou,"persist_only"===r.substr(ou,12).toLowerCase()?(e=r.substr(ou,12),ou+=12):(e=u,0===cu&&bu(Co));e!==u?(n=ou,cu++,o=ns(),cu--,o===u?n=void 0:(ou=n,n=u),n!==u?(uu=t,t=e="PERSIST_ONLY"):(ou=t,t=u)):(ou=t,t=u);return t}()),n===u&&(n=null),n!==u&&rc()!==u&&(o=function(){var r,t,e,n,o,a,s,i;if(r=ou,(t=ic())!==u){for(e=[],n=ou,(o=rc())!==u&&(a=Gi())!==u&&(s=rc())!==u&&(i=ic())!==u?n=o=[o,a,s,i]:(ou=n,n=u);n!==u;)e.push(n),n=ou,(o=rc())!==u&&(a=Gi())!==u&&(s=rc())!==u&&(i=ic())!==u?n=o=[o,a,s,i]:(ou=n,n=u);e!==u?(uu=r,t=ur(t,e),r=t):(ou=r,r=u)}else ou=r,r=u;return r}())!==u?(uu=t,a=n,(s=o).keyword=a,e={tableList:Array.from(Nc),columnList:Ic(Oc),ast:{type:"set",keyword:a,expr:s}},t=e):(ou=t,t=u)):(ou=t,t=u);var a,s;return t}())===u&&(t=function(){var t,e,n;t=ou,(e=function(){var t,e,n,o;t=ou,"lock"===r.substr(ou,4).toLowerCase()?(e=r.substr(ou,4),ou+=4):(e=u,0===cu&&bu(_));e!==u?(n=ou,cu++,o=ns(),cu--,o===u?n=void 0:(ou=n,n=u),n!==u?t=e=[e,n]:(ou=t,t=u)):(ou=t,t=u);return t}())!==u&&rc()!==u&&Gs()!==u&&rc()!==u&&(n=function(){var r,t,e,n,o,a,s,i;if(r=ou,(t=Mu())!==u){for(e=[],n=ou,(o=rc())!==u&&(a=Gi())!==u&&(s=rc())!==u&&(i=Mu())!==u?n=o=[o,a,s,i]:(ou=n,n=u);n!==u;)e.push(n),n=ou,(o=rc())!==u&&(a=Gi())!==u&&(s=rc())!==u&&(i=Mu())!==u?n=o=[o,a,s,i]:(ou=n,n=u);e!==u?(uu=r,t=ur(t,e),r=t):(ou=r,r=u)}else ou=r,r=u;return r}())!==u?(uu=t,o=n,e={tableList:Array.from(Nc),columnList:Ic(Oc),ast:{type:"lock",keyword:"tables",tables:o}},t=e):(ou=t,t=u);var o;return t}())===u&&(t=function(){var t,e;t=ou,(e=function(){var t,e,n,o;t=ou,"unlock"===r.substr(ou,6).toLowerCase()?(e=r.substr(ou,6),ou+=6):(e=u,0===cu&&bu(Pe));e!==u?(n=ou,cu++,o=ns(),cu--,o===u?n=void 0:(ou=n,n=u),n!==u?t=e=[e,n]:(ou=t,t=u)):(ou=t,t=u);return t}())!==u&&rc()!==u&&Gs()!==u?(uu=t,e={tableList:Array.from(Nc),columnList:Ic(Oc),ast:{type:"unlock",keyword:"tables"}},t=e):(ou=t,t=u);return t}()),t}function mu(){var t;return(t=Lu())===u&&(t=function(){var r,t,e,n,o;r=ou,(t=Ns())!==u&&rc()!==u&&(e=ra())!==u&&rc()!==u&&$s()!==u&&rc()!==u&&(n=function(){var r,t,e,n,o,a,s,i;if(r=ou,(t=ma())!==u){for(e=[],n=ou,(o=rc())!==u&&(a=Gi())!==u&&(s=rc())!==u&&(i=ma())!==u?n=o=[o,a,s,i]:(ou=n,n=u);n!==u;)e.push(n),n=ou,(o=rc())!==u&&(a=Gi())!==u&&(s=rc())!==u&&(i=ma())!==u?n=o=[o,a,s,i]:(ou=n,n=u);e!==u?(uu=r,t=l(t,e),r=t):(ou=r,r=u)}else ou=r,r=u;return r}())!==u&&rc()!==u?((o=sa())===u&&(o=null),o!==u?(uu=r,t=function(r,t,e){const n={};return r&&r.forEach(r=>{const{db:t,as:e,table:o,join:u}=r,a=u?"select":"update";t&&(n[o]=t),o&&Nc.add(`${a}::${t}::${o}`)}),t&&t.forEach(r=>{if(r.table){const t=xc(r.table);Nc.add(`update::${n[t]||null}::${t}`)}Oc.add(`update::${r.table}::${r.column}`)}),{tableList:Array.from(Nc),columnList:Ic(Oc),ast:{type:"update",table:r,set:t,where:e}}}(e,n,o),r=t):(ou=r,r=u)):(ou=r,r=u);return r}())===u&&(t=function(){var r,t,e,n,o,a,s,i;r=ou,(t=Ca())!==u&&rc()!==u&&(e=Fs())!==u&&rc()!==u?((n=qs())===u&&(n=null),n!==u&&rc()!==u&&(o=oa())!==u?((a=La())===u&&(a=null),a!==u&&rc()!==u&&Yi()!==u&&rc()!==u&&(s=function(){var r,t,e,n,o,a,s,i;if(r=ou,(t=rs())!==u){for(e=[],n=ou,(o=rc())!==u&&(a=Gi())!==u&&(s=rc())!==u&&(i=rs())!==u?n=o=[o,a,s,i]:(ou=n,n=u);n!==u;)e.push(n),n=ou,(o=rc())!==u&&(a=Gi())!==u&&(s=rc())!==u&&(i=rs())!==u?n=o=[o,a,s,i]:(ou=n,n=u);e!==u?(uu=r,t=l(t,e),r=t):(ou=r,r=u)}else ou=r,r=u;return r}())!==u&&rc()!==u&&Vi()!==u&&rc()!==u&&(i=wa())!==u?(uu=r,t=function(r,t,e,n,o,u,a){if(n&&(Nc.add(`insert::${n.db}::${n.table}`),n.as=null),u){let r=n&&n.table||null;Array.isArray(a.values)&&a.values.forEach((r,t)=>{if(r.value.length!=u.length)throw new Error("Error: column count doesn't match value count at row "+(t+1))}),u.forEach(t=>Oc.add(`insert::${r}::${t}`))}const s=e?" "+e.toLowerCase():"";return{tableList:Array.from(Nc),columnList:Ic(Oc),ast:{type:r,prefix:`${t.toLowerCase()}${s}`,table:[n],columns:u,values:a,partition:o}}}(t,e,n,o,a,s,i),r=t):(ou=r,r=u)):(ou=r,r=u)):(ou=r,r=u);return r}())===u&&(t=function(){var t,e,n,o,a,s,i;t=ou,(e=Ca())!==u&&rc()!==u?((n=Fs())===u&&(n=function(){var t,e,n,o;t=ou,"overwrite"===r.substr(ou,9).toLowerCase()?(e=r.substr(ou,9),ou+=9):(e=u,0===cu&&bu(Me));e!==u?(n=ou,cu++,o=ns(),cu--,o===u?n=void 0:(ou=n,n=u),n!==u?(uu=t,t=e="OVERWRITE"):(ou=t,t=u)):(ou=t,t=u);return t}()),n!==u&&rc()!==u?((o=qs())===u&&(o=null),o!==u&&rc()!==u&&(a=oa())!==u&&rc()!==u?((s=La())===u&&(s=null),s!==u&&rc()!==u&&(i=wa())!==u?(uu=t,e=function(r,t,e,n,o,u){n&&(Nc.add(`insert::${n.db}::${n.table}`),Oc.add(`insert::${n.table}::(.*)`),n.as=null);const a=e?" "+e.toLowerCase():"";return{tableList:Array.from(Nc),columnList:Ic(Oc),ast:{type:r,prefix:`${t.toLowerCase()}${a}`,table:[n],columns:null,values:u,partition:o}}}(e,n,o,a,s,i),t=e):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u);return t}())===u&&(t=function(){var r,t,e,n,o;r=ou,(t=Us())!==u&&rc()!==u?((e=ra())===u&&(e=null),e!==u&&rc()!==u&&(n=Xu())!==u&&rc()!==u?((o=sa())===u&&(o=null),o!==u?(uu=r,t=function(r,t,e){if(t&&t.forEach(r=>{const{db:t,as:e,table:n,join:o}=r,u=o?"select":"delete";n&&Nc.add(`${u}::${t}::${n}`),o||Oc.add(`delete::${n}::(.*)`)}),null===r&&1===t.length){const e=t[0];r=[{db:e.db,table:e.table,as:e.as,addition:!0}]}return{tableList:Array.from(Nc),columnList:Ic(Oc),ast:{type:"delete",table:r,from:t,where:e}}}(e,n,o),r=t):(ou=r,r=u)):(ou=r,r=u)):(ou=r,r=u);return r}())===u&&(t=hu())===u&&(t=function(){var r,t;r=[],t=sc();for(;t!==u;)r.push(t),t=sc();return r}()),t}function wu(){var t,e,n;return t=ou,function(){var t,e,n,o;t=ou,"union"===r.substr(ou,5).toLowerCase()?(e=r.substr(ou,5),ou+=5):(e=u,0===cu&&bu(Ze));e!==u?(n=ou,cu++,o=ns(),cu--,o===u?n=void 0:(ou=n,n=u),n!==u?t=e=[e,n]:(ou=t,t=u)):(ou=t,t=u);return t}()!==u&&rc()!==u?((e=ri())===u&&(e=ti()),e===u&&(e=null),e!==u?(uu=t,t=(n=e)?"union "+n.toLowerCase():"union"):(ou=t,t=u)):(ou=t,t=u),t}function Lu(){var r,t,e,n,o,a,s,i;if(r=ou,(t=Du())!==u){for(e=[],n=ou,(o=rc())!==u&&(a=wu())!==u&&(s=rc())!==u&&(i=Du())!==u?n=o=[o,a,s,i]:(ou=n,n=u);n!==u;)e.push(n),n=ou,(o=rc())!==u&&(a=wu())!==u&&(s=rc())!==u&&(i=Du())!==u?n=o=[o,a,s,i]:(ou=n,n=u);e!==u&&(n=rc())!==u?((o=va())===u&&(o=null),o!==u&&(a=rc())!==u?((s=ha())===u&&(s=null),s!==u?(uu=r,r=t=function(r,t,e,n){t.forEach(r=>r.slice(1,1));let o=r;for(let r=0;r<t.length;r++)o._next=t[r][3],o.set_op=t[r][1],o=o._next;return e&&(r._orderby=e),n&&(r._limit=n),{tableList:Array.from(Nc),columnList:Ic(Oc),ast:r}}(t,e,o,s)):(ou=r,r=u)):(ou=r,r=u)):(ou=r,r=u)}else ou=r,r=u;return r}function Cu(){var t,e;return t=ou,"if"===r.substr(ou,2).toLowerCase()?(e=r.substr(ou,2),ou+=2):(e=u,0===cu&&bu(c)),e!==u&&rc()!==u&&ii()!==u&&rc()!==u&&si()!==u?(uu=t,t=e="IF NOT EXISTS"):(ou=t,t=u),t}function Au(){var t;return(t=gu())===u&&(t=xu())===u&&(t=Iu())===u&&(t=function(){var t;(t=function(){var t,e,n,o,a,s;t=ou,(e=ku())===u&&(e=null);e!==u&&rc()!==u?("primary key"===r.substr(ou,11).toLowerCase()?(n=r.substr(ou,11),ou+=11):(n=u,0===cu&&bu(I)),n!==u&&rc()!==u?((o=zu())===u&&(o=null),o!==u&&rc()!==u&&(a=Fu())!==u&&rc()!==u?((s=Zu())===u&&(s=null),s!==u?(uu=t,c=n,l=o,f=a,p=s,e={constraint:(i=e)&&i.constraint,definition:f,constraint_type:c.toLowerCase(),keyword:i&&i.keyword,index_type:l,resource:"constraint",index_options:p},t=e):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u);var i,c,l,f,p;return t}())===u&&(t=function(){var t,e,n,o,a,s,i,c;t=ou,(e=ku())===u&&(e=null);e!==u&&rc()!==u&&(n=function(){var t,e,n,o;t=ou,"unique"===r.substr(ou,6).toLowerCase()?(e=r.substr(ou,6),ou+=6):(e=u,0===cu&&bu(p));e!==u?(n=ou,cu++,o=ns(),cu--,o===u?n=void 0:(ou=n,n=u),n!==u?(uu=t,t=e="UNIQUE"):(ou=t,t=u)):(ou=t,t=u);return t}())!==u&&rc()!==u?((o=Hi())===u&&(o=$i()),o===u&&(o=null),o!==u&&rc()!==u?((a=rs())===u&&(a=null),a!==u&&rc()!==u?((s=zu())===u&&(s=null),s!==u&&rc()!==u&&(i=Fu())!==u&&rc()!==u?((c=Zu())===u&&(c=null),c!==u?(uu=t,f=n,v=o,b=a,y=s,d=i,h=c,e={constraint:(l=e)&&l.constraint,definition:d,constraint_type:v&&`${f.toLowerCase()} ${v.toLowerCase()}`||f.toLowerCase(),keyword:l&&l.keyword,index_type:y,index:b,resource:"constraint",index_options:h},t=e):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u);var l,f,v,b,y,d,h;return t}())===u&&(t=function(){var t,e,n,o,a,s;t=ou,(e=ku())===u&&(e=null);e!==u&&rc()!==u?("foreign key"===r.substr(ou,11).toLowerCase()?(n=r.substr(ou,11),ou+=11):(n=u,0===cu&&bu(k)),n!==u&&rc()!==u?((o=rs())===u&&(o=null),o!==u&&rc()!==u&&(a=Fu())!==u&&rc()!==u?((s=Nu())===u&&(s=null),s!==u?(uu=t,c=n,l=o,f=a,p=s,e={constraint:(i=e)&&i.constraint,definition:f,constraint_type:c,keyword:i&&i.keyword,index:l,resource:"constraint",reference_definition:p},t=e):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u);var i,c,l,f,p;return t}());return t}()),t}function Eu(){var t,e,n,o;return t=ou,(e=function(){var t,e;t=ou,(e=function(){var t,e,n,o;t=ou,"not null"===r.substr(ou,8).toLowerCase()?(e=r.substr(ou,8),ou+=8):(e=u,0===cu&&bu(he));e!==u?(n=ou,cu++,o=ns(),cu--,o===u?n=void 0:(ou=n,n=u),n!==u?t=e=[e,n]:(ou=t,t=u)):(ou=t,t=u);return t}())!==u&&(uu=t,e={type:"not null",value:"not null"});return t=e}())===u&&(e=hs()),e!==u&&(uu=t,(o=e)&&!o.value&&(o.value="null"),e={nullable:o}),(t=e)===u&&(t=ou,(e=function(){var r,t;r=ou,xs()!==u&&rc()!==u&&(t=Ia())!==u?(uu=r,r={type:"default",value:t}):(ou=r,r=u);return r}())!==u&&(uu=t,e={default_val:e}),(t=e)===u&&(t=ou,"auto_increment"===r.substr(ou,14).toLowerCase()?(e=r.substr(ou,14),ou+=14):(e=u,0===cu&&bu(f)),e!==u&&(uu=t,e={auto_increment:e.toLowerCase()}),(t=e)===u&&(t=ou,"unique"===r.substr(ou,6).toLowerCase()?(e=r.substr(ou,6),ou+=6):(e=u,0===cu&&bu(p)),e!==u&&rc()!==u?("key"===r.substr(ou,3).toLowerCase()?(n=r.substr(ou,3),ou+=3):(n=u,0===cu&&bu(v)),n===u&&(n=null),n!==u?(uu=t,t=e=function(r){const t=["unique"];return r&&t.push(r),{unique:t.join(" ").toLowerCase("")}}(n)):(ou=t,t=u)):(ou=t,t=u),t===u&&(t=ou,"primary"===r.substr(ou,7).toLowerCase()?(e=r.substr(ou,7),ou+=7):(e=u,0===cu&&bu(b)),e===u&&(e=null),e!==u&&rc()!==u?("key"===r.substr(ou,3).toLowerCase()?(n=r.substr(ou,3),ou+=3):(n=u,0===cu&&bu(v)),n!==u?(uu=t,t=e=function(r){const t=[];return r&&t.push("primary"),t.push("key"),{primary_key:t.join(" ").toLowerCase("")}}(e)):(ou=t,t=u)):(ou=t,t=u),t===u&&(t=ou,(e=nc())!==u&&(uu=t,e={comment:e}),(t=e)===u&&(t=ou,(e=ju())!==u&&(uu=t,e={collate:e}),(t=e)===u&&(t=ou,(e=function(){var t,e,n;t=ou,"column_format"===r.substr(ou,13).toLowerCase()?(e=r.substr(ou,13),ou+=13):(e=u,0===cu&&bu(y));e!==u&&rc()!==u?("fixed"===r.substr(ou,5).toLowerCase()?(n=r.substr(ou,5),ou+=5):(n=u,0===cu&&bu(d)),n===u&&("dynamic"===r.substr(ou,7).toLowerCase()?(n=r.substr(ou,7),ou+=7):(n=u,0===cu&&bu(h)),n===u&&("default"===r.substr(ou,7).toLowerCase()?(n=r.substr(ou,7),ou+=7):(n=u,0===cu&&bu(m)))),n!==u?(uu=t,e={type:"column_format",value:n.toLowerCase()},t=e):(ou=t,t=u)):(ou=t,t=u);return t}())!==u&&(uu=t,e={column_format:e}),(t=e)===u&&(t=ou,(e=function(){var t,e,n;t=ou,"storage"===r.substr(ou,7).toLowerCase()?(e=r.substr(ou,7),ou+=7):(e=u,0===cu&&bu(w));e!==u&&rc()!==u?("disk"===r.substr(ou,4).toLowerCase()?(n=r.substr(ou,4),ou+=4):(n=u,0===cu&&bu(L)),n===u&&("memory"===r.substr(ou,6).toLowerCase()?(n=r.substr(ou,6),ou+=6):(n=u,0===cu&&bu(C))),n!==u?(uu=t,e={type:"storage",value:n.toLowerCase()},t=e):(ou=t,t=u)):(ou=t,t=u);return t}())!==u&&(uu=t,e={storage:e}),(t=e)===u&&(t=ou,(e=Nu())!==u&&(uu=t,e={reference_definition:e}),t=e))))))))),t}function gu(){var r,t,e,n,o,a,s;return r=ou,(t=Ga())!==u&&rc()!==u&&(e=mc())!==u&&rc()!==u?((n=function(){var r,t,e,n,o,a;if(r=ou,(t=Eu())!==u)if(rc()!==u){for(e=[],n=ou,(o=rc())!==u&&(a=Eu())!==u?n=o=[o,a]:(ou=n,n=u);n!==u;)e.push(n),n=ou,(o=rc())!==u&&(a=Eu())!==u?n=o=[o,a]:(ou=n,n=u);e!==u?(uu=r,r=t=function(r,t){let e=r;for(let r=0;r<t.length;r++)e={...e,...t[r][1]};return e}(t,e)):(ou=r,r=u)}else ou=r,r=u;else ou=r,r=u;return r}())===u&&(n=null),n!==u?(uu=r,o=t,a=e,s=n,Oc.add(`create::${o.table}::${o.column}`),r=t={column:o,definition:a,resource:"column",...s||{}}):(ou=r,r=u)):(ou=r,r=u),r}function ju(){var r,t,e,n;return r=ou,Bs()!==u&&rc()!==u&&(t=es())!==u&&rc()!==u&&(e=Di())!==u&&rc()!==u&&(n=Ya())!==u?(uu=r,r={type:"collate",keyword:"collate",collate:{name:t,symbol:e,value:n}}):(ou=r,r=u),r===u&&(r=ou,Bs()!==u&&rc()!==u?((t=Di())===u&&(t=null),t!==u&&rc()!==u&&(e=Ya())!==u?(uu=r,r=function(r,t){return{type:"collate",keyword:"collate",collate:{name:t,symbol:r}}}(t,e)):(ou=r,r=u)):(ou=r,r=u)),r}function _u(){var r;return(r=function(){var r,t,e,n;r=ou,(t=Pi())!==u&&rc()!==u?((e=Fi())===u&&(e=null),e!==u&&rc()!==u&&(n=gu())!==u?(uu=r,o=e,a=n,t={action:"add",...a,keyword:o,resource:"column",type:"alter"},r=t):(ou=r,r=u)):(ou=r,r=u);var o,a;return r}())===u&&(r=function(){var r,t,e;r=ou,ks()!==u&&rc()!==u?((t=Fi())===u&&(t=null),t!==u&&rc()!==u&&(e=Ga())!==u?(uu=r,r={action:"drop",column:e,keyword:t,resource:"column",type:"alter"}):(ou=r,r=u)):(ou=r,r=u);return r}())===u&&(r=function(){var r,t,e;r=ou,(t=Pi())!==u&&rc()!==u&&(e=xu())!==u?(uu=r,n=e,t={action:"add",type:"alter",...n},r=t):(ou=r,r=u);var n;return r}())===u&&(r=function(){var r,t,e;r=ou,(t=Pi())!==u&&rc()!==u&&(e=Iu())!==u?(uu=r,n=e,t={action:"add",type:"alter",...n},r=t):(ou=r,r=u);var n;return r}())===u&&(r=function(){var r,t,e,n;r=ou,(t=Ds())!==u&&rc()!==u?((e=Is())===u&&(e=Ws()),e===u&&(e=null),e!==u&&rc()!==u&&(n=Ya())!==u?(uu=r,a=n,t={action:"rename",type:"alter",resource:"table",keyword:(o=e)&&o[0].toLowerCase(),table:a},r=t):(ou=r,r=u)):(ou=r,r=u);var o,a;return r}())===u&&(r=Tu())===u&&(r=Su()),r}function Tu(){var t,e,n,o;return t=ou,"algorithm"===r.substr(ou,9).toLowerCase()?(e=r.substr(ou,9),ou+=9):(e=u,0===cu&&bu(A)),e!==u&&rc()!==u?((n=Di())===u&&(n=null),n!==u&&rc()!==u?("default"===r.substr(ou,7).toLowerCase()?(o=r.substr(ou,7),ou+=7):(o=u,0===cu&&bu(m)),o===u&&("instant"===r.substr(ou,7).toLowerCase()?(o=r.substr(ou,7),ou+=7):(o=u,0===cu&&bu(E)),o===u&&("inplace"===r.substr(ou,7).toLowerCase()?(o=r.substr(ou,7),ou+=7):(o=u,0===cu&&bu(g)),o===u&&("copy"===r.substr(ou,4).toLowerCase()?(o=r.substr(ou,4),ou+=4):(o=u,0===cu&&bu(j))))),o!==u?(uu=t,t=e={type:"alter",keyword:"algorithm",resource:"algorithm",symbol:n,algorithm:o}):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u),t}function Su(){var t,e,n,o;return t=ou,"lock"===r.substr(ou,4).toLowerCase()?(e=r.substr(ou,4),ou+=4):(e=u,0===cu&&bu(_)),e!==u&&rc()!==u?((n=Di())===u&&(n=null),n!==u&&rc()!==u?("default"===r.substr(ou,7).toLowerCase()?(o=r.substr(ou,7),ou+=7):(o=u,0===cu&&bu(m)),o===u&&("none"===r.substr(ou,4).toLowerCase()?(o=r.substr(ou,4),ou+=4):(o=u,0===cu&&bu(T)),o===u&&("shared"===r.substr(ou,6).toLowerCase()?(o=r.substr(ou,6),ou+=6):(o=u,0===cu&&bu(S)),o===u&&("exclusive"===r.substr(ou,9).toLowerCase()?(o=r.substr(ou,9),ou+=9):(o=u,0===cu&&bu(x))))),o!==u?(uu=t,t=e={type:"alter",keyword:"lock",resource:"lock",symbol:n,lock:o}):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u),t}function xu(){var r,t,e,n,o,a,s,i;return r=ou,(t=Hi())===u&&(t=$i()),t!==u&&rc()!==u?((e=rs())===u&&(e=null),e!==u&&rc()!==u?((n=zu())===u&&(n=null),n!==u&&rc()!==u&&(o=Fu())!==u&&rc()!==u?((a=Zu())===u&&(a=null),a!==u&&rc()!==u?(uu=r,s=n,i=a,r=t={index:e,definition:o,keyword:t.toLowerCase(),index_type:s,resource:"index",index_options:i}):(ou=r,r=u)):(ou=r,r=u)):(ou=r,r=u)):(ou=r,r=u),r}function Iu(){var t,e,n,o,a,s,i,c,l;return t=ou,(e=function(){var t,e,n,o;t=ou,"fulltext"===r.substr(ou,8).toLowerCase()?(e=r.substr(ou,8),ou+=8):(e=u,0===cu&&bu(ko));e!==u?(n=ou,cu++,o=ns(),cu--,o===u?n=void 0:(ou=n,n=u),n!==u?(uu=t,t=e="FULLTEXT"):(ou=t,t=u)):(ou=t,t=u);return t}())===u&&(e=function(){var t,e,n,o;t=ou,"spatial"===r.substr(ou,7).toLowerCase()?(e=r.substr(ou,7),ou+=7):(e=u,0===cu&&bu(No));e!==u?(n=ou,cu++,o=ns(),cu--,o===u?n=void 0:(ou=n,n=u),n!==u?(uu=t,t=e="SPATIAL"):(ou=t,t=u)):(ou=t,t=u);return t}()),e!==u&&rc()!==u?((n=Hi())===u&&(n=$i()),n===u&&(n=null),n!==u&&rc()!==u?((o=rs())===u&&(o=null),o!==u&&rc()!==u&&(a=Fu())!==u&&rc()!==u?((s=Zu())===u&&(s=null),s!==u&&rc()!==u?(uu=t,i=e,l=s,t=e={index:o,definition:a,keyword:(c=n)&&`${i.toLowerCase()} ${c.toLowerCase()}`||i.toLowerCase(),index_options:l,resource:"index"}):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u),t}function ku(){var t,e,n,o;return t=ou,(e=function(){var t,e,n,o;t=ou,"constraint"===r.substr(ou,10).toLowerCase()?(e=r.substr(ou,10),ou+=10):(e=u,0===cu&&bu(Ro));e!==u?(n=ou,cu++,o=ns(),cu--,o===u?n=void 0:(ou=n,n=u),n!==u?(uu=t,t=e="CONSTRAINT"):(ou=t,t=u)):(ou=t,t=u);return t}())!==u&&rc()!==u?((n=Ya())===u&&(n=null),n!==u?(uu=t,o=n,t=e={keyword:e.toLowerCase(),constraint:o}):(ou=t,t=u)):(ou=t,t=u),t}function Nu(){var t,e,n,o,a,s,i,c,l,f;return t=ou,(e=function(){var t,e,n,o;t=ou,"references"===r.substr(ou,10).toLowerCase()?(e=r.substr(ou,10),ou+=10):(e=u,0===cu&&bu(Uo));e!==u?(n=ou,cu++,o=ns(),cu--,o===u?n=void 0:(ou=n,n=u),n!==u?(uu=t,t=e="REFERENCES"):(ou=t,t=u)):(ou=t,t=u);return t}())!==u&&rc()!==u&&(n=ra())!==u&&rc()!==u&&(o=Fu())!==u&&rc()!==u?("match full"===r.substr(ou,10).toLowerCase()?(a=r.substr(ou,10),ou+=10):(a=u,0===cu&&bu(N)),a===u&&("match partial"===r.substr(ou,13).toLowerCase()?(a=r.substr(ou,13),ou+=13):(a=u,0===cu&&bu(O)),a===u&&("match simple"===r.substr(ou,12).toLowerCase()?(a=r.substr(ou,12),ou+=12):(a=u,0===cu&&bu(R)))),a===u&&(a=null),a!==u&&rc()!==u?((s=Ou())===u&&(s=null),s!==u&&rc()!==u?((i=Ou())===u&&(i=null),i!==u?(uu=t,c=a,l=s,f=i,t=e={definition:o,table:n,keyword:e.toLowerCase(),match:c&&c.toLowerCase(),on_action:[l,f].filter(r=>r)}):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u),t===u&&(t=ou,(e=Ou())!==u&&(uu=t,e={on_action:[e]}),t=e),t}function Ou(){var t,e,n,o;return t=ou,Ys()!==u&&rc()!==u?((e=Us())===u&&(e=Ns()),e!==u&&rc()!==u&&(n=function(){var t,e,n;t=ou,(e=Ui())!==u&&rc()!==u&&Yi()!==u&&rc()!==u?((n=ga())===u&&(n=null),n!==u&&rc()!==u&&Vi()!==u?(uu=t,t=e={type:"function",name:{name:[{type:"origin",value:e}]},args:n}):(ou=t,t=u)):(ou=t,t=u);t===u&&(t=ou,"restrict"===r.substr(ou,8).toLowerCase()?(e=r.substr(ou,8),ou+=8):(e=u,0===cu&&bu(U)),e===u&&("cascade"===r.substr(ou,7).toLowerCase()?(e=r.substr(ou,7),ou+=7):(e=u,0===cu&&bu(M)),e===u&&("set null"===r.substr(ou,8).toLowerCase()?(e=r.substr(ou,8),ou+=8):(e=u,0===cu&&bu(D)),e===u&&("no action"===r.substr(ou,9).toLowerCase()?(e=r.substr(ou,9),ou+=9):(e=u,0===cu&&bu(P)),e===u&&("set default"===r.substr(ou,11).toLowerCase()?(e=r.substr(ou,11),ou+=11):(e=u,0===cu&&bu(F)),e===u&&(e=Ui()))))),e!==u&&(uu=t,e={type:"origin",value:e.toLowerCase()}),t=e);return t}())!==u?(uu=t,o=n,t={type:"on "+e[0].toLowerCase(),value:o}):(ou=t,t=u)):(ou=t,t=u),t}function Ru(){var t,e,n,o,a,s,i,c,l;return t=ou,(e=xs())===u&&(e=null),e!==u&&rc()!==u?((n=function(){var t,e,n;return t=ou,"character"===r.substr(ou,9).toLowerCase()?(e=r.substr(ou,9),ou+=9):(e=u,0===cu&&bu(H)),e!==u&&rc()!==u?("set"===r.substr(ou,3).toLowerCase()?(n=r.substr(ou,3),ou+=3):(n=u,0===cu&&bu($)),n!==u?(uu=t,t=e="CHARACTER SET"):(ou=t,t=u)):(ou=t,t=u),t}())===u&&("charset"===r.substr(ou,7).toLowerCase()?(n=r.substr(ou,7),ou+=7):(n=u,0===cu&&bu(W)),n===u&&("collate"===r.substr(ou,7).toLowerCase()?(n=r.substr(ou,7),ou+=7):(n=u,0===cu&&bu(q)))),n!==u&&rc()!==u?((o=Di())===u&&(o=null),o!==u&&rc()!==u&&(a=Ba())!==u?(uu=t,i=n,c=o,l=a,t=e={keyword:(s=e)&&`${s[0].toLowerCase()} ${i.toLowerCase()}`||i.toLowerCase(),symbol:c,value:l}):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u),t}function Uu(){var t,e,n,o,a,s,i,c,l;return t=ou,"auto_increment"===r.substr(ou,14).toLowerCase()?(e=r.substr(ou,14),ou+=14):(e=u,0===cu&&bu(f)),e===u&&("avg_row_length"===r.substr(ou,14).toLowerCase()?(e=r.substr(ou,14),ou+=14):(e=u,0===cu&&bu(G)),e===u&&("key_block_size"===r.substr(ou,14).toLowerCase()?(e=r.substr(ou,14),ou+=14):(e=u,0===cu&&bu(B)),e===u&&("max_rows"===r.substr(ou,8).toLowerCase()?(e=r.substr(ou,8),ou+=8):(e=u,0===cu&&bu(Y)),e===u&&("min_rows"===r.substr(ou,8).toLowerCase()?(e=r.substr(ou,8),ou+=8):(e=u,0===cu&&bu(V)),e===u&&("stats_sample_pages"===r.substr(ou,18).toLowerCase()?(e=r.substr(ou,18),ou+=18):(e=u,0===cu&&bu(Q))))))),e!==u&&rc()!==u?((n=Di())===u&&(n=null),n!==u&&rc()!==u&&(o=As())!==u?(uu=t,c=n,l=o,t=e={keyword:e.toLowerCase(),symbol:c,value:l.value}):(ou=t,t=u)):(ou=t,t=u),t===u&&(t=Ru())===u&&(t=ou,(e=Wi())===u&&("connection"===r.substr(ou,10).toLowerCase()?(e=r.substr(ou,10),ou+=10):(e=u,0===cu&&bu(X))),e!==u&&rc()!==u?((n=Di())===u&&(n=null),n!==u&&rc()!==u&&(o=ms())!==u?(uu=t,t=e=function(r,t,e){return{keyword:r.toLowerCase(),symbol:t,value:`'${e.value}'`}}(e,n,o)):(ou=t,t=u)):(ou=t,t=u),t===u&&(t=ou,"compression"===r.substr(ou,11).toLowerCase()?(e=r.substr(ou,11),ou+=11):(e=u,0===cu&&bu(K)),e!==u&&rc()!==u?((n=Di())===u&&(n=null),n!==u&&rc()!==u?(o=ou,39===r.charCodeAt(ou)?(a="'",ou++):(a=u,0===cu&&bu(z)),a!==u?("zlib"===r.substr(ou,4).toLowerCase()?(s=r.substr(ou,4),ou+=4):(s=u,0===cu&&bu(Z)),s===u&&("lz4"===r.substr(ou,3).toLowerCase()?(s=r.substr(ou,3),ou+=3):(s=u,0===cu&&bu(J)),s===u&&("none"===r.substr(ou,4).toLowerCase()?(s=r.substr(ou,4),ou+=4):(s=u,0===cu&&bu(T)))),s!==u?(39===r.charCodeAt(ou)?(i="'",ou++):(i=u,0===cu&&bu(z)),i!==u?o=a=[a,s,i]:(ou=o,o=u)):(ou=o,o=u)):(ou=o,o=u),o!==u?(uu=t,t=e=function(r,t,e){return{keyword:r.toLowerCase(),symbol:t,value:e.join("").toUpperCase()}}(e,n,o)):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u),t===u&&(t=ou,"engine"===r.substr(ou,6).toLowerCase()?(e=r.substr(ou,6),ou+=6):(e=u,0===cu&&bu(rr)),e!==u&&rc()!==u?((n=Di())===u&&(n=null),n!==u&&rc()!==u&&(o=es())!==u?(uu=t,t=e=function(r,t,e){return{keyword:r.toLowerCase(),symbol:t,value:e.toUpperCase()}}(e,n,o)):(ou=t,t=u)):(ou=t,t=u)))),t}function Mu(){var t,e,n,o,a;return t=ou,(e=ea())!==u&&rc()!==u&&(n=function(){var t,e,n;return t=ou,"read"===r.substr(ou,4).toLowerCase()?(e=r.substr(ou,4),ou+=4):(e=u,0===cu&&bu(tr)),e!==u&&rc()!==u?("local"===r.substr(ou,5).toLowerCase()?(n=r.substr(ou,5),ou+=5):(n=u,0===cu&&bu(er)),n===u&&(n=null),n!==u?(uu=t,t=e={type:"read",suffix:n&&"local"}):(ou=t,t=u)):(ou=t,t=u),t===u&&(t=ou,"low_priority"===r.substr(ou,12).toLowerCase()?(e=r.substr(ou,12),ou+=12):(e=u,0===cu&&bu(nr)),e===u&&(e=null),e!==u&&rc()!==u?("write"===r.substr(ou,5).toLowerCase()?(n=r.substr(ou,5),ou+=5):(n=u,0===cu&&bu(or)),n!==u?(uu=t,t=e={type:"write",prefix:e&&"low_priority"}):(ou=t,t=u)):(ou=t,t=u)),t}())!==u?(uu=t,o=e,a=n,Nc.add(`lock::${o.db}::${o.table}`),t=e={table:o,lock_type:a}):(ou=t,t=u),t}function Du(){var t,e,n,o,a,s,i;return(t=function(){var t,e,n,o,a,s,i,c,f,p,v,b;t=ou,(e=rc())!==u?((n=function(){var t,e,n,o,a,s,i,c,f,p,v,b;if(t=ou,(e=zs())!==u)if(rc()!==u)if((n=Pu())!==u){for(o=[],a=ou,(s=rc())!==u&&(i=Gi())!==u&&(c=rc())!==u&&(f=Pu())!==u?a=s=[s,i,c,f]:(ou=a,a=u);a!==u;)o.push(a),a=ou,(s=rc())!==u&&(i=Gi())!==u&&(c=rc())!==u&&(f=Pu())!==u?a=s=[s,i,c,f]:(ou=a,a=u);o!==u?(uu=t,e=l(n,o),t=e):(ou=t,t=u)}else ou=t,t=u;else ou=t,t=u;else ou=t,t=u;if(t===u)if(t=ou,(e=rc())!==u)if(zs()!==u)if((n=rc())!==u)if((o=function(){var t,e,n,o;t=ou,"recursive"===r.substr(ou,9).toLowerCase()?(e=r.substr(ou,9),ou+=9):(e=u,0===cu&&bu(Ie));e!==u?(n=ou,cu++,o=ns(),cu--,o===u?n=void 0:(ou=n,n=u),n!==u?t=e=[e,n]:(ou=t,t=u)):(ou=t,t=u);return t}())!==u)if((a=rc())!==u)if((s=Pu())!==u){for(i=[],c=ou,(f=rc())!==u&&(p=Gi())!==u&&(v=rc())!==u&&(b=Pu())!==u?c=f=[f,p,v,b]:(ou=c,c=u);c!==u;)i.push(c),c=ou,(f=rc())!==u&&(p=Gi())!==u&&(v=rc())!==u&&(b=Pu())!==u?c=f=[f,p,v,b]:(ou=c,c=u);i!==u?(uu=t,d=i,(y=s).recursive=!0,e=Tc(y,d),t=e):(ou=t,t=u)}else ou=t,t=u;else ou=t,t=u;else ou=t,t=u;else ou=t,t=u;else ou=t,t=u;else ou=t,t=u;var y,d;return t}())===u&&(n=null),n!==u&&rc()!==u&&function(){var t,e,n,o;t=ou,"select"===r.substr(ou,6).toLowerCase()?(e=r.substr(ou,6),ou+=6):(e=u,0===cu&&bu(ge));e!==u?(n=ou,cu++,o=ns(),cu--,o===u?n=void 0:(ou=n,n=u),n!==u?t=e=[e,n]:(ou=t,t=u)):(ou=t,t=u);return t}()!==u&&tc()!==u?((o=function(){var r,t,e,n,o,a;if(r=ou,(t=Hu())!==u){for(e=[],n=ou,(o=rc())!==u&&(a=Hu())!==u?n=o=[o,a]:(ou=n,n=u);n!==u;)e.push(n),n=ou,(o=rc())!==u&&(a=Hu())!==u?n=o=[o,a]:(ou=n,n=u);e!==u?(uu=r,t=function(r,t){const e=[r];for(let r=0,n=t.length;r<n;++r)e.push(t[r][1]);return e}(t,e),r=t):(ou=r,r=u)}else ou=r,r=u;return r}())===u&&(o=null),o!==u&&rc()!==u?((a=ti())===u&&(a=null),a!==u&&rc()!==u&&(s=$u())!==u&&rc()!==u?((i=Xu())===u&&(i=null),i!==u&&rc()!==u?((c=sa())===u&&(c=null),c!==u&&rc()!==u?((f=function(){var t,e,n;t=ou,(e=function(){var t,e,n,o;t=ou,"group"===r.substr(ou,5).toLowerCase()?(e=r.substr(ou,5),ou+=5):(e=u,0===cu&&bu(en));e!==u?(n=ou,cu++,o=ns(),cu--,o===u?n=void 0:(ou=n,n=u),n!==u?t=e=[e,n]:(ou=t,t=u)):(ou=t,t=u);return t}())!==u&&rc()!==u&&Zs()!==u&&rc()!==u&&(n=ga())!==u?(uu=t,e={columns:n.value},t=e):(ou=t,t=u);return t}())===u&&(f=null),f!==u&&rc()!==u?((p=function(){var t,e;t=ou,function(){var t,e,n,o;t=ou,"having"===r.substr(ou,6).toLowerCase()?(e=r.substr(ou,6),ou+=6):(e=u,0===cu&&bu(un));e!==u?(n=ou,cu++,o=ns(),cu--,o===u?n=void 0:(ou=n,n=u),n!==u?t=e=[e,n]:(ou=t,t=u)):(ou=t,t=u);return t}()!==u&&rc()!==u&&(e=ka())!==u?(uu=t,t=e):(ou=t,t=u);return t}())===u&&(p=null),p!==u&&rc()!==u?((v=va())===u&&(v=null),v!==u&&rc()!==u?((b=ha())===u&&(b=null),b!==u?(uu=t,e=function(r,t,e,n,o,u,a,s,i,c){if(o){(Array.isArray(o)?o:o.expr).forEach(r=>r.table&&Nc.add(`select::${r.db}::${r.table}`))}return{with:r,type:"select",options:t,distinct:e,columns:n,from:o,where:u,groupby:a,having:s,orderby:i,limit:c}}(n,o,a,s,i,c,f,p,v,b),t=e):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u);return t}())===u&&(t=ou,e=ou,40===r.charCodeAt(ou)?(n="(",ou++):(n=u,0===cu&&bu(ar)),n!==u&&(o=rc())!==u&&(a=Du())!==u&&(s=rc())!==u?(41===r.charCodeAt(ou)?(i=")",ou++):(i=u,0===cu&&bu(sr)),i!==u?e=n=[n,o,a,s,i]:(ou=e,e=u)):(ou=e,e=u),e!==u&&(uu=t,e={...e[2],parentheses_symbol:!0}),t=e),t}function Pu(){var r,t,e,n,o;return r=ou,(t=ms())===u&&(t=es()),t!==u&&rc()!==u?((e=Fu())===u&&(e=null),e!==u&&rc()!==u&&Ws()!==u&&rc()!==u&&Yi()!==u&&rc()!==u&&(n=Lu())!==u&&rc()!==u&&Vi()!==u?(uu=r,"string"==typeof(o=t)&&(o={type:"default",value:o}),r=t={name:o,stmt:n,columns:e}):(ou=r,r=u)):(ou=r,r=u),r}function Fu(){var r,t;return r=ou,Yi()!==u&&rc()!==u&&(t=function(){var r,t,e,n,o,a,s,i;if(r=ou,(t=Ga())!==u){for(e=[],n=ou,(o=rc())!==u&&(a=Gi())!==u&&(s=rc())!==u&&(i=Ga())!==u?n=o=[o,a,s,i]:(ou=n,n=u);n!==u;)e.push(n),n=ou,(o=rc())!==u&&(a=Gi())!==u&&(s=rc())!==u&&(i=Ga())!==u?n=o=[o,a,s,i]:(ou=n,n=u);e!==u?(uu=r,t=l(t,e),r=t):(ou=r,r=u)}else ou=r,r=u;return r}())!==u&&rc()!==u&&Vi()!==u?(uu=r,r=t):(ou=r,r=u),r}function Hu(){var t,e;return t=ou,(e=function(){var t;"sql_calc_found_rows"===r.substr(ou,19).toLowerCase()?(t=r.substr(ou,19),ou+=19):(t=u,0===cu&&bu(Mo));return t}())===u&&((e=function(){var t;"sql_cache"===r.substr(ou,9).toLowerCase()?(t=r.substr(ou,9),ou+=9):(t=u,0===cu&&bu(Do));return t}())===u&&(e=function(){var t;"sql_no_cache"===r.substr(ou,12).toLowerCase()?(t=r.substr(ou,12),ou+=12):(t=u,0===cu&&bu(Po));return t}()),e===u&&(e=function(){var t;"sql_big_result"===r.substr(ou,14).toLowerCase()?(t=r.substr(ou,14),ou+=14):(t=u,0===cu&&bu(Ho));return t}())===u&&(e=function(){var t;"sql_small_result"===r.substr(ou,16).toLowerCase()?(t=r.substr(ou,16),ou+=16):(t=u,0===cu&&bu(Fo));return t}())===u&&(e=function(){var t;"sql_buffer_result"===r.substr(ou,17).toLowerCase()?(t=r.substr(ou,17),ou+=17):(t=u,0===cu&&bu($o));return t}())),e!==u&&(uu=t,e=e),t=e}function $u(){var r,t,e,n,o,a,s,i;if(r=ou,(t=ri())===u&&(t=ou,(e=Bi())!==u?(n=ou,cu++,o=ns(),cu--,o===u?n=void 0:(ou=n,n=u),n!==u?t=e=[e,n]:(ou=t,t=u)):(ou=t,t=u),t===u&&(t=Bi())),t!==u){for(e=[],n=ou,(o=rc())!==u&&(a=Gi())!==u&&(s=rc())!==u&&(i=Bu())!==u?n=o=[o,a,s,i]:(ou=n,n=u);n!==u;)e.push(n),n=ou,(o=rc())!==u&&(a=Gi())!==u&&(s=rc())!==u&&(i=Bu())!==u?n=o=[o,a,s,i]:(ou=n,n=u);e!==u?(uu=r,r=t=function(r,t){Oc.add("select::null::(.*)");const e={expr:{type:"column_ref",table:null,column:"*"},as:null};return t&&t.length>0?Tc(e,t):[e]}(0,e)):(ou=r,r=u)}else ou=r,r=u;if(r===u)if(r=ou,(t=Bu())!==u){for(e=[],n=ou,(o=rc())!==u&&(a=Gi())!==u&&(s=rc())!==u&&(i=Bu())!==u?n=o=[o,a,s,i]:(ou=n,n=u);n!==u;)e.push(n),n=ou,(o=rc())!==u&&(a=Gi())!==u&&(s=rc())!==u&&(i=Bu())!==u?n=o=[o,a,s,i]:(ou=n,n=u);e!==u?(uu=r,r=t=l(t,e)):(ou=r,r=u)}else ou=r,r=u;return r}function Wu(){var t,e,n,o,a,s,i;return t=ou,Qi()!==u&&rc()!==u?((e=As())===u&&(e=ms()),e!==u&&rc()!==u&&Xi()!==u?(n=ou,(o=rc())!==u?(46===r.charCodeAt(ou)?(a=".",ou++):(a=u,0===cu&&bu(ir)),a!==u&&(s=rc())!==u&&(i=Ya())!==u?n=o=[o,a,s,i]:(ou=n,n=u)):(ou=n,n=u),n===u&&(n=null),n!==u?(uu=t,t=function(r,t){let e;return t&&(e={type:"default",value:t[3]}),{brackets:!0,index:r,property:e}}(e,n)):(ou=t,t=u)):(ou=t,t=u)):(ou=t,t=u),t}function qu(){var r,t,e,n,o,a;if(r=ou,(t=Wu())!==u){for(e=[],n=ou,(o=rc())!==u&&(a=Wu())!==u?n=o=[o,a]:(ou=n,n=u);n!==u;)e.push(n),n=ou,(o=rc())!==u&&(a=Wu())!==u?n=o=[o,a]:(ou=n,n=u);e!==u?(uu=r,r=t=i(t,e)):(ou=r,r=u)}else ou=r,r=u;return r}function Gu(){var r,t,e,n,o;return r=ou,(t=function(){var r,t,e,n,o,a,s,i;if(r=ou,(t=Ia())!==u){for(e=[],n=ou,(o=rc())!==u?((a=ci())===u&&(a=li())===u&&(a=Ji()),a!==u&&(s=rc())!==u&&(i=Ia())!==u?n=o=[o,a,s,i]:(ou=n,n=u)):(ou=n,n=u);n!==u;)e.push(n),n=ou,(o=rc())!==u?((a=ci())===u&&(a=li())===u&&(a=Ji()),a!==u&&(s=rc())!==u&&(i=Ia())!==u?n=o=[o,a,s,i]:(ou=n,n=u)):(ou=n,n=u);e!==u?(uu=r,t=function(r,t){const e=r.ast;if(e&&"select"===e.type&&(!(r.parentheses_symbol||r.parentheses||r.ast.parentheses||r.ast.parentheses_symbol)||1!==e.columns.length||"*"===e.columns[0].expr.column))throw new Error("invalid column clause with select statement");if(!t||0===t.length)return r;const n=t.length;let o=t[n-1][3];for(let e=n-1;e>=0;e--){const n=0===e?r:t[e-1][3];o=jc(t[e][1],n,o)}return o}(t,e),r=t):(ou=r,r=u)}else ou=r,r=u;return r}())!==u&&rc()!==u?((e=qu())===u&&(e=null),e!==u?(uu=r,n=t,(o=e)&&(n.array_index=o),r=t=n):(ou=r,r=u)):(ou=r,r=u),r}function Bu(){var r,t,e,n,o,a,s;return r=ou,t=ou,(e=Ya())!==u&&(n=rc())!==u&&(o=qi())!==u?t=e=[e,n,o]:(ou=t,t=u),t===u&&(t=null),t!==u&&(e=rc())!==u&&(n=Bi())!==u?(uu=r,r=t=function(r){const t=r&&r[0]||null;return Oc.add(`select::${t}::(.*)`),{expr:{type:"column_ref",table:t,column:"*"},as:null}}(t)):(ou=r,r=u),r===u&&(r=ou,(t=Gu())!==u&&(e=rc())!==u?((n=Vu())===u&&(n=null),n!==u?(uu=r,s=n,"double_quote_string"!==(a=t).type&&"single_quote_string"!==a.type||Oc.add("select::null::"+a.value),r=t={type:"expr",expr:a,as:s}):(ou=r,r=u)):(ou=r,r=u)),r}function Yu(){var r,t,e;return r=ou,(t=Ws())===u&&(t=null),t!==u&&rc()!==u?((e=vs())===u&&(e=Va()),e!==u?(uu=r,r=t=e):(ou=r,r=u)):(ou=r,r=u),r}function Vu(){var r,t,e;return r=ou,(t=Ws())!==u&&rc()!==u?((e=vs())===u&&(e=Va()),e!==u?(uu=r,r=t=e):(ou=r,r=u)):(ou=r,r=u),r===u&&(r=ou,(t=Ws())===u&&(t=null),t!==u&&rc()!==u&&(e=Ya())!==u?(uu=r,r=t=e):(ou=r,r=u)),r}function Qu(){var t,e,n,o,a;return t=ou,"unnest"===r.substr(ou,6).toLowerCase()?(e=r.substr(ou,6),ou+=6):(e=u,0===cu&&bu(cr)),e!=