@stonecrop/graphql-middleware 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs ADDED
@@ -0,0 +1,192 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("zod"),ce=require("node:fs"),Pe=require("node:path"),de=require("postgraphile/utils"),ge=j.z.enum(["Data","Text","Int","Float","Decimal","Check","Date","Time","Datetime","Duration","DateRange","JSON","Code","Link","Doctype","Attach","Currency","Quantity","Select"]),Ae={Data:{component:"ATextInput",fieldtype:"Data"},Text:{component:"ATextInput",fieldtype:"Text"},Int:{component:"ANumericInput",fieldtype:"Int"},Float:{component:"ANumericInput",fieldtype:"Float"},Decimal:{component:"ADecimalInput",fieldtype:"Decimal"},Check:{component:"ACheckbox",fieldtype:"Check"},Date:{component:"ADatePicker",fieldtype:"Date"},Time:{component:"ATimeInput",fieldtype:"Time"},Datetime:{component:"ADatetimePicker",fieldtype:"Datetime"},Duration:{component:"ADurationInput",fieldtype:"Duration"},DateRange:{component:"ADateRangePicker",fieldtype:"DateRange"},JSON:{component:"ACodeEditor",fieldtype:"JSON"},Code:{component:"ACodeEditor",fieldtype:"Code"},Link:{component:"ALink",fieldtype:"Link"},Doctype:{component:"ATable",fieldtype:"Doctype"},Attach:{component:"AFileAttach",fieldtype:"Attach"},Currency:{component:"ACurrencyInput",fieldtype:"Currency"},Quantity:{component:"AQuantityInput",fieldtype:"Quantity"},Select:{component:"ADropdown",fieldtype:"Select"}};function Fe(y){return Ae[y]?.component??"ATextInput"}const ve=j.z.union([j.z.string(),j.z.array(j.z.string()),j.z.record(j.z.string(),j.z.unknown())]),Ee=j.z.object({errorMessage:j.z.string()}).passthrough(),le=j.z.object({fieldname:j.z.string().min(1),fieldtype:ge,component:j.z.string().optional(),label:j.z.string().optional(),width:j.z.string().optional(),align:j.z.enum(["left","center","right","start","end"]).optional(),required:j.z.boolean().optional(),readOnly:j.z.boolean().optional(),edit:j.z.boolean().optional(),hidden:j.z.boolean().optional(),value:j.z.unknown().optional(),default:j.z.unknown().optional(),options:ve.optional(),mask:j.z.string().optional(),validation:Ee.optional()}),Te=j.z.object({label:j.z.string().min(1),handler:j.z.string().min(1),requiredFields:j.z.array(j.z.string()).optional(),allowedStates:j.z.array(j.z.string()).optional(),confirm:j.z.boolean().optional(),args:j.z.record(j.z.string(),j.z.unknown()).optional()}),Se=j.z.object({states:j.z.array(j.z.string()).optional(),actions:j.z.record(j.z.string(),Te).optional()}),_e=j.z.object({name:j.z.string().min(1),slug:j.z.string().min(1).optional(),tableName:j.z.string().optional(),fields:j.z.array(le),workflow:Se.optional(),inherits:j.z.string().optional(),listDoctype:j.z.string().optional(),parentDoctype:j.z.string().optional()});function Be(y){const _=le.safeParse(y);return _.success?{success:!0,errors:[]}:{success:!1,errors:_.error.issues.map(p=>({path:p.path,message:p.message}))}}function be(y){const _=_e.safeParse(y);return _.success?{success:!0,errors:[]}:{success:!1,errors:_.error.issues.map(p=>({path:p.path,message:p.message}))}}function He(y){return le.parse(y)}function ue(y){return _e.parse(y)}var fe={},me={exports:{}},Ge=me.exports,xe;function We(){return xe||(xe=1,(function(y){(function(_,p){y.exports?y.exports=p():_.moo=p()})(Ge,function(){var _=Object.prototype.hasOwnProperty,p=Object.prototype.toString,h=typeof new RegExp().sticky=="boolean";function l(t){return t&&p.call(t)==="[object RegExp]"}function r(t){return t&&typeof t=="object"&&!l(t)&&!Array.isArray(t)}function n(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function u(t){var c=new RegExp("|"+t);return c.exec("").length-1}function g(t){return"("+t+")"}function x(t){if(!t.length)return"(?!)";var c=t.map(function(f){return"(?:"+f+")"}).join("|");return"(?:"+c+")"}function s(t){if(typeof t=="string")return"(?:"+n(t)+")";if(l(t)){if(t.ignoreCase)throw new Error("RegExp /i flag not allowed");if(t.global)throw new Error("RegExp /g flag is implied");if(t.sticky)throw new Error("RegExp /y flag is implied");if(t.multiline)throw new Error("RegExp /m flag is implied");return t.source}else throw new Error("Not a pattern: "+t)}function $(t,c){return t.length>c?t:Array(c-t.length+1).join(" ")+t}function i(t,c){for(var f=t.length,A=0;;){var q=t.lastIndexOf(`
2
+ `,f-1);if(q===-1||(A++,f=q,A===c)||f===0)break}var R=A<c?0:f+1;return t.substring(R).split(`
3
+ `)}function a(t){for(var c=Object.getOwnPropertyNames(t),f=[],A=0;A<c.length;A++){var q=c[A],R=t[q],O=[].concat(R);if(q==="include"){for(var F=0;F<O.length;F++)f.push({include:O[F]});continue}var z=[];O.forEach(function(I){r(I)?(z.length&&f.push(b(q,z)),f.push(b(q,I)),z=[]):z.push(I)}),z.length&&f.push(b(q,z))}return f}function m(t){for(var c=[],f=0;f<t.length;f++){var A=t[f];if(A.include){for(var q=[].concat(A.include),R=0;R<q.length;R++)c.push({include:q[R]});continue}if(!A.type)throw new Error("Rule has no type: "+JSON.stringify(A));c.push(b(A.type,A))}return c}function b(t,c){if(r(c)||(c={match:c}),c.include)throw new Error("Matching rules cannot also include states");var f={defaultType:t,lineBreaks:!!c.error||!!c.fallback,pop:!1,next:null,push:null,error:!1,fallback:!1,value:null,type:null,shouldThrow:!1};for(var A in c)_.call(c,A)&&(f[A]=c[A]);if(typeof f.type=="string"&&t!==f.type)throw new Error("Type transform cannot be a string (type '"+f.type+"' for token '"+t+"')");var q=f.match;return f.match=Array.isArray(q)?q:q?[q]:[],f.match.sort(function(R,O){return l(R)&&l(O)?0:l(O)?-1:l(R)?1:O.length-R.length}),f}function d(t){return Array.isArray(t)?m(t):a(t)}var E=b("error",{lineBreaks:!0,shouldThrow:!0});function C(t,c){for(var f=null,A=Object.create(null),q=!0,R=null,O=[],F=[],z=0;z<t.length;z++)t[z].fallback&&(q=!1);for(var z=0;z<t.length;z++){var I=t[z];if(I.include)throw new Error("Inheritance is not allowed in stateless lexers");if(I.error||I.fallback){if(f)throw!I.fallback==!f.fallback?new Error("Multiple "+(I.fallback?"fallback":"error")+" rules not allowed (for token '"+I.defaultType+"')"):new Error("fallback and error are mutually exclusive (for token '"+I.defaultType+"')");f=I}var B=I.match.slice();if(q)for(;B.length&&typeof B[0]=="string"&&B[0].length===1;){var X=B.shift();A[X.charCodeAt(0)]=I}if(I.pop||I.push||I.next){if(!c)throw new Error("State-switching options are not allowed in stateless lexers (for token '"+I.defaultType+"')");if(I.fallback)throw new Error("State-switching options are not allowed on fallback tokens (for token '"+I.defaultType+"')")}if(B.length!==0){q=!1,O.push(I);for(var J=0;J<B.length;J++){var Q=B[J];if(l(Q)){if(R===null)R=Q.unicode;else if(R!==Q.unicode&&I.fallback===!1)throw new Error("If one rule is /u then all must be")}}var K=x(B.map(s)),G=new RegExp(K);if(G.test(""))throw new Error("RegExp matches empty string: "+G);var ee=u(K);if(ee>0)throw new Error("RegExp has capture groups: "+G+`
4
+ Use (?: … ) instead`);if(!I.lineBreaks&&G.test(`
5
+ `))throw new Error("Rule should declare lineBreaks: "+G);F.push(g(K))}}var Z=f&&f.fallback,se=h&&!Z?"ym":"gm",ne=h||Z?"":"|";R===!0&&(se+="u");var ze=new RegExp(x(F)+ne,se);return{regexp:ze,groups:O,fast:A,error:f||E}}function L(t){var c=C(d(t));return new N({start:c},"start")}function w(t,c,f){var A=t&&(t.push||t.next);if(A&&!f[A])throw new Error("Missing state '"+A+"' (in token '"+t.defaultType+"' of state '"+c+"')");if(t&&t.pop&&+t.pop!=1)throw new Error("pop must be 1 (in token '"+t.defaultType+"' of state '"+c+"')")}function k(t,c){var f=t.$all?d(t.$all):[];delete t.$all;var A=Object.getOwnPropertyNames(t);c||(c=A[0]);for(var q=Object.create(null),R=0;R<A.length;R++){var O=A[R];q[O]=d(t[O]).concat(f)}for(var R=0;R<A.length;R++)for(var O=A[R],F=q[O],z=Object.create(null),I=0;I<F.length;I++){var B=F[I];if(B.include){var X=[I,1];if(B.include!==O&&!z[B.include]){z[B.include]=!0;var J=q[B.include];if(!J)throw new Error("Cannot include nonexistent state '"+B.include+"' (in state '"+O+"')");for(var Q=0;Q<J.length;Q++){var K=J[Q];F.indexOf(K)===-1&&X.push(K)}}F.splice.apply(F,X),I--}}for(var G=Object.create(null),R=0;R<A.length;R++){var O=A[R];G[O]=C(q[O],!0)}for(var R=0;R<A.length;R++){for(var ee=A[R],Z=G[ee],se=Z.groups,I=0;I<se.length;I++)w(se[I],ee,G);for(var ne=Object.getOwnPropertyNames(Z.fast),I=0;I<ne.length;I++)w(Z.fast[ne[I]],ee,G)}return new N(G,c)}function v(t){for(var c=typeof Map<"u",f=c?new Map:Object.create(null),A=Object.getOwnPropertyNames(t),q=0;q<A.length;q++){var R=A[q],O=t[R],F=Array.isArray(O)?O:[O];F.forEach(function(z){if(typeof z!="string")throw new Error("keyword must be string (in keyword '"+R+"')");c?f.set(z,R):f[z]=R})}return function(z){return c?f.get(z):f[z]}}var N=function(t,c){this.startState=c,this.states=t,this.buffer="",this.stack=[],this.reset()};N.prototype.reset=function(t,c){return this.buffer=t||"",this.index=0,this.line=c?c.line:1,this.col=c?c.col:1,this.queuedToken=c?c.queuedToken:null,this.queuedText=c?c.queuedText:"",this.queuedThrow=c?c.queuedThrow:null,this.setState(c?c.state:this.startState),this.stack=c&&c.stack?c.stack.slice():[],this},N.prototype.save=function(){return{line:this.line,col:this.col,state:this.state,stack:this.stack.slice(),queuedToken:this.queuedToken,queuedText:this.queuedText,queuedThrow:this.queuedThrow}},N.prototype.setState=function(t){if(!(!t||this.state===t)){this.state=t;var c=this.states[t];this.groups=c.groups,this.error=c.error,this.re=c.regexp,this.fast=c.fast}},N.prototype.popState=function(){this.setState(this.stack.pop())},N.prototype.pushState=function(t){this.stack.push(this.state),this.setState(t)};var U=h?function(t,c){return t.exec(c)}:function(t,c){var f=t.exec(c);return f[0].length===0?null:f};N.prototype._getGroup=function(t){for(var c=this.groups.length,f=0;f<c;f++)if(t[f+1]!==void 0)return this.groups[f];throw new Error("Cannot find token type for matched text")};function e(){return this.value}if(N.prototype.next=function(){var t=this.index;if(this.queuedGroup){var c=this._token(this.queuedGroup,this.queuedText,t);return this.queuedGroup=null,this.queuedText="",c}var f=this.buffer;if(t!==f.length){var O=this.fast[f.charCodeAt(t)];if(O)return this._token(O,f.charAt(t),t);var A=this.re;A.lastIndex=t;var q=U(A,f),R=this.error;if(q==null)return this._token(R,f.slice(t,f.length),t);var O=this._getGroup(q),F=q[0];return R.fallback&&q.index!==t?(this.queuedGroup=O,this.queuedText=F,this._token(R,f.slice(t,q.index),t)):this._token(O,F,t)}},N.prototype._token=function(t,c,f){var A=0;if(t.lineBreaks){var q=/\n/g,R=1;if(c===`
6
+ `)A=1;else for(;q.exec(c);)A++,R=q.lastIndex}var O={type:typeof t.type=="function"&&t.type(c)||t.defaultType,value:typeof t.value=="function"?t.value(c):c,text:c,toString:e,offset:f,lineBreaks:A,line:this.line,col:this.col},F=c.length;if(this.index+=F,this.line+=A,A!==0?this.col=F-R+1:this.col+=F,t.shouldThrow){var z=new Error(this.formatError(O,"invalid syntax"));throw z}return t.pop?this.popState():t.push?this.pushState(t.push):t.next&&this.setState(t.next),O},typeof Symbol<"u"&&Symbol.iterator){var o=function(t){this.lexer=t};o.prototype.next=function(){var t=this.lexer.next();return{value:t,done:!t}},o.prototype[Symbol.iterator]=function(){return this},N.prototype[Symbol.iterator]=function(){return new o(this)}}return N.prototype.formatError=function(A,c){if(A==null)var f=this.buffer.slice(this.index),A={text:f,offset:this.index,lineBreaks:f.indexOf(`
7
+ `)===-1?0:1,line:this.line,col:this.col};var q=2,R=Math.max(A.line-q,1),O=A.line+q,F=String(O).length,z=i(this.buffer,this.line-A.line+q+1).slice(0,5),I=[];I.push(c+" at line "+A.line+" col "+A.col+":"),I.push("");for(var B=0;B<z.length;B++){var X=z[B],J=R+B;I.push($(String(J),F)+" "+X),J===A.line&&I.push($("",F+A.col+1)+"^")}return I.join(`
8
+ `)},N.prototype.clone=function(){return new N(this.states,this.state)},N.prototype.has=function(t){return!0},{compile:L,states:k,error:Object.freeze({error:!0}),fallback:Object.freeze({fallback:!0}),keywords:v}})})(me)),me.exports}var ie={exports:{}},Ve=ie.exports,we;function Ye(){return we||(we=1,(function(y){(function(_,p){y.exports?y.exports=p():_.nearley=p()})(Ve,function(){function _(x,s,$){return this.id=++_.highestId,this.name=x,this.symbols=s,this.postprocess=$,this}_.highestId=0,_.prototype.toString=function(x){var s=typeof x>"u"?this.symbols.map(g).join(" "):this.symbols.slice(0,x).map(g).join(" ")+" ● "+this.symbols.slice(x).map(g).join(" ");return this.name+" → "+s};function p(x,s,$,i){this.rule=x,this.dot=s,this.reference=$,this.data=[],this.wantedBy=i,this.isComplete=this.dot===x.symbols.length}p.prototype.toString=function(){return"{"+this.rule.toString(this.dot)+"}, from: "+(this.reference||0)},p.prototype.nextState=function(x){var s=new p(this.rule,this.dot+1,this.reference,this.wantedBy);return s.left=this,s.right=x,s.isComplete&&(s.data=s.build(),s.right=void 0),s},p.prototype.build=function(){var x=[],s=this;do x.push(s.right.data),s=s.left;while(s.left);return x.reverse(),x},p.prototype.finish=function(){this.rule.postprocess&&(this.data=this.rule.postprocess(this.data,this.reference,n.fail))};function h(x,s){this.grammar=x,this.index=s,this.states=[],this.wants={},this.scannable=[],this.completed={}}h.prototype.process=function(x){for(var s=this.states,$=this.wants,i=this.completed,a=0;a<s.length;a++){var m=s[a];if(m.isComplete){if(m.finish(),m.data!==n.fail){for(var b=m.wantedBy,d=b.length;d--;){var E=b[d];this.complete(E,m)}if(m.reference===this.index){var C=m.rule.name;(this.completed[C]=this.completed[C]||[]).push(m)}}}else{var C=m.rule.symbols[m.dot];if(typeof C!="string"){this.scannable.push(m);continue}if($[C]){if($[C].push(m),i.hasOwnProperty(C))for(var L=i[C],d=0;d<L.length;d++){var w=L[d];this.complete(m,w)}}else $[C]=[m],this.predict(C)}}},h.prototype.predict=function(x){for(var s=this.grammar.byName[x]||[],$=0;$<s.length;$++){var i=s[$],a=this.wants[x],m=new p(i,0,this.index,a);this.states.push(m)}},h.prototype.complete=function(x,s){var $=x.nextState(s);this.states.push($)};function l(x,s){this.rules=x,this.start=s||this.rules[0].name;var $=this.byName={};this.rules.forEach(function(i){$.hasOwnProperty(i.name)||($[i.name]=[]),$[i.name].push(i)})}l.fromCompiled=function(i,s){var $=i.Lexer;i.ParserStart&&(s=i.ParserStart,i=i.ParserRules);var i=i.map(function(m){return new _(m.name,m.symbols,m.postprocess)}),a=new l(i,s);return a.lexer=$,a};function r(){this.reset("")}r.prototype.reset=function(x,s){this.buffer=x,this.index=0,this.line=s?s.line:1,this.lastLineBreak=s?-s.col:0},r.prototype.next=function(){if(this.index<this.buffer.length){var x=this.buffer[this.index++];return x===`
9
+ `&&(this.line+=1,this.lastLineBreak=this.index),{value:x}}},r.prototype.save=function(){return{line:this.line,col:this.index-this.lastLineBreak}},r.prototype.formatError=function(x,s){var $=this.buffer;if(typeof $=="string"){var i=$.split(`
10
+ `).slice(Math.max(0,this.line-5),this.line),a=$.indexOf(`
11
+ `,this.index);a===-1&&(a=$.length);var m=this.index-this.lastLineBreak,b=String(this.line).length;return s+=" at line "+this.line+" col "+m+`:
12
+
13
+ `,s+=i.map(function(E,C){return d(this.line-i.length+C+1,b)+" "+E},this).join(`
14
+ `),s+=`
15
+ `+d("",b+m)+`^
16
+ `,s}else return s+" at index "+(this.index-1);function d(E,C){var L=String(E);return Array(C-L.length+1).join(" ")+L}};function n(x,s,i){if(x instanceof l)var a=x,i=s;else var a=l.fromCompiled(x,s);this.grammar=a,this.options={keepHistory:!1,lexer:a.lexer||new r};for(var m in i||{})this.options[m]=i[m];this.lexer=this.options.lexer,this.lexerState=void 0;var b=new h(a,0);this.table=[b],b.wants[a.start]=[],b.predict(a.start),b.process(),this.current=0}n.fail={},n.prototype.feed=function(x){var s=this.lexer;s.reset(x,this.lexerState);for(var $;;){try{if($=s.next(),!$)break}catch(N){var b=new h(this.grammar,this.current+1);this.table.push(b);var i=new Error(this.reportLexerError(N));throw i.offset=this.current,i.token=N.token,i}var a=this.table[this.current];this.options.keepHistory||delete this.table[this.current-1];var m=this.current+1,b=new h(this.grammar,m);this.table.push(b);for(var d=$.text!==void 0?$.text:$.value,E=s.constructor===r?$.value:$,C=a.scannable,L=C.length;L--;){var w=C[L],k=w.rule.symbols[w.dot];if(k.test?k.test(E):k.type?k.type===$.type:k.literal===d){var v=w.nextState({data:E,token:$,isToken:!0,reference:m-1});b.states.push(v)}}if(b.process(),b.states.length===0){var i=new Error(this.reportError($));throw i.offset=this.current,i.token=$,i}this.options.keepHistory&&(a.lexerState=s.save()),this.current++}return a&&(this.lexerState=s.save()),this.results=this.finish(),this},n.prototype.reportLexerError=function(x){var s,$,i=x.token;return i?(s="input "+JSON.stringify(i.text[0])+" (lexer error)",$=this.lexer.formatError(i,"Syntax error")):(s="input (lexer error)",$=x.message),this.reportErrorCommon($,s)},n.prototype.reportError=function(x){var s=(x.type?x.type+" token: ":"")+JSON.stringify(x.value!==void 0?x.value:x),$=this.lexer.formatError(x,"Syntax error");return this.reportErrorCommon($,s)},n.prototype.reportErrorCommon=function(x,s){var $=[];$.push(x);var i=this.table.length-2,a=this.table[i],m=a.states.filter(function(d){var E=d.rule.symbols[d.dot];return E&&typeof E!="string"});if(m.length===0)$.push("Unexpected "+s+`. I did not expect any more input. Here is the state of my parse table:
17
+ `),this.displayStateStack(a.states,$);else{$.push("Unexpected "+s+`. Instead, I was expecting to see one of the following:
18
+ `);var b=m.map(function(d){return this.buildFirstStateStack(d,[])||[d]},this);b.forEach(function(d){var E=d[0],C=E.rule.symbols[E.dot],L=this.getSymbolDisplay(C);$.push("A "+L+" based on:"),this.displayStateStack(d,$)},this)}return $.push(""),$.join(`
19
+ `)},n.prototype.displayStateStack=function(x,s){for(var $,i=0,a=0;a<x.length;a++){var m=x[a],b=m.rule.toString(m.dot);b===$?i++:(i>0&&s.push(" ^ "+i+" more lines identical to this"),i=0,s.push(" "+b)),$=b}},n.prototype.getSymbolDisplay=function(x){return u(x)},n.prototype.buildFirstStateStack=function(x,s){if(s.indexOf(x)!==-1)return null;if(x.wantedBy.length===0)return[x];var $=x.wantedBy[0],i=[x].concat(s),a=this.buildFirstStateStack($,i);return a===null?null:[x].concat(a)},n.prototype.save=function(){var x=this.table[this.current];return x.lexerState=this.lexerState,x},n.prototype.restore=function(x){var s=x.index;this.current=s,this.table[s]=x,this.table.splice(s+1),this.lexerState=x.lexerState,this.results=this.finish()},n.prototype.rewind=function(x){if(!this.options.keepHistory)throw new Error("set option `keepHistory` to enable rewinding");this.restore(this.table[x])},n.prototype.finish=function(){var x=[],s=this.grammar.start,$=this.table[this.table.length-1];return $.states.forEach(function(i){i.rule.name===s&&i.dot===i.rule.symbols.length&&i.reference===0&&i.data!==n.fail&&x.push(i)}),x.map(function(i){return i.data})};function u(x){var s=typeof x;if(s==="string")return x;if(s==="object"){if(x.literal)return JSON.stringify(x.literal);if(x instanceof RegExp)return"character matching "+x;if(x.type)return x.type+" token";if(x.test)return"token matching "+String(x.test);throw new Error("Unknown symbol type: "+x)}}function g(x){var s=typeof x;if(s==="string")return x;if(s==="object"){if(x.literal)return JSON.stringify(x.literal);if(x instanceof RegExp)return x.toString();if(x.type)return"%"+x.type;if(x.test)return"<"+String(x.test)+">";throw new Error("Unknown symbol type: "+x)}}return{Parser:n,Grammar:l,Rule:_}})})(ie)),ie.exports}var he;function Je(){return he||(he=1,(function(y){(function(_,p){for(var h in p)_[h]=p[h]})(y,(function(_){var p={};function h(l){if(p[l])return p[l].exports;var r=p[l]={i:l,l:!1,exports:{}};return _[l].call(r.exports,r,r.exports,h),r.l=!0,r.exports}return h.m=_,h.c=p,h.d=function(l,r,n){h.o(l,r)||Object.defineProperty(l,r,{enumerable:!0,get:n})},h.r=function(l){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(l,"__esModule",{value:!0})},h.t=function(l,r){if(r&1&&(l=h(l)),r&8||r&4&&typeof l=="object"&&l&&l.__esModule)return l;var n=Object.create(null);if(h.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:l}),r&2&&typeof l!="string")for(var u in l)h.d(n,u,(function(g){return l[g]}).bind(null,u));return n},h.n=function(l){var r=l&&l.__esModule?(function(){return l.default}):(function(){return l});return h.d(r,"a",r),r},h.o=function(l,r){return Object.prototype.hasOwnProperty.call(l,r)},h.p="",h(h.s=7)})([(function(_,p){_.exports=We()}),(function(_,p,h){Object.defineProperty(p,"__esModule",{value:!0}),p.unbox=p.doubleQuoted=p.box=p.track=p.tracking=p.trackingComments=p.lexerAny=p.lexer=void 0;const l=h(0),r=h(3),n={};for(const k of r.sqlKeywords)n["kw_"+k.toLowerCase()]=k;const u=k=>{const v=(0,l.keywords)(k);return N=>v(N.toUpperCase())};p.lexer=(0,l.compile)({word:{match:/[eE](?!')[A-Za-z0-9_]*|[a-df-zA-DF-Z_][A-Za-z0-9_]*/,type:u(n),value:k=>k.toLowerCase()},wordQuoted:{match:/"(?:[^"\*]|"")+"/,type:()=>"quoted_word",value:k=>k.substring(1,k.length-1)},string:{match:/'(?:[^']|\'\')*'/,value:k=>k.substring(1,k.length-1).replace(/''/g,"'")},eString:{match:/\b(?:e|E)'(?:[^'\\]|[\r\n\s]|(?:\\\s)|(?:\\\n)|(?:\\.)|(?:\'\'))+'/,value:k=>k.substring(2,k.length-1).replace(/''/g,"'").replace(/\\([\s\n])/g,(v,N)=>N).replace(/\\./g,v=>JSON.parse('"'+v+'"'))},qparam:{match:/\$\d+/},commentLine:/\-\-.*?$[\s\r\n]*/,commentFullOpen:/\/\*/,commentFullClose:/\*\/[\s\r\n]*/,star:"*",comma:",",space:{match:/[\s\t\n\v\f\r]+/,lineBreaks:!0},int:/\-?\d+(?![\.\d])/,float:/\-?(?:(?:\d*\.\d+)|(?:\d+\.\d*))/,lparen:"(",rparen:")",lbracket:"[",rbracket:"]",semicolon:";",dot:/\.(?!\d)/,op_cast:"::",op_colon:":",op_plus:"+",op_eq:"=",op_neq:{match:/(?:!=)|(?:\<\>)/,value:()=>"!="},op_membertext:"->>",op_member:"->",op_minus:"-",op_div:/\//,op_not_ilike:/\!~~\*/,op_not_like:/\!~~/,op_ilike:/~~\*/,op_like:/~~/,op_mod:"%",op_exp:"^",op_additive:{match:["||","-","#-","&&"]},op_compare:{match:[">",">=","<","<=","@>","<@","?","?|","?&","#>>",">>","<<","~","~*","!~","!~*","@@"]},ops_others:{match:["|","&","^","#"]},codeblock:{match:/\$\$(?:.|[\s\t\n\v\f\r])*?\$\$/s,lineBreaks:!0,value:k=>k.substring(2,k.length-2)}}),p.lexer.next=(k=>()=>{let v,N=null;for(;v=k.call(p.lexer);){if(v.type==="commentFullOpen"){if(N===null){N={nested:0,offset:v.offset,text:v.text};continue}N.nested++}if(N!=null){if(N.text+=v.text,v.type==="commentFullClose"){if(N.nested===0){g?.push(x(N)),N=null;continue}N.nested--}continue}if(v.type!=="space"){if(v.type==="commentLine"){g?.push(x(v));continue}break}}if($&&v){const U=v.offset,e={start:U,end:U+v.text.length};v._location=e}return v})(p.lexer.next),p.lexerAny=p.lexer;let g=null;const x=({offset:k,text:v})=>({_location:{start:k,end:k+v.length},comment:v});function s(k){if(g)throw new Error("WAT ? Recursive comments tracking 🤔🤨 ?");try{g=[];const v=k();return{comments:g,ast:v}}finally{g=null}}p.trackingComments=s;let $=!1;function i(k){if($)return k();try{return $=!0,k()}finally{$=!1}}p.tracking=i;function a(k,v){if(!$||!v||typeof v!="object")return v;const N=w(k,!0),U=w(k,!1);if(!N||!U)return v;if(N===U)v._location=N;else{const e={start:N.start,end:U.end};v._location=e}return v}p.track=a;const m=Symbol("_literal"),b=Symbol("_doublequoted");function d(k,v,N){return!$&&!N?v:a(k,{[m]:v,[b]:N})}p.box=d;function E(k){return Array.isArray(k)&&k.length===1&&(k=E(k[0])),Array.isArray(k)&&!k.length?null:k}function C(k){const v=E(k);if(typeof k=="object"&&v?.[b])return{doubleQuoted:!0}}p.doubleQuoted=C;function L(k){var v;return typeof k=="object"&&(v=k?.[m])!==null&&v!==void 0?v:k}p.unbox=L;function w(k,v){if(!k)return null;if(Array.isArray(k)){const N=v?1:-1;for(let U=v?0:k.length-1;U>=0&&U<k.length;U+=N){const e=w(k[U],v);if(e)return e}return null}return typeof k!="object"?null:k._location}}),(function(_,p,h){Object.defineProperty(p,"__esModule",{value:!0}),p.AstDefaultMapper=p.arrayNilMap=p.assignChanged=p.astMapper=void 0;const l=h(6);function r(i){const a=new x;return a.wrapped=i(a),a}p.astMapper=r;function n(i,a){if(!i)return i;let m=!1;for(const b of Object.keys(a))if(i[b]!==a[b]){m=!0;break}return m?(0,l.trimNullish)({...i,...a},0):i}p.assignChanged=n;function u(i,a){if(!i?.length)return i;let m=!1,b=i;for(let d=0;d<i.length;d++){const E=i[d],C=a(E);!m&&(!C||C!==E)&&(m=!0,b=i.slice(0,d)),C&&m&&b.push(C)}return b}p.arrayNilMap=u;function g(i){switch(i?.type){case"select":case"delete":case"insert":case"update":case"union":case"union all":case"with":return!0;default:return!1}}class x{super(){return new $(this)}statement(a){switch(a.type){case"alter table":return this.alterTable(a);case"alter index":return this.alterIndex(a);case"commit":case"start transaction":case"rollback":return this.transaction(a);case"create index":return this.createIndex(a);case"create table":return this.createTable(a);case"truncate table":return this.truncateTable(a);case"delete":return this.delete(a);case"insert":return this.insert(a);case"with":return this.with(a);case"with recursive":return this.withRecursive(a);case"select":return this.selection(a);case"update":return this.update(a);case"create extension":return this.createExtension(a);case"tablespace":return this.tablespace(a);case"set":return this.setGlobal(a);case"set timezone":return this.setTimezone(a);case"set names":return this.setNames(a);case"create sequence":return this.createSequence(a);case"alter sequence":return this.alterSequence(a);case"begin":return this.begin(a);case"drop table":case"drop index":case"drop sequence":case"drop type":case"drop trigger":return this.drop(a);case"create enum":return this.createEnum(a);case"alter enum":return this.alterEnum(a);case"create composite type":return this.createCompositeType(a);case"union":case"union all":return this.union(a);case"show":return this.show(a);case"prepare":return this.prepare(a);case"deallocate":return this.deallocate(a);case"create view":return this.createView(a);case"create materialized view":return this.createMaterializedView(a);case"refresh materialized view":return this.refreshMaterializedView(a);case"create schema":return this.createSchema(a);case"raise":return this.raise(a);case"comment":return this.comment(a);case"do":return this.do(a);case"create function":return this.createFunction(a);case"drop function":return this.dropFunction(a);case"values":return this.values(a);default:throw l.NotSupported.never(a)}}comment(a){return a}createView(a){const m=this.select(a.query);if(!m)return null;const b=this.tableRef(a.name);return b?n(a,{query:m,name:b}):null}createMaterializedView(a){const m=this.select(a.query);if(!m)return null;const b=this.tableRef(a.name);return b?n(a,{query:m,name:b}):null}refreshMaterializedView(a){return a}do(a){return a}createFunction(a){const m=u(a.arguments,d=>{const E=this.dataType(d.type);return n(d,{type:E})});let b;if(a.returns)switch(a.returns.kind){case"table":b=n(a.returns,{columns:u(a.returns.columns,d=>{const E=this.dataType(d.type);return E&&n(d,{type:E})})});break;case void 0:case null:case"array":b=this.dataType(a.returns);break;default:throw l.NotSupported.never(a.returns)}return n(a,{returns:b,arguments:m})}dropFunction(a){const m=u(a.arguments,b=>{const d=this.dataType(b.type);return n(b,{type:d})});return n(a,{arguments:m})}show(a){return a}createEnum(a){return a}alterEnum(a){return a}createCompositeType(a){const m=u(a.attributes,b=>n(b,{dataType:this.dataType(b.dataType)}));return n(a,{attributes:m})}drop(a){return a}alterSequence(a){return a.change.type==="set options"&&a.change.as&&this.dataType(a.change.as),a}begin(a){return a}createSequence(a){return a.options.as&&this.dataType(a.options.as),a}tablespace(a){return a}setGlobal(a){return a}setTimezone(a){return a}setNames(a){return a}update(a){if(!a)return a;const m=this.tableRef(a.table);if(!m)return null;const b=a.from&&this.from(a.from),d=a.where&&this.expr(a.where),E=u(a.sets,L=>this.set(L));if(!E?.length)return null;const C=u(a.returning,L=>this.selectionColumn(L));return n(a,{table:m,where:d,sets:E,from:b,returning:C})}insert(a){var m,b;const d=this.tableRef(a.into);if(!d)return null;const E=a.insert&&this.select(a.insert);if(!E)return null;const C=u(a.returning,k=>this.selectionColumn(k));let L=(m=a.onConflict)===null||m===void 0?void 0:m.on;switch(L?.type){case"on constraint":break;case"on expr":L=n(L,{exprs:u(L.exprs,k=>this.expr(k))});break;case null:case void 0:break;default:throw l.NotSupported.never(L)}let w=(b=a.onConflict)===null||b===void 0?void 0:b.do;if(w&&w!=="do nothing"){const k=u(w.sets,v=>this.set(v));k?.length?w.sets!==k&&(w={sets:k}):w="do nothing"}return n(a,{into:d,insert:E,returning:C,onConflict:w?n(a.onConflict,{do:w,on:L}):a.onConflict})}raise(a){return n(a,{formatExprs:a.formatExprs&&u(a.formatExprs,m=>this.expr(m)),using:a.using&&u(a.using,m=>n(m,{value:this.expr(m.value)}))})}delete(a){const m=this.tableRef(a.from);if(!m)return null;const b=a.where&&this.expr(a.where),d=u(a.returning,E=>this.selectionColumn(E));return n(a,{where:b,returning:d,from:m})}createSchema(a){return a}createTable(a){const m=u(a.columns,b=>{switch(b.kind){case"column":return this.createColumn(b);case"like table":return this.likeTable(b);default:throw l.NotSupported.never(b)}});return m?.length?n(a,{columns:m}):null}likeTable(a){const m=this.tableRef(a.like);return m?n(a,{like:m}):null}truncateTable(a){return a}constraint(a){switch(a.type){case"not null":case"null":case"primary key":case"unique":case"add generated":return a;case"default":{const m=this.expr(a.default);return m?n(a,{default:m}):null}case"check":{const m=this.expr(a.expr);return m?n(a,{expr:m}):null}case"reference":{const m=this.tableRef(a.foreignTable);return m?n(a,{foreignTable:m}):null}default:throw l.NotSupported.never(a)}}set(a){const m=this.expr(a.value);return m?n(a,{value:m}):null}dataType(a){return a}tableRef(a){return a}transaction(a){return a}createExtension(a){return a}createIndex(a){const m=u(a.expressions,b=>{const d=this.expr(b.expression);return d===b.expression?b:d?{...b,expression:d}:null});return m?.length?n(a,{expressions:m}):null}prepare(a){const m=this.statement(a.statement);return m?n(a,{args:u(a.args,b=>this.dataType(b)),statement:m}):null}deallocate(a){return a}alterIndex(a){return a}alterTable(a){var m;const b=this.tableRef(a.table);if(!b)return null;let d=[],E=!1;for(let C=0;C<(((m=a.changes)===null||m===void 0?void 0:m.length)||0);C++){const L=a.changes[C],w=this.tableAlteration(L,a.table);E=E||w!=L,w&&d.push(w)}return d.length?E?n(a,{table:b,changes:d}):a:null}tableAlteration(a,m){switch(a.type){case"add column":return this.addColumn(a,m);case"add constraint":return this.addConstraint(a,m);case"alter column":return this.alterColumn(a,m);case"rename":return this.renameTable(a,m);case"rename column":return this.renameColumn(a,m);case"rename constraint":return this.renameConstraint(a,m);case"drop column":return this.dropColumn(a,m);case"drop constraint":return this.dropConstraint(a,m);case"owner":return this.setTableOwner(a,m);default:throw l.NotSupported.never(a)}}dropColumn(a,m){return a}dropConstraint(a,m){return a}setTableOwner(a,m){return a}renameConstraint(a,m){return a}renameColumn(a,m){return a}renameTable(a,m){return a}alterColumn(a,m){let b;switch(a.alter.type){case"set default":b=this.setColumnDefault(a.alter,m,a.column);break;case"set type":b=this.setColumnType(a.alter,m,a.column);break;case"drop default":case"set not null":case"drop not null":b=this.alterColumnSimple(a.alter,m,a.column);break;case"add generated":b=this.alterColumnAddGenerated(a.alter,m,a.column);break;default:throw l.NotSupported.never(a.alter)}return b?n(a,{alter:b}):null}setColumnType(a,m,b){const d=this.dataType(a.dataType);return n(a,{dataType:d})}alterColumnAddGenerated(a,m,b){return a}alterColumnSimple(a,m,b){return a}setColumnDefault(a,m,b){const d=this.expr(a.default);return d?n(a,{default:d}):null}addConstraint(a,m){return a}addColumn(a,m){const b=this.createColumn(a.column);return b?n(a,{column:b}):null}createColumn(a){var m;const b=this.dataType(a.dataType);if(!b)return null;const d=(m=u(a.constraints,E=>this.constraint(E)))!==null&&m!==void 0?m:void 0;return n(a,{dataType:b,constraints:d})}select(a){switch(a.type){case"select":return this.selection(a);case"union":case"union all":return this.union(a);case"with":return this.with(a);case"values":return this.values(a);case"with recursive":return this.withRecursive(a);default:throw l.NotSupported.never(a)}}selection(a){var m,b;const d=u(a.from,N=>this.from(N)),E=u(a.columns,N=>this.selectionColumn(N)),C=a.where&&this.expr(a.where),L=u(a.groupBy,N=>this.expr(N)),w=a.having&&this.expr(a.having),k=this.orderBy(a.orderBy),v=n(a.limit,{limit:this.expr((m=a.limit)===null||m===void 0?void 0:m.limit),offset:this.expr((b=a.limit)===null||b===void 0?void 0:b.offset)});return n(a,{from:d,columns:E,where:C,groupBy:L,having:w,orderBy:k,limit:v})}orderBy(a){return u(a,m=>{const b=this.expr(m.by);return b?b===m.by?m:{...m,by:b}:null})}union(a){const m=this.select(a.left),b=this.select(a.right);return!m||!b?m??b:n(a,{left:m,right:b})}with(a){const m=u(a.bind,d=>{const E=this.statement(d.statement);return g(E)?n(d,{statement:E}):null});if(!m)return null;const b=this.statement(a.in);return g(b)?n(a,{bind:m,in:b}):null}withRecursive(a){const m=this.union(a.bind);if(!m||m.type!=="union"&&m.type!=="union all")return null;const b=this.statement(a.in);return g(b)?n(a,{bind:m,in:b}):null}from(a){switch(a.type){case"table":return this.fromTable(a);case"statement":return this.fromStatement(a);case"call":return this.fromCall(a);default:throw l.NotSupported.never(a)}}fromCall(a){const m=this.call(a);return!m||m.type!=="call"?null:n(a,m)}fromStatement(a){const m=this.select(a.statement);if(!m)return null;const b=a.join&&this.join(a.join);return n(a,{statement:m,join:b})}values(a){const m=u(a.values,b=>u(b,d=>this.expr(d)));return m?.length?n(a,{values:m}):null}join(a){const m=a.on&&this.expr(a.on);return!m&&!a.using?a:n(a,{on:m})}fromTable(a){const m=this.tableRef(a.name);if(!m)return null;const b=a.join&&this.join(a.join);return n(a,{name:m,join:b})}selectionColumn(a){const m=this.expr(a.expr);return m?n(a,{expr:m}):null}expr(a){if(!a)return a;switch(a.type){case"binary":return this.binary(a);case"unary":return this.unary(a);case"ref":return this.ref(a);case"string":case"numeric":case"integer":case"boolean":case"constant":case"null":return this.constant(a);case"list":case"array":return this.array(a);case"array select":return this.arraySelect(a);case"call":return this.call(a);case"cast":return this.cast(a);case"case":return this.case(a);case"member":return this.member(a);case"arrayIndex":return this.arrayIndex(a);case"ternary":return this.ternary(a);case"select":case"union":case"union all":case"with":case"with recursive":return this.select(a);case"keyword":return this.valueKeyword(a);case"parameter":return this.parameter(a);case"extract":return this.extract(a);case"overlay":return this.callOverlay(a);case"substring":return this.callSubstring(a);case"values":return this.values(a);case"default":return this.default(a);default:throw l.NotSupported.never(a)}}arraySelect(a){const m=this.select(a.select);return m?n(a,{select:m}):null}extract(a){const m=this.expr(a.from);return m?n(a,{from:m}):null}valueKeyword(a){return a}ternary(a){const m=this.expr(a.value),b=this.expr(a.lo),d=this.expr(a.hi);return!m||!b||!d?null:n(a,{value:m,lo:b,hi:d})}parameter(a){return a}arrayIndex(a){const m=this.expr(a.array),b=this.expr(a.index);return!m||!b?null:n(a,{array:m,index:b})}member(a){const m=this.expr(a.operand);return m?n(a,{operand:m}):null}case(a){const m=a.value&&this.expr(a.value),b=u(a.whens,E=>{const C=this.expr(E.when),L=this.expr(E.value);return!C||!L?null:n(E,{value:L,when:C})});if(!b?.length)return null;const d=a.else&&this.expr(a.else);return n(a,{value:m,whens:b,else:d})}cast(a){const m=this.expr(a.operand);return m?n(a,{operand:m}):null}call(a){var m;const b=u(a.args,w=>this.expr(w));if(!b)return null;const d=this.orderBy(a.orderBy),E=this.expr(a.filter),C=a.withinGroup?[a.withinGroup]:void 0,L=(m=this.orderBy(C))===null||m===void 0?void 0:m[0];return n(a,{args:b,orderBy:d,filter:E,withinGroup:L})}callSubstring(a){return n(a,{value:this.expr(a.value),from:this.expr(a.from),for:this.expr(a.for)})}callOverlay(a){return n(a,{value:this.expr(a.value),placing:this.expr(a.placing),from:this.expr(a.from),for:this.expr(a.for)})}array(a){const m=u(a.expressions,b=>this.expr(b));return m?n(a,{expressions:m}):null}constant(a){return a}default(a){return a}ref(a){return a}unary(a){const m=this.expr(a.operand);return m?n(a,{operand:m}):null}binary(a){const m=this.expr(a.left),b=this.expr(a.right);return!m||!b?null:n(a,{left:m,right:b})}}p.AstDefaultMapper=x;const s=x.prototype;for(const i of Object.getOwnPropertyNames(s)){const a=s[i];i==="constructor"||i==="super"||typeof a!="function"||Object.defineProperty(s,i,{configurable:!1,get(){return function(...m){var b;if(this.skipNext)return this.skipNext=!1,a.apply(this,m);const d=(b=this.wrapped)===null||b===void 0?void 0:b[i];return d?d.apply(this.wrapped,m):a.apply(this,m)}}})}class $ extends x{constructor(a){super(),this.parent=a}}for(const i of Object.getOwnPropertyNames(s)){const a=s[i];i==="constructor"||i==="super"||typeof a!="function"||Object.defineProperty($.prototype,i,{configurable:!1,get(){return function(...m){return this.parent.skipNext=!0,a.apply(this.parent,m)}}})}}),(function(_,p,h){Object.defineProperty(p,"__esModule",{value:!0}),p.sqlKeywords=void 0,p.sqlKeywords=["ALL","ANALYSE","ANALYZE","AND","ANY","ARRAY","AS","ASC","ASYMMETRIC","AUTHORIZATION","BINARY","BOTH","CASE","CAST","CHECK","COLLATE","COLLATION","CONCURRENTLY","CONSTRAINT","CREATE","CROSS","CURRENT_CATALOG","CURRENT_DATE","CURRENT_ROLE","CURRENT_SCHEMA","CURRENT_TIME","CURRENT_TIMESTAMP","CURRENT_USER","DEFAULT","DEFERRABLE","DESC","DISTINCT","DO","ELSE","END","EXCEPT","FALSE","FETCH","FOR","FOREIGN","FREEZE","FROM","FULL","GRANT","GROUP","HAVING","ILIKE","IN","INITIALLY","INNER","INTERSECT","INTO","IS","ISNULL","JOIN","LATERAL","LEADING","LEFT","LIKE","LIMIT","LOCALTIME","LOCALTIMESTAMP","NATURAL","NOT","NOTNULL","NULL","OFFSET","ON","ONLY","OR","ORDER","OUTER","OVERLAPS","PLACING","PRIMARY","REFERENCES","RETURNING","RIGHT","SELECT","SESSION_USER","SIMILAR","SOME","SYMMETRIC","TABLE","TABLESAMPLE","THEN","TO","TRAILING","TRUE","UNION","UNIQUE","USER","USING","VARIADIC","VERBOSE","WHEN","WHERE","WINDOW","WITH","PRECISION"]}),(function(_,p,h){Object.defineProperty(p,"__esModule",{value:!0}),p.intervalToString=p.normalizeInterval=p.buildInterval=void 0;const l=[["years",12],["months",30],["days",24],["hours",60],["minutes",60],["seconds",1e3],["milliseconds",0]];function*r($){if(typeof $[1]=="number")yield $;else for(const i of $)yield*r(i)}function n($,i){var a;const m={};if(i==="invalid")throw new Error(`invalid input syntax for type interval: "${$}"`);for(const[b,d]of r(i))m[b]=((a=m[b])!==null&&a!==void 0?a:0)+d;return m}p.buildInterval=n;function u($){var i,a,m,b,d,E,C,L,w;const k={...$};for(let U=0;U<l.length;U++){const[e,o]=l[U],t=(i=k[e])!==null&&i!==void 0?i:0,c=t>=0?Math.floor(t):Math.ceil(t);if(!t||c===t)continue;const f=(a=l[U+1])===null||a===void 0?void 0:a[0];f&&(k[f]=((m=k[f])!==null&&m!==void 0?m:0)+o*(t-c)),k[e]=c}if(k.months||k.years){const U=((b=k.months)!==null&&b!==void 0?b:0)+((d=k.years)!==null&&d!==void 0?d:0)*12;k.months=U%12,k.years=(U-k.months)/12}let v=((E=k.hours)!==null&&E!==void 0?E:0)*3600+((C=k.minutes)!==null&&C!==void 0?C:0)*60+((L=k.seconds)!==null&&L!==void 0?L:0)+((w=k.milliseconds)!==null&&w!==void 0?w:0)/1e3,N=1;v<0&&(N=-1,v=-v),v>=3600?(k.hours=N*Math.floor(v/3600),v-=N*k.hours*3600):delete k.hours,v>=60?(k.minutes=N*Math.floor(v/60),v-=N*k.minutes*60):delete k.minutes,v>0?(k.seconds=N*Math.floor(v),v-=N*k.seconds):delete k.seconds,v>0?k.milliseconds=N*Math.round(v*1e3):delete k.milliseconds;for(const[U]of l)k[U]||delete k[U];return k}p.normalizeInterval=u;function g($){var i,a,m;$=u($);const b=[];if($.years&&b.push($.years===1?"1 year":$.years+" years"),$.months&&b.push($.months===1?"1 month":$.months+" months"),$.days&&b.push($.days===1?"1 day":$.days+" days"),$.hours||$.minutes||$.seconds||$.milliseconds){let d=`${x((i=$.hours)!==null&&i!==void 0?i:0)}:${x((a=$.minutes)!==null&&a!==void 0?a:0)}:${x((m=$.seconds)!==null&&m!==void 0?m:0)}`;$.milliseconds&&(d=d+($.milliseconds/1e3).toString().substr(1)),(s($.hours)||s($.minutes)||s($.seconds)||s($.milliseconds))&&(d="-"+d),b.push(d)}return b.join(" ")}p.intervalToString=g;function x($){return $=Math.abs($),$<10?"0"+$:$.toString()}function s($){return $&&$<0}}),(function(_,p,h){Object.defineProperty(p,"__esModule",{value:!0}),p.astVisitor=void 0;const l=h(2);class r{super(){return new u(this)}}const n=l.AstDefaultMapper.prototype;for(const x of Object.getOwnPropertyNames(n)){const s=n[x];x==="constructor"||x==="super"||typeof s!="function"||Object.defineProperty(r.prototype,x,{configurable:!1,get(){return function(...$){const i=this.visitor[x];return i?(i.apply(this.visitor,$),$[0]):s.apply(this,$)}}})}class u{constructor(s){this.parent=s}}for(const x of Object.getOwnPropertyNames(n)){const s=n[x];x==="constructor"||x==="super"||typeof s!="function"||Object.defineProperty(u.prototype,x,{configurable:!1,get(){return function(...$){return s.apply(this.parent,$)}}})}function g(x){return(0,l.astMapper)(s=>{const $=new r;return $.mapper=s,$.visitor=x($),$})}p.astVisitor=g}),(function(_,p,h){Object.defineProperty(p,"__esModule",{value:!0}),p.trimNullish=p.NotSupported=void 0;class l extends Error{constructor(u){super("Not supported"+(u?": "+u:""))}static never(u,g){return new l(`${g??""} ${JSON.stringify(u)}`)}}p.NotSupported=l;function r(n,u=5){if(u<0||(n instanceof Array&&n.forEach(g=>r(g,u-1)),typeof n!="object"||n instanceof Date)||!n)return n;for(const g of Object.keys(n)){const x=n[g];x==null?delete n[g]:r(x,u-1)}return n}p.trimNullish=r}),(function(_,p,h){var l=this&&this.__createBinding||(Object.create?(function($,i,a,m){m===void 0&&(m=a);var b=Object.getOwnPropertyDescriptor(i,a);(!b||("get"in b?!i.__esModule:b.writable||b.configurable))&&(b={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty($,m,b)}):(function($,i,a,m){m===void 0&&(m=a),$[m]=i[a]})),r=this&&this.__exportStar||function($,i){for(var a in $)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&l(i,$,a)};Object.defineProperty(p,"__esModule",{value:!0}),p.normalizeInterval=p.intervalToString=p.toSql=p.astMapper=p.assignChanged=p.arrayNilMap=p.astVisitor=p.parseWithComments=p.parseIntervalLiteral=p.parseGeometricLiteral=p.parseArrayLiteral=p.parseFirst=p.parse=void 0;var n=h(8);Object.defineProperty(p,"parse",{enumerable:!0,get:function(){return n.parse}}),Object.defineProperty(p,"parseFirst",{enumerable:!0,get:function(){return n.parseFirst}}),Object.defineProperty(p,"parseArrayLiteral",{enumerable:!0,get:function(){return n.parseArrayLiteral}}),Object.defineProperty(p,"parseGeometricLiteral",{enumerable:!0,get:function(){return n.parseGeometricLiteral}}),Object.defineProperty(p,"parseIntervalLiteral",{enumerable:!0,get:function(){return n.parseIntervalLiteral}}),Object.defineProperty(p,"parseWithComments",{enumerable:!0,get:function(){return n.parseWithComments}});var u=h(5);Object.defineProperty(p,"astVisitor",{enumerable:!0,get:function(){return u.astVisitor}});var g=h(2);Object.defineProperty(p,"arrayNilMap",{enumerable:!0,get:function(){return g.arrayNilMap}}),Object.defineProperty(p,"assignChanged",{enumerable:!0,get:function(){return g.assignChanged}}),Object.defineProperty(p,"astMapper",{enumerable:!0,get:function(){return g.astMapper}});var x=h(19);Object.defineProperty(p,"toSql",{enumerable:!0,get:function(){return x.toSql}}),r(h(21),p);var s=h(4);Object.defineProperty(p,"intervalToString",{enumerable:!0,get:function(){return s.intervalToString}}),Object.defineProperty(p,"normalizeInterval",{enumerable:!0,get:function(){return s.normalizeInterval}})}),(function(_,p,h){var l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(p,"__esModule",{value:!0}),p.parseGeometricLiteral=p.parseIntervalLiteral=p.parseArrayLiteral=p.parse=p.parseWithComments=p.parseFirst=void 0;const r=h(9),n=l(h(10)),u=l(h(11)),g=l(h(13)),x=l(h(15)),s=l(h(17)),$=h(4),i=h(1);let a,m,b,d,E;function C(e){return w(e)[0]}p.parseFirst=C;function L(e,o){return(0,i.trackingComments)(()=>w(e,o))}p.parseWithComments=L;function w(e,o){a||(a=r.Grammar.fromCompiled(n.default));const t=typeof o=="string"?o:o?.entry,c=typeof o=="string"?null:o,f=()=>U(e,a,t);let A=c?.locationTracking?(0,i.tracking)(f):f();return typeof o!="string"&&!Array.isArray(A)&&(A=[A]),A}p.parse=w;function k(e){return m||(m=r.Grammar.fromCompiled(u.default)),U(e,m)}p.parseArrayLiteral=k;function v(e){if(e.startsWith("P"))return E||(E=r.Grammar.fromCompiled(s.default)),(0,$.buildInterval)(e,U(e,E));{d||(d=r.Grammar.fromCompiled(x.default));const o=e.toLowerCase();return(0,$.buildInterval)(e,U(o,d))}}p.parseIntervalLiteral=v;function N(e,o){return b||(b=r.Grammar.fromCompiled(g.default)),U(e,b,o)}p.parseGeometricLiteral=N;function U(e,o,t){try{o.start=t??"main";const c=new r.Parser(o);c.feed(e);const f=c.finish();if(f.length){if(f.length!==1)throw new Error(`💀 Ambiguous SQL syntax: Please file an issue stating the request that has failed at https://github.com/oguimbal/pgsql-ast-parser:
20
+
21
+ ${e}
22
+
23
+ `)}else throw new Error("Unexpected end of input");return f[0]}catch(c){if(typeof c?.message!="string")throw c;let f=c.message,A=null;const q=[],R=/A (.+) token based on:/g;let O;for(;O=R.exec(f);)A=A??f.substr(0,O.index),q.push(` - A "${O[1]}" token`);throw A&&(f=A+q.join(`
24
+ `)+`
25
+
26
+ `),c.message=f,c}}}),(function(_,p){_.exports=Ye()}),(function(_,p,h){Object.defineProperty(p,"__esModule",{value:!0});function l(e){return e[0]}const r=h(1),n=h(1);function u(e){return g(e,void 0)}function g(e,o){const t=d(e);return!o||o.length===0?(0,n.track)(e,{name:t}):(0,n.track)(e,{name:t,columns:o.map(c=>({name:d(c)}))})}function x(e){const o=d(e);return(0,n.track)(e,{value:o})}function s(e){return Array.isArray(e)&&e.length===1&&(e=s(e[0])),Array.isArray(e)&&!e.length?null:(0,n.unbox)(e)}const $=e=>o=>(0,n.track)(o,o[e]),i=e=>Array.isArray(e)?(0,n.track)(e[e.length-1],e[e.length-1]):e;function a(e){if(Array.isArray(e)){const o=[];for(const t of e)o.push(...a(t));return o}return e?[e]:[]}function m(e){var o;return e=(0,n.unbox)(e),(o=e?.value)!==null&&o!==void 0?o:e}function b(e){return a((0,n.unbox)(e)).filter(o=>!!o).map(o=>m(o)).filter(o=>typeof o=="string").map(o=>o.trim()).filter(o=>!!o)}function d(e,o){return b(e).join(o||"")}function E(e){const o={};for(const[t,c]of e)o[t]=c;return o}const C={sensitivity:"accent"},L=(e,o)=>e.localeCompare(o,void 0,C)===0,w=e=>(o,t,c)=>{const f=m(o[0]);return L(f,e)?(0,n.box)(o,e):c},k=w,v=(...e)=>{const o=new Set(e);return(t,c,f)=>{const A=typeof t[0]=="string"?t[0]:t[0].value;return o.has(A)?A:f}};function N(e,o){const t=new Set,c=o.map(n.unbox);for(const[f,A]of c){if(t.has(f))throw new Error("conflicting or redundant options");t.add(f),e[f]=(0,n.unbox)(A)}}const U={Lexer:r.lexerAny,ParserRules:[{name:"lparen",symbols:[r.lexerAny.has("lparen")?{type:"lparen"}:lparen]},{name:"rparen",symbols:[r.lexerAny.has("rparen")?{type:"rparen"}:rparen]},{name:"number$subexpression$1",symbols:["float"]},{name:"number$subexpression$1",symbols:["int"]},{name:"number",symbols:["number$subexpression$1"],postprocess:s},{name:"dot",symbols:[r.lexerAny.has("dot")?{type:"dot"}:dot],postprocess:l},{name:"float",symbols:[r.lexerAny.has("float")?{type:"float"}:float],postprocess:e=>(0,n.box)(e,parseFloat(s(e)))},{name:"int",symbols:[r.lexerAny.has("int")?{type:"int"}:int],postprocess:e=>(0,n.box)(e,parseInt(s(e),10))},{name:"comma",symbols:[r.lexerAny.has("comma")?{type:"comma"}:comma],postprocess:l},{name:"star",symbols:[r.lexerAny.has("star")?{type:"star"}:star],postprocess:e=>(0,n.box)(e,e[0].value)},{name:"string$subexpression$1",symbols:[r.lexerAny.has("string")?{type:"string"}:string]},{name:"string$subexpression$1",symbols:[r.lexerAny.has("eString")?{type:"eString"}:eString]},{name:"string",symbols:["string$subexpression$1"],postprocess:e=>(0,n.box)(e,s(e[0]).value)},{name:"ident",symbols:["word"],postprocess:$(0)},{name:"word",symbols:[r.lexerAny.has("kw_primary")?{type:"kw_primary"}:kw_primary],postprocess:e=>(0,n.box)(e,"primary")},{name:"word",symbols:[r.lexerAny.has("kw_unique")?{type:"kw_unique"}:kw_unique],postprocess:e=>(0,n.box)(e,"unique")},{name:"word",symbols:[r.lexerAny.has("quoted_word")?{type:"quoted_word"}:quoted_word],postprocess:e=>(0,n.box)(e,e[0].value,!0)},{name:"word",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:e=>(0,n.box)(e,e[0].value)},{name:"collist_paren",symbols:["lparen","collist","rparen"],postprocess:$(1)},{name:"collist$ebnf$1",symbols:[]},{name:"collist$ebnf$1$subexpression$1",symbols:["comma","ident"],postprocess:i},{name:"collist$ebnf$1",symbols:["collist$ebnf$1","collist$ebnf$1$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"collist",symbols:["ident","collist$ebnf$1"],postprocess:([e,o])=>[e,...o||[]]},{name:"kw_between",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("between")},{name:"kw_conflict",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("conflict")},{name:"kw_nothing",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("nothing")},{name:"kw_begin",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("begin")},{name:"kw_if",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("if")},{name:"kw_exists",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("exists")},{name:"kw_key",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("key")},{name:"kw_index",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("index")},{name:"kw_extension",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("extension")},{name:"kw_schema",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("schema")},{name:"kw_nulls",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("nulls")},{name:"kw_first",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("first")},{name:"kw_last",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("last")},{name:"kw_start",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("start")},{name:"kw_restart",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("restart")},{name:"kw_filter",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("filter")},{name:"kw_commit",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("commit")},{name:"kw_tablespace",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("tablespace")},{name:"kw_transaction",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("transaction")},{name:"kw_work",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("work")},{name:"kw_read",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("read")},{name:"kw_write",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("write")},{name:"kw_isolation",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("isolation")},{name:"kw_level",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("level")},{name:"kw_serializable",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("serializable")},{name:"kw_rollback",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("rollback")},{name:"kw_insert",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("insert")},{name:"kw_value",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("value")},{name:"kw_values",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("values")},{name:"kw_update",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("update")},{name:"kw_column",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("column")},{name:"kw_set",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("set")},{name:"kw_version",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("version")},{name:"kw_alter",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("alter")},{name:"kw_rename",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("rename")},{name:"kw_sequence",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("sequence")},{name:"kw_temp",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("temp")},{name:"kw_temporary",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("temporary")},{name:"kw_add",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("add")},{name:"kw_owner",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("owner")},{name:"kw_owned",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("owned")},{name:"kw_including",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("including")},{name:"kw_excluding",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("excluding")},{name:"kw_none",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("none")},{name:"kw_drop",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("drop")},{name:"kw_operator",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("operator")},{name:"kw_minvalue",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("minvalue")},{name:"kw_maxvalue",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("maxvalue")},{name:"kw_data",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("data")},{name:"kw_type",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("type")},{name:"kw_trigger",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("trigger")},{name:"kw_delete",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("delete")},{name:"kw_cache",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("cache")},{name:"kw_cascade",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("cascade")},{name:"kw_no",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("no")},{name:"kw_timestamp",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("timestamp")},{name:"kw_cycle",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("cycle")},{name:"kw_function",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("function")},{name:"kw_returns",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("returns")},{name:"kw_language",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("language")},{name:"kw_out",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("out")},{name:"kw_inout",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("inout")},{name:"kw_variadic",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("variadic")},{name:"kw_action",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("action")},{name:"kw_restrict",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("restrict")},{name:"kw_truncate",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("truncate")},{name:"kw_increment",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("increment")},{name:"kw_by",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("by")},{name:"kw_row",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("row")},{name:"kw_rows",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("rows")},{name:"kw_next",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("next")},{name:"kw_match",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("match")},{name:"kw_replace",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("replace")},{name:"kw_recursive",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("recursive")},{name:"kw_view",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("view")},{name:"kw_cascaded",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("cascaded")},{name:"kw_unlogged",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("unlogged")},{name:"kw_global",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("global")},{name:"kw_option",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("option")},{name:"kw_materialized",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("materialized")},{name:"kw_partial",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("partial")},{name:"kw_partition",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("partition")},{name:"kw_simple",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("simple")},{name:"kw_generated",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("generated")},{name:"kw_always",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("always")},{name:"kw_identity",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("identity")},{name:"kw_name",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("name")},{name:"kw_enum",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("enum")},{name:"kw_show",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("show")},{name:"kw_ordinality",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("ordinality")},{name:"kw_overriding",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("overriding")},{name:"kw_over",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("over")},{name:"kw_system",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("system")},{name:"kw_comment",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("comment")},{name:"kw_time",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("time")},{name:"kw_names",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("names")},{name:"kw_at",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("at")},{name:"kw_zone",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("zone")},{name:"kw_interval",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("interval")},{name:"kw_hour",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("hour")},{name:"kw_minute",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("minute")},{name:"kw_local",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("local")},{name:"kw_session",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("session")},{name:"kw_prepare",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("prepare")},{name:"kw_deallocate",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("deallocate")},{name:"kw_raise",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("raise")},{name:"kw_continue",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("continue")},{name:"kw_share",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("share")},{name:"kw_refresh",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("refresh")},{name:"kw_nowait",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("nowait")},{name:"kw_skip",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("skip")},{name:"kw_locked",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("locked")},{name:"kw_within",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:w("within")},{name:"kw_ifnotexists",symbols:["kw_if",r.lexerAny.has("kw_not")?{type:"kw_not"}:kw_not,"kw_exists"]},{name:"kw_ifexists",symbols:["kw_if","kw_exists"]},{name:"kw_withordinality",symbols:[r.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with,"kw_ordinality"]},{name:"kw_not_null",symbols:[r.lexerAny.has("kw_not")?{type:"kw_not"}:kw_not,r.lexerAny.has("kw_null")?{type:"kw_null"}:kw_null]},{name:"kw_primary_key",symbols:[r.lexerAny.has("kw_primary")?{type:"kw_primary"}:kw_primary,"kw_key"]},{name:"data_type$ebnf$1$subexpression$1$macrocall$2",symbols:["int"]},{name:"data_type$ebnf$1$subexpression$1$macrocall$1$ebnf$1",symbols:[]},{name:"data_type$ebnf$1$subexpression$1$macrocall$1$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("comma")?{type:"comma"}:comma,"data_type$ebnf$1$subexpression$1$macrocall$2"],postprocess:i},{name:"data_type$ebnf$1$subexpression$1$macrocall$1$ebnf$1",symbols:["data_type$ebnf$1$subexpression$1$macrocall$1$ebnf$1","data_type$ebnf$1$subexpression$1$macrocall$1$ebnf$1$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"data_type$ebnf$1$subexpression$1$macrocall$1",symbols:["data_type$ebnf$1$subexpression$1$macrocall$2","data_type$ebnf$1$subexpression$1$macrocall$1$ebnf$1"],postprocess:([e,o])=>[e,...o||[]]},{name:"data_type$ebnf$1$subexpression$1",symbols:["lparen","data_type$ebnf$1$subexpression$1$macrocall$1","rparen"],postprocess:$(1)},{name:"data_type$ebnf$1",symbols:["data_type$ebnf$1$subexpression$1"],postprocess:l},{name:"data_type$ebnf$1",symbols:[],postprocess:()=>null},{name:"data_type$ebnf$2$subexpression$1",symbols:[r.lexerAny.has("kw_array")?{type:"kw_array"}:kw_array]},{name:"data_type$ebnf$2$subexpression$1$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("lbracket")?{type:"lbracket"}:lbracket,r.lexerAny.has("rbracket")?{type:"rbracket"}:rbracket]},{name:"data_type$ebnf$2$subexpression$1$ebnf$1",symbols:["data_type$ebnf$2$subexpression$1$ebnf$1$subexpression$1"]},{name:"data_type$ebnf$2$subexpression$1$ebnf$1$subexpression$2",symbols:[r.lexerAny.has("lbracket")?{type:"lbracket"}:lbracket,r.lexerAny.has("rbracket")?{type:"rbracket"}:rbracket]},{name:"data_type$ebnf$2$subexpression$1$ebnf$1",symbols:["data_type$ebnf$2$subexpression$1$ebnf$1","data_type$ebnf$2$subexpression$1$ebnf$1$subexpression$2"],postprocess:e=>e[0].concat([e[1]])},{name:"data_type$ebnf$2$subexpression$1",symbols:["data_type$ebnf$2$subexpression$1$ebnf$1"]},{name:"data_type$ebnf$2",symbols:["data_type$ebnf$2$subexpression$1"],postprocess:l},{name:"data_type$ebnf$2",symbols:[],postprocess:()=>null},{name:"data_type",symbols:["data_type_simple","data_type$ebnf$1","data_type$ebnf$2"],postprocess:e=>{let o=e[2];const t=s(e[0]);let c;if(c={...t,...Array.isArray(e[1])&&e[1].length?{config:e[1].map(s)}:{}},o){o[0].type==="kw_array"&&(o=[["array"]]);for(const f of o[0])c={kind:"array",arrayOf:c}}return(0,n.track)(e,c)}},{name:"data_type_list$ebnf$1",symbols:[]},{name:"data_type_list$ebnf$1$subexpression$1",symbols:["comma","data_type"],postprocess:i},{name:"data_type_list$ebnf$1",symbols:["data_type_list$ebnf$1","data_type_list$ebnf$1$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"data_type_list",symbols:["data_type","data_type_list$ebnf$1"],postprocess:([e,o])=>[e,...o||[]]},{name:"data_type_simple",symbols:["data_type_text"],postprocess:e=>(0,n.track)(e,{name:d(e," ")})},{name:"data_type_simple",symbols:["data_type_numeric"],postprocess:e=>(0,n.track)(e,{name:d(e," ")})},{name:"data_type_simple",symbols:["data_type_date"]},{name:"data_type_simple",symbols:["qualified_name_mark_quotes"]},{name:"data_type_numeric$subexpression$1",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:k("double")},{name:"data_type_numeric",symbols:["data_type_numeric$subexpression$1",r.lexerAny.has("kw_precision")?{type:"kw_precision"}:kw_precision]},{name:"data_type_text$subexpression$1",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:v("character","bit")},{name:"data_type_text$subexpression$2",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:k("varying")},{name:"data_type_text",symbols:["data_type_text$subexpression$1","data_type_text$subexpression$2"]},{name:"data_type_date$subexpression$1",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:v("timestamp","time")},{name:"data_type_date$subexpression$2",symbols:[r.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with]},{name:"data_type_date$subexpression$2",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:k("without")},{name:"data_type_date$subexpression$3",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:k("time")},{name:"data_type_date$subexpression$4",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:k("zone")},{name:"data_type_date",symbols:["data_type_date$subexpression$1","data_type_date$subexpression$2","data_type_date$subexpression$3","data_type_date$subexpression$4"],postprocess:e=>(0,n.track)(e,{name:d(e," ")})},{name:"data_type_date$subexpression$5",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:v("timestamp","time")},{name:"data_type_date$subexpression$6",symbols:["lparen","int","rparen"],postprocess:$(1)},{name:"data_type_date$subexpression$7",symbols:[r.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with]},{name:"data_type_date$subexpression$7",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:k("without")},{name:"data_type_date$subexpression$8",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:k("time")},{name:"data_type_date$subexpression$9",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:k("zone")},{name:"data_type_date",symbols:["data_type_date$subexpression$5","data_type_date$subexpression$6","data_type_date$subexpression$7","data_type_date$subexpression$8","data_type_date$subexpression$9"],postprocess:e=>(0,n.track)(e,{name:`timestamp ${d(e[2])} time zone`,config:[(0,n.unbox)(e[1])]})},{name:"ident_aliased$subexpression$1",symbols:[r.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"ident"],postprocess:i},{name:"ident_aliased",symbols:["ident_aliased$subexpression$1"]},{name:"ident_aliased",symbols:["ident"],postprocess:s},{name:"table_ref",symbols:["qualified_name"],postprocess:s},{name:"qcolumn$ebnf$1$subexpression$1",symbols:["dot","ident"],postprocess:i},{name:"qcolumn$ebnf$1",symbols:["qcolumn$ebnf$1$subexpression$1"],postprocess:l},{name:"qcolumn$ebnf$1",symbols:[],postprocess:()=>null},{name:"qcolumn",symbols:["ident","dot","ident","qcolumn$ebnf$1"],postprocess:e=>e[3]?(0,n.track)(e,{schema:(0,n.unbox)(e[0]),table:(0,n.unbox)(e[2]),column:(0,n.unbox)(e[3])}):(0,n.track)(e,{table:(0,n.unbox)(e[0]),column:(0,n.unbox)(e[2])})},{name:"table_ref_aliased$ebnf$1",symbols:["ident_aliased"],postprocess:l},{name:"table_ref_aliased$ebnf$1",symbols:[],postprocess:()=>null},{name:"table_ref_aliased",symbols:["table_ref","table_ref_aliased$ebnf$1"],postprocess:e=>{const o=s(e[1]);return(0,n.track)(e,{...s(e[0]),...o?{alias:o}:{}})}},{name:"qualified_name",symbols:["qname_ident"],postprocess:e=>(0,n.track)(e,{name:d(e)})},{name:"qualified_name",symbols:["ident","dot","ident_extended"],postprocess:e=>{const o=d(e[0]),t=d(e[2]);return(0,n.track)(e,{schema:o,name:t})}},{name:"qualified_name",symbols:[r.lexerAny.has("kw_current_schema")?{type:"kw_current_schema"}:kw_current_schema],postprocess:e=>(0,n.track)(e,{name:"current_schema"})},{name:"qualified_name_mark_quotes",symbols:["qname_ident"],postprocess:e=>(0,n.track)(e,{name:d(e),...(0,n.doubleQuoted)(e)})},{name:"qualified_name_mark_quotes",symbols:["ident","dot","ident_extended"],postprocess:e=>{const o=d(e[0]),t=d(e[2]);return(0,n.track)(e,{schema:o,name:t,...(0,n.doubleQuoted)(e[2])})}},{name:"qualified_name_mark_quotes",symbols:[r.lexerAny.has("kw_current_schema")?{type:"kw_current_schema"}:kw_current_schema],postprocess:e=>(0,n.track)(e,{name:"current_schema"})},{name:"qname_ident",symbols:["ident"]},{name:"qname_ident",symbols:[r.lexerAny.has("kw_precision")?{type:"kw_precision"}:kw_precision]},{name:"qname",symbols:["qualified_name"],postprocess:s},{name:"any_keyword",symbols:[r.lexerAny.has("kw_all")?{type:"kw_all"}:kw_all]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_analyse")?{type:"kw_analyse"}:kw_analyse]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_analyze")?{type:"kw_analyze"}:kw_analyze]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_and")?{type:"kw_and"}:kw_and]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_any")?{type:"kw_any"}:kw_any]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_array")?{type:"kw_array"}:kw_array]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_asc")?{type:"kw_asc"}:kw_asc]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_asymmetric")?{type:"kw_asymmetric"}:kw_asymmetric]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_authorization")?{type:"kw_authorization"}:kw_authorization]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_binary")?{type:"kw_binary"}:kw_binary]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_both")?{type:"kw_both"}:kw_both]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_case")?{type:"kw_case"}:kw_case]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_cast")?{type:"kw_cast"}:kw_cast]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_check")?{type:"kw_check"}:kw_check]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_collate")?{type:"kw_collate"}:kw_collate]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_collation")?{type:"kw_collation"}:kw_collation]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_concurrently")?{type:"kw_concurrently"}:kw_concurrently]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_constraint")?{type:"kw_constraint"}:kw_constraint]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_create")?{type:"kw_create"}:kw_create]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_cross")?{type:"kw_cross"}:kw_cross]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_current_catalog")?{type:"kw_current_catalog"}:kw_current_catalog]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_current_date")?{type:"kw_current_date"}:kw_current_date]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_current_role")?{type:"kw_current_role"}:kw_current_role]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_current_schema")?{type:"kw_current_schema"}:kw_current_schema]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_current_time")?{type:"kw_current_time"}:kw_current_time]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_current_timestamp")?{type:"kw_current_timestamp"}:kw_current_timestamp]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_current_user")?{type:"kw_current_user"}:kw_current_user]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_default")?{type:"kw_default"}:kw_default]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_deferrable")?{type:"kw_deferrable"}:kw_deferrable]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_desc")?{type:"kw_desc"}:kw_desc]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_distinct")?{type:"kw_distinct"}:kw_distinct]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_do")?{type:"kw_do"}:kw_do]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_else")?{type:"kw_else"}:kw_else]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_end")?{type:"kw_end"}:kw_end]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_except")?{type:"kw_except"}:kw_except]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_false")?{type:"kw_false"}:kw_false]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_fetch")?{type:"kw_fetch"}:kw_fetch]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_for")?{type:"kw_for"}:kw_for]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_foreign")?{type:"kw_foreign"}:kw_foreign]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_freeze")?{type:"kw_freeze"}:kw_freeze]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_from")?{type:"kw_from"}:kw_from]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_full")?{type:"kw_full"}:kw_full]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_grant")?{type:"kw_grant"}:kw_grant]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_group")?{type:"kw_group"}:kw_group]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_having")?{type:"kw_having"}:kw_having]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_ilike")?{type:"kw_ilike"}:kw_ilike]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_in")?{type:"kw_in"}:kw_in]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_initially")?{type:"kw_initially"}:kw_initially]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_inner")?{type:"kw_inner"}:kw_inner]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_intersect")?{type:"kw_intersect"}:kw_intersect]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_into")?{type:"kw_into"}:kw_into]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_is")?{type:"kw_is"}:kw_is]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_isnull")?{type:"kw_isnull"}:kw_isnull]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_join")?{type:"kw_join"}:kw_join]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_lateral")?{type:"kw_lateral"}:kw_lateral]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_leading")?{type:"kw_leading"}:kw_leading]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_left")?{type:"kw_left"}:kw_left]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_like")?{type:"kw_like"}:kw_like]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_limit")?{type:"kw_limit"}:kw_limit]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_localtime")?{type:"kw_localtime"}:kw_localtime]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_localtimestamp")?{type:"kw_localtimestamp"}:kw_localtimestamp]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_natural")?{type:"kw_natural"}:kw_natural]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_not")?{type:"kw_not"}:kw_not]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_notnull")?{type:"kw_notnull"}:kw_notnull]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_null")?{type:"kw_null"}:kw_null]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_offset")?{type:"kw_offset"}:kw_offset]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_only")?{type:"kw_only"}:kw_only]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_or")?{type:"kw_or"}:kw_or]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_order")?{type:"kw_order"}:kw_order]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_outer")?{type:"kw_outer"}:kw_outer]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_overlaps")?{type:"kw_overlaps"}:kw_overlaps]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_placing")?{type:"kw_placing"}:kw_placing]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_primary")?{type:"kw_primary"}:kw_primary]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_references")?{type:"kw_references"}:kw_references]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_returning")?{type:"kw_returning"}:kw_returning]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_right")?{type:"kw_right"}:kw_right]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_select")?{type:"kw_select"}:kw_select]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_session_user")?{type:"kw_session_user"}:kw_session_user]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_similar")?{type:"kw_similar"}:kw_similar]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_some")?{type:"kw_some"}:kw_some]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_symmetric")?{type:"kw_symmetric"}:kw_symmetric]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_table")?{type:"kw_table"}:kw_table]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_tablesample")?{type:"kw_tablesample"}:kw_tablesample]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_then")?{type:"kw_then"}:kw_then]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_to")?{type:"kw_to"}:kw_to]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_trailing")?{type:"kw_trailing"}:kw_trailing]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_true")?{type:"kw_true"}:kw_true]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_union")?{type:"kw_union"}:kw_union]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_unique")?{type:"kw_unique"}:kw_unique]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_user")?{type:"kw_user"}:kw_user]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_using")?{type:"kw_using"}:kw_using]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_variadic")?{type:"kw_variadic"}:kw_variadic]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_verbose")?{type:"kw_verbose"}:kw_verbose]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_when")?{type:"kw_when"}:kw_when]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_where")?{type:"kw_where"}:kw_where]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_window")?{type:"kw_window"}:kw_window]},{name:"any_keyword",symbols:[r.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with]},{name:"ident_extended",symbols:["ident"]},{name:"ident_extended",symbols:["any_keyword"]},{name:"select_statement$ebnf$1",symbols:["select_from"],postprocess:l},{name:"select_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_statement$ebnf$2",symbols:["select_where"],postprocess:l},{name:"select_statement$ebnf$2",symbols:[],postprocess:()=>null},{name:"select_statement$ebnf$3$subexpression$1$ebnf$1",symbols:["select_having"],postprocess:l},{name:"select_statement$ebnf$3$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_statement$ebnf$3$subexpression$1",symbols:["select_groupby","select_statement$ebnf$3$subexpression$1$ebnf$1"]},{name:"select_statement$ebnf$3",symbols:["select_statement$ebnf$3$subexpression$1"],postprocess:l},{name:"select_statement$ebnf$3",symbols:[],postprocess:()=>null},{name:"select_statement$ebnf$4",symbols:["select_order_by"],postprocess:l},{name:"select_statement$ebnf$4",symbols:[],postprocess:()=>null},{name:"select_statement$ebnf$5",symbols:["select_limit_offset"],postprocess:l},{name:"select_statement$ebnf$5",symbols:[],postprocess:()=>null},{name:"select_statement$ebnf$6$subexpression$1$ebnf$1",symbols:["select_skip"],postprocess:l},{name:"select_statement$ebnf$6$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_statement$ebnf$6$subexpression$1",symbols:["select_for","select_statement$ebnf$6$subexpression$1$ebnf$1"]},{name:"select_statement$ebnf$6",symbols:["select_statement$ebnf$6$subexpression$1"],postprocess:l},{name:"select_statement$ebnf$6",symbols:[],postprocess:()=>null},{name:"select_statement",symbols:["select_what","select_statement$ebnf$1","select_statement$ebnf$2","select_statement$ebnf$3","select_statement$ebnf$4","select_statement$ebnf$5","select_statement$ebnf$6"],postprocess:e=>{let[o,t,c,f,A,q,R]=e;t=s(t);let O=f&&f[0],F=f&&f[1];O=O&&(O.length===1&&O[0].type==="list"?O[0].expressions:O),F=F&&s(F);let z=R&&R[0],I=R&&R[1];return I=s(I),(0,n.track)(e,{...o,...t?{from:Array.isArray(t)?t:[t]}:{},...O?{groupBy:O}:{},...F?{having:F}:{},...q?{limit:s(q)}:{},...A?{orderBy:A}:{},...c?{where:c}:{},...z?{for:z[1]}:{},...I?{skip:I}:{},type:"select"})}},{name:"select_from",symbols:[r.lexerAny.has("kw_from")?{type:"kw_from"}:kw_from,"select_from_items"],postprocess:i},{name:"select_from_items$ebnf$1",symbols:[]},{name:"select_from_items$ebnf$1$subexpression$1",symbols:["comma","select_from_item"],postprocess:i},{name:"select_from_items$ebnf$1",symbols:["select_from_items$ebnf$1","select_from_items$ebnf$1$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"select_from_items",symbols:["select_from_item","select_from_items$ebnf$1"],postprocess:([e,o])=>[...e,...a(o)||[]]},{name:"select_from_item",symbols:["select_from_subject"]},{name:"select_from_item",symbols:["select_from_item_joins"],postprocess:$(0)},{name:"select_from_item_joins$subexpression$1",symbols:["select_from_item"],postprocess:$(0)},{name:"select_from_item_joins",symbols:["select_from_item_joins$subexpression$1","select_table_join"],postprocess:a},{name:"select_from_item_joins",symbols:["lparen","select_from_item_joins","rparen"],postprocess:$(1)},{name:"select_from_subject",symbols:["stb_table"],postprocess:s},{name:"select_from_subject",symbols:["stb_statement"],postprocess:s},{name:"select_from_subject",symbols:["stb_call"],postprocess:s},{name:"stb_opts$ebnf$1",symbols:["collist_paren"],postprocess:l},{name:"stb_opts$ebnf$1",symbols:[],postprocess:()=>null},{name:"stb_opts",symbols:["ident_aliased","stb_opts$ebnf$1"],postprocess:e=>(0,n.track)(e,{alias:d(e[0]),...e[1]&&{columnNames:(0,n.unbox)(e[1]).map(u)}})},{name:"stb_table$ebnf$1",symbols:["stb_opts"],postprocess:l},{name:"stb_table$ebnf$1",symbols:[],postprocess:()=>null},{name:"stb_table",symbols:["table_ref","stb_table$ebnf$1"],postprocess:e=>(0,n.track)(e,{type:"table",name:(0,n.track)(e,{...e[0],...e[1]})})},{name:"stb_statement$ebnf$1",symbols:[r.lexerAny.has("kw_lateral")?{type:"kw_lateral"}:kw_lateral],postprocess:l},{name:"stb_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"stb_statement",symbols:["stb_statement$ebnf$1","selection_paren","stb_opts"],postprocess:e=>(0,n.track)(e,{type:"statement",statement:s(e[1]),...e[0]&&{lateral:!0},...e[2]})},{name:"select_values",symbols:["kw_values","insert_values"],postprocess:e=>(0,n.track)(e,{type:"values",values:e[1]})},{name:"stb_call$ebnf$1",symbols:[r.lexerAny.has("kw_lateral")?{type:"kw_lateral"}:kw_lateral],postprocess:l},{name:"stb_call$ebnf$1",symbols:[],postprocess:()=>null},{name:"stb_call$ebnf$2",symbols:["kw_withordinality"],postprocess:l},{name:"stb_call$ebnf$2",symbols:[],postprocess:()=>null},{name:"stb_call$ebnf$3",symbols:["stb_call_alias"],postprocess:l},{name:"stb_call$ebnf$3",symbols:[],postprocess:()=>null},{name:"stb_call",symbols:["stb_call$ebnf$1","expr_function_call","stb_call$ebnf$2","stb_call$ebnf$3"],postprocess:e=>{const o=e[0],t=e[2],c=e[3];return!t&&!c?e[1]:(0,n.track)(e,{...e[1],...o&&{lateral:!0},...t&&{withOrdinality:!0},alias:c?g(c[0],c[1]):void 0})}},{name:"stb_call_alias$subexpression$1$ebnf$1",symbols:[r.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as],postprocess:l},{name:"stb_call_alias$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"stb_call_alias$subexpression$1",symbols:["stb_call_alias$subexpression$1$ebnf$1","ident"],postprocess:i},{name:"stb_call_alias$ebnf$1",symbols:["stb_call_alias_list"],postprocess:l},{name:"stb_call_alias$ebnf$1",symbols:[],postprocess:()=>null},{name:"stb_call_alias",symbols:["stb_call_alias$subexpression$1","stb_call_alias$ebnf$1"]},{name:"stb_call_alias_list",symbols:["lparen","stb_call_alias_list_raw","rparen"],postprocess:$(1)},{name:"stb_call_alias_list_raw$ebnf$1",symbols:[]},{name:"stb_call_alias_list_raw$ebnf$1$subexpression$1",symbols:["comma","ident"],postprocess:i},{name:"stb_call_alias_list_raw$ebnf$1",symbols:["stb_call_alias_list_raw$ebnf$1","stb_call_alias_list_raw$ebnf$1$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"stb_call_alias_list_raw",symbols:["ident","stb_call_alias_list_raw$ebnf$1"],postprocess:([e,o])=>[e,...o||[]]},{name:"select_table_join$ebnf$1",symbols:["select_table_join_clause"],postprocess:l},{name:"select_table_join$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_table_join",symbols:["select_join_op",r.lexerAny.has("kw_join")?{type:"kw_join"}:kw_join,"select_from_subject","select_table_join$ebnf$1"],postprocess:e=>(0,n.track)(e,{...s(e[2]),join:{type:d(e[0]," "),...e[3]&&s(e[3])}})},{name:"select_table_join_clause",symbols:[r.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on,"expr"],postprocess:e=>(0,n.track)(e,{on:i(e)})},{name:"select_table_join_clause$macrocall$2",symbols:["ident"]},{name:"select_table_join_clause$macrocall$1$ebnf$1",symbols:[]},{name:"select_table_join_clause$macrocall$1$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("comma")?{type:"comma"}:comma,"select_table_join_clause$macrocall$2"],postprocess:i},{name:"select_table_join_clause$macrocall$1$ebnf$1",symbols:["select_table_join_clause$macrocall$1$ebnf$1","select_table_join_clause$macrocall$1$ebnf$1$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"select_table_join_clause$macrocall$1",symbols:["select_table_join_clause$macrocall$2","select_table_join_clause$macrocall$1$ebnf$1"],postprocess:([e,o])=>[s(e),...o.map(s)||[]]},{name:"select_table_join_clause",symbols:[r.lexerAny.has("kw_using")?{type:"kw_using"}:kw_using,"lparen","select_table_join_clause$macrocall$1","rparen"],postprocess:e=>(0,n.track)(e,{using:e[2].map(u)})},{name:"select_join_op$subexpression$1$ebnf$1",symbols:[r.lexerAny.has("kw_inner")?{type:"kw_inner"}:kw_inner],postprocess:l},{name:"select_join_op$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_join_op$subexpression$1",symbols:["select_join_op$subexpression$1$ebnf$1"],postprocess:e=>(0,n.box)(e,"INNER JOIN")},{name:"select_join_op",symbols:["select_join_op$subexpression$1"]},{name:"select_join_op$subexpression$2",symbols:[r.lexerAny.has("kw_cross")?{type:"kw_cross"}:kw_cross],postprocess:e=>(0,n.box)(e,"CROSS JOIN")},{name:"select_join_op",symbols:["select_join_op$subexpression$2"]},{name:"select_join_op$subexpression$3$ebnf$1",symbols:[r.lexerAny.has("kw_outer")?{type:"kw_outer"}:kw_outer],postprocess:l},{name:"select_join_op$subexpression$3$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_join_op$subexpression$3",symbols:[r.lexerAny.has("kw_left")?{type:"kw_left"}:kw_left,"select_join_op$subexpression$3$ebnf$1"],postprocess:e=>(0,n.box)(e,"LEFT JOIN")},{name:"select_join_op",symbols:["select_join_op$subexpression$3"]},{name:"select_join_op$subexpression$4$ebnf$1",symbols:[r.lexerAny.has("kw_outer")?{type:"kw_outer"}:kw_outer],postprocess:l},{name:"select_join_op$subexpression$4$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_join_op$subexpression$4",symbols:[r.lexerAny.has("kw_right")?{type:"kw_right"}:kw_right,"select_join_op$subexpression$4$ebnf$1"],postprocess:e=>(0,n.box)(e,"RIGHT JOIN")},{name:"select_join_op",symbols:["select_join_op$subexpression$4"]},{name:"select_join_op$subexpression$5$ebnf$1",symbols:[r.lexerAny.has("kw_outer")?{type:"kw_outer"}:kw_outer],postprocess:l},{name:"select_join_op$subexpression$5$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_join_op$subexpression$5",symbols:[r.lexerAny.has("kw_full")?{type:"kw_full"}:kw_full,"select_join_op$subexpression$5$ebnf$1"],postprocess:e=>(0,n.box)(e,"FULL JOIN")},{name:"select_join_op",symbols:["select_join_op$subexpression$5"]},{name:"select_what$ebnf$1",symbols:["select_distinct"],postprocess:l},{name:"select_what$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_what$ebnf$2",symbols:["select_expr_list_aliased"],postprocess:l},{name:"select_what$ebnf$2",symbols:[],postprocess:()=>null},{name:"select_what",symbols:[r.lexerAny.has("kw_select")?{type:"kw_select"}:kw_select,"select_what$ebnf$1","select_what$ebnf$2"],postprocess:e=>(0,n.track)(e,{columns:e[2],...e[1]&&{distinct:(0,n.unbox)(e[1])}})},{name:"select_expr_list_aliased$ebnf$1",symbols:[]},{name:"select_expr_list_aliased$ebnf$1$subexpression$1",symbols:["comma","select_expr_list_item"],postprocess:i},{name:"select_expr_list_aliased$ebnf$1",symbols:["select_expr_list_aliased$ebnf$1","select_expr_list_aliased$ebnf$1$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"select_expr_list_aliased",symbols:["select_expr_list_item","select_expr_list_aliased$ebnf$1"],postprocess:([e,o])=>[e,...o||[]]},{name:"select_expr_list_item$ebnf$1",symbols:["ident_aliased"],postprocess:l},{name:"select_expr_list_item$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_expr_list_item",symbols:["expr","select_expr_list_item$ebnf$1"],postprocess:e=>(0,n.track)(e,{expr:e[0],...e[1]?{alias:u(e[1])}:{}})},{name:"select_distinct",symbols:[r.lexerAny.has("kw_all")?{type:"kw_all"}:kw_all],postprocess:e=>(0,n.box)(e,"all")},{name:"select_distinct$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on,"lparen","expr_list_raw","rparen"],postprocess:$(2)},{name:"select_distinct$ebnf$1",symbols:["select_distinct$ebnf$1$subexpression$1"],postprocess:l},{name:"select_distinct$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_distinct",symbols:[r.lexerAny.has("kw_distinct")?{type:"kw_distinct"}:kw_distinct,"select_distinct$ebnf$1"],postprocess:e=>(0,n.box)(e,e[1]||"distinct")},{name:"select_where",symbols:[r.lexerAny.has("kw_where")?{type:"kw_where"}:kw_where,"expr"],postprocess:i},{name:"select_groupby",symbols:[r.lexerAny.has("kw_group")?{type:"kw_group"}:kw_group,"kw_by","expr_list_raw"],postprocess:i},{name:"select_having",symbols:[r.lexerAny.has("kw_having")?{type:"kw_having"}:kw_having,"expr"],postprocess:i},{name:"select_limit_offset$ebnf$1$subexpression$1",symbols:["select_offset"]},{name:"select_limit_offset$ebnf$1$subexpression$1",symbols:["select_limit"]},{name:"select_limit_offset$ebnf$1",symbols:["select_limit_offset$ebnf$1$subexpression$1"]},{name:"select_limit_offset$ebnf$1$subexpression$2",symbols:["select_offset"]},{name:"select_limit_offset$ebnf$1$subexpression$2",symbols:["select_limit"]},{name:"select_limit_offset$ebnf$1",symbols:["select_limit_offset$ebnf$1","select_limit_offset$ebnf$1$subexpression$2"],postprocess:e=>e[0].concat([e[1]])},{name:"select_limit_offset",symbols:["select_limit_offset$ebnf$1"],postprocess:(e,o)=>{const t=s(e);if(!Array.isArray(t))return(0,n.track)(e,t);if(t.length!=2)return o;const c=s(t[0]),f=s(t[1]);return c.offset&&f.offset||c.limit&&f.limit?o:(0,n.track)(e,{...c,...f})}},{name:"select_offset$ebnf$1$subexpression$1",symbols:["kw_row"]},{name:"select_offset$ebnf$1$subexpression$1",symbols:["kw_rows"]},{name:"select_offset$ebnf$1",symbols:["select_offset$ebnf$1$subexpression$1"],postprocess:l},{name:"select_offset$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_offset",symbols:[r.lexerAny.has("kw_offset")?{type:"kw_offset"}:kw_offset,"expr_nostar","select_offset$ebnf$1"],postprocess:e=>(0,n.track)(e,{offset:s(e[1])})},{name:"select_limit$subexpression$1",symbols:["select_limit_1"]},{name:"select_limit$subexpression$1",symbols:["select_limit_2"]},{name:"select_limit",symbols:["select_limit$subexpression$1"],postprocess:e=>(0,n.track)(e,{limit:s(e)})},{name:"select_limit_1",symbols:[r.lexerAny.has("kw_limit")?{type:"kw_limit"}:kw_limit,"expr_nostar"],postprocess:i},{name:"select_limit_2$ebnf$1$subexpression$1",symbols:["kw_first"]},{name:"select_limit_2$ebnf$1$subexpression$1",symbols:["kw_next"]},{name:"select_limit_2$ebnf$1",symbols:["select_limit_2$ebnf$1$subexpression$1"],postprocess:l},{name:"select_limit_2$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_limit_2$subexpression$1",symbols:["kw_row"]},{name:"select_limit_2$subexpression$1",symbols:["kw_rows"]},{name:"select_limit_2",symbols:[r.lexerAny.has("kw_fetch")?{type:"kw_fetch"}:kw_fetch,"select_limit_2$ebnf$1","expr_nostar","select_limit_2$subexpression$1",r.lexerAny.has("kw_only")?{type:"kw_only"}:kw_only],postprocess:$(2)},{name:"select_for$subexpression$1",symbols:["kw_update"],postprocess:e=>(0,n.track)(e,{type:"update"})},{name:"select_for$subexpression$1",symbols:["kw_no","kw_key","kw_update"],postprocess:e=>(0,n.track)(e,{type:"no key update"})},{name:"select_for$subexpression$1",symbols:["kw_share"],postprocess:e=>(0,n.track)(e,{type:"share"})},{name:"select_for$subexpression$1",symbols:["kw_key","kw_share"],postprocess:e=>(0,n.track)(e,{type:"key share"})},{name:"select_for",symbols:[r.lexerAny.has("kw_for")?{type:"kw_for"}:kw_for,"select_for$subexpression$1"]},{name:"select_skip$subexpression$1",symbols:["kw_nowait"],postprocess:e=>(0,n.track)(e,{type:"nowait"})},{name:"select_skip$subexpression$1",symbols:["kw_skip","kw_locked"],postprocess:e=>(0,n.track)(e,{type:"skip locked"})},{name:"select_skip",symbols:["select_skip$subexpression$1"]},{name:"select_order_by$subexpression$1",symbols:[r.lexerAny.has("kw_order")?{type:"kw_order"}:kw_order,"kw_by"]},{name:"select_order_by$ebnf$1",symbols:[]},{name:"select_order_by$ebnf$1$subexpression$1",symbols:["comma","select_order_by_expr"],postprocess:i},{name:"select_order_by$ebnf$1",symbols:["select_order_by$ebnf$1","select_order_by$ebnf$1$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"select_order_by",symbols:["select_order_by$subexpression$1","select_order_by_expr","select_order_by$ebnf$1"],postprocess:([e,o,t])=>[o,...t||[]]},{name:"select_order_by_expr$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("kw_asc")?{type:"kw_asc"}:kw_asc]},{name:"select_order_by_expr$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("kw_desc")?{type:"kw_desc"}:kw_desc]},{name:"select_order_by_expr$ebnf$1",symbols:["select_order_by_expr$ebnf$1$subexpression$1"],postprocess:l},{name:"select_order_by_expr$ebnf$1",symbols:[],postprocess:()=>null},{name:"select_order_by_expr$ebnf$2$subexpression$1$subexpression$1",symbols:["kw_first"]},{name:"select_order_by_expr$ebnf$2$subexpression$1$subexpression$1",symbols:["kw_last"]},{name:"select_order_by_expr$ebnf$2$subexpression$1",symbols:["kw_nulls","select_order_by_expr$ebnf$2$subexpression$1$subexpression$1"],postprocess:i},{name:"select_order_by_expr$ebnf$2",symbols:["select_order_by_expr$ebnf$2$subexpression$1"],postprocess:l},{name:"select_order_by_expr$ebnf$2",symbols:[],postprocess:()=>null},{name:"select_order_by_expr",symbols:["expr","select_order_by_expr$ebnf$1","select_order_by_expr$ebnf$2"],postprocess:e=>(0,n.track)(e,{by:e[0],...e[1]&&{order:d(e[1]).toUpperCase()},...e[2]&&{nulls:d(e[2]).toUpperCase()}})},{name:"expr",symbols:["expr_nostar"],postprocess:s},{name:"expr",symbols:["expr_star"],postprocess:s},{name:"expr_nostar",symbols:["expr_paren"],postprocess:s},{name:"expr_nostar",symbols:["expr_or"],postprocess:s},{name:"expr_paren$subexpression$1",symbols:["expr_or_select"]},{name:"expr_paren$subexpression$1",symbols:["expr_list_many"]},{name:"expr_paren",symbols:["lparen","expr_paren$subexpression$1","rparen"],postprocess:$(1)},{name:"expr_or$macrocall$2$macrocall$2",symbols:[r.lexerAny.has("kw_or")?{type:"kw_or"}:kw_or]},{name:"expr_or$macrocall$2$macrocall$1",symbols:["expr_or$macrocall$2$macrocall$2"],postprocess:e=>(0,n.track)(e,{op:(d(e," ")||"<error>").toUpperCase()})},{name:"expr_or$macrocall$2",symbols:["expr_or$macrocall$2$macrocall$1"]},{name:"expr_or$macrocall$3",symbols:["expr_or"]},{name:"expr_or$macrocall$4",symbols:["expr_and"]},{name:"expr_or$macrocall$1$subexpression$1",symbols:["expr_or$macrocall$3"]},{name:"expr_or$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_or$macrocall$1$subexpression$2",symbols:["expr_or$macrocall$4"]},{name:"expr_or$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_or$macrocall$1",symbols:["expr_or$macrocall$1$subexpression$1","expr_or$macrocall$2","expr_or$macrocall$1$subexpression$2"],postprocess:e=>(0,n.track)(e,{type:"binary",left:s(e[0]),right:s(e[2]),...s(e[1])})},{name:"expr_or$macrocall$1",symbols:["expr_or$macrocall$4"],postprocess:s},{name:"expr_or",symbols:["expr_or$macrocall$1"]},{name:"expr_and$macrocall$2$macrocall$2",symbols:[r.lexerAny.has("kw_and")?{type:"kw_and"}:kw_and]},{name:"expr_and$macrocall$2$macrocall$1",symbols:["expr_and$macrocall$2$macrocall$2"],postprocess:e=>(0,n.track)(e,{op:(d(e," ")||"<error>").toUpperCase()})},{name:"expr_and$macrocall$2",symbols:["expr_and$macrocall$2$macrocall$1"]},{name:"expr_and$macrocall$3",symbols:["expr_and"]},{name:"expr_and$macrocall$4",symbols:["expr_not"]},{name:"expr_and$macrocall$1$subexpression$1",symbols:["expr_and$macrocall$3"]},{name:"expr_and$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_and$macrocall$1$subexpression$2",symbols:["expr_and$macrocall$4"]},{name:"expr_and$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_and$macrocall$1",symbols:["expr_and$macrocall$1$subexpression$1","expr_and$macrocall$2","expr_and$macrocall$1$subexpression$2"],postprocess:e=>(0,n.track)(e,{type:"binary",left:s(e[0]),right:s(e[2]),...s(e[1])})},{name:"expr_and$macrocall$1",symbols:["expr_and$macrocall$4"],postprocess:s},{name:"expr_and",symbols:["expr_and$macrocall$1"]},{name:"expr_not$macrocall$2$macrocall$2",symbols:[r.lexerAny.has("kw_not")?{type:"kw_not"}:kw_not]},{name:"expr_not$macrocall$2$macrocall$1",symbols:["expr_not$macrocall$2$macrocall$2"],postprocess:e=>(0,n.track)(e,{op:(d(e," ")||"<error>").toUpperCase()})},{name:"expr_not$macrocall$2",symbols:["expr_not$macrocall$2$macrocall$1"]},{name:"expr_not$macrocall$3",symbols:["expr_not"]},{name:"expr_not$macrocall$4",symbols:["expr_eq"]},{name:"expr_not$macrocall$1$subexpression$1",symbols:["expr_not$macrocall$3"]},{name:"expr_not$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_not$macrocall$1",symbols:["expr_not$macrocall$2","expr_not$macrocall$1$subexpression$1"],postprocess:e=>(0,n.track)(e,{type:"unary",...s(e[0]),operand:s(e[1])})},{name:"expr_not$macrocall$1",symbols:["expr_not$macrocall$4"],postprocess:s},{name:"expr_not",symbols:["expr_not$macrocall$1"]},{name:"expr_eq$macrocall$2$macrocall$2$subexpression$1",symbols:[r.lexerAny.has("op_eq")?{type:"op_eq"}:op_eq]},{name:"expr_eq$macrocall$2$macrocall$2$subexpression$1",symbols:[r.lexerAny.has("op_neq")?{type:"op_neq"}:op_neq]},{name:"expr_eq$macrocall$2$macrocall$2",symbols:["expr_eq$macrocall$2$macrocall$2$subexpression$1"]},{name:"expr_eq$macrocall$2$macrocall$1$macrocall$2",symbols:["expr_eq$macrocall$2$macrocall$2"]},{name:"expr_eq$macrocall$2$macrocall$1$macrocall$1",symbols:["expr_eq$macrocall$2$macrocall$1$macrocall$2"],postprocess:e=>(0,n.track)(e,{op:(d(e," ")||"<error>").toUpperCase()})},{name:"expr_eq$macrocall$2$macrocall$1",symbols:["expr_eq$macrocall$2$macrocall$1$macrocall$1"],postprocess:s},{name:"expr_eq$macrocall$2$macrocall$1",symbols:["kw_operator","lparen","ident","dot","expr_eq$macrocall$2$macrocall$2","rparen"],postprocess:e=>(0,n.track)(e,{op:(d(e[4]," ")||"<error>").toUpperCase(),opSchema:d(e[2])})},{name:"expr_eq$macrocall$2",symbols:["expr_eq$macrocall$2$macrocall$1"]},{name:"expr_eq$macrocall$3",symbols:["expr_eq"]},{name:"expr_eq$macrocall$4",symbols:["expr_is"]},{name:"expr_eq$macrocall$1$subexpression$1",symbols:["expr_eq$macrocall$3"]},{name:"expr_eq$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_eq$macrocall$1$subexpression$2",symbols:["expr_eq$macrocall$4"]},{name:"expr_eq$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_eq$macrocall$1",symbols:["expr_eq$macrocall$1$subexpression$1","expr_eq$macrocall$2","expr_eq$macrocall$1$subexpression$2"],postprocess:e=>(0,n.track)(e,{type:"binary",left:s(e[0]),right:s(e[2]),...s(e[1])})},{name:"expr_eq$macrocall$1",symbols:["expr_eq$macrocall$4"],postprocess:s},{name:"expr_eq",symbols:["expr_eq$macrocall$1"]},{name:"expr_star",symbols:["star"],postprocess:e=>(0,n.track)(e,{type:"ref",name:"*"})},{name:"expr_is$subexpression$1",symbols:["expr_is"]},{name:"expr_is$subexpression$1",symbols:["expr_paren"]},{name:"expr_is$subexpression$2",symbols:[r.lexerAny.has("kw_isnull")?{type:"kw_isnull"}:kw_isnull]},{name:"expr_is$subexpression$2",symbols:[r.lexerAny.has("kw_is")?{type:"kw_is"}:kw_is,r.lexerAny.has("kw_null")?{type:"kw_null"}:kw_null]},{name:"expr_is",symbols:["expr_is$subexpression$1","expr_is$subexpression$2"],postprocess:e=>(0,n.track)(e,{type:"unary",op:"IS NULL",operand:s(e[0])})},{name:"expr_is$subexpression$3",symbols:["expr_is"]},{name:"expr_is$subexpression$3",symbols:["expr_paren"]},{name:"expr_is$subexpression$4",symbols:[r.lexerAny.has("kw_notnull")?{type:"kw_notnull"}:kw_notnull]},{name:"expr_is$subexpression$4",symbols:[r.lexerAny.has("kw_is")?{type:"kw_is"}:kw_is,"kw_not_null"]},{name:"expr_is",symbols:["expr_is$subexpression$3","expr_is$subexpression$4"],postprocess:e=>(0,n.track)(e,{type:"unary",op:"IS NOT NULL",operand:s(e[0])})},{name:"expr_is$subexpression$5",symbols:["expr_is"]},{name:"expr_is$subexpression$5",symbols:["expr_paren"]},{name:"expr_is$ebnf$1",symbols:[r.lexerAny.has("kw_not")?{type:"kw_not"}:kw_not],postprocess:l},{name:"expr_is$ebnf$1",symbols:[],postprocess:()=>null},{name:"expr_is$subexpression$6",symbols:[r.lexerAny.has("kw_true")?{type:"kw_true"}:kw_true]},{name:"expr_is$subexpression$6",symbols:[r.lexerAny.has("kw_false")?{type:"kw_false"}:kw_false]},{name:"expr_is",symbols:["expr_is$subexpression$5",r.lexerAny.has("kw_is")?{type:"kw_is"}:kw_is,"expr_is$ebnf$1","expr_is$subexpression$6"],postprocess:e=>(0,n.track)(e,{type:"unary",op:"IS "+b([e[2],e[3]]).join(" ").toUpperCase(),operand:s(e[0])})},{name:"expr_is",symbols:["expr_compare"],postprocess:s},{name:"expr_compare$macrocall$2$macrocall$2",symbols:[r.lexerAny.has("op_compare")?{type:"op_compare"}:op_compare]},{name:"expr_compare$macrocall$2$macrocall$1$macrocall$2",symbols:["expr_compare$macrocall$2$macrocall$2"]},{name:"expr_compare$macrocall$2$macrocall$1$macrocall$1",symbols:["expr_compare$macrocall$2$macrocall$1$macrocall$2"],postprocess:e=>(0,n.track)(e,{op:(d(e," ")||"<error>").toUpperCase()})},{name:"expr_compare$macrocall$2$macrocall$1",symbols:["expr_compare$macrocall$2$macrocall$1$macrocall$1"],postprocess:s},{name:"expr_compare$macrocall$2$macrocall$1",symbols:["kw_operator","lparen","ident","dot","expr_compare$macrocall$2$macrocall$2","rparen"],postprocess:e=>(0,n.track)(e,{op:(d(e[4]," ")||"<error>").toUpperCase(),opSchema:d(e[2])})},{name:"expr_compare$macrocall$2",symbols:["expr_compare$macrocall$2$macrocall$1"]},{name:"expr_compare$macrocall$3",symbols:["expr_compare"]},{name:"expr_compare$macrocall$4",symbols:["expr_range"]},{name:"expr_compare$macrocall$1$subexpression$1",symbols:["expr_compare$macrocall$3"]},{name:"expr_compare$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_compare$macrocall$1$subexpression$2",symbols:["expr_compare$macrocall$4"]},{name:"expr_compare$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_compare$macrocall$1",symbols:["expr_compare$macrocall$1$subexpression$1","expr_compare$macrocall$2","expr_compare$macrocall$1$subexpression$2"],postprocess:e=>(0,n.track)(e,{type:"binary",left:s(e[0]),right:s(e[2]),...s(e[1])})},{name:"expr_compare$macrocall$1",symbols:["expr_compare$macrocall$4"],postprocess:s},{name:"expr_compare",symbols:["expr_compare$macrocall$1"]},{name:"expr_range$macrocall$2",symbols:["ops_between"]},{name:"expr_range$macrocall$3",symbols:[r.lexerAny.has("kw_and")?{type:"kw_and"}:kw_and]},{name:"expr_range$macrocall$4",symbols:["expr_range"]},{name:"expr_range$macrocall$5",symbols:["expr_others"]},{name:"expr_range$macrocall$1$subexpression$1",symbols:["expr_range$macrocall$4"]},{name:"expr_range$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_range$macrocall$1$subexpression$2",symbols:["expr_range$macrocall$4"]},{name:"expr_range$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_range$macrocall$1$subexpression$3",symbols:["expr_range$macrocall$5"]},{name:"expr_range$macrocall$1$subexpression$3",symbols:["expr_paren"]},{name:"expr_range$macrocall$1",symbols:["expr_range$macrocall$1$subexpression$1","expr_range$macrocall$2","expr_range$macrocall$1$subexpression$2","expr_range$macrocall$3","expr_range$macrocall$1$subexpression$3"],postprocess:e=>(0,n.track)(e,{type:"ternary",value:s(e[0]),lo:s(e[2]),hi:s(e[4]),op:(b(e[1]).join(" ")||"<error>").toUpperCase()})},{name:"expr_range$macrocall$1",symbols:["expr_range$macrocall$5"],postprocess:s},{name:"expr_range",symbols:["expr_range$macrocall$1"]},{name:"expr_others$macrocall$2$macrocall$2",symbols:[r.lexerAny.has("ops_others")?{type:"ops_others"}:ops_others]},{name:"expr_others$macrocall$2$macrocall$1$macrocall$2",symbols:["expr_others$macrocall$2$macrocall$2"]},{name:"expr_others$macrocall$2$macrocall$1$macrocall$1",symbols:["expr_others$macrocall$2$macrocall$1$macrocall$2"],postprocess:e=>(0,n.track)(e,{op:(d(e," ")||"<error>").toUpperCase()})},{name:"expr_others$macrocall$2$macrocall$1",symbols:["expr_others$macrocall$2$macrocall$1$macrocall$1"],postprocess:s},{name:"expr_others$macrocall$2$macrocall$1",symbols:["kw_operator","lparen","ident","dot","expr_others$macrocall$2$macrocall$2","rparen"],postprocess:e=>(0,n.track)(e,{op:(d(e[4]," ")||"<error>").toUpperCase(),opSchema:d(e[2])})},{name:"expr_others$macrocall$2",symbols:["expr_others$macrocall$2$macrocall$1"]},{name:"expr_others$macrocall$3",symbols:["expr_others"]},{name:"expr_others$macrocall$4",symbols:["expr_like"]},{name:"expr_others$macrocall$1$subexpression$1",symbols:["expr_others$macrocall$3"]},{name:"expr_others$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_others$macrocall$1$subexpression$2",symbols:["expr_others$macrocall$4"]},{name:"expr_others$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_others$macrocall$1",symbols:["expr_others$macrocall$1$subexpression$1","expr_others$macrocall$2","expr_others$macrocall$1$subexpression$2"],postprocess:e=>(0,n.track)(e,{type:"binary",left:s(e[0]),right:s(e[2]),...s(e[1])})},{name:"expr_others$macrocall$1",symbols:["expr_others$macrocall$4"],postprocess:s},{name:"expr_others",symbols:["expr_others$macrocall$1"]},{name:"expr_like$macrocall$2$macrocall$2",symbols:["ops_like"]},{name:"expr_like$macrocall$2$macrocall$1",symbols:["expr_like$macrocall$2$macrocall$2"],postprocess:e=>(0,n.track)(e,{op:(d(e," ")||"<error>").toUpperCase()})},{name:"expr_like$macrocall$2",symbols:["expr_like$macrocall$2$macrocall$1"]},{name:"expr_like$macrocall$3",symbols:["expr_like"]},{name:"expr_like$macrocall$4",symbols:["expr_in"]},{name:"expr_like$macrocall$1$subexpression$1",symbols:["expr_like$macrocall$3"]},{name:"expr_like$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_like$macrocall$1$subexpression$2",symbols:["expr_like$macrocall$4"]},{name:"expr_like$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_like$macrocall$1",symbols:["expr_like$macrocall$1$subexpression$1","expr_like$macrocall$2","expr_like$macrocall$1$subexpression$2"],postprocess:e=>(0,n.track)(e,{type:"binary",left:s(e[0]),right:s(e[2]),...s(e[1])})},{name:"expr_like$macrocall$1",symbols:["expr_like$macrocall$4"],postprocess:s},{name:"expr_like",symbols:["expr_like$macrocall$1"]},{name:"expr_in$macrocall$2$macrocall$2",symbols:["ops_in"]},{name:"expr_in$macrocall$2$macrocall$1",symbols:["expr_in$macrocall$2$macrocall$2"],postprocess:e=>(0,n.track)(e,{op:(d(e," ")||"<error>").toUpperCase()})},{name:"expr_in$macrocall$2",symbols:["expr_in$macrocall$2$macrocall$1"]},{name:"expr_in$macrocall$3",symbols:["expr_in"]},{name:"expr_in$macrocall$4",symbols:["expr_add"]},{name:"expr_in$macrocall$1$subexpression$1",symbols:["expr_in$macrocall$3"]},{name:"expr_in$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_in$macrocall$1$subexpression$2",symbols:["expr_in$macrocall$4"]},{name:"expr_in$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_in$macrocall$1",symbols:["expr_in$macrocall$1$subexpression$1","expr_in$macrocall$2","expr_in$macrocall$1$subexpression$2"],postprocess:e=>(0,n.track)(e,{type:"binary",left:s(e[0]),right:s(e[2]),...s(e[1])})},{name:"expr_in$macrocall$1",symbols:["expr_in$macrocall$4"],postprocess:s},{name:"expr_in",symbols:["expr_in$macrocall$1"]},{name:"expr_add$macrocall$2$macrocall$2$subexpression$1",symbols:[r.lexerAny.has("op_plus")?{type:"op_plus"}:op_plus]},{name:"expr_add$macrocall$2$macrocall$2$subexpression$1",symbols:[r.lexerAny.has("op_minus")?{type:"op_minus"}:op_minus]},{name:"expr_add$macrocall$2$macrocall$2$subexpression$1",symbols:[r.lexerAny.has("op_additive")?{type:"op_additive"}:op_additive]},{name:"expr_add$macrocall$2$macrocall$2",symbols:["expr_add$macrocall$2$macrocall$2$subexpression$1"]},{name:"expr_add$macrocall$2$macrocall$1$macrocall$2",symbols:["expr_add$macrocall$2$macrocall$2"]},{name:"expr_add$macrocall$2$macrocall$1$macrocall$1",symbols:["expr_add$macrocall$2$macrocall$1$macrocall$2"],postprocess:e=>(0,n.track)(e,{op:(d(e," ")||"<error>").toUpperCase()})},{name:"expr_add$macrocall$2$macrocall$1",symbols:["expr_add$macrocall$2$macrocall$1$macrocall$1"],postprocess:s},{name:"expr_add$macrocall$2$macrocall$1",symbols:["kw_operator","lparen","ident","dot","expr_add$macrocall$2$macrocall$2","rparen"],postprocess:e=>(0,n.track)(e,{op:(d(e[4]," ")||"<error>").toUpperCase(),opSchema:d(e[2])})},{name:"expr_add$macrocall$2",symbols:["expr_add$macrocall$2$macrocall$1"]},{name:"expr_add$macrocall$3",symbols:["expr_add"]},{name:"expr_add$macrocall$4",symbols:["expr_mult"]},{name:"expr_add$macrocall$1$subexpression$1",symbols:["expr_add$macrocall$3"]},{name:"expr_add$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_add$macrocall$1$subexpression$2",symbols:["expr_add$macrocall$4"]},{name:"expr_add$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_add$macrocall$1",symbols:["expr_add$macrocall$1$subexpression$1","expr_add$macrocall$2","expr_add$macrocall$1$subexpression$2"],postprocess:e=>(0,n.track)(e,{type:"binary",left:s(e[0]),right:s(e[2]),...s(e[1])})},{name:"expr_add$macrocall$1",symbols:["expr_add$macrocall$4"],postprocess:s},{name:"expr_add",symbols:["expr_add$macrocall$1"]},{name:"expr_mult$macrocall$2$macrocall$2$subexpression$1",symbols:[r.lexerAny.has("star")?{type:"star"}:star]},{name:"expr_mult$macrocall$2$macrocall$2$subexpression$1",symbols:[r.lexerAny.has("op_div")?{type:"op_div"}:op_div]},{name:"expr_mult$macrocall$2$macrocall$2$subexpression$1",symbols:[r.lexerAny.has("op_mod")?{type:"op_mod"}:op_mod]},{name:"expr_mult$macrocall$2$macrocall$2",symbols:["expr_mult$macrocall$2$macrocall$2$subexpression$1"]},{name:"expr_mult$macrocall$2$macrocall$1$macrocall$2",symbols:["expr_mult$macrocall$2$macrocall$2"]},{name:"expr_mult$macrocall$2$macrocall$1$macrocall$1",symbols:["expr_mult$macrocall$2$macrocall$1$macrocall$2"],postprocess:e=>(0,n.track)(e,{op:(d(e," ")||"<error>").toUpperCase()})},{name:"expr_mult$macrocall$2$macrocall$1",symbols:["expr_mult$macrocall$2$macrocall$1$macrocall$1"],postprocess:s},{name:"expr_mult$macrocall$2$macrocall$1",symbols:["kw_operator","lparen","ident","dot","expr_mult$macrocall$2$macrocall$2","rparen"],postprocess:e=>(0,n.track)(e,{op:(d(e[4]," ")||"<error>").toUpperCase(),opSchema:d(e[2])})},{name:"expr_mult$macrocall$2",symbols:["expr_mult$macrocall$2$macrocall$1"]},{name:"expr_mult$macrocall$3",symbols:["expr_mult"]},{name:"expr_mult$macrocall$4",symbols:["expr_exp"]},{name:"expr_mult$macrocall$1$subexpression$1",symbols:["expr_mult$macrocall$3"]},{name:"expr_mult$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_mult$macrocall$1$subexpression$2",symbols:["expr_mult$macrocall$4"]},{name:"expr_mult$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_mult$macrocall$1",symbols:["expr_mult$macrocall$1$subexpression$1","expr_mult$macrocall$2","expr_mult$macrocall$1$subexpression$2"],postprocess:e=>(0,n.track)(e,{type:"binary",left:s(e[0]),right:s(e[2]),...s(e[1])})},{name:"expr_mult$macrocall$1",symbols:["expr_mult$macrocall$4"],postprocess:s},{name:"expr_mult",symbols:["expr_mult$macrocall$1"]},{name:"expr_exp$macrocall$2$macrocall$2",symbols:[r.lexerAny.has("op_exp")?{type:"op_exp"}:op_exp]},{name:"expr_exp$macrocall$2$macrocall$1$macrocall$2",symbols:["expr_exp$macrocall$2$macrocall$2"]},{name:"expr_exp$macrocall$2$macrocall$1$macrocall$1",symbols:["expr_exp$macrocall$2$macrocall$1$macrocall$2"],postprocess:e=>(0,n.track)(e,{op:(d(e," ")||"<error>").toUpperCase()})},{name:"expr_exp$macrocall$2$macrocall$1",symbols:["expr_exp$macrocall$2$macrocall$1$macrocall$1"],postprocess:s},{name:"expr_exp$macrocall$2$macrocall$1",symbols:["kw_operator","lparen","ident","dot","expr_exp$macrocall$2$macrocall$2","rparen"],postprocess:e=>(0,n.track)(e,{op:(d(e[4]," ")||"<error>").toUpperCase(),opSchema:d(e[2])})},{name:"expr_exp$macrocall$2",symbols:["expr_exp$macrocall$2$macrocall$1"]},{name:"expr_exp$macrocall$3",symbols:["expr_exp"]},{name:"expr_exp$macrocall$4",symbols:["expr_unary_add"]},{name:"expr_exp$macrocall$1$subexpression$1",symbols:["expr_exp$macrocall$3"]},{name:"expr_exp$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_exp$macrocall$1$subexpression$2",symbols:["expr_exp$macrocall$4"]},{name:"expr_exp$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_exp$macrocall$1",symbols:["expr_exp$macrocall$1$subexpression$1","expr_exp$macrocall$2","expr_exp$macrocall$1$subexpression$2"],postprocess:e=>(0,n.track)(e,{type:"binary",left:s(e[0]),right:s(e[2]),...s(e[1])})},{name:"expr_exp$macrocall$1",symbols:["expr_exp$macrocall$4"],postprocess:s},{name:"expr_exp",symbols:["expr_exp$macrocall$1"]},{name:"expr_unary_add$macrocall$2$macrocall$2$subexpression$1",symbols:[r.lexerAny.has("op_plus")?{type:"op_plus"}:op_plus]},{name:"expr_unary_add$macrocall$2$macrocall$2$subexpression$1",symbols:[r.lexerAny.has("op_minus")?{type:"op_minus"}:op_minus]},{name:"expr_unary_add$macrocall$2$macrocall$2",symbols:["expr_unary_add$macrocall$2$macrocall$2$subexpression$1"]},{name:"expr_unary_add$macrocall$2$macrocall$1$macrocall$2",symbols:["expr_unary_add$macrocall$2$macrocall$2"]},{name:"expr_unary_add$macrocall$2$macrocall$1$macrocall$1",symbols:["expr_unary_add$macrocall$2$macrocall$1$macrocall$2"],postprocess:e=>(0,n.track)(e,{op:(d(e," ")||"<error>").toUpperCase()})},{name:"expr_unary_add$macrocall$2$macrocall$1",symbols:["expr_unary_add$macrocall$2$macrocall$1$macrocall$1"],postprocess:s},{name:"expr_unary_add$macrocall$2$macrocall$1",symbols:["kw_operator","lparen","ident","dot","expr_unary_add$macrocall$2$macrocall$2","rparen"],postprocess:e=>(0,n.track)(e,{op:(d(e[4]," ")||"<error>").toUpperCase(),opSchema:d(e[2])})},{name:"expr_unary_add$macrocall$2",symbols:["expr_unary_add$macrocall$2$macrocall$1"]},{name:"expr_unary_add$macrocall$3",symbols:["expr_unary_add"]},{name:"expr_unary_add$macrocall$4",symbols:["expr_various_constructs"]},{name:"expr_unary_add$macrocall$1$subexpression$1",symbols:["expr_unary_add$macrocall$3"]},{name:"expr_unary_add$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_unary_add$macrocall$1",symbols:["expr_unary_add$macrocall$2","expr_unary_add$macrocall$1$subexpression$1"],postprocess:e=>(0,n.track)(e,{type:"unary",...s(e[0]),operand:s(e[1])})},{name:"expr_unary_add$macrocall$1",symbols:["expr_unary_add$macrocall$4"],postprocess:s},{name:"expr_unary_add",symbols:["expr_unary_add$macrocall$1"]},{name:"expr_various_constructs$macrocall$2$macrocall$2",symbols:["various_binaries"]},{name:"expr_various_constructs$macrocall$2$macrocall$1",symbols:["expr_various_constructs$macrocall$2$macrocall$2"],postprocess:e=>(0,n.track)(e,{op:(d(e," ")||"<error>").toUpperCase()})},{name:"expr_various_constructs$macrocall$2",symbols:["expr_various_constructs$macrocall$2$macrocall$1"]},{name:"expr_various_constructs$macrocall$3",symbols:["expr_various_constructs"]},{name:"expr_various_constructs$macrocall$4",symbols:["expr_array_index"]},{name:"expr_various_constructs$macrocall$1$subexpression$1",symbols:["expr_various_constructs$macrocall$3"]},{name:"expr_various_constructs$macrocall$1$subexpression$1",symbols:["expr_paren"]},{name:"expr_various_constructs$macrocall$1$subexpression$2",symbols:["expr_various_constructs$macrocall$4"]},{name:"expr_various_constructs$macrocall$1$subexpression$2",symbols:["expr_paren"]},{name:"expr_various_constructs$macrocall$1",symbols:["expr_various_constructs$macrocall$1$subexpression$1","expr_various_constructs$macrocall$2","expr_various_constructs$macrocall$1$subexpression$2"],postprocess:e=>(0,n.track)(e,{type:"binary",left:s(e[0]),right:s(e[2]),...s(e[1])})},{name:"expr_various_constructs$macrocall$1",symbols:["expr_various_constructs$macrocall$4"],postprocess:s},{name:"expr_various_constructs",symbols:["expr_various_constructs$macrocall$1"]},{name:"expr_array_index$subexpression$1",symbols:["expr_array_index"]},{name:"expr_array_index$subexpression$1",symbols:["expr_paren"]},{name:"expr_array_index",symbols:["expr_array_index$subexpression$1",r.lexerAny.has("lbracket")?{type:"lbracket"}:lbracket,"expr_nostar",r.lexerAny.has("rbracket")?{type:"rbracket"}:rbracket],postprocess:e=>(0,n.track)(e,{type:"arrayIndex",array:s(e[0]),index:s(e[2])})},{name:"expr_array_index",symbols:["expr_member"],postprocess:s},{name:"expr_member$subexpression$1",symbols:["expr_member"]},{name:"expr_member$subexpression$1",symbols:["expr_paren"]},{name:"expr_member$subexpression$2",symbols:["string"]},{name:"expr_member$subexpression$2",symbols:["int"]},{name:"expr_member",symbols:["expr_member$subexpression$1","ops_member","expr_member$subexpression$2"],postprocess:e=>(0,n.track)(e,{type:"member",operand:s(e[0]),op:e[1],member:s(e[2])})},{name:"expr_member$subexpression$3",symbols:["expr_member"]},{name:"expr_member$subexpression$3",symbols:["expr_paren"]},{name:"expr_member",symbols:["expr_member$subexpression$3",r.lexerAny.has("op_cast")?{type:"op_cast"}:op_cast,"data_type"],postprocess:e=>(0,n.track)(e,{type:"cast",operand:s(e[0]),to:e[2]})},{name:"expr_member",symbols:[r.lexerAny.has("kw_cast")?{type:"kw_cast"}:kw_cast,"lparen","expr_nostar",r.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"data_type","rparen"],postprocess:e=>(0,n.track)(e,{type:"cast",operand:s(e[2]),to:e[4]})},{name:"expr_member",symbols:["data_type","string"],postprocess:e=>(0,n.track)(e,{type:"cast",operand:(0,n.track)(e[1],{type:"string",value:(0,n.unbox)(e[1])}),to:(0,n.unbox)(e[0])})},{name:"expr_member",symbols:["expr_dot"],postprocess:s},{name:"expr_dot$subexpression$1",symbols:["word"]},{name:"expr_dot$subexpression$1",symbols:["star"]},{name:"expr_dot",symbols:["qname",r.lexerAny.has("dot")?{type:"dot"}:dot,"expr_dot$subexpression$1"],postprocess:e=>(0,n.track)(e,{type:"ref",table:s(e[0]),name:d(e[2])})},{name:"expr_dot",symbols:["expr_final"],postprocess:s},{name:"expr_final",symbols:["expr_basic"]},{name:"expr_final",symbols:["expr_primary"]},{name:"expr_basic",symbols:["expr_special_calls"]},{name:"expr_basic",symbols:["expr_call"]},{name:"expr_basic",symbols:["expr_array"]},{name:"expr_basic",symbols:["expr_case"]},{name:"expr_basic",symbols:["expr_extract"]},{name:"expr_basic",symbols:["word"],postprocess:e=>(0,n.track)(e,{type:"ref",name:s(e[0])})},{name:"expr_array$ebnf$1",symbols:["expr_subarray_items"],postprocess:l},{name:"expr_array$ebnf$1",symbols:[],postprocess:()=>null},{name:"expr_array",symbols:[r.lexerAny.has("kw_array")?{type:"kw_array"}:kw_array,r.lexerAny.has("lbracket")?{type:"lbracket"}:lbracket,"expr_array$ebnf$1",r.lexerAny.has("rbracket")?{type:"rbracket"}:rbracket],postprocess:e=>(0,n.track)(e,{type:"array",expressions:e[2]||[]})},{name:"expr_array",symbols:[r.lexerAny.has("kw_array")?{type:"kw_array"}:kw_array,"lparen","selection","rparen"],postprocess:e=>(0,n.track)(e,{type:"array select",select:s(e[2])})},{name:"expr_subarray$ebnf$1",symbols:["expr_subarray_items"],postprocess:l},{name:"expr_subarray$ebnf$1",symbols:[],postprocess:()=>null},{name:"expr_subarray",symbols:[r.lexerAny.has("lbracket")?{type:"lbracket"}:lbracket,"expr_subarray$ebnf$1",r.lexerAny.has("rbracket")?{type:"rbracket"}:rbracket],postprocess:$(1)},{name:"expr_subarray_items$macrocall$2",symbols:["expr_list_item"]},{name:"expr_subarray_items$macrocall$1$ebnf$1",symbols:[]},{name:"expr_subarray_items$macrocall$1$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("comma")?{type:"comma"}:comma,"expr_subarray_items$macrocall$2"],postprocess:i},{name:"expr_subarray_items$macrocall$1$ebnf$1",symbols:["expr_subarray_items$macrocall$1$ebnf$1","expr_subarray_items$macrocall$1$ebnf$1$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"expr_subarray_items$macrocall$1",symbols:["expr_subarray_items$macrocall$2","expr_subarray_items$macrocall$1$ebnf$1"],postprocess:([e,o])=>[e,...o||[]]},{name:"expr_subarray_items",symbols:["expr_subarray_items$macrocall$1"],postprocess:e=>e[0].map(s)},{name:"expr_subarray_items$macrocall$4",symbols:["expr_subarray"]},{name:"expr_subarray_items$macrocall$3$ebnf$1",symbols:[]},{name:"expr_subarray_items$macrocall$3$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("comma")?{type:"comma"}:comma,"expr_subarray_items$macrocall$4"],postprocess:i},{name:"expr_subarray_items$macrocall$3$ebnf$1",symbols:["expr_subarray_items$macrocall$3$ebnf$1","expr_subarray_items$macrocall$3$ebnf$1$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"expr_subarray_items$macrocall$3",symbols:["expr_subarray_items$macrocall$4","expr_subarray_items$macrocall$3$ebnf$1"],postprocess:([e,o])=>[e,...o||[]]},{name:"expr_subarray_items",symbols:["expr_subarray_items$macrocall$3"],postprocess:e=>e[0].map(o=>(0,n.track)(o,{type:"array",expressions:o[0].map(s)}))},{name:"expr_function_call$ebnf$1",symbols:["expr_list_raw"],postprocess:l},{name:"expr_function_call$ebnf$1",symbols:[],postprocess:()=>null},{name:"expr_function_call",symbols:["expr_fn_name","lparen","expr_function_call$ebnf$1","rparen"],postprocess:e=>(0,n.track)(e,{type:"call",function:s(e[0]),args:e[2]||[]})},{name:"expr_call$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("kw_all")?{type:"kw_all"}:kw_all]},{name:"expr_call$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("kw_distinct")?{type:"kw_distinct"}:kw_distinct]},{name:"expr_call$ebnf$1",symbols:["expr_call$ebnf$1$subexpression$1"],postprocess:l},{name:"expr_call$ebnf$1",symbols:[],postprocess:()=>null},{name:"expr_call$ebnf$2",symbols:["expr_list_raw"],postprocess:l},{name:"expr_call$ebnf$2",symbols:[],postprocess:()=>null},{name:"expr_call$ebnf$3",symbols:["select_order_by"],postprocess:l},{name:"expr_call$ebnf$3",symbols:[],postprocess:()=>null},{name:"expr_call$ebnf$4$subexpression$1",symbols:["kw_filter","lparen",r.lexerAny.has("kw_where")?{type:"kw_where"}:kw_where,"expr","rparen"],postprocess:$(3)},{name:"expr_call$ebnf$4",symbols:["expr_call$ebnf$4$subexpression$1"],postprocess:l},{name:"expr_call$ebnf$4",symbols:[],postprocess:()=>null},{name:"expr_call$ebnf$5",symbols:["expr_call_within_group"],postprocess:l},{name:"expr_call$ebnf$5",symbols:[],postprocess:()=>null},{name:"expr_call$ebnf$6",symbols:["expr_call_over"],postprocess:l},{name:"expr_call$ebnf$6",symbols:[],postprocess:()=>null},{name:"expr_call",symbols:["expr_fn_name","lparen","expr_call$ebnf$1","expr_call$ebnf$2","expr_call$ebnf$3","rparen","expr_call$ebnf$4","expr_call$ebnf$5","expr_call$ebnf$6"],postprocess:e=>(0,n.track)(e,{type:"call",function:s(e[0]),...e[2]&&{distinct:d(e[2])},args:e[3]||[],...e[4]&&{orderBy:e[4]},...e[6]&&{filter:s(e[6])},...e[7]&&{withinGroup:e[7]},...e[8]&&{over:s(e[8])}})},{name:"expr_call_over$ebnf$1$subexpression$1",symbols:["kw_partition","kw_by","expr_list_raw"],postprocess:i},{name:"expr_call_over$ebnf$1",symbols:["expr_call_over$ebnf$1$subexpression$1"],postprocess:l},{name:"expr_call_over$ebnf$1",symbols:[],postprocess:()=>null},{name:"expr_call_over$ebnf$2",symbols:["select_order_by"],postprocess:l},{name:"expr_call_over$ebnf$2",symbols:[],postprocess:()=>null},{name:"expr_call_over",symbols:["kw_over","lparen","expr_call_over$ebnf$1","expr_call_over$ebnf$2","rparen"],postprocess:e=>(0,n.track)(e,{...e[2]&&{partitionBy:e[2]},...e[3]&&{orderBy:e[3]}})},{name:"expr_call_within_group$subexpression$1",symbols:["kw_within",r.lexerAny.has("kw_group")?{type:"kw_group"}:kw_group]},{name:"expr_call_within_group$subexpression$2",symbols:[r.lexerAny.has("kw_order")?{type:"kw_order"}:kw_order,"kw_by"]},{name:"expr_call_within_group",symbols:["expr_call_within_group$subexpression$1","lparen","expr_call_within_group$subexpression$2","select_order_by_expr","rparen"],postprocess:e=>(0,n.track)(e,e[3])},{name:"expr_extract$subexpression$1",symbols:["word"],postprocess:k("extract")},{name:"expr_extract",symbols:["expr_extract$subexpression$1","lparen","word",r.lexerAny.has("kw_from")?{type:"kw_from"}:kw_from,"expr","rparen"],postprocess:e=>(0,n.track)(e,{type:"extract",field:u(e[2]),from:e[4]})},{name:"expr_primary",symbols:["float"],postprocess:e=>(0,n.track)(e,{type:"numeric",value:(0,n.unbox)(e[0])})},{name:"expr_primary",symbols:["int"],postprocess:e=>(0,n.track)(e,{type:"integer",value:(0,n.unbox)(e[0])})},{name:"expr_primary",symbols:["string"],postprocess:e=>(0,n.track)(e,{type:"string",value:(0,n.unbox)(e[0])})},{name:"expr_primary",symbols:[r.lexerAny.has("kw_true")?{type:"kw_true"}:kw_true],postprocess:e=>(0,n.track)(e,{type:"boolean",value:!0})},{name:"expr_primary",symbols:[r.lexerAny.has("kw_false")?{type:"kw_false"}:kw_false],postprocess:e=>(0,n.track)(e,{type:"boolean",value:!1})},{name:"expr_primary",symbols:[r.lexerAny.has("kw_null")?{type:"kw_null"}:kw_null],postprocess:e=>(0,n.track)(e,{type:"null"})},{name:"expr_primary",symbols:["value_keyword"],postprocess:e=>(0,n.track)(e,{type:"keyword",keyword:d(e)})},{name:"expr_primary",symbols:[r.lexerAny.has("qparam")?{type:"qparam"}:qparam],postprocess:e=>(0,n.track)(e,{type:"parameter",name:d(e[0])})},{name:"expr_primary",symbols:[r.lexerAny.has("kw_default")?{type:"kw_default"}:kw_default],postprocess:e=>(0,n.track)(e,{type:"default"})},{name:"ops_like",symbols:["ops_like_keywors"]},{name:"ops_like",symbols:["ops_like_operators"]},{name:"ops_like_keywors$ebnf$1",symbols:[r.lexerAny.has("kw_not")?{type:"kw_not"}:kw_not],postprocess:l},{name:"ops_like_keywors$ebnf$1",symbols:[],postprocess:()=>null},{name:"ops_like_keywors$subexpression$1",symbols:[r.lexerAny.has("kw_like")?{type:"kw_like"}:kw_like]},{name:"ops_like_keywors$subexpression$1",symbols:[r.lexerAny.has("kw_ilike")?{type:"kw_ilike"}:kw_ilike]},{name:"ops_like_keywors",symbols:["ops_like_keywors$ebnf$1","ops_like_keywors$subexpression$1"]},{name:"ops_like_operators$subexpression$1",symbols:[r.lexerAny.has("op_like")?{type:"op_like"}:op_like],postprocess:()=>"LIKE"},{name:"ops_like_operators",symbols:["ops_like_operators$subexpression$1"]},{name:"ops_like_operators$subexpression$2",symbols:[r.lexerAny.has("op_ilike")?{type:"op_ilike"}:op_ilike],postprocess:()=>"ILIKE"},{name:"ops_like_operators",symbols:["ops_like_operators$subexpression$2"]},{name:"ops_like_operators$subexpression$3",symbols:[r.lexerAny.has("op_not_like")?{type:"op_not_like"}:op_not_like],postprocess:()=>"NOT LIKE"},{name:"ops_like_operators",symbols:["ops_like_operators$subexpression$3"]},{name:"ops_like_operators$subexpression$4",symbols:[r.lexerAny.has("op_not_ilike")?{type:"op_not_ilike"}:op_not_ilike],postprocess:()=>"NOT ILIKE"},{name:"ops_like_operators",symbols:["ops_like_operators$subexpression$4"]},{name:"ops_in$ebnf$1",symbols:[r.lexerAny.has("kw_not")?{type:"kw_not"}:kw_not],postprocess:l},{name:"ops_in$ebnf$1",symbols:[],postprocess:()=>null},{name:"ops_in",symbols:["ops_in$ebnf$1",r.lexerAny.has("kw_in")?{type:"kw_in"}:kw_in]},{name:"ops_between$ebnf$1",symbols:[r.lexerAny.has("kw_not")?{type:"kw_not"}:kw_not],postprocess:l},{name:"ops_between$ebnf$1",symbols:[],postprocess:()=>null},{name:"ops_between",symbols:["ops_between$ebnf$1","kw_between"]},{name:"ops_member$subexpression$1",symbols:[r.lexerAny.has("op_member")?{type:"op_member"}:op_member]},{name:"ops_member$subexpression$1",symbols:[r.lexerAny.has("op_membertext")?{type:"op_membertext"}:op_membertext]},{name:"ops_member",symbols:["ops_member$subexpression$1"],postprocess:e=>{var o;return(o=s(e))===null||o===void 0?void 0:o.value}},{name:"expr_list_item",symbols:["expr_or_select"],postprocess:s},{name:"expr_list_item",symbols:["expr_star"],postprocess:s},{name:"expr_list_raw$macrocall$2",symbols:["expr_list_item"]},{name:"expr_list_raw$macrocall$1$ebnf$1",symbols:[]},{name:"expr_list_raw$macrocall$1$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("comma")?{type:"comma"}:comma,"expr_list_raw$macrocall$2"],postprocess:i},{name:"expr_list_raw$macrocall$1$ebnf$1",symbols:["expr_list_raw$macrocall$1$ebnf$1","expr_list_raw$macrocall$1$ebnf$1$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"expr_list_raw$macrocall$1",symbols:["expr_list_raw$macrocall$2","expr_list_raw$macrocall$1$ebnf$1"],postprocess:([e,o])=>[e,...o||[]]},{name:"expr_list_raw",symbols:["expr_list_raw$macrocall$1"],postprocess:([e])=>e.map(s)},{name:"expr_list_raw_many$macrocall$2",symbols:["expr_list_item"]},{name:"expr_list_raw_many$macrocall$1$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("comma")?{type:"comma"}:comma,"expr_list_raw_many$macrocall$2"],postprocess:i},{name:"expr_list_raw_many$macrocall$1$ebnf$1",symbols:["expr_list_raw_many$macrocall$1$ebnf$1$subexpression$1"]},{name:"expr_list_raw_many$macrocall$1$ebnf$1$subexpression$2",symbols:[r.lexerAny.has("comma")?{type:"comma"}:comma,"expr_list_raw_many$macrocall$2"],postprocess:i},{name:"expr_list_raw_many$macrocall$1$ebnf$1",symbols:["expr_list_raw_many$macrocall$1$ebnf$1","expr_list_raw_many$macrocall$1$ebnf$1$subexpression$2"],postprocess:e=>e[0].concat([e[1]])},{name:"expr_list_raw_many$macrocall$1",symbols:["expr_list_raw_many$macrocall$2","expr_list_raw_many$macrocall$1$ebnf$1"],postprocess:([e,o])=>[e,...o||[]]},{name:"expr_list_raw_many",symbols:["expr_list_raw_many$macrocall$1"],postprocess:([e])=>e.map(s)},{name:"expr_or_select",symbols:["expr_nostar"],postprocess:s},{name:"expr_or_select",symbols:["selection"],postprocess:s},{name:"expr_list_many",symbols:["expr_list_raw_many"],postprocess:e=>(0,n.track)(e,{type:"list",expressions:e[0]})},{name:"expr_case$ebnf$1",symbols:["expr_nostar"],postprocess:l},{name:"expr_case$ebnf$1",symbols:[],postprocess:()=>null},{name:"expr_case$ebnf$2",symbols:[]},{name:"expr_case$ebnf$2",symbols:["expr_case$ebnf$2","expr_case_whens"],postprocess:e=>e[0].concat([e[1]])},{name:"expr_case$ebnf$3",symbols:["expr_case_else"],postprocess:l},{name:"expr_case$ebnf$3",symbols:[],postprocess:()=>null},{name:"expr_case",symbols:[r.lexerAny.has("kw_case")?{type:"kw_case"}:kw_case,"expr_case$ebnf$1","expr_case$ebnf$2","expr_case$ebnf$3",r.lexerAny.has("kw_end")?{type:"kw_end"}:kw_end],postprocess:e=>(0,n.track)(e,{type:"case",value:e[1],whens:e[2],else:e[3]})},{name:"expr_case_whens",symbols:[r.lexerAny.has("kw_when")?{type:"kw_when"}:kw_when,"expr_nostar",r.lexerAny.has("kw_then")?{type:"kw_then"}:kw_then,"expr_nostar"],postprocess:e=>(0,n.track)(e,{when:e[1],value:e[3]})},{name:"expr_case_else",symbols:[r.lexerAny.has("kw_else")?{type:"kw_else"}:kw_else,"expr_nostar"],postprocess:i},{name:"expr_fn_name$subexpression$1$ebnf$1$subexpression$1",symbols:["word",r.lexerAny.has("dot")?{type:"dot"}:dot]},{name:"expr_fn_name$subexpression$1$ebnf$1",symbols:["expr_fn_name$subexpression$1$ebnf$1$subexpression$1"],postprocess:l},{name:"expr_fn_name$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"expr_fn_name$subexpression$1",symbols:["expr_fn_name$subexpression$1$ebnf$1","word_or_keyword"],postprocess:e=>(0,n.track)(e,{name:(0,n.unbox)(s(e[1])),...e[0]&&{schema:d(e[0][0])}})},{name:"expr_fn_name",symbols:["expr_fn_name$subexpression$1"]},{name:"expr_fn_name$subexpression$2$subexpression$1",symbols:[r.lexerAny.has("kw_any")?{type:"kw_any"}:kw_any]},{name:"expr_fn_name$subexpression$2$subexpression$1",symbols:[r.lexerAny.has("kw_some")?{type:"kw_some"}:kw_some]},{name:"expr_fn_name$subexpression$2$subexpression$1",symbols:[r.lexerAny.has("kw_all")?{type:"kw_all"}:kw_all]},{name:"expr_fn_name$subexpression$2$subexpression$1",symbols:[r.lexerAny.has("kw_left")?{type:"kw_left"}:kw_left]},{name:"expr_fn_name$subexpression$2$subexpression$1",symbols:[r.lexerAny.has("kw_right")?{type:"kw_right"}:kw_right]},{name:"expr_fn_name$subexpression$2",symbols:["expr_fn_name$subexpression$2$subexpression$1"],postprocess:e=>(0,n.track)(e,{name:d(s(e))})},{name:"expr_fn_name",symbols:["expr_fn_name$subexpression$2"]},{name:"word_or_keyword",symbols:["word"]},{name:"word_or_keyword",symbols:["value_keyword"],postprocess:e=>(0,n.box)(e,d(e))},{name:"value_keyword",symbols:[r.lexerAny.has("kw_current_catalog")?{type:"kw_current_catalog"}:kw_current_catalog]},{name:"value_keyword",symbols:[r.lexerAny.has("kw_current_date")?{type:"kw_current_date"}:kw_current_date]},{name:"value_keyword",symbols:[r.lexerAny.has("kw_current_role")?{type:"kw_current_role"}:kw_current_role]},{name:"value_keyword",symbols:[r.lexerAny.has("kw_current_schema")?{type:"kw_current_schema"}:kw_current_schema]},{name:"value_keyword",symbols:[r.lexerAny.has("kw_current_timestamp")?{type:"kw_current_timestamp"}:kw_current_timestamp]},{name:"value_keyword",symbols:[r.lexerAny.has("kw_current_time")?{type:"kw_current_time"}:kw_current_time]},{name:"value_keyword",symbols:[r.lexerAny.has("kw_localtimestamp")?{type:"kw_localtimestamp"}:kw_localtimestamp]},{name:"value_keyword",symbols:[r.lexerAny.has("kw_localtime")?{type:"kw_localtime"}:kw_localtime]},{name:"value_keyword",symbols:[r.lexerAny.has("kw_session_user")?{type:"kw_session_user"}:kw_session_user]},{name:"value_keyword",symbols:[r.lexerAny.has("kw_user")?{type:"kw_user"}:kw_user]},{name:"value_keyword",symbols:[r.lexerAny.has("kw_current_user")?{type:"kw_current_user"}:kw_current_user]},{name:"expr_special_calls",symbols:["spe_overlay"]},{name:"expr_special_calls",symbols:["spe_substring"]},{name:"spe_overlay$subexpression$1",symbols:["word"],postprocess:k("overlay")},{name:"spe_overlay$subexpression$2",symbols:[r.lexerAny.has("lparen")?{type:"lparen"}:lparen,"expr_nostar"]},{name:"spe_overlay$subexpression$3",symbols:[r.lexerAny.has("kw_placing")?{type:"kw_placing"}:kw_placing,"expr_nostar"]},{name:"spe_overlay$subexpression$4",symbols:[r.lexerAny.has("kw_from")?{type:"kw_from"}:kw_from,"expr_nostar"]},{name:"spe_overlay$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("kw_for")?{type:"kw_for"}:kw_for,"expr_nostar"]},{name:"spe_overlay$ebnf$1",symbols:["spe_overlay$ebnf$1$subexpression$1"],postprocess:l},{name:"spe_overlay$ebnf$1",symbols:[],postprocess:()=>null},{name:"spe_overlay",symbols:["spe_overlay$subexpression$1","spe_overlay$subexpression$2","spe_overlay$subexpression$3","spe_overlay$subexpression$4","spe_overlay$ebnf$1",r.lexerAny.has("rparen")?{type:"rparen"}:rparen],postprocess:e=>(0,n.track)(e,{type:"overlay",value:e[1][1],placing:e[2][1],from:e[3][1],...e[4]&&{for:e[4][1]}})},{name:"spe_substring$subexpression$1",symbols:["word"],postprocess:k("substring")},{name:"spe_substring$subexpression$2",symbols:[r.lexerAny.has("lparen")?{type:"lparen"}:lparen,"expr_nostar"]},{name:"spe_substring$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("kw_from")?{type:"kw_from"}:kw_from,"expr_nostar"]},{name:"spe_substring$ebnf$1",symbols:["spe_substring$ebnf$1$subexpression$1"],postprocess:l},{name:"spe_substring$ebnf$1",symbols:[],postprocess:()=>null},{name:"spe_substring$ebnf$2$subexpression$1",symbols:[r.lexerAny.has("kw_for")?{type:"kw_for"}:kw_for,"expr_nostar"]},{name:"spe_substring$ebnf$2",symbols:["spe_substring$ebnf$2$subexpression$1"],postprocess:l},{name:"spe_substring$ebnf$2",symbols:[],postprocess:()=>null},{name:"spe_substring",symbols:["spe_substring$subexpression$1","spe_substring$subexpression$2","spe_substring$ebnf$1","spe_substring$ebnf$2",r.lexerAny.has("rparen")?{type:"rparen"}:rparen],postprocess:e=>(0,n.track)(e,{type:"substring",value:e[1][1],...e[2]&&{from:e[2][1]},...e[3]&&{for:e[3][1]}})},{name:"various_binaries",symbols:["kw_at","kw_time","kw_zone"],postprocess:()=>"AT TIME ZONE"},{name:"createtable_statement$ebnf$1",symbols:["createtable_modifiers"],postprocess:l},{name:"createtable_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"createtable_statement$ebnf$2",symbols:["kw_ifnotexists"],postprocess:l},{name:"createtable_statement$ebnf$2",symbols:[],postprocess:()=>null},{name:"createtable_statement$ebnf$3",symbols:["createtable_opts"],postprocess:l},{name:"createtable_statement$ebnf$3",symbols:[],postprocess:()=>null},{name:"createtable_statement",symbols:[r.lexerAny.has("kw_create")?{type:"kw_create"}:kw_create,"createtable_statement$ebnf$1",r.lexerAny.has("kw_table")?{type:"kw_table"}:kw_table,"createtable_statement$ebnf$2","qname","lparen","createtable_declarationlist","rparen","createtable_statement$ebnf$3"],postprocess:e=>{const o=e[6].filter(c=>"kind"in c),t=e[6].filter(c=>!("kind"in c));return(0,n.track)(e,{type:"create table",...e[3]?{ifNotExists:!0}:{},name:e[4],columns:o,...s(e[1]),...t.length?{constraints:t}:{},...i(e)})}},{name:"createtable_modifiers",symbols:["kw_unlogged"],postprocess:e=>e[0]?{unlogged:!0}:{}},{name:"createtable_modifiers",symbols:["m_locglob"]},{name:"createtable_modifiers",symbols:["m_tmp"]},{name:"createtable_modifiers",symbols:["m_locglob","m_tmp"],postprocess:([e,o])=>({...e,...o})},{name:"m_locglob$subexpression$1",symbols:["kw_local"]},{name:"m_locglob$subexpression$1",symbols:["kw_global"]},{name:"m_locglob",symbols:["m_locglob$subexpression$1"],postprocess:e=>({locality:d(e)})},{name:"m_tmp$subexpression$1",symbols:["kw_temp"]},{name:"m_tmp$subexpression$1",symbols:["kw_temporary"]},{name:"m_tmp",symbols:["m_tmp$subexpression$1"],postprocess:e=>({temporary:!0})},{name:"createtable_declarationlist$ebnf$1",symbols:[]},{name:"createtable_declarationlist$ebnf$1$subexpression$1",symbols:["comma","createtable_declaration"],postprocess:i},{name:"createtable_declarationlist$ebnf$1",symbols:["createtable_declarationlist$ebnf$1","createtable_declarationlist$ebnf$1$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"createtable_declarationlist",symbols:["createtable_declaration","createtable_declarationlist$ebnf$1"],postprocess:([e,o])=>[e,...o||[]]},{name:"createtable_declaration$subexpression$1",symbols:["createtable_constraint"]},{name:"createtable_declaration$subexpression$1",symbols:["createtable_column"]},{name:"createtable_declaration$subexpression$1",symbols:["createtable_like"]},{name:"createtable_declaration",symbols:["createtable_declaration$subexpression$1"],postprocess:s},{name:"createtable_constraint$macrocall$2",symbols:["createtable_constraint_def"]},{name:"createtable_constraint$macrocall$1$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("kw_constraint")?{type:"kw_constraint"}:kw_constraint,"word"]},{name:"createtable_constraint$macrocall$1$ebnf$1",symbols:["createtable_constraint$macrocall$1$ebnf$1$subexpression$1"],postprocess:l},{name:"createtable_constraint$macrocall$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"createtable_constraint$macrocall$1",symbols:["createtable_constraint$macrocall$1$ebnf$1","createtable_constraint$macrocall$2"],postprocess:e=>{const o=e[0]&&u(e[0][1]);return o?(0,n.track)(e,{constraintName:o,...s(e[1])}):(0,n.track)(e,s(e[1]))}},{name:"createtable_constraint",symbols:["createtable_constraint$macrocall$1"],postprocess:s},{name:"createtable_constraint_def",symbols:["createtable_constraint_def_unique"]},{name:"createtable_constraint_def",symbols:["createtable_constraint_def_check"]},{name:"createtable_constraint_def",symbols:["createtable_constraint_foreignkey"]},{name:"createtable_constraint_def_unique$subexpression$1",symbols:[r.lexerAny.has("kw_unique")?{type:"kw_unique"}:kw_unique]},{name:"createtable_constraint_def_unique$subexpression$1",symbols:["kw_primary_key"]},{name:"createtable_constraint_def_unique",symbols:["createtable_constraint_def_unique$subexpression$1","lparen","createtable_collist","rparen"],postprocess:e=>(0,n.track)(e,{type:d(e[0]," "),columns:e[2].map(u)})},{name:"createtable_constraint_def_check",symbols:[r.lexerAny.has("kw_check")?{type:"kw_check"}:kw_check,"expr_paren"],postprocess:e=>(0,n.track)(e,{type:"check",expr:s(e[1])})},{name:"createtable_constraint_foreignkey",symbols:[r.lexerAny.has("kw_foreign")?{type:"kw_foreign"}:kw_foreign,"kw_key","collist_paren","createtable_references"],postprocess:e=>(0,n.track)(e,{type:"foreign key",localColumns:e[2].map(u),...e[3]})},{name:"createtable_references$ebnf$1",symbols:[]},{name:"createtable_references$ebnf$1",symbols:["createtable_references$ebnf$1","createtable_constraint_foreignkey_onsometing"],postprocess:e=>e[0].concat([e[1]])},{name:"createtable_references",symbols:[r.lexerAny.has("kw_references")?{type:"kw_references"}:kw_references,"table_ref","collist_paren","createtable_references$ebnf$1"],postprocess:e=>(0,n.track)(e,{foreignTable:s(e[1]),foreignColumns:e[2].map(u),...e[3].reduce((o,t)=>({...o,...t}),{})})},{name:"createtable_constraint_foreignkey_onsometing",symbols:[r.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on,"kw_delete","createtable_constraint_on_action"],postprocess:e=>(0,n.track)(e,{onDelete:i(e)})},{name:"createtable_constraint_foreignkey_onsometing",symbols:[r.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on,"kw_update","createtable_constraint_on_action"],postprocess:e=>(0,n.track)(e,{onUpdate:i(e)})},{name:"createtable_constraint_foreignkey_onsometing$subexpression$1",symbols:[r.lexerAny.has("kw_full")?{type:"kw_full"}:kw_full]},{name:"createtable_constraint_foreignkey_onsometing$subexpression$1",symbols:["kw_partial"]},{name:"createtable_constraint_foreignkey_onsometing$subexpression$1",symbols:["kw_simple"]},{name:"createtable_constraint_foreignkey_onsometing",symbols:["kw_match","createtable_constraint_foreignkey_onsometing$subexpression$1"],postprocess:e=>(0,n.track)(e,{match:d(i(e))})},{name:"createtable_constraint_on_action$subexpression$1",symbols:["kw_cascade"]},{name:"createtable_constraint_on_action$subexpression$1$subexpression$1",symbols:["kw_no","kw_action"]},{name:"createtable_constraint_on_action$subexpression$1",symbols:["createtable_constraint_on_action$subexpression$1$subexpression$1"]},{name:"createtable_constraint_on_action$subexpression$1",symbols:["kw_restrict"]},{name:"createtable_constraint_on_action$subexpression$1$subexpression$2",symbols:[r.lexerAny.has("kw_null")?{type:"kw_null"}:kw_null]},{name:"createtable_constraint_on_action$subexpression$1$subexpression$2",symbols:[r.lexerAny.has("kw_default")?{type:"kw_default"}:kw_default]},{name:"createtable_constraint_on_action$subexpression$1",symbols:["kw_set","createtable_constraint_on_action$subexpression$1$subexpression$2"]},{name:"createtable_constraint_on_action",symbols:["createtable_constraint_on_action$subexpression$1"],postprocess:e=>d(e," ")},{name:"createtable_collist$ebnf$1",symbols:[]},{name:"createtable_collist$ebnf$1$subexpression$1",symbols:["comma","ident"],postprocess:i},{name:"createtable_collist$ebnf$1",symbols:["createtable_collist$ebnf$1","createtable_collist$ebnf$1$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"createtable_collist",symbols:["ident","createtable_collist$ebnf$1"],postprocess:([e,o])=>[e,...o||[]]},{name:"createtable_column$ebnf$1",symbols:["createtable_collate"],postprocess:l},{name:"createtable_column$ebnf$1",symbols:[],postprocess:()=>null},{name:"createtable_column$ebnf$2",symbols:[]},{name:"createtable_column$ebnf$2",symbols:["createtable_column$ebnf$2","createtable_column_constraint"],postprocess:e=>e[0].concat([e[1]])},{name:"createtable_column",symbols:["word","data_type","createtable_column$ebnf$1","createtable_column$ebnf$2"],postprocess:e=>(0,n.track)(e,{kind:"column",name:u(e[0]),dataType:e[1],...e[2]?{collate:e[2][1]}:{},...e[3]&&e[3].length?{constraints:e[3]}:{}})},{name:"createtable_like$ebnf$1",symbols:[]},{name:"createtable_like$ebnf$1",symbols:["createtable_like$ebnf$1","createtable_like_opt"],postprocess:e=>e[0].concat([e[1]])},{name:"createtable_like",symbols:[r.lexerAny.has("kw_like")?{type:"kw_like"}:kw_like,"qname","createtable_like$ebnf$1"],postprocess:e=>(0,n.track)(e,{kind:"like table",like:e[1],options:e[2]})},{name:"createtable_like_opt$subexpression$1",symbols:["kw_including"]},{name:"createtable_like_opt$subexpression$1",symbols:["kw_excluding"]},{name:"createtable_like_opt",symbols:["createtable_like_opt$subexpression$1","createtable_like_opt_val"],postprocess:e=>(0,n.track)(e,{verb:d(e[0]),option:d(e[1])})},{name:"createtable_like_opt_val",symbols:["word"],postprocess:v("defaults","constraints","indexes","storage","comments")},{name:"createtable_like_opt_val",symbols:[r.lexerAny.has("kw_all")?{type:"kw_all"}:kw_all]},{name:"createtable_column_constraint$macrocall$2",symbols:["createtable_column_constraint_def"]},{name:"createtable_column_constraint$macrocall$1$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("kw_constraint")?{type:"kw_constraint"}:kw_constraint,"word"]},{name:"createtable_column_constraint$macrocall$1$ebnf$1",symbols:["createtable_column_constraint$macrocall$1$ebnf$1$subexpression$1"],postprocess:l},{name:"createtable_column_constraint$macrocall$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"createtable_column_constraint$macrocall$1",symbols:["createtable_column_constraint$macrocall$1$ebnf$1","createtable_column_constraint$macrocall$2"],postprocess:e=>{const o=e[0]&&u(e[0][1]);return o?(0,n.track)(e,{constraintName:o,...s(e[1])}):(0,n.track)(e,s(e[1]))}},{name:"createtable_column_constraint",symbols:["createtable_column_constraint$macrocall$1"],postprocess:s},{name:"createtable_column_constraint_def",symbols:[r.lexerAny.has("kw_unique")?{type:"kw_unique"}:kw_unique],postprocess:e=>(0,n.track)(e,{type:"unique"})},{name:"createtable_column_constraint_def",symbols:["kw_primary_key"],postprocess:e=>(0,n.track)(e,{type:"primary key"})},{name:"createtable_column_constraint_def",symbols:["kw_not_null"],postprocess:e=>(0,n.track)(e,{type:"not null"})},{name:"createtable_column_constraint_def",symbols:[r.lexerAny.has("kw_null")?{type:"kw_null"}:kw_null],postprocess:e=>(0,n.track)(e,{type:"null"})},{name:"createtable_column_constraint_def",symbols:[r.lexerAny.has("kw_default")?{type:"kw_default"}:kw_default,"expr"],postprocess:e=>(0,n.track)(e,{type:"default",default:s(e[1])})},{name:"createtable_column_constraint_def",symbols:[r.lexerAny.has("kw_check")?{type:"kw_check"}:kw_check,"expr_paren"],postprocess:e=>(0,n.track)(e,{type:"check",expr:s(e[1])})},{name:"createtable_column_constraint_def",symbols:["createtable_references"],postprocess:e=>(0,n.track)(e,{type:"reference",...s(e)})},{name:"createtable_column_constraint_def",symbols:["altercol_generated"]},{name:"createtable_collate",symbols:[r.lexerAny.has("kw_collate")?{type:"kw_collate"}:kw_collate,"qualified_name"]},{name:"createtable_opts$subexpression$1",symbols:["word"],postprocess:k("inherits")},{name:"createtable_opts$macrocall$2",symbols:["qname"]},{name:"createtable_opts$macrocall$1$ebnf$1",symbols:[]},{name:"createtable_opts$macrocall$1$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("comma")?{type:"comma"}:comma,"createtable_opts$macrocall$2"],postprocess:i},{name:"createtable_opts$macrocall$1$ebnf$1",symbols:["createtable_opts$macrocall$1$ebnf$1","createtable_opts$macrocall$1$ebnf$1$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"createtable_opts$macrocall$1",symbols:["createtable_opts$macrocall$2","createtable_opts$macrocall$1$ebnf$1"],postprocess:([e,o])=>[s(e),...o.map(s)||[]]},{name:"createtable_opts",symbols:["createtable_opts$subexpression$1","lparen","createtable_opts$macrocall$1","rparen"],postprocess:e=>(0,n.track)(e,{inherits:e[2]})},{name:"createindex_statement$ebnf$1",symbols:[r.lexerAny.has("kw_unique")?{type:"kw_unique"}:kw_unique],postprocess:l},{name:"createindex_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"createindex_statement$ebnf$2",symbols:[r.lexerAny.has("kw_concurrently")?{type:"kw_concurrently"}:kw_concurrently],postprocess:l},{name:"createindex_statement$ebnf$2",symbols:[],postprocess:()=>null},{name:"createindex_statement$ebnf$3",symbols:["kw_ifnotexists"],postprocess:l},{name:"createindex_statement$ebnf$3",symbols:[],postprocess:()=>null},{name:"createindex_statement$ebnf$4",symbols:["word"],postprocess:l},{name:"createindex_statement$ebnf$4",symbols:[],postprocess:()=>null},{name:"createindex_statement$ebnf$5$subexpression$1",symbols:[r.lexerAny.has("kw_using")?{type:"kw_using"}:kw_using,"ident"],postprocess:i},{name:"createindex_statement$ebnf$5",symbols:["createindex_statement$ebnf$5$subexpression$1"],postprocess:l},{name:"createindex_statement$ebnf$5",symbols:[],postprocess:()=>null},{name:"createindex_statement$ebnf$6",symbols:["createindex_with"],postprocess:l},{name:"createindex_statement$ebnf$6",symbols:[],postprocess:()=>null},{name:"createindex_statement$ebnf$7",symbols:["createindex_tblspace"],postprocess:l},{name:"createindex_statement$ebnf$7",symbols:[],postprocess:()=>null},{name:"createindex_statement$ebnf$8",symbols:["createindex_predicate"],postprocess:l},{name:"createindex_statement$ebnf$8",symbols:[],postprocess:()=>null},{name:"createindex_statement",symbols:[r.lexerAny.has("kw_create")?{type:"kw_create"}:kw_create,"createindex_statement$ebnf$1","kw_index","createindex_statement$ebnf$2","createindex_statement$ebnf$3","createindex_statement$ebnf$4",r.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on,"table_ref","createindex_statement$ebnf$5","lparen","createindex_expressions","rparen","createindex_statement$ebnf$6","createindex_statement$ebnf$7","createindex_statement$ebnf$8"],postprocess:e=>(0,n.track)(e,{type:"create index",...e[1]&&{unique:!0},...e[3]&&{concurrently:!0},...e[4]&&{ifNotExists:!0},...e[5]&&{indexName:u(e[5])},table:e[7],...e[8]&&{using:u(e[8])},expressions:e[10],...e[12]&&{with:e[12]},...e[13]&&{tablespace:s(e[13])},...e[14]&&{where:s(e[14])}})},{name:"createindex_expressions$ebnf$1",symbols:[]},{name:"createindex_expressions$ebnf$1$subexpression$1",symbols:["comma","createindex_expression"],postprocess:i},{name:"createindex_expressions$ebnf$1",symbols:["createindex_expressions$ebnf$1","createindex_expressions$ebnf$1$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"createindex_expressions",symbols:["createindex_expression","createindex_expressions$ebnf$1"],postprocess:([e,o])=>[e,...o||[]]},{name:"createindex_expression$subexpression$1",symbols:["expr_basic"]},{name:"createindex_expression$subexpression$1",symbols:["expr_paren"]},{name:"createindex_expression$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("kw_collate")?{type:"kw_collate"}:kw_collate,"qualified_name"],postprocess:i},{name:"createindex_expression$ebnf$1",symbols:["createindex_expression$ebnf$1$subexpression$1"],postprocess:l},{name:"createindex_expression$ebnf$1",symbols:[],postprocess:()=>null},{name:"createindex_expression$ebnf$2",symbols:["qualified_name"],postprocess:l},{name:"createindex_expression$ebnf$2",symbols:[],postprocess:()=>null},{name:"createindex_expression$ebnf$3$subexpression$1",symbols:[r.lexerAny.has("kw_asc")?{type:"kw_asc"}:kw_asc]},{name:"createindex_expression$ebnf$3$subexpression$1",symbols:[r.lexerAny.has("kw_desc")?{type:"kw_desc"}:kw_desc]},{name:"createindex_expression$ebnf$3",symbols:["createindex_expression$ebnf$3$subexpression$1"],postprocess:l},{name:"createindex_expression$ebnf$3",symbols:[],postprocess:()=>null},{name:"createindex_expression$ebnf$4$subexpression$1$subexpression$1",symbols:["kw_first"]},{name:"createindex_expression$ebnf$4$subexpression$1$subexpression$1",symbols:["kw_last"]},{name:"createindex_expression$ebnf$4$subexpression$1",symbols:["kw_nulls","createindex_expression$ebnf$4$subexpression$1$subexpression$1"],postprocess:i},{name:"createindex_expression$ebnf$4",symbols:["createindex_expression$ebnf$4$subexpression$1"],postprocess:l},{name:"createindex_expression$ebnf$4",symbols:[],postprocess:()=>null},{name:"createindex_expression",symbols:["createindex_expression$subexpression$1","createindex_expression$ebnf$1","createindex_expression$ebnf$2","createindex_expression$ebnf$3","createindex_expression$ebnf$4"],postprocess:e=>(0,n.track)(e,{expression:s(e[0]),...e[1]&&{collate:s(e[1])},...e[2]&&{opclass:s(e[2])},...e[3]&&{order:s(e[3]).value},...e[4]&&{nulls:s(e[4])}})},{name:"createindex_predicate",symbols:[r.lexerAny.has("kw_where")?{type:"kw_where"}:kw_where,"expr"],postprocess:i},{name:"createindex_with$macrocall$2",symbols:["createindex_with_item"]},{name:"createindex_with$macrocall$1$ebnf$1",symbols:[]},{name:"createindex_with$macrocall$1$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("comma")?{type:"comma"}:comma,"createindex_with$macrocall$2"],postprocess:i},{name:"createindex_with$macrocall$1$ebnf$1",symbols:["createindex_with$macrocall$1$ebnf$1","createindex_with$macrocall$1$ebnf$1$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"createindex_with$macrocall$1",symbols:["createindex_with$macrocall$2","createindex_with$macrocall$1$ebnf$1"],postprocess:([e,o])=>[s(e),...o.map(s)||[]]},{name:"createindex_with",symbols:[r.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with,"lparen","createindex_with$macrocall$1","rparen"],postprocess:$(2)},{name:"createindex_with_item$subexpression$1",symbols:["string"]},{name:"createindex_with_item$subexpression$1",symbols:["int"]},{name:"createindex_with_item",symbols:["ident",r.lexerAny.has("op_eq")?{type:"op_eq"}:op_eq,"createindex_with_item$subexpression$1"],postprocess:e=>(0,n.track)(e,{parameter:d(e[0]),value:s(e[2]).toString()})},{name:"createindex_tblspace",symbols:["kw_tablespace","ident"],postprocess:i},{name:"createextension_statement$ebnf$1",symbols:["kw_ifnotexists"],postprocess:l},{name:"createextension_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"createextension_statement$ebnf$2",symbols:[r.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with],postprocess:l},{name:"createextension_statement$ebnf$2",symbols:[],postprocess:()=>null},{name:"createextension_statement$ebnf$3$subexpression$1",symbols:["kw_schema","word"],postprocess:i},{name:"createextension_statement$ebnf$3",symbols:["createextension_statement$ebnf$3$subexpression$1"],postprocess:l},{name:"createextension_statement$ebnf$3",symbols:[],postprocess:()=>null},{name:"createextension_statement$ebnf$4$subexpression$1",symbols:["kw_version","string"],postprocess:i},{name:"createextension_statement$ebnf$4",symbols:["createextension_statement$ebnf$4$subexpression$1"],postprocess:l},{name:"createextension_statement$ebnf$4",symbols:[],postprocess:()=>null},{name:"createextension_statement$ebnf$5$subexpression$1",symbols:[r.lexerAny.has("kw_from")?{type:"kw_from"}:kw_from,"string"],postprocess:i},{name:"createextension_statement$ebnf$5",symbols:["createextension_statement$ebnf$5$subexpression$1"],postprocess:l},{name:"createextension_statement$ebnf$5",symbols:[],postprocess:()=>null},{name:"createextension_statement",symbols:[r.lexerAny.has("kw_create")?{type:"kw_create"}:kw_create,"kw_extension","createextension_statement$ebnf$1","word","createextension_statement$ebnf$2","createextension_statement$ebnf$3","createextension_statement$ebnf$4","createextension_statement$ebnf$5"],postprocess:e=>(0,n.track)(e,{type:"create extension",...e[2]?{ifNotExists:!0}:{},extension:u(e[3]),...e[5]?{schema:u(e[5])}:{},...e[6]?{version:x(e[6])}:{},...e[7]?{from:x(e[7])}:{}})},{name:"simplestatements_all",symbols:["simplestatements_start_transaction"]},{name:"simplestatements_all",symbols:["simplestatements_commit"]},{name:"simplestatements_all",symbols:["simplestatements_rollback"]},{name:"simplestatements_all",symbols:["simplestatements_tablespace"]},{name:"simplestatements_all",symbols:["simplestatements_set"]},{name:"simplestatements_all",symbols:["simplestatements_show"]},{name:"simplestatements_all",symbols:["simplestatements_begin"]},{name:"simplestatements_start_transaction$subexpression$1",symbols:["kw_start","kw_transaction"]},{name:"simplestatements_start_transaction",symbols:["simplestatements_start_transaction$subexpression$1"],postprocess:e=>(0,n.track)(e,{type:"start transaction"})},{name:"simplestatements_commit",symbols:["kw_commit"],postprocess:e=>(0,n.track)(e,{type:"commit"})},{name:"simplestatements_rollback",symbols:["kw_rollback"],postprocess:e=>(0,n.track)(e,{type:"rollback"})},{name:"simplestatements_tablespace",symbols:["kw_tablespace","word"],postprocess:e=>(0,n.track)(e,{type:"tablespace",tablespace:u(e[1])})},{name:"simplestatements_set$subexpression$1",symbols:["simplestatements_set_simple"]},{name:"simplestatements_set$subexpression$1",symbols:["simplestatements_set_timezone"]},{name:"simplestatements_set$subexpression$1",symbols:["simplestatements_set_names"]},{name:"simplestatements_set",symbols:["kw_set","simplestatements_set$subexpression$1"],postprocess:i},{name:"simplestatements_set_timezone",symbols:["kw_time","kw_zone","simplestatements_set_timezone_val"],postprocess:e=>(0,n.track)(e,{type:"set timezone",to:e[2]})},{name:"simplestatements_set_timezone_val$subexpression$1",symbols:["string"]},{name:"simplestatements_set_timezone_val$subexpression$1",symbols:["int"]},{name:"simplestatements_set_timezone_val",symbols:["simplestatements_set_timezone_val$subexpression$1"],postprocess:e=>(0,n.track)(e,{type:"value",value:s(e[0])})},{name:"simplestatements_set_timezone_val",symbols:["kw_local"],postprocess:e=>(0,n.track)(e,{type:"local"})},{name:"simplestatements_set_timezone_val",symbols:[r.lexerAny.has("kw_default")?{type:"kw_default"}:kw_default],postprocess:e=>(0,n.track)(e,{type:"default"})},{name:"simplestatements_set_timezone_val",symbols:["kw_interval","string","kw_hour",r.lexerAny.has("kw_to")?{type:"kw_to"}:kw_to,"kw_minute"],postprocess:e=>(0,n.track)(e,{type:"interval",value:(0,n.unbox)(e[1])})},{name:"simplestatements_set_names",symbols:["kw_names","simplestatements_set_names_val"],postprocess:e=>(0,n.track)(e,{type:"set names",to:e[1]})},{name:"simplestatements_set_names_val$subexpression$1",symbols:["string"]},{name:"simplestatements_set_names_val",symbols:["simplestatements_set_names_val$subexpression$1"],postprocess:e=>(0,n.track)(e,{type:"value",value:s(e[0])})},{name:"simplestatements_set_simple$ebnf$1$subexpression$1",symbols:["kw_local"]},{name:"simplestatements_set_simple$ebnf$1$subexpression$1",symbols:["kw_session"]},{name:"simplestatements_set_simple$ebnf$1",symbols:["simplestatements_set_simple$ebnf$1$subexpression$1"],postprocess:l},{name:"simplestatements_set_simple$ebnf$1",symbols:[],postprocess:()=>null},{name:"simplestatements_set_simple$subexpression$1",symbols:[r.lexerAny.has("op_eq")?{type:"op_eq"}:op_eq]},{name:"simplestatements_set_simple$subexpression$1",symbols:[r.lexerAny.has("kw_to")?{type:"kw_to"}:kw_to]},{name:"simplestatements_set_simple",symbols:["simplestatements_set_simple$ebnf$1","ident","simplestatements_set_simple$subexpression$1","simplestatements_set_val"],postprocess:e=>{var o;return(0,n.track)(e,{type:"set",variable:u(e[1]),scope:(o=s(e[0]))===null||o===void 0?void 0:o.toLowerCase(),set:(0,n.unbox)(e[3])})}},{name:"simplestatements_set_val",symbols:["simplestatements_set_val_raw"],postprocess:s},{name:"simplestatements_set_val",symbols:[r.lexerAny.has("kw_default")?{type:"kw_default"}:kw_default],postprocess:e=>(0,n.track)(e,{type:"default"})},{name:"simplestatements_set_val$ebnf$1$subexpression$1",symbols:["comma","simplestatements_set_val_raw"]},{name:"simplestatements_set_val$ebnf$1",symbols:["simplestatements_set_val$ebnf$1$subexpression$1"]},{name:"simplestatements_set_val$ebnf$1$subexpression$2",symbols:["comma","simplestatements_set_val_raw"]},{name:"simplestatements_set_val$ebnf$1",symbols:["simplestatements_set_val$ebnf$1","simplestatements_set_val$ebnf$1$subexpression$2"],postprocess:e=>e[0].concat([e[1]])},{name:"simplestatements_set_val",symbols:["simplestatements_set_val_raw","simplestatements_set_val$ebnf$1"],postprocess:e=>(0,n.track)(e,{type:"list",values:[e[0],...e[1]||[]]})},{name:"simplestatements_set_val_raw$subexpression$1",symbols:["string"]},{name:"simplestatements_set_val_raw$subexpression$1",symbols:["int"]},{name:"simplestatements_set_val_raw",symbols:["simplestatements_set_val_raw$subexpression$1"],postprocess:e=>(0,n.track)(e,{type:"value",value:s(e)})},{name:"simplestatements_set_val_raw$subexpression$2",symbols:[r.lexerAny.has("word")?{type:"word"}:word]},{name:"simplestatements_set_val_raw$subexpression$2",symbols:[r.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on]},{name:"simplestatements_set_val_raw$subexpression$2",symbols:[r.lexerAny.has("kw_true")?{type:"kw_true"}:kw_true]},{name:"simplestatements_set_val_raw$subexpression$2",symbols:[r.lexerAny.has("kw_false")?{type:"kw_false"}:kw_false]},{name:"simplestatements_set_val_raw",symbols:["simplestatements_set_val_raw$subexpression$2"],postprocess:e=>(0,n.track)(e,{type:"identifier",name:s(e).value})},{name:"simplestatements_set_val_raw",symbols:[r.lexerAny.has("quoted_word")?{type:"quoted_word"}:quoted_word],postprocess:e=>(0,n.track)(e,{type:"identifier",doubleQuoted:!0,name:s(e).value})},{name:"simplestatements_show",symbols:["kw_show","ident"],postprocess:e=>(0,n.track)(e,{type:"show",variable:u(e[1])})},{name:"create_schema$subexpression$1",symbols:[r.lexerAny.has("kw_create")?{type:"kw_create"}:kw_create,"kw_schema"]},{name:"create_schema$ebnf$1",symbols:["kw_ifnotexists"],postprocess:l},{name:"create_schema$ebnf$1",symbols:[],postprocess:()=>null},{name:"create_schema",symbols:["create_schema$subexpression$1","create_schema$ebnf$1","ident"],postprocess:e=>(0,n.track)(e,{type:"create schema",name:u(e[2]),...e[1]?{ifNotExists:!0}:{}})},{name:"raise_statement$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:v("debug","log","info","notice","warning","exception")},{name:"raise_statement$ebnf$1",symbols:["raise_statement$ebnf$1$subexpression$1"],postprocess:l},{name:"raise_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"raise_statement$ebnf$2$subexpression$1",symbols:["comma","expr_list_raw"],postprocess:i},{name:"raise_statement$ebnf$2",symbols:["raise_statement$ebnf$2$subexpression$1"],postprocess:l},{name:"raise_statement$ebnf$2",symbols:[],postprocess:()=>null},{name:"raise_statement$ebnf$3",symbols:["raise_using"],postprocess:l},{name:"raise_statement$ebnf$3",symbols:[],postprocess:()=>null},{name:"raise_statement",symbols:["kw_raise","raise_statement$ebnf$1","string","raise_statement$ebnf$2","raise_statement$ebnf$3"],postprocess:e=>(0,n.track)(e,{type:"raise",format:d(e[2]),...e[1]&&{level:d(e[1])},...e[3]&&e[3].length&&{formatExprs:e[3]},...e[4]&&e[4].length&&{using:e[4]}})},{name:"raise_using$macrocall$2",symbols:["raise_using_one"]},{name:"raise_using$macrocall$1$ebnf$1",symbols:[]},{name:"raise_using$macrocall$1$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("comma")?{type:"comma"}:comma,"raise_using$macrocall$2"],postprocess:i},{name:"raise_using$macrocall$1$ebnf$1",symbols:["raise_using$macrocall$1$ebnf$1","raise_using$macrocall$1$ebnf$1$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"raise_using$macrocall$1",symbols:["raise_using$macrocall$2","raise_using$macrocall$1$ebnf$1"],postprocess:([e,o])=>[s(e),...o.map(s)||[]]},{name:"raise_using",symbols:[r.lexerAny.has("kw_using")?{type:"kw_using"}:kw_using,"raise_using$macrocall$1"],postprocess:i},{name:"raise_using_one",symbols:["raise_using_what",r.lexerAny.has("op_eq")?{type:"op_eq"}:op_eq,"expr"],postprocess:e=>(0,n.track)(e,{type:d(e[0]),value:e[2]})},{name:"raise_using_what",symbols:[r.lexerAny.has("kw_table")?{type:"kw_table"}:kw_table]},{name:"raise_using_what",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:v("message","detail","hint","errcode","column","constraint","datatype","schema")},{name:"comment_statement",symbols:["kw_comment",r.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on,"comment_what",r.lexerAny.has("kw_is")?{type:"kw_is"}:kw_is,"string"],postprocess:e=>(0,n.track)(e,{type:"comment",comment:(0,n.unbox)(i(e)),on:s(e[2])})},{name:"comment_what",symbols:["comment_what_col"]},{name:"comment_what",symbols:["comment_what_nm"]},{name:"comment_what_nm$subexpression$1",symbols:[r.lexerAny.has("kw_table")?{type:"kw_table"}:kw_table]},{name:"comment_what_nm$subexpression$1",symbols:["kw_materialized","kw_view"]},{name:"comment_what_nm$subexpression$1",symbols:[r.lexerAny.has("word")?{type:"word"}:word],postprocess:v("database","index","trigger","type","view")},{name:"comment_what_nm",symbols:["comment_what_nm$subexpression$1","qualified_name"],postprocess:e=>(0,n.track)(e,{type:d(e[0]),name:e[1]})},{name:"comment_what_col",symbols:["kw_column","qcolumn"],postprocess:e=>(0,n.track)(e,{type:"column",column:i(e)})},{name:"simplestatements_begin$ebnf$1$subexpression$1",symbols:["kw_transaction"]},{name:"simplestatements_begin$ebnf$1$subexpression$1",symbols:["kw_work"]},{name:"simplestatements_begin$ebnf$1",symbols:["simplestatements_begin$ebnf$1$subexpression$1"],postprocess:l},{name:"simplestatements_begin$ebnf$1",symbols:[],postprocess:()=>null},{name:"simplestatements_begin$ebnf$2",symbols:[]},{name:"simplestatements_begin$ebnf$2$subexpression$1",symbols:["simplestatements_begin_isol"]},{name:"simplestatements_begin$ebnf$2$subexpression$1",symbols:["simplestatements_begin_writ"]},{name:"simplestatements_begin$ebnf$2$subexpression$1",symbols:["simplestatements_begin_def"]},{name:"simplestatements_begin$ebnf$2",symbols:["simplestatements_begin$ebnf$2","simplestatements_begin$ebnf$2$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"simplestatements_begin",symbols:["kw_begin","simplestatements_begin$ebnf$1","simplestatements_begin$ebnf$2"],postprocess:e=>(0,n.track)(e,{type:"begin",...e[2].reduce((o,t)=>({...s(o),...s(t)}),{})})},{name:"simplestatements_begin_isol$subexpression$1",symbols:["kw_isolation","kw_level"]},{name:"simplestatements_begin_isol$subexpression$2",symbols:["kw_serializable"]},{name:"simplestatements_begin_isol$subexpression$2$subexpression$1",symbols:["word"],postprocess:k("repeatable")},{name:"simplestatements_begin_isol$subexpression$2",symbols:["simplestatements_begin_isol$subexpression$2$subexpression$1","kw_read"]},{name:"simplestatements_begin_isol$subexpression$2$subexpression$2",symbols:["word"],postprocess:k("committed")},{name:"simplestatements_begin_isol$subexpression$2",symbols:["kw_read","simplestatements_begin_isol$subexpression$2$subexpression$2"]},{name:"simplestatements_begin_isol$subexpression$2$subexpression$3",symbols:["word"],postprocess:k("uncommitted")},{name:"simplestatements_begin_isol$subexpression$2",symbols:["kw_read","simplestatements_begin_isol$subexpression$2$subexpression$3"]},{name:"simplestatements_begin_isol",symbols:["simplestatements_begin_isol$subexpression$1","simplestatements_begin_isol$subexpression$2"],postprocess:e=>(0,n.track)(e,{isolationLevel:d(e[1]," ")})},{name:"simplestatements_begin_writ$subexpression$1",symbols:["kw_read","kw_write"]},{name:"simplestatements_begin_writ$subexpression$1",symbols:["kw_read",r.lexerAny.has("kw_only")?{type:"kw_only"}:kw_only]},{name:"simplestatements_begin_writ",symbols:["simplestatements_begin_writ$subexpression$1"],postprocess:e=>(0,n.track)(e,{writeable:d(e," ")})},{name:"simplestatements_begin_def$ebnf$1",symbols:[r.lexerAny.has("kw_not")?{type:"kw_not"}:kw_not],postprocess:l},{name:"simplestatements_begin_def$ebnf$1",symbols:[],postprocess:()=>null},{name:"simplestatements_begin_def",symbols:["simplestatements_begin_def$ebnf$1",r.lexerAny.has("kw_deferrable")?{type:"kw_deferrable"}:kw_deferrable],postprocess:e=>(0,n.track)(e,{deferrable:!e[0]})},{name:"insert_statement$subexpression$1",symbols:["kw_insert",r.lexerAny.has("kw_into")?{type:"kw_into"}:kw_into]},{name:"insert_statement$ebnf$1",symbols:["collist_paren"],postprocess:l},{name:"insert_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"insert_statement$ebnf$2$subexpression$1$subexpression$1",symbols:["kw_system"]},{name:"insert_statement$ebnf$2$subexpression$1$subexpression$1",symbols:[r.lexerAny.has("kw_user")?{type:"kw_user"}:kw_user]},{name:"insert_statement$ebnf$2$subexpression$1",symbols:["kw_overriding","insert_statement$ebnf$2$subexpression$1$subexpression$1","kw_value"],postprocess:$(1)},{name:"insert_statement$ebnf$2",symbols:["insert_statement$ebnf$2$subexpression$1"],postprocess:l},{name:"insert_statement$ebnf$2",symbols:[],postprocess:()=>null},{name:"insert_statement$ebnf$3$subexpression$1",symbols:["selection"]},{name:"insert_statement$ebnf$3$subexpression$1",symbols:["selection_paren"]},{name:"insert_statement$ebnf$3",symbols:["insert_statement$ebnf$3$subexpression$1"],postprocess:l},{name:"insert_statement$ebnf$3",symbols:[],postprocess:()=>null},{name:"insert_statement$ebnf$4$subexpression$1",symbols:[r.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on,"kw_conflict","insert_on_conflict"],postprocess:i},{name:"insert_statement$ebnf$4",symbols:["insert_statement$ebnf$4$subexpression$1"],postprocess:l},{name:"insert_statement$ebnf$4",symbols:[],postprocess:()=>null},{name:"insert_statement$ebnf$5$subexpression$1",symbols:[r.lexerAny.has("kw_returning")?{type:"kw_returning"}:kw_returning,"select_expr_list_aliased"],postprocess:i},{name:"insert_statement$ebnf$5",symbols:["insert_statement$ebnf$5$subexpression$1"],postprocess:l},{name:"insert_statement$ebnf$5",symbols:[],postprocess:()=>null},{name:"insert_statement",symbols:["insert_statement$subexpression$1","table_ref_aliased","insert_statement$ebnf$1","insert_statement$ebnf$2","insert_statement$ebnf$3","insert_statement$ebnf$4","insert_statement$ebnf$5"],postprocess:e=>{const o=e[2]&&e[2].map(u),t=d(e[3]),c=s(e[4]),f=e[5],A=e[6];return(0,n.track)(e,{type:"insert",into:s(e[1]),insert:c,...t&&{overriding:t},...o&&{columns:o},...A&&{returning:A},...f&&{onConflict:f}})}},{name:"insert_values$ebnf$1",symbols:[]},{name:"insert_values$ebnf$1$subexpression$1",symbols:["comma","insert_value"],postprocess:i},{name:"insert_values$ebnf$1",symbols:["insert_values$ebnf$1","insert_values$ebnf$1$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"insert_values",symbols:["insert_value","insert_values$ebnf$1"],postprocess:([e,o])=>[e,...o||[]]},{name:"insert_value",symbols:["lparen","insert_expr_list_raw","rparen"],postprocess:$(1)},{name:"insert_expr_list_raw$ebnf$1",symbols:[]},{name:"insert_expr_list_raw$ebnf$1$subexpression$1",symbols:["comma","expr_or_select"],postprocess:i},{name:"insert_expr_list_raw$ebnf$1",symbols:["insert_expr_list_raw$ebnf$1","insert_expr_list_raw$ebnf$1$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"insert_expr_list_raw",symbols:["expr_or_select","insert_expr_list_raw$ebnf$1"],postprocess:([e,o])=>[e,...o||[]]},{name:"insert_on_conflict$ebnf$1",symbols:["insert_on_conflict_what"],postprocess:l},{name:"insert_on_conflict$ebnf$1",symbols:[],postprocess:()=>null},{name:"insert_on_conflict",symbols:["insert_on_conflict$ebnf$1","insert_on_conflict_do"],postprocess:e=>(0,n.track)(e,{...e[0]?{on:s(e[0])}:{},...e[1]})},{name:"insert_on_conflict_what",symbols:["lparen","expr_list_raw","rparen"],postprocess:e=>(0,n.track)(e,{type:"on expr",exprs:e[1]})},{name:"insert_on_conflict_what",symbols:[r.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on,r.lexerAny.has("kw_constraint")?{type:"kw_constraint"}:kw_constraint,"qname"],postprocess:e=>(0,n.track)(e,{type:"on constraint",constraint:i(e)})},{name:"insert_on_conflict_do",symbols:[r.lexerAny.has("kw_do")?{type:"kw_do"}:kw_do,"kw_nothing"],postprocess:e=>({do:"do nothing"})},{name:"insert_on_conflict_do$subexpression$1",symbols:[r.lexerAny.has("kw_do")?{type:"kw_do"}:kw_do,"kw_update","kw_set"]},{name:"insert_on_conflict_do$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("kw_where")?{type:"kw_where"}:kw_where,"expr"],postprocess:i},{name:"insert_on_conflict_do$ebnf$1",symbols:["insert_on_conflict_do$ebnf$1$subexpression$1"],postprocess:l},{name:"insert_on_conflict_do$ebnf$1",symbols:[],postprocess:()=>null},{name:"insert_on_conflict_do",symbols:["insert_on_conflict_do$subexpression$1","update_set_list","insert_on_conflict_do$ebnf$1"],postprocess:e=>({do:{sets:e[1]},...e[2]&&{where:e[2]}})},{name:"update_statement$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("kw_from")?{type:"kw_from"}:kw_from,"select_from_subject"],postprocess:i},{name:"update_statement$ebnf$1",symbols:["update_statement$ebnf$1$subexpression$1"],postprocess:l},{name:"update_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"update_statement$ebnf$2",symbols:["select_where"],postprocess:l},{name:"update_statement$ebnf$2",symbols:[],postprocess:()=>null},{name:"update_statement$ebnf$3$subexpression$1",symbols:[r.lexerAny.has("kw_returning")?{type:"kw_returning"}:kw_returning,"select_expr_list_aliased"],postprocess:i},{name:"update_statement$ebnf$3",symbols:["update_statement$ebnf$3$subexpression$1"],postprocess:l},{name:"update_statement$ebnf$3",symbols:[],postprocess:()=>null},{name:"update_statement",symbols:["kw_update","table_ref_aliased","kw_set","update_set_list","update_statement$ebnf$1","update_statement$ebnf$2","update_statement$ebnf$3"],postprocess:e=>{const o=s(e[4]),t=s(e[5]),c=e[6];return(0,n.track)(e,{type:"update",table:s(e[1]),sets:e[3],...t?{where:t}:{},...o?{from:o}:{},...c?{returning:c}:{}})}},{name:"update_set_list$ebnf$1",symbols:[]},{name:"update_set_list$ebnf$1$subexpression$1",symbols:["comma","update_set"],postprocess:i},{name:"update_set_list$ebnf$1",symbols:["update_set_list$ebnf$1","update_set_list$ebnf$1$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"update_set_list",symbols:["update_set","update_set_list$ebnf$1"],postprocess:([e,o])=>{const t=[];for(const c of[e,...o||[]]){const f=s(c);Array.isArray(f)?t.push(...f):t.push(f)}return t}},{name:"update_set",symbols:["update_set_one"]},{name:"update_set",symbols:["update_set_multiple"]},{name:"update_set_one",symbols:["ident",r.lexerAny.has("op_eq")?{type:"op_eq"}:op_eq,"expr"],postprocess:e=>(0,n.box)(e,{column:u(e[0]),value:s(e[2])})},{name:"update_set_multiple$subexpression$1",symbols:["lparen","expr_list_raw","rparen"],postprocess:$(1)},{name:"update_set_multiple",symbols:["collist_paren",r.lexerAny.has("op_eq")?{type:"op_eq"}:op_eq,"update_set_multiple$subexpression$1"],postprocess:e=>{const o=e[0],t=e[2];if(o.length!==t.length)throw new Error("number of columns does not match number of values");return(0,n.box)(e,o.map((c,f)=>({column:u(c),value:s(t[f])})))}},{name:"altertable_statement$ebnf$1",symbols:["kw_ifexists"],postprocess:l},{name:"altertable_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"altertable_statement$ebnf$2",symbols:[r.lexerAny.has("kw_only")?{type:"kw_only"}:kw_only],postprocess:l},{name:"altertable_statement$ebnf$2",symbols:[],postprocess:()=>null},{name:"altertable_statement",symbols:["kw_alter",r.lexerAny.has("kw_table")?{type:"kw_table"}:kw_table,"altertable_statement$ebnf$1","altertable_statement$ebnf$2","table_ref","altertable_actions"],postprocess:e=>(0,n.track)(e,{type:"alter table",...e[2]?{ifExists:!0}:{},...e[3]?{only:!0}:{},table:s(e[4]),changes:(0,n.unbox)(e[5]).map(s)})},{name:"altertable_actions$ebnf$1",symbols:[]},{name:"altertable_actions$ebnf$1$subexpression$1",symbols:["comma","altertable_action"],postprocess:i},{name:"altertable_actions$ebnf$1",symbols:["altertable_actions$ebnf$1","altertable_actions$ebnf$1$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"altertable_actions",symbols:["altertable_action","altertable_actions$ebnf$1"],postprocess:([e,o])=>[e,...o||[]]},{name:"altertable_action",symbols:["altertable_rename_table"]},{name:"altertable_action",symbols:["altertable_rename_column"]},{name:"altertable_action",symbols:["altertable_rename_constraint"]},{name:"altertable_action",symbols:["altertable_add_column"]},{name:"altertable_action",symbols:["altertable_drop_column"]},{name:"altertable_action",symbols:["altertable_alter_column"]},{name:"altertable_action",symbols:["altertable_add_constraint"]},{name:"altertable_action",symbols:["altertable_drop_constraint"]},{name:"altertable_action",symbols:["altertable_owner"]},{name:"altertable_rename_table",symbols:["kw_rename",r.lexerAny.has("kw_to")?{type:"kw_to"}:kw_to,"word"],postprocess:e=>(0,n.track)(e,{type:"rename",to:u(i(e))})},{name:"altertable_rename_column$ebnf$1",symbols:["kw_column"],postprocess:l},{name:"altertable_rename_column$ebnf$1",symbols:[],postprocess:()=>null},{name:"altertable_rename_column",symbols:["kw_rename","altertable_rename_column$ebnf$1","ident",r.lexerAny.has("kw_to")?{type:"kw_to"}:kw_to,"ident"],postprocess:e=>(0,n.track)(e,{type:"rename column",column:u(e[2]),to:u(i(e))})},{name:"altertable_rename_constraint",symbols:["kw_rename",r.lexerAny.has("kw_constraint")?{type:"kw_constraint"}:kw_constraint,"ident",r.lexerAny.has("kw_to")?{type:"kw_to"}:kw_to,"ident"],postprocess:e=>(0,n.track)(e,{type:"rename constraint",constraint:u(e[2]),to:u(i(e))})},{name:"altertable_add_column$ebnf$1",symbols:["kw_column"],postprocess:l},{name:"altertable_add_column$ebnf$1",symbols:[],postprocess:()=>null},{name:"altertable_add_column$ebnf$2",symbols:["kw_ifnotexists"],postprocess:l},{name:"altertable_add_column$ebnf$2",symbols:[],postprocess:()=>null},{name:"altertable_add_column",symbols:["kw_add","altertable_add_column$ebnf$1","altertable_add_column$ebnf$2","createtable_column"],postprocess:e=>(0,n.track)(e,{type:"add column",...e[2]?{ifNotExists:!0}:{},column:s(e[3])})},{name:"altertable_drop_column$ebnf$1",symbols:["kw_column"],postprocess:l},{name:"altertable_drop_column$ebnf$1",symbols:[],postprocess:()=>null},{name:"altertable_drop_column$ebnf$2",symbols:["kw_ifexists"],postprocess:l},{name:"altertable_drop_column$ebnf$2",symbols:[],postprocess:()=>null},{name:"altertable_drop_column$ebnf$3$subexpression$1",symbols:["kw_restrict"]},{name:"altertable_drop_column$ebnf$3$subexpression$1",symbols:["kw_cascade"]},{name:"altertable_drop_column$ebnf$3",symbols:["altertable_drop_column$ebnf$3$subexpression$1"],postprocess:l},{name:"altertable_drop_column$ebnf$3",symbols:[],postprocess:()=>null},{name:"altertable_drop_column",symbols:["kw_drop","altertable_drop_column$ebnf$1","altertable_drop_column$ebnf$2","ident","altertable_drop_column$ebnf$3"],postprocess:e=>(0,n.track)(e,{type:"drop column",...e[2]?{ifExists:!0}:{},column:u(e[3]),...e[4]?{behaviour:d(e[4]," ")}:{}})},{name:"altertable_alter_column$ebnf$1",symbols:["kw_column"],postprocess:l},{name:"altertable_alter_column$ebnf$1",symbols:[],postprocess:()=>null},{name:"altertable_alter_column",symbols:["kw_alter","altertable_alter_column$ebnf$1","ident","altercol"],postprocess:e=>(0,n.track)(e,{type:"alter column",column:u(e[2]),alter:s(e[3])})},{name:"altercol$ebnf$1$subexpression$1",symbols:["kw_set","kw_data"]},{name:"altercol$ebnf$1",symbols:["altercol$ebnf$1$subexpression$1"],postprocess:l},{name:"altercol$ebnf$1",symbols:[],postprocess:()=>null},{name:"altercol",symbols:["altercol$ebnf$1","kw_type","data_type"],postprocess:e=>(0,n.track)(e,{type:"set type",dataType:s(i(e))})},{name:"altercol",symbols:["kw_set",r.lexerAny.has("kw_default")?{type:"kw_default"}:kw_default,"expr"],postprocess:e=>(0,n.track)(e,{type:"set default",default:s(i(e))})},{name:"altercol",symbols:["kw_drop",r.lexerAny.has("kw_default")?{type:"kw_default"}:kw_default],postprocess:e=>(0,n.track)(e,{type:"drop default"})},{name:"altercol$subexpression$1",symbols:["kw_set"]},{name:"altercol$subexpression$1",symbols:["kw_drop"]},{name:"altercol",symbols:["altercol$subexpression$1","kw_not_null"],postprocess:e=>(0,n.track)(e,{type:d(e," ")})},{name:"altercol",symbols:["altercol_generated_add"],postprocess:s},{name:"altertable_add_constraint",symbols:["kw_add","createtable_constraint"],postprocess:e=>(0,n.track)(e,{type:"add constraint",constraint:s(i(e))})},{name:"altertable_drop_constraint$ebnf$1",symbols:["kw_ifexists"],postprocess:l},{name:"altertable_drop_constraint$ebnf$1",symbols:[],postprocess:()=>null},{name:"altertable_drop_constraint$ebnf$2$subexpression$1",symbols:["kw_restrict"]},{name:"altertable_drop_constraint$ebnf$2$subexpression$1",symbols:["kw_cascade"]},{name:"altertable_drop_constraint$ebnf$2",symbols:["altertable_drop_constraint$ebnf$2$subexpression$1"],postprocess:l},{name:"altertable_drop_constraint$ebnf$2",symbols:[],postprocess:()=>null},{name:"altertable_drop_constraint",symbols:["kw_drop",r.lexerAny.has("kw_constraint")?{type:"kw_constraint"}:kw_constraint,"altertable_drop_constraint$ebnf$1","ident","altertable_drop_constraint$ebnf$2"],postprocess:e=>(0,n.track)(e,{type:"drop constraint",...e[2]?{ifExists:!0}:{},constraint:u(e[3]),...e[4]?{behaviour:d(e[4]," ")}:{}})},{name:"altertable_owner",symbols:["kw_owner",r.lexerAny.has("kw_to")?{type:"kw_to"}:kw_to,"ident"],postprocess:e=>(0,n.track)(e,{type:"owner",to:u(i(e))})},{name:"altercol_generated_add",symbols:["kw_add","altercol_generated"],postprocess:i},{name:"altercol_generated$ebnf$1$subexpression$1",symbols:["kw_always"]},{name:"altercol_generated$ebnf$1$subexpression$1",symbols:["kw_by",r.lexerAny.has("kw_default")?{type:"kw_default"}:kw_default]},{name:"altercol_generated$ebnf$1",symbols:["altercol_generated$ebnf$1$subexpression$1"],postprocess:l},{name:"altercol_generated$ebnf$1",symbols:[],postprocess:()=>null},{name:"altercol_generated$subexpression$1",symbols:[r.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"kw_identity"]},{name:"altercol_generated$ebnf$2$subexpression$1",symbols:["lparen","altercol_generated_seq","rparen"],postprocess:$(1)},{name:"altercol_generated$ebnf$2",symbols:["altercol_generated$ebnf$2$subexpression$1"],postprocess:l},{name:"altercol_generated$ebnf$2",symbols:[],postprocess:()=>null},{name:"altercol_generated",symbols:["kw_generated","altercol_generated$ebnf$1","altercol_generated$subexpression$1","altercol_generated$ebnf$2"],postprocess:e=>(0,n.track)(e,{type:"add generated",...e[1]&&{always:d(e[1]," ")},...e[3]&&{sequence:s(e[3])}})},{name:"altercol_generated_seq$ebnf$1$subexpression$1",symbols:["kw_sequence","kw_name","qualified_name"]},{name:"altercol_generated_seq$ebnf$1",symbols:["altercol_generated_seq$ebnf$1$subexpression$1"],postprocess:l},{name:"altercol_generated_seq$ebnf$1",symbols:[],postprocess:()=>null},{name:"altercol_generated_seq$ebnf$2",symbols:[]},{name:"altercol_generated_seq$ebnf$2",symbols:["altercol_generated_seq$ebnf$2","create_sequence_option"],postprocess:e=>e[0].concat([e[1]])},{name:"altercol_generated_seq",symbols:["altercol_generated_seq$ebnf$1","altercol_generated_seq$ebnf$2"],postprocess:e=>{const o={...e[0]&&{name:s(i(e[0]))}};return N(o,e[1]),(0,n.track)(e,o)}},{name:"alterindex_statement$ebnf$1",symbols:["kw_ifexists"],postprocess:l},{name:"alterindex_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"alterindex_statement",symbols:["kw_alter","kw_index","alterindex_statement$ebnf$1","table_ref","alterindex_action"],postprocess:e=>(0,n.track)(e,{type:"alter index",...e[2]?{ifExists:!0}:{},index:s(e[3]),change:s(e[4])})},{name:"alterindex_action",symbols:["alterindex_rename"]},{name:"alterindex_action",symbols:["alterindex_set_tablespace"]},{name:"alterindex_rename",symbols:["kw_rename",r.lexerAny.has("kw_to")?{type:"kw_to"}:kw_to,"word"],postprocess:e=>(0,n.track)(e,{type:"rename",to:u(i(e))})},{name:"alterindex_set_tablespace",symbols:["kw_set","kw_tablespace","word"],postprocess:e=>(0,n.track)(e,{type:"set tablespace",tablespace:u(i(e))})},{name:"delete_statement",symbols:["delete_delete"]},{name:"delete_statement",symbols:["delete_truncate"]},{name:"delete_delete$subexpression$1",symbols:["kw_delete",r.lexerAny.has("kw_from")?{type:"kw_from"}:kw_from]},{name:"delete_delete$ebnf$1",symbols:["select_where"],postprocess:l},{name:"delete_delete$ebnf$1",symbols:[],postprocess:()=>null},{name:"delete_delete$ebnf$2$subexpression$1",symbols:[r.lexerAny.has("kw_returning")?{type:"kw_returning"}:kw_returning,"select_expr_list_aliased"],postprocess:i},{name:"delete_delete$ebnf$2",symbols:["delete_delete$ebnf$2$subexpression$1"],postprocess:l},{name:"delete_delete$ebnf$2",symbols:[],postprocess:()=>null},{name:"delete_delete",symbols:["delete_delete$subexpression$1","table_ref_aliased","delete_delete$ebnf$1","delete_delete$ebnf$2"],postprocess:e=>{const o=e[2],t=e[3];return(0,n.track)(e,{type:"delete",from:s(e[1]),...o?{where:o}:{},...t?{returning:t}:{}})}},{name:"delete_truncate$subexpression$1$ebnf$1",symbols:[r.lexerAny.has("kw_table")?{type:"kw_table"}:kw_table],postprocess:l},{name:"delete_truncate$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"delete_truncate$subexpression$1",symbols:["kw_truncate","delete_truncate$subexpression$1$ebnf$1"]},{name:"delete_truncate$macrocall$2",symbols:["table_ref"]},{name:"delete_truncate$macrocall$1$ebnf$1",symbols:[]},{name:"delete_truncate$macrocall$1$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("comma")?{type:"comma"}:comma,"delete_truncate$macrocall$2"],postprocess:i},{name:"delete_truncate$macrocall$1$ebnf$1",symbols:["delete_truncate$macrocall$1$ebnf$1","delete_truncate$macrocall$1$ebnf$1$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"delete_truncate$macrocall$1",symbols:["delete_truncate$macrocall$2","delete_truncate$macrocall$1$ebnf$1"],postprocess:([e,o])=>[s(e),...o.map(s)||[]]},{name:"delete_truncate$ebnf$1$subexpression$1$subexpression$1",symbols:["kw_restart"]},{name:"delete_truncate$ebnf$1$subexpression$1$subexpression$1",symbols:["kw_continue"]},{name:"delete_truncate$ebnf$1$subexpression$1",symbols:["delete_truncate$ebnf$1$subexpression$1$subexpression$1","kw_identity"]},{name:"delete_truncate$ebnf$1",symbols:["delete_truncate$ebnf$1$subexpression$1"],postprocess:l},{name:"delete_truncate$ebnf$1",symbols:[],postprocess:()=>null},{name:"delete_truncate$ebnf$2$subexpression$1",symbols:["kw_restrict"]},{name:"delete_truncate$ebnf$2$subexpression$1",symbols:["kw_cascade"]},{name:"delete_truncate$ebnf$2",symbols:["delete_truncate$ebnf$2$subexpression$1"],postprocess:l},{name:"delete_truncate$ebnf$2",symbols:[],postprocess:()=>null},{name:"delete_truncate",symbols:["delete_truncate$subexpression$1","delete_truncate$macrocall$1","delete_truncate$ebnf$1","delete_truncate$ebnf$2"],postprocess:e=>(0,n.track)(e,{type:"truncate table",tables:e[1],...e[2]&&{identity:d(e[2][0])},...e[3]&&{cascade:d(e[3])}})},{name:"create_sequence_statement$ebnf$1$subexpression$1",symbols:["kw_temp"]},{name:"create_sequence_statement$ebnf$1$subexpression$1",symbols:["kw_temporary"]},{name:"create_sequence_statement$ebnf$1",symbols:["create_sequence_statement$ebnf$1$subexpression$1"],postprocess:l},{name:"create_sequence_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"create_sequence_statement$ebnf$2",symbols:["kw_ifnotexists"],postprocess:l},{name:"create_sequence_statement$ebnf$2",symbols:[],postprocess:()=>null},{name:"create_sequence_statement$ebnf$3",symbols:[]},{name:"create_sequence_statement$ebnf$3",symbols:["create_sequence_statement$ebnf$3","create_sequence_option"],postprocess:e=>e[0].concat([e[1]])},{name:"create_sequence_statement",symbols:[r.lexerAny.has("kw_create")?{type:"kw_create"}:kw_create,"create_sequence_statement$ebnf$1","kw_sequence","create_sequence_statement$ebnf$2","qualified_name","create_sequence_statement$ebnf$3"],postprocess:e=>{const o={type:"create sequence",...e[1]&&{temp:!0},...e[3]&&{ifNotExists:!0},name:s(e[4]),options:{}};return N(o.options,e[5]),(0,n.track)(e,o)}},{name:"create_sequence_option",symbols:[r.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"data_type"],postprocess:e=>(0,n.box)(e,["as",e[1]])},{name:"create_sequence_option$ebnf$1",symbols:["kw_by"],postprocess:l},{name:"create_sequence_option$ebnf$1",symbols:[],postprocess:()=>null},{name:"create_sequence_option",symbols:["kw_increment","create_sequence_option$ebnf$1","int"],postprocess:e=>(0,n.box)(e,["incrementBy",e[2]])},{name:"create_sequence_option",symbols:["create_sequence_minvalue"],postprocess:e=>(0,n.box)(e,["minValue",e[0]])},{name:"create_sequence_option",symbols:["create_sequence_maxvalue"],postprocess:e=>(0,n.box)(e,["maxValue",e[0]])},{name:"create_sequence_option$ebnf$2",symbols:[r.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with],postprocess:l},{name:"create_sequence_option$ebnf$2",symbols:[],postprocess:()=>null},{name:"create_sequence_option",symbols:["kw_start","create_sequence_option$ebnf$2","int"],postprocess:e=>(0,n.box)(e,["startWith",e[2]])},{name:"create_sequence_option",symbols:["kw_cache","int"],postprocess:e=>(0,n.box)(e,["cache",e[1]])},{name:"create_sequence_option$ebnf$3",symbols:["kw_no"],postprocess:l},{name:"create_sequence_option$ebnf$3",symbols:[],postprocess:()=>null},{name:"create_sequence_option",symbols:["create_sequence_option$ebnf$3","kw_cycle"],postprocess:e=>(0,n.box)(e,["cycle",d(e," ")])},{name:"create_sequence_option",symbols:["create_sequence_owned_by"],postprocess:e=>(0,n.box)(e,["ownedBy",s(e)])},{name:"create_sequence_minvalue",symbols:["kw_minvalue","int"],postprocess:i},{name:"create_sequence_minvalue",symbols:["kw_no","kw_minvalue"],postprocess:e=>(0,n.box)(e,"no minvalue")},{name:"create_sequence_maxvalue",symbols:["kw_maxvalue","int"],postprocess:i},{name:"create_sequence_maxvalue",symbols:["kw_no","kw_maxvalue"],postprocess:e=>(0,n.box)(e,"no maxvalue")},{name:"create_sequence_owned_by$subexpression$1",symbols:["kw_none"]},{name:"create_sequence_owned_by$subexpression$1",symbols:["qcolumn"]},{name:"create_sequence_owned_by",symbols:["kw_owned","kw_by","create_sequence_owned_by$subexpression$1"],postprocess:e=>(0,n.box)(e,s(i(e)))},{name:"alter_sequence_statement$ebnf$1",symbols:["kw_ifexists"],postprocess:l},{name:"alter_sequence_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"alter_sequence_statement",symbols:["kw_alter","kw_sequence","alter_sequence_statement$ebnf$1","qualified_name","alter_sequence_statement_body"],postprocess:e=>{const o={type:"alter sequence",...e[2]&&{ifExists:!0},name:s(e[3]),change:e[4]};return(0,n.track)(e,o)}},{name:"alter_sequence_statement_body$ebnf$1",symbols:["alter_sequence_option"]},{name:"alter_sequence_statement_body$ebnf$1",symbols:["alter_sequence_statement_body$ebnf$1","alter_sequence_option"],postprocess:e=>e[0].concat([e[1]])},{name:"alter_sequence_statement_body",symbols:["alter_sequence_statement_body$ebnf$1"],postprocess:e=>{const o={type:"set options"};return N(o,e[0]),(0,n.track)(e,o)}},{name:"alter_sequence_statement_body$subexpression$1",symbols:["ident"]},{name:"alter_sequence_statement_body$subexpression$1",symbols:[r.lexerAny.has("kw_session_user")?{type:"kw_session_user"}:kw_session_user]},{name:"alter_sequence_statement_body$subexpression$1",symbols:[r.lexerAny.has("kw_current_user")?{type:"kw_current_user"}:kw_current_user]},{name:"alter_sequence_statement_body",symbols:["kw_owner",r.lexerAny.has("kw_to")?{type:"kw_to"}:kw_to,"alter_sequence_statement_body$subexpression$1"],postprocess:e=>(0,n.track)(e,{type:"owner to",owner:u(i(e))})},{name:"alter_sequence_statement_body",symbols:["kw_rename",r.lexerAny.has("kw_to")?{type:"kw_to"}:kw_to,"ident"],postprocess:e=>(0,n.track)(e,{type:"rename",newName:u(i(e))})},{name:"alter_sequence_statement_body",symbols:["kw_set","kw_schema","ident"],postprocess:e=>(0,n.track)(e,{type:"set schema",newSchema:u(i(e))})},{name:"alter_sequence_option",symbols:["create_sequence_option"],postprocess:s},{name:"alter_sequence_option$ebnf$1$subexpression$1$ebnf$1",symbols:[r.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with],postprocess:l},{name:"alter_sequence_option$ebnf$1$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"alter_sequence_option$ebnf$1$subexpression$1",symbols:["alter_sequence_option$ebnf$1$subexpression$1$ebnf$1","int"],postprocess:i},{name:"alter_sequence_option$ebnf$1",symbols:["alter_sequence_option$ebnf$1$subexpression$1"],postprocess:l},{name:"alter_sequence_option$ebnf$1",symbols:[],postprocess:()=>null},{name:"alter_sequence_option",symbols:["kw_restart","alter_sequence_option$ebnf$1"],postprocess:e=>(0,n.box)(e,["restart",typeof(0,n.unbox)(e[1])=="number"?(0,n.unbox)(e[1]):!0])},{name:"drop_statement$ebnf$1",symbols:["kw_ifexists"],postprocess:l},{name:"drop_statement$ebnf$1",symbols:[],postprocess:()=>null},{name:"drop_statement$macrocall$2",symbols:["qualified_name"]},{name:"drop_statement$macrocall$1$ebnf$1",symbols:[]},{name:"drop_statement$macrocall$1$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("comma")?{type:"comma"}:comma,"drop_statement$macrocall$2"],postprocess:i},{name:"drop_statement$macrocall$1$ebnf$1",symbols:["drop_statement$macrocall$1$ebnf$1","drop_statement$macrocall$1$ebnf$1$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"drop_statement$macrocall$1",symbols:["drop_statement$macrocall$2","drop_statement$macrocall$1$ebnf$1"],postprocess:([e,o])=>[s(e),...o.map(s)||[]]},{name:"drop_statement$ebnf$2$subexpression$1",symbols:["kw_cascade"]},{name:"drop_statement$ebnf$2$subexpression$1",symbols:["kw_restrict"]},{name:"drop_statement$ebnf$2",symbols:["drop_statement$ebnf$2$subexpression$1"],postprocess:l},{name:"drop_statement$ebnf$2",symbols:[],postprocess:()=>null},{name:"drop_statement",symbols:["kw_drop","drop_what","drop_statement$ebnf$1","drop_statement$macrocall$1","drop_statement$ebnf$2"],postprocess:(e,o)=>{const t=s(e[1]);return(0,n.track)(e,{...t,...e[2]&&{ifExists:!0},names:e[3],...e[4]&&{cascade:d(e[4])}})}},{name:"drop_what",symbols:[r.lexerAny.has("kw_table")?{type:"kw_table"}:kw_table],postprocess:e=>(0,n.track)(e,{type:"drop table"})},{name:"drop_what",symbols:["kw_sequence"],postprocess:e=>(0,n.track)(e,{type:"drop sequence"})},{name:"drop_what",symbols:["kw_type"],postprocess:e=>(0,n.track)(e,{type:"drop type"})},{name:"drop_what",symbols:["kw_trigger"],postprocess:e=>(0,n.track)(e,{type:"drop trigger"})},{name:"drop_what$ebnf$1",symbols:[r.lexerAny.has("kw_concurrently")?{type:"kw_concurrently"}:kw_concurrently],postprocess:l},{name:"drop_what$ebnf$1",symbols:[],postprocess:()=>null},{name:"drop_what",symbols:["kw_index","drop_what$ebnf$1"],postprocess:e=>(0,n.track)(e,{type:"drop index",...e[1]&&{concurrently:!0}})},{name:"with_statement",symbols:[r.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with,"with_statement_bindings","with_statement_statement"],postprocess:e=>(0,n.track)(e,{type:"with",bind:e[1],in:s(e[2])})},{name:"with_recursive_statement$subexpression$1",symbols:[r.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with,"kw_recursive"]},{name:"with_recursive_statement",symbols:["with_recursive_statement$subexpression$1","ident","collist_paren",r.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"lparen","union_statement","rparen","with_statement_statement"],postprocess:e=>(0,n.track)(e,{type:"with recursive",alias:u(e[1]),columnNames:e[2].map(u),bind:e[5],in:s(e[7])})},{name:"with_statement_bindings$ebnf$1",symbols:[]},{name:"with_statement_bindings$ebnf$1$subexpression$1",symbols:["comma","with_statement_binding"],postprocess:i},{name:"with_statement_bindings$ebnf$1",symbols:["with_statement_bindings$ebnf$1","with_statement_bindings$ebnf$1$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"with_statement_bindings",symbols:["with_statement_binding","with_statement_bindings$ebnf$1"],postprocess:([e,o])=>[e,...o||[]]},{name:"with_statement_binding",symbols:["word",r.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"lparen","with_statement_statement","rparen"],postprocess:e=>(0,n.track)(e,{alias:u(e[0]),statement:s(e[3])})},{name:"with_statement_statement",symbols:["selection"]},{name:"with_statement_statement",symbols:["insert_statement"]},{name:"with_statement_statement",symbols:["update_statement"]},{name:"with_statement_statement",symbols:["delete_statement"]},{name:"createtype_statement$subexpression$1",symbols:["createtype_enum"]},{name:"createtype_statement$subexpression$1",symbols:["createtype_composite"]},{name:"createtype_statement",symbols:[r.lexerAny.has("kw_create")?{type:"kw_create"}:kw_create,"kw_type","qualified_name","createtype_statement$subexpression$1"],postprocess:e=>(0,n.track)(e,{name:e[2],...s(e[3])})},{name:"createtype_enum$macrocall$2",symbols:["enum_value"]},{name:"createtype_enum$macrocall$1$ebnf$1",symbols:[]},{name:"createtype_enum$macrocall$1$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("comma")?{type:"comma"}:comma,"createtype_enum$macrocall$2"],postprocess:i},{name:"createtype_enum$macrocall$1$ebnf$1",symbols:["createtype_enum$macrocall$1$ebnf$1","createtype_enum$macrocall$1$ebnf$1$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"createtype_enum$macrocall$1",symbols:["createtype_enum$macrocall$2","createtype_enum$macrocall$1$ebnf$1"],postprocess:([e,o])=>[s(e),...o.map(s)||[]]},{name:"createtype_enum",symbols:[r.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"kw_enum","lparen","createtype_enum$macrocall$1","rparen"],postprocess:e=>(0,n.track)(e,{type:"create enum",values:e[3]})},{name:"enum_value",symbols:["string"],postprocess:e=>(0,n.track)(e,{value:d(e)})},{name:"createtype_composite$macrocall$2",symbols:["createtype_composite_attr"]},{name:"createtype_composite$macrocall$1$ebnf$1",symbols:[]},{name:"createtype_composite$macrocall$1$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("comma")?{type:"comma"}:comma,"createtype_composite$macrocall$2"],postprocess:i},{name:"createtype_composite$macrocall$1$ebnf$1",symbols:["createtype_composite$macrocall$1$ebnf$1","createtype_composite$macrocall$1$ebnf$1$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"createtype_composite$macrocall$1",symbols:["createtype_composite$macrocall$2","createtype_composite$macrocall$1$ebnf$1"],postprocess:([e,o])=>[s(e),...o.map(s)||[]]},{name:"createtype_composite",symbols:[r.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"lparen","createtype_composite$macrocall$1","rparen"],postprocess:e=>(0,n.track)(e,{type:"create composite type",attributes:e[2]})},{name:"createtype_composite_attr$ebnf$1",symbols:["createtable_collate"],postprocess:l},{name:"createtype_composite_attr$ebnf$1",symbols:[],postprocess:()=>null},{name:"createtype_composite_attr",symbols:["word","data_type","createtype_composite_attr$ebnf$1"],postprocess:e=>(0,n.track)(e,{name:u(e[0]),dataType:e[1],...e[2]?{collate:e[2][1]}:{}})},{name:"altertype_statement$subexpression$1",symbols:["altertype_enum_add_value"]},{name:"altertype_statement$subexpression$1",symbols:["altertype_enum_rename"]},{name:"altertype_statement",symbols:["kw_alter","kw_type","qualified_name","altertype_statement$subexpression$1"],postprocess:e=>(0,n.track)(e,{name:e[2],...s(e[3])})},{name:"altertype_enum_add_value",symbols:["kw_add","kw_value","enum_additional_value"],postprocess:e=>(0,n.track)(e,{type:"alter enum",change:{type:"add value",add:e[2]}})},{name:"enum_additional_value",symbols:["string"],postprocess:e=>(0,n.track)(e,{value:d(e)})},{name:"altertype_enum_rename",symbols:["kw_rename",r.lexerAny.has("kw_to")?{type:"kw_to"}:kw_to,"word"],postprocess:e=>(0,n.track)(e,{type:"alter enum",change:{type:"rename",to:u(i(e))}})},{name:"union_left",symbols:["select_statement"]},{name:"union_left",symbols:["select_values"]},{name:"union_left",symbols:["selection_paren"]},{name:"union_right",symbols:["selection"]},{name:"union_right",symbols:["selection_paren"]},{name:"union_statement$subexpression$1$ebnf$1",symbols:[r.lexerAny.has("kw_all")?{type:"kw_all"}:kw_all],postprocess:l},{name:"union_statement$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"union_statement$subexpression$1",symbols:[r.lexerAny.has("kw_union")?{type:"kw_union"}:kw_union,"union_statement$subexpression$1$ebnf$1"]},{name:"union_statement",symbols:["union_left","union_statement$subexpression$1","union_right"],postprocess:e=>(0,n.track)(e,{type:d(e[1]," "),left:s(e[0]),right:s(e[2])})},{name:"prepare$ebnf$1$subexpression$1",symbols:["lparen","data_type_list","rparen"],postprocess:$(1)},{name:"prepare$ebnf$1",symbols:["prepare$ebnf$1$subexpression$1"],postprocess:l},{name:"prepare$ebnf$1",symbols:[],postprocess:()=>null},{name:"prepare",symbols:["kw_prepare","ident","prepare$ebnf$1",r.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"statement_noprep"],postprocess:e=>(0,n.track)(e,{type:"prepare",name:u(e[1]),...e[2]&&{args:e[2]},statement:s(i(e))})},{name:"deallocate$ebnf$1",symbols:["kw_prepare"],postprocess:l},{name:"deallocate$ebnf$1",symbols:[],postprocess:()=>null},{name:"deallocate",symbols:["kw_deallocate","deallocate$ebnf$1","deallocate_target"],postprocess:e=>(0,n.track)(e,{type:"deallocate",target:e[2]})},{name:"deallocate_target",symbols:["deallocate_all"],postprocess:s},{name:"deallocate_target",symbols:["deallocate_name"],postprocess:s},{name:"deallocate_name",symbols:["ident"],postprocess:e=>(0,n.track)(e,u(e[0]))},{name:"deallocate_all",symbols:[r.lexerAny.has("kw_all")?{type:"kw_all"}:kw_all],postprocess:e=>(0,n.track)(e,{option:"all"})},{name:"create_view_statements",symbols:["create_view"]},{name:"create_view_statements",symbols:["create_materialized_view"]},{name:"create_view$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("kw_or")?{type:"kw_or"}:kw_or,"kw_replace"]},{name:"create_view$ebnf$1",symbols:["create_view$ebnf$1$subexpression$1"],postprocess:l},{name:"create_view$ebnf$1",symbols:[],postprocess:()=>null},{name:"create_view$ebnf$2$subexpression$1",symbols:["kw_temp"]},{name:"create_view$ebnf$2$subexpression$1",symbols:["kw_temporary"]},{name:"create_view$ebnf$2",symbols:["create_view$ebnf$2$subexpression$1"],postprocess:l},{name:"create_view$ebnf$2",symbols:[],postprocess:()=>null},{name:"create_view$ebnf$3",symbols:["kw_recursive"],postprocess:l},{name:"create_view$ebnf$3",symbols:[],postprocess:()=>null},{name:"create_view$ebnf$4$subexpression$1$macrocall$2",symbols:["ident"]},{name:"create_view$ebnf$4$subexpression$1$macrocall$1$ebnf$1",symbols:[]},{name:"create_view$ebnf$4$subexpression$1$macrocall$1$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("comma")?{type:"comma"}:comma,"create_view$ebnf$4$subexpression$1$macrocall$2"],postprocess:i},{name:"create_view$ebnf$4$subexpression$1$macrocall$1$ebnf$1",symbols:["create_view$ebnf$4$subexpression$1$macrocall$1$ebnf$1","create_view$ebnf$4$subexpression$1$macrocall$1$ebnf$1$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"create_view$ebnf$4$subexpression$1$macrocall$1",symbols:["create_view$ebnf$4$subexpression$1$macrocall$2","create_view$ebnf$4$subexpression$1$macrocall$1$ebnf$1"],postprocess:([e,o])=>[s(e),...o.map(s)||[]]},{name:"create_view$ebnf$4$subexpression$1",symbols:["lparen","create_view$ebnf$4$subexpression$1$macrocall$1","rparen"],postprocess:$(1)},{name:"create_view$ebnf$4",symbols:["create_view$ebnf$4$subexpression$1"],postprocess:l},{name:"create_view$ebnf$4",symbols:[],postprocess:()=>null},{name:"create_view$ebnf$5",symbols:["create_view_opts"],postprocess:l},{name:"create_view$ebnf$5",symbols:[],postprocess:()=>null},{name:"create_view$ebnf$6$subexpression$1$subexpression$1",symbols:["kw_local"]},{name:"create_view$ebnf$6$subexpression$1$subexpression$1",symbols:["kw_cascaded"]},{name:"create_view$ebnf$6$subexpression$1",symbols:[r.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with,"create_view$ebnf$6$subexpression$1$subexpression$1",r.lexerAny.has("kw_check")?{type:"kw_check"}:kw_check,"kw_option"],postprocess:$(1)},{name:"create_view$ebnf$6",symbols:["create_view$ebnf$6$subexpression$1"],postprocess:l},{name:"create_view$ebnf$6",symbols:[],postprocess:()=>null},{name:"create_view",symbols:[r.lexerAny.has("kw_create")?{type:"kw_create"}:kw_create,"create_view$ebnf$1","create_view$ebnf$2","create_view$ebnf$3","kw_view","qualified_name","create_view$ebnf$4","create_view$ebnf$5",r.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"selection","create_view$ebnf$6"],postprocess:e=>(0,n.track)(e,{type:"create view",...e[1]&&{orReplace:!0},...e[2]&&{temp:!0},...e[3]&&{recursive:!0},name:e[5],...e[6]&&{columnNames:e[6].map(u)},...e[7]&&{parameters:E(e[7])},query:e[9],...e[10]&&{checkOption:d(e[10])}})},{name:"create_view_opt",symbols:["ident",r.lexerAny.has("op_eq")?{type:"op_eq"}:op_eq,"ident"],postprocess:([e,o,t])=>[d(e),d(t)]},{name:"create_view_opts$macrocall$2",symbols:["create_view_opt"]},{name:"create_view_opts$macrocall$1$ebnf$1",symbols:[]},{name:"create_view_opts$macrocall$1$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("comma")?{type:"comma"}:comma,"create_view_opts$macrocall$2"],postprocess:i},{name:"create_view_opts$macrocall$1$ebnf$1",symbols:["create_view_opts$macrocall$1$ebnf$1","create_view_opts$macrocall$1$ebnf$1$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"create_view_opts$macrocall$1",symbols:["create_view_opts$macrocall$2","create_view_opts$macrocall$1$ebnf$1"],postprocess:([e,o])=>[s(e),...o.map(s)||[]]},{name:"create_view_opts",symbols:[r.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with,"create_view_opts$macrocall$1"],postprocess:i},{name:"create_materialized_view$ebnf$1",symbols:["kw_ifnotexists"],postprocess:l},{name:"create_materialized_view$ebnf$1",symbols:[],postprocess:()=>null},{name:"create_materialized_view$ebnf$2$subexpression$1$macrocall$2",symbols:["ident"]},{name:"create_materialized_view$ebnf$2$subexpression$1$macrocall$1$ebnf$1",symbols:[]},{name:"create_materialized_view$ebnf$2$subexpression$1$macrocall$1$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("comma")?{type:"comma"}:comma,"create_materialized_view$ebnf$2$subexpression$1$macrocall$2"],postprocess:i},{name:"create_materialized_view$ebnf$2$subexpression$1$macrocall$1$ebnf$1",symbols:["create_materialized_view$ebnf$2$subexpression$1$macrocall$1$ebnf$1","create_materialized_view$ebnf$2$subexpression$1$macrocall$1$ebnf$1$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"create_materialized_view$ebnf$2$subexpression$1$macrocall$1",symbols:["create_materialized_view$ebnf$2$subexpression$1$macrocall$2","create_materialized_view$ebnf$2$subexpression$1$macrocall$1$ebnf$1"],postprocess:([e,o])=>[s(e),...o.map(s)||[]]},{name:"create_materialized_view$ebnf$2$subexpression$1",symbols:["lparen","create_materialized_view$ebnf$2$subexpression$1$macrocall$1","rparen"],postprocess:$(1)},{name:"create_materialized_view$ebnf$2",symbols:["create_materialized_view$ebnf$2$subexpression$1"],postprocess:l},{name:"create_materialized_view$ebnf$2",symbols:[],postprocess:()=>null},{name:"create_materialized_view$ebnf$3",symbols:["create_view_opts"],postprocess:l},{name:"create_materialized_view$ebnf$3",symbols:[],postprocess:()=>null},{name:"create_materialized_view$ebnf$4$subexpression$1",symbols:["kw_tablespace","ident"],postprocess:i},{name:"create_materialized_view$ebnf$4",symbols:["create_materialized_view$ebnf$4$subexpression$1"],postprocess:l},{name:"create_materialized_view$ebnf$4",symbols:[],postprocess:()=>null},{name:"create_materialized_view$ebnf$5$subexpression$1$ebnf$1",symbols:["kw_no"],postprocess:l},{name:"create_materialized_view$ebnf$5$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"create_materialized_view$ebnf$5$subexpression$1",symbols:[r.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with,"create_materialized_view$ebnf$5$subexpression$1$ebnf$1","kw_data"]},{name:"create_materialized_view$ebnf$5",symbols:["create_materialized_view$ebnf$5$subexpression$1"],postprocess:l},{name:"create_materialized_view$ebnf$5",symbols:[],postprocess:()=>null},{name:"create_materialized_view",symbols:[r.lexerAny.has("kw_create")?{type:"kw_create"}:kw_create,"kw_materialized","kw_view","create_materialized_view$ebnf$1","qualified_name","create_materialized_view$ebnf$2","create_materialized_view$ebnf$3","create_materialized_view$ebnf$4",r.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"selection","create_materialized_view$ebnf$5"],postprocess:e=>(0,n.track)(e,{type:"create materialized view",...e[3]&&{ifNotExists:!0},name:e[4],...e[5]&&{columnNames:e[6].map(u)},...e[6]&&{parameters:E(e[6])},...e[7]&&{tablespace:u(e[7])},query:e[9],...e[10]&&{withData:d(e[10][1])!=="no"}})},{name:"refresh_view_statements$ebnf$1",symbols:[r.lexerAny.has("kw_concurrently")?{type:"kw_concurrently"}:kw_concurrently],postprocess:l},{name:"refresh_view_statements$ebnf$1",symbols:[],postprocess:()=>null},{name:"refresh_view_statements$ebnf$2$subexpression$1$ebnf$1",symbols:["kw_no"],postprocess:l},{name:"refresh_view_statements$ebnf$2$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"refresh_view_statements$ebnf$2$subexpression$1",symbols:[r.lexerAny.has("kw_with")?{type:"kw_with"}:kw_with,"refresh_view_statements$ebnf$2$subexpression$1$ebnf$1","kw_data"]},{name:"refresh_view_statements$ebnf$2",symbols:["refresh_view_statements$ebnf$2$subexpression$1"],postprocess:l},{name:"refresh_view_statements$ebnf$2",symbols:[],postprocess:()=>null},{name:"refresh_view_statements",symbols:["kw_refresh","kw_materialized","kw_view","refresh_view_statements$ebnf$1","qname","refresh_view_statements$ebnf$2"],postprocess:e=>(0,n.track)(e,{type:"refresh materialized view",...e[3]?{concurrently:!0}:{},name:e[4],...e[5]?{withData:d(e[5][1])!=="no"}:{}})},{name:"functions_statements",symbols:["create_func"]},{name:"functions_statements",symbols:["do_stm"]},{name:"functions_statements",symbols:["drop_func"]},{name:"create_func$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("kw_or")?{type:"kw_or"}:kw_or,"kw_replace"]},{name:"create_func$ebnf$1",symbols:["create_func$ebnf$1$subexpression$1"],postprocess:l},{name:"create_func$ebnf$1",symbols:[],postprocess:()=>null},{name:"create_func$subexpression$1$ebnf$1$macrocall$2",symbols:["func_argdef"]},{name:"create_func$subexpression$1$ebnf$1$macrocall$1$ebnf$1",symbols:[]},{name:"create_func$subexpression$1$ebnf$1$macrocall$1$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("comma")?{type:"comma"}:comma,"create_func$subexpression$1$ebnf$1$macrocall$2"],postprocess:i},{name:"create_func$subexpression$1$ebnf$1$macrocall$1$ebnf$1",symbols:["create_func$subexpression$1$ebnf$1$macrocall$1$ebnf$1","create_func$subexpression$1$ebnf$1$macrocall$1$ebnf$1$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"create_func$subexpression$1$ebnf$1$macrocall$1",symbols:["create_func$subexpression$1$ebnf$1$macrocall$2","create_func$subexpression$1$ebnf$1$macrocall$1$ebnf$1"],postprocess:([e,o])=>[s(e),...o.map(s)||[]]},{name:"create_func$subexpression$1$ebnf$1",symbols:["create_func$subexpression$1$ebnf$1$macrocall$1"],postprocess:l},{name:"create_func$subexpression$1$ebnf$1",symbols:[],postprocess:()=>null},{name:"create_func$subexpression$1",symbols:["lparen","create_func$subexpression$1$ebnf$1","rparen"],postprocess:$(1)},{name:"create_func$ebnf$2",symbols:["func_spec"]},{name:"create_func$ebnf$2",symbols:["create_func$ebnf$2","func_spec"],postprocess:e=>e[0].concat([e[1]])},{name:"create_func",symbols:[r.lexerAny.has("kw_create")?{type:"kw_create"}:kw_create,"create_func$ebnf$1","kw_function","qname","create_func$subexpression$1","create_func$ebnf$2"],postprocess:(e,o)=>{var t;const c={};for(const f of e[5]){for(const A in f)if(A[0]!=="_"&&A in c)throw new Error("conflicting or redundant options "+A);Object.assign(c,f)}return(0,n.track)(e,{type:"create function",...e[1]&&{orReplace:!0},name:e[3],arguments:(t=e[4])!==null&&t!==void 0?t:[],...c})}},{name:"func_argdef$ebnf$1",symbols:["func_argopts"],postprocess:l},{name:"func_argdef$ebnf$1",symbols:[],postprocess:()=>null},{name:"func_argdef$ebnf$2",symbols:["func_argdefault"],postprocess:l},{name:"func_argdef$ebnf$2",symbols:[],postprocess:()=>null},{name:"func_argdef",symbols:["func_argdef$ebnf$1","data_type","func_argdef$ebnf$2"],postprocess:e=>(0,n.track)(e,{default:e[2],type:e[1],...e[0]})},{name:"func_argdefault",symbols:[r.lexerAny.has("kw_default")?{type:"kw_default"}:kw_default,"expr"],postprocess:e=>e[1]},{name:"func_argdefault",symbols:[r.lexerAny.has("op_eq")?{type:"op_eq"}:op_eq,"expr"],postprocess:e=>e[1]},{name:"func_argopts$ebnf$1",symbols:["word"],postprocess:l},{name:"func_argopts$ebnf$1",symbols:[],postprocess:()=>null},{name:"func_argopts",symbols:["func_argmod","func_argopts$ebnf$1"],postprocess:e=>(0,n.track)(e,{mode:d(e[0]),...e[1]&&{name:u(e[1])}})},{name:"func_argopts",symbols:["word"],postprocess:(e,o)=>{const t=u(e);return t==="out"||t==="inout"||t==="variadic"?o:(0,n.track)(e,{name:t})}},{name:"func_argmod",symbols:[r.lexerAny.has("kw_in")?{type:"kw_in"}:kw_in]},{name:"func_argmod",symbols:["kw_out"]},{name:"func_argmod",symbols:["kw_inout"]},{name:"func_argmod",symbols:["kw_variadic"]},{name:"func_spec",symbols:["kw_language","word"],postprocess:e=>(0,n.track)(e,{language:u(i(e))})},{name:"func_spec",symbols:["func_purity"],postprocess:e=>(0,n.track)(e,{purity:d(e)})},{name:"func_spec$subexpression$1",symbols:[r.lexerAny.has("codeblock")?{type:"codeblock"}:codeblock]},{name:"func_spec$subexpression$1",symbols:["string"]},{name:"func_spec",symbols:[r.lexerAny.has("kw_as")?{type:"kw_as"}:kw_as,"func_spec$subexpression$1"],postprocess:e=>({code:d(i(e))})},{name:"func_spec$ebnf$1",symbols:[r.lexerAny.has("kw_not")?{type:"kw_not"}:kw_not],postprocess:l},{name:"func_spec$ebnf$1",symbols:[],postprocess:()=>null},{name:"func_spec$subexpression$2",symbols:["word"],postprocess:k("leakproof")},{name:"func_spec",symbols:["func_spec$ebnf$1","func_spec$subexpression$2"],postprocess:e=>(0,n.track)(e,{leakproof:!e[0]})},{name:"func_spec",symbols:["func_returns"],postprocess:e=>(0,n.track)(e,{returns:s(e)})},{name:"func_spec$subexpression$3",symbols:["word"],postprocess:k("called")},{name:"func_spec",symbols:["func_spec$subexpression$3","oninp"],postprocess:()=>({onNullInput:"call"})},{name:"func_spec$subexpression$4",symbols:["word"],postprocess:k("returns")},{name:"func_spec",symbols:["func_spec$subexpression$4",r.lexerAny.has("kw_null")?{type:"kw_null"}:kw_null,"oninp"],postprocess:()=>({onNullInput:"null"})},{name:"func_spec$subexpression$5",symbols:["word"],postprocess:k("strict")},{name:"func_spec",symbols:["func_spec$subexpression$5"],postprocess:()=>({onNullInput:"strict"})},{name:"func_purity",symbols:["word"],postprocess:k("immutable")},{name:"func_purity",symbols:["word"],postprocess:k("stable")},{name:"func_purity",symbols:["word"],postprocess:k("volatile")},{name:"oninp$subexpression$1",symbols:["word"],postprocess:k("input")},{name:"oninp",symbols:[r.lexerAny.has("kw_on")?{type:"kw_on"}:kw_on,r.lexerAny.has("kw_null")?{type:"kw_null"}:kw_null,"oninp$subexpression$1"]},{name:"func_returns",symbols:["kw_returns","data_type"],postprocess:i},{name:"func_returns$macrocall$2",symbols:["func_ret_table_col"]},{name:"func_returns$macrocall$1$ebnf$1",symbols:[]},{name:"func_returns$macrocall$1$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("comma")?{type:"comma"}:comma,"func_returns$macrocall$2"],postprocess:i},{name:"func_returns$macrocall$1$ebnf$1",symbols:["func_returns$macrocall$1$ebnf$1","func_returns$macrocall$1$ebnf$1$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"func_returns$macrocall$1",symbols:["func_returns$macrocall$2","func_returns$macrocall$1$ebnf$1"],postprocess:([e,o])=>[s(e),...o.map(s)||[]]},{name:"func_returns",symbols:["kw_returns",r.lexerAny.has("kw_table")?{type:"kw_table"}:kw_table,"lparen","func_returns$macrocall$1","rparen"],postprocess:e=>(0,n.track)(e,{kind:"table",columns:e[3]})},{name:"func_ret_table_col",symbols:["word","data_type"],postprocess:e=>(0,n.track)(e,{name:u(e[0]),type:e[1]})},{name:"do_stm$ebnf$1$subexpression$1",symbols:["kw_language","word"],postprocess:i},{name:"do_stm$ebnf$1",symbols:["do_stm$ebnf$1$subexpression$1"],postprocess:l},{name:"do_stm$ebnf$1",symbols:[],postprocess:()=>null},{name:"do_stm",symbols:[r.lexerAny.has("kw_do")?{type:"kw_do"}:kw_do,"do_stm$ebnf$1",r.lexerAny.has("codeblock")?{type:"codeblock"}:codeblock],postprocess:e=>(0,n.track)(e,{type:"do",...e[1]&&{language:u(e[1])},code:e[2].value})},{name:"drop_func$ebnf$1$subexpression$1",symbols:["kw_if","kw_exists"]},{name:"drop_func$ebnf$1",symbols:["drop_func$ebnf$1$subexpression$1"],postprocess:l},{name:"drop_func$ebnf$1",symbols:[],postprocess:()=>null},{name:"drop_func$ebnf$2",symbols:["drop_func_overload"],postprocess:l},{name:"drop_func$ebnf$2",symbols:[],postprocess:()=>null},{name:"drop_func",symbols:["kw_drop","kw_function","drop_func$ebnf$1","qname","drop_func$ebnf$2"],postprocess:e=>(0,n.track)(e,{type:"drop function",...e[2]&&{ifExists:!0},name:e[3],...e[4]&&{arguments:e[4]}})},{name:"drop_func_overload$macrocall$2",symbols:["drop_func_overload_col"]},{name:"drop_func_overload$macrocall$1$ebnf$1",symbols:[]},{name:"drop_func_overload$macrocall$1$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("comma")?{type:"comma"}:comma,"drop_func_overload$macrocall$2"],postprocess:i},{name:"drop_func_overload$macrocall$1$ebnf$1",symbols:["drop_func_overload$macrocall$1$ebnf$1","drop_func_overload$macrocall$1$ebnf$1$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"drop_func_overload$macrocall$1",symbols:["drop_func_overload$macrocall$2","drop_func_overload$macrocall$1$ebnf$1"],postprocess:([e,o])=>[s(e),...o.map(s)||[]]},{name:"drop_func_overload",symbols:["lparen","drop_func_overload$macrocall$1","rparen"],postprocess:$(1)},{name:"drop_func_overload_col$ebnf$1",symbols:["word"],postprocess:l},{name:"drop_func_overload_col$ebnf$1",symbols:[],postprocess:()=>null},{name:"drop_func_overload_col",symbols:["drop_func_overload_col$ebnf$1","qname"],postprocess:e=>(0,n.track)(e,{type:e[1],...e[0]&&{name:u(e[0])}})},{name:"main$ebnf$1",symbols:[]},{name:"main$ebnf$1",symbols:["main$ebnf$1","statement_separator"],postprocess:e=>e[0].concat([e[1]])},{name:"main$ebnf$2",symbols:[]},{name:"main$ebnf$2$subexpression$1$ebnf$1",symbols:["statement_separator"]},{name:"main$ebnf$2$subexpression$1$ebnf$1",symbols:["main$ebnf$2$subexpression$1$ebnf$1","statement_separator"],postprocess:e=>e[0].concat([e[1]])},{name:"main$ebnf$2$subexpression$1",symbols:["main$ebnf$2$subexpression$1$ebnf$1","statement"]},{name:"main$ebnf$2",symbols:["main$ebnf$2","main$ebnf$2$subexpression$1"],postprocess:e=>e[0].concat([e[1]])},{name:"main$ebnf$3",symbols:[]},{name:"main$ebnf$3",symbols:["main$ebnf$3","statement_separator"],postprocess:e=>e[0].concat([e[1]])},{name:"main",symbols:["main$ebnf$1","statement","main$ebnf$2","main$ebnf$3"],postprocess:([e,o,t])=>{const c=t,f=[s(o),...c.map(A=>s(A[1]))];return f.length===1?f[0]:f}},{name:"statement_separator",symbols:[r.lexerAny.has("semicolon")?{type:"semicolon"}:semicolon]},{name:"statement",symbols:["statement_noprep"]},{name:"statement",symbols:["prepare"]},{name:"statement",symbols:["deallocate"]},{name:"statement_noprep",symbols:["selection"]},{name:"statement_noprep",symbols:["createtable_statement"]},{name:"statement_noprep",symbols:["createextension_statement"]},{name:"statement_noprep",symbols:["createindex_statement"]},{name:"statement_noprep",symbols:["simplestatements_all"]},{name:"statement_noprep",symbols:["insert_statement"]},{name:"statement_noprep",symbols:["update_statement"]},{name:"statement_noprep",symbols:["altertable_statement"]},{name:"statement_noprep",symbols:["alterindex_statement"]},{name:"statement_noprep",symbols:["delete_statement"]},{name:"statement_noprep",symbols:["create_sequence_statement"]},{name:"statement_noprep",symbols:["alter_sequence_statement"]},{name:"statement_noprep",symbols:["drop_statement"]},{name:"statement_noprep",symbols:["createtype_statement"]},{name:"statement_noprep",symbols:["altertype_statement"]},{name:"statement_noprep",symbols:["create_view_statements"]},{name:"statement_noprep",symbols:["refresh_view_statements"]},{name:"statement_noprep",symbols:["create_schema"]},{name:"statement_noprep",symbols:["raise_statement"]},{name:"statement_noprep",symbols:["comment_statement"]},{name:"statement_noprep",symbols:["functions_statements"]},{name:"selection",symbols:["select_statement"],postprocess:s},{name:"selection",symbols:["select_values"],postprocess:s},{name:"selection",symbols:["with_statement"],postprocess:s},{name:"selection",symbols:["with_recursive_statement"],postprocess:s},{name:"selection",symbols:["union_statement"],postprocess:s},{name:"selection_paren",symbols:["lparen","selection","rparen"],postprocess:$(1)}],ParserStart:"main"};p.default=U}),(function(_,p,h){Object.defineProperty(p,"__esModule",{value:!0});function l(g){return g[0]}const r=h(12),n=g=>g&&g[g.length-1],u={Lexer:r.lexerAny,ParserRules:[{name:"main$ebnf$1",symbols:["elements"],postprocess:l},{name:"main$ebnf$1",symbols:[],postprocess:()=>null},{name:"main",symbols:[r.lexerAny.has("start_list")?{type:"start_list"}:start_list,"main$ebnf$1",r.lexerAny.has("end_list")?{type:"end_list"}:end_list],postprocess:g=>g[1]||[]},{name:"elements$ebnf$1",symbols:[]},{name:"elements$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("comma")?{type:"comma"}:comma,"elt"],postprocess:n},{name:"elements$ebnf$1",symbols:["elements$ebnf$1","elements$ebnf$1$subexpression$1"],postprocess:g=>g[0].concat([g[1]])},{name:"elements",symbols:["elt","elements$ebnf$1"],postprocess:([g,x])=>[g,...x||[]]},{name:"elt",symbols:[r.lexerAny.has("value")?{type:"value"}:value],postprocess:g=>g[0].value},{name:"elt",symbols:["main"],postprocess:g=>g[0]}],ParserStart:"main"};p.default=u}),(function(_,p,h){Object.defineProperty(p,"__esModule",{value:!0}),p.lexerAny=p.lexer=void 0;const l=h(0);p.lexer=(0,l.compile)({valueString:{match:/"(?:\\["\\]|[^\n"\\])*"/,value:r=>JSON.parse(r),type:r=>"value"},valueRaw:{match:/[^\s,\{\}"](?:[^,\{\}"]*[^\s,\{\}"])?/,type:()=>"value"},comma:",",space:{match:/[\s\t\n\v\f\r]+/,lineBreaks:!0},start_list:"{",end_list:"}"}),p.lexer.next=(r=>()=>{let n;for(;(n=r.call(p.lexer))&&n.type==="space";);return n})(p.lexer.next),p.lexerAny=p.lexer}),(function(_,p,h){Object.defineProperty(p,"__esModule",{value:!0});function l(s){return s[0]}const r=h(14),n=s=>$=>$[s],u=s=>s&&s[s.length-1];function g(s){return Array.isArray(s)&&s.length===1&&(s=g(s[0])),Array.isArray(s)&&!s.length?null:s}const x={Lexer:r.lexerAny,ParserRules:[{name:"number$subexpression$1",symbols:["float"]},{name:"number$subexpression$1",symbols:["int"]},{name:"number",symbols:["number$subexpression$1"],postprocess:g},{name:"float",symbols:[r.lexerAny.has("float")?{type:"float"}:float],postprocess:s=>parseFloat(g(s))},{name:"int",symbols:[r.lexerAny.has("int")?{type:"int"}:int],postprocess:s=>parseInt(g(s),10)},{name:"comma",symbols:[r.lexerAny.has("comma")?{type:"comma"}:comma],postprocess:l},{name:"point$macrocall$2",symbols:["point_content"]},{name:"point$macrocall$1$subexpression$1",symbols:["point$macrocall$2"]},{name:"point$macrocall$1$subexpression$1",symbols:[r.lexerAny.has("lparen")?{type:"lparen"}:lparen,"point$macrocall$2",r.lexerAny.has("rparen")?{type:"rparen"}:rparen],postprocess:n(1)},{name:"point$macrocall$1",symbols:["point$macrocall$1$subexpression$1"],postprocess:g},{name:"point",symbols:["point$macrocall$1"],postprocess:g},{name:"point_content",symbols:["number","comma","number"],postprocess:s=>({x:s[0],y:s[2]})},{name:"line",symbols:[r.lexerAny.has("lcurl")?{type:"lcurl"}:lcurl,"number","comma","number","comma","number",r.lexerAny.has("rcurl")?{type:"rcurl"}:rcurl],postprocess:s=>({a:s[1],b:s[3],c:s[5]})},{name:"box",symbols:["closed_path"],postprocess:([s],$)=>s.length!==2?$:s},{name:"lseg",symbols:["path"],postprocess:([s],$)=>s.path.length!==2?$:s.path},{name:"path",symbols:["open_path"],postprocess:([s])=>({closed:!1,path:s})},{name:"path",symbols:["closed_path"],postprocess:([s])=>({closed:!0,path:s})},{name:"open_path$macrocall$2",symbols:[r.lexerAny.has("lbracket")?{type:"lbracket"}:lbracket]},{name:"open_path$macrocall$3",symbols:[r.lexerAny.has("rbracket")?{type:"rbracket"}:rbracket]},{name:"open_path$macrocall$1$macrocall$2",symbols:["point"]},{name:"open_path$macrocall$1$macrocall$1$ebnf$1",symbols:[]},{name:"open_path$macrocall$1$macrocall$1$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("comma")?{type:"comma"}:comma,"open_path$macrocall$1$macrocall$2"],postprocess:u},{name:"open_path$macrocall$1$macrocall$1$ebnf$1",symbols:["open_path$macrocall$1$macrocall$1$ebnf$1","open_path$macrocall$1$macrocall$1$ebnf$1$subexpression$1"],postprocess:s=>s[0].concat([s[1]])},{name:"open_path$macrocall$1$macrocall$1",symbols:["open_path$macrocall$1$macrocall$2","open_path$macrocall$1$macrocall$1$ebnf$1"],postprocess:([s,$])=>[g(s),...$.map(g)||[]]},{name:"open_path$macrocall$1",symbols:["open_path$macrocall$2","open_path$macrocall$1$macrocall$1","open_path$macrocall$3"],postprocess:n(1)},{name:"open_path",symbols:["open_path$macrocall$1"],postprocess:u},{name:"closed_path$subexpression$1$macrocall$2",symbols:[r.lexerAny.has("lparen")?{type:"lparen"}:lparen]},{name:"closed_path$subexpression$1$macrocall$3",symbols:[r.lexerAny.has("rparen")?{type:"rparen"}:rparen]},{name:"closed_path$subexpression$1$macrocall$1$macrocall$2",symbols:["point"]},{name:"closed_path$subexpression$1$macrocall$1$macrocall$1$ebnf$1",symbols:[]},{name:"closed_path$subexpression$1$macrocall$1$macrocall$1$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("comma")?{type:"comma"}:comma,"closed_path$subexpression$1$macrocall$1$macrocall$2"],postprocess:u},{name:"closed_path$subexpression$1$macrocall$1$macrocall$1$ebnf$1",symbols:["closed_path$subexpression$1$macrocall$1$macrocall$1$ebnf$1","closed_path$subexpression$1$macrocall$1$macrocall$1$ebnf$1$subexpression$1"],postprocess:s=>s[0].concat([s[1]])},{name:"closed_path$subexpression$1$macrocall$1$macrocall$1",symbols:["closed_path$subexpression$1$macrocall$1$macrocall$2","closed_path$subexpression$1$macrocall$1$macrocall$1$ebnf$1"],postprocess:([s,$])=>[g(s),...$.map(g)||[]]},{name:"closed_path$subexpression$1$macrocall$1",symbols:["closed_path$subexpression$1$macrocall$2","closed_path$subexpression$1$macrocall$1$macrocall$1","closed_path$subexpression$1$macrocall$3"],postprocess:n(1)},{name:"closed_path$subexpression$1",symbols:["closed_path$subexpression$1$macrocall$1"],postprocess:u},{name:"closed_path$subexpression$1$macrocall$5",symbols:["point"]},{name:"closed_path$subexpression$1$macrocall$4$ebnf$1",symbols:[]},{name:"closed_path$subexpression$1$macrocall$4$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("comma")?{type:"comma"}:comma,"closed_path$subexpression$1$macrocall$5"],postprocess:u},{name:"closed_path$subexpression$1$macrocall$4$ebnf$1",symbols:["closed_path$subexpression$1$macrocall$4$ebnf$1","closed_path$subexpression$1$macrocall$4$ebnf$1$subexpression$1"],postprocess:s=>s[0].concat([s[1]])},{name:"closed_path$subexpression$1$macrocall$4",symbols:["closed_path$subexpression$1$macrocall$5","closed_path$subexpression$1$macrocall$4$ebnf$1"],postprocess:([s,$])=>[g(s),...$.map(g)||[]]},{name:"closed_path$subexpression$1",symbols:["closed_path$subexpression$1$macrocall$4"],postprocess:u},{name:"closed_path",symbols:["closed_path$subexpression$1"],postprocess:n(0)},{name:"polygon",symbols:["closed_path"],postprocess:n(0)},{name:"circle_body",symbols:["point","comma","number"],postprocess:s=>({c:s[0],r:s[2]})},{name:"circle$subexpression$1$macrocall$2",symbols:[r.lexerAny.has("lcomp")?{type:"lcomp"}:lcomp]},{name:"circle$subexpression$1$macrocall$3",symbols:[r.lexerAny.has("rcomp")?{type:"rcomp"}:rcomp]},{name:"circle$subexpression$1$macrocall$1",symbols:["circle$subexpression$1$macrocall$2","circle_body","circle$subexpression$1$macrocall$3"],postprocess:n(1)},{name:"circle$subexpression$1",symbols:["circle$subexpression$1$macrocall$1"]},{name:"circle$subexpression$1$macrocall$5",symbols:[r.lexerAny.has("lparen")?{type:"lparen"}:lparen]},{name:"circle$subexpression$1$macrocall$6",symbols:[r.lexerAny.has("rparen")?{type:"rparen"}:rparen]},{name:"circle$subexpression$1$macrocall$4",symbols:["circle$subexpression$1$macrocall$5","circle_body","circle$subexpression$1$macrocall$6"],postprocess:n(1)},{name:"circle$subexpression$1",symbols:["circle$subexpression$1$macrocall$4"]},{name:"circle$subexpression$1",symbols:["circle_body"]},{name:"circle",symbols:["circle$subexpression$1"],postprocess:g}],ParserStart:"number"};p.default=x}),(function(_,p,h){Object.defineProperty(p,"__esModule",{value:!0}),p.lexerAny=p.lexer=void 0;const l=h(0);p.lexer=(0,l.compile)({comma:",",space:{match:/[\s\t\n\v\f\r]+/,lineBreaks:!0},int:/\-?\d+(?![\.\d])/,float:/\-?(?:(?:\d*\.\d+)|(?:\d+\.\d*))/,lcurl:"{",rcurl:"}",lparen:"(",rparen:")",lbracket:"[",rbracket:"]",lcomp:"<",rcomp:">"}),p.lexer.next=(r=>()=>{let n;for(;(n=r.call(p.lexer))&&n.type==="space";);return n})(p.lexer.next),p.lexerAny=p.lexer}),(function(_,p,h){Object.defineProperty(p,"__esModule",{value:!0});function l(u){return u[0]}const r=h(16),n={Lexer:r.lexerAny,ParserRules:[{name:"main$ebnf$1",symbols:["elt"]},{name:"main$ebnf$1",symbols:["main$ebnf$1","elt"],postprocess:u=>u[0].concat([u[1]])},{name:"main",symbols:["main$ebnf$1"],postprocess:([u])=>{const g=new Set;for(const x of u){const s=typeof x[1]=="number"?x[0]:"time";if(g.has(s))return"invalid";g.add(s)}return u}},{name:"elt",symbols:["time"]},{name:"elt",symbols:["num","unit"],postprocess:([[u],g])=>(g=g[0].type,[g,u])},{name:"unit",symbols:[r.lexerAny.has("years")?{type:"years"}:years]},{name:"unit",symbols:[r.lexerAny.has("months")?{type:"months"}:months]},{name:"unit",symbols:[r.lexerAny.has("days")?{type:"days"}:days]},{name:"unit",symbols:[r.lexerAny.has("hours")?{type:"hours"}:hours]},{name:"unit",symbols:[r.lexerAny.has("minutes")?{type:"minutes"}:minutes]},{name:"unit",symbols:[r.lexerAny.has("seconds")?{type:"seconds"}:seconds]},{name:"unit",symbols:[r.lexerAny.has("milliseconds")?{type:"milliseconds"}:milliseconds]},{name:"num",symbols:["int"]},{name:"num",symbols:["float"]},{name:"uint",symbols:[r.lexerAny.has("int")?{type:"int"}:int],postprocess:([u])=>parseInt(u,10)},{name:"int$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("neg")?{type:"neg"}:neg]},{name:"int$ebnf$1",symbols:["int$ebnf$1$subexpression$1"],postprocess:l},{name:"int$ebnf$1",symbols:[],postprocess:()=>null},{name:"int",symbols:["int$ebnf$1",r.lexerAny.has("int")?{type:"int"}:int],postprocess:([u,g])=>parseInt(g,10)*(u?-1:1)},{name:"float$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("neg")?{type:"neg"}:neg]},{name:"float$ebnf$1",symbols:["float$ebnf$1$subexpression$1"],postprocess:l},{name:"float$ebnf$1",symbols:[],postprocess:()=>null},{name:"float$ebnf$2",symbols:[r.lexerAny.has("int")?{type:"int"}:int],postprocess:l},{name:"float$ebnf$2",symbols:[],postprocess:()=>null},{name:"float",symbols:["float$ebnf$1","float$ebnf$2",r.lexerAny.has("dot")?{type:"dot"}:dot,r.lexerAny.has("int")?{type:"int"}:int],postprocess:([u,...g])=>parseFloat(g.map(x=>x?x.text:"0").join(""))*(u?-1:1)},{name:"time$ebnf$1$subexpression$1",symbols:[r.lexerAny.has("colon")?{type:"colon"}:colon,"uint"]},{name:"time$ebnf$1",symbols:["time$ebnf$1$subexpression$1"],postprocess:l},{name:"time$ebnf$1",symbols:[],postprocess:()=>null},{name:"time$ebnf$2$subexpression$1",symbols:[r.lexerAny.has("dot")?{type:"dot"}:dot,r.lexerAny.has("int")?{type:"int"}:int]},{name:"time$ebnf$2",symbols:["time$ebnf$2$subexpression$1"],postprocess:l},{name:"time$ebnf$2",symbols:[],postprocess:()=>null},{name:"time",symbols:["uint",r.lexerAny.has("colon")?{type:"colon"}:colon,"uint","time$ebnf$1","time$ebnf$2"],postprocess:([u,g,x,s,$])=>{s=s&&s[1],$=$&&$[1];const i=typeof s=="number"?[["hours",u],["minutes",x],["seconds",s]]:[["minutes",u],["seconds",x]];return $&&i.push(["milliseconds",parseFloat("0."+$)*1e3]),i}}],ParserStart:"main"};p.default=n}),(function(_,p,h){Object.defineProperty(p,"__esModule",{value:!0}),p.lexerAny=p.lexer=void 0;const l=h(0);p.lexer=(0,l.compile)({int:/\d+/,neg:"-",dot:".",years:/(?:y|yrs?|years?)\b/,months:/(?:mon(?:th)?s?)\b/,days:/(?:d|days?)\b/,hours:/(?:h|hrs?|hours?)\b/,minutes:/(?:m|mins?|minutes?)\b/,seconds:/(?:s|secs?|seconds?)\b/,milliseconds:/(?:ms|milliseconds?)\b/,space:{match:/[\s\t\n\v\f\r]+/,lineBreaks:!0},colon:":"}),p.lexer.next=(r=>()=>{let n;for(;(n=r.call(p.lexer))&&n.type==="space";);return n})(p.lexer.next),p.lexerAny=p.lexer}),(function(_,p,h){Object.defineProperty(p,"__esModule",{value:!0});function l(u){return u[0]}const r=h(18),n={Lexer:r.lexerAny,ParserRules:[{name:"num",symbols:[r.lexerAny.has("int")?{type:"int"}:int]},{name:"num",symbols:[r.lexerAny.has("float")?{type:"float"}:float]},{name:"main$ebnf$1",symbols:[]},{name:"main$ebnf$1",symbols:["main$ebnf$1","long"],postprocess:u=>u[0].concat([u[1]])},{name:"main$ebnf$2$subexpression$1$ebnf$1",symbols:["short"]},{name:"main$ebnf$2$subexpression$1$ebnf$1",symbols:["main$ebnf$2$subexpression$1$ebnf$1","short"],postprocess:u=>u[0].concat([u[1]])},{name:"main$ebnf$2$subexpression$1",symbols:[r.lexerAny.has("T")?{type:"T"}:T,"main$ebnf$2$subexpression$1$ebnf$1"]},{name:"main$ebnf$2",symbols:["main$ebnf$2$subexpression$1"],postprocess:l},{name:"main$ebnf$2",symbols:[],postprocess:()=>null},{name:"main",symbols:[r.lexerAny.has("P")?{type:"P"}:P,"main$ebnf$1","main$ebnf$2"],postprocess:([u,g,x],s)=>(x=x?x[1]:[],!g.length&&!x.length?s:g.length?x.length?[...g,...x]:g:x)},{name:"long$subexpression$1",symbols:[r.lexerAny.has("Y")?{type:"Y"}:Y]},{name:"long$subexpression$1",symbols:[r.lexerAny.has("M")?{type:"M"}:M]},{name:"long$subexpression$1",symbols:[r.lexerAny.has("W")?{type:"W"}:W]},{name:"long$subexpression$1",symbols:[r.lexerAny.has("D")?{type:"D"}:D]},{name:"long",symbols:["num","long$subexpression$1"],postprocess:([u,g])=>{switch(u=parseFloat(u[0].value),g=g[0].type,g){case"Y":return["years",u];case"M":return["months",u];case"W":return["days",u*7];case"D":return["days",u];default:throw new Error("Unexpected unit "+g)}}},{name:"short$ebnf$1",symbols:[r.lexerAny.has("T")?{type:"T"}:T],postprocess:l},{name:"short$ebnf$1",symbols:[],postprocess:()=>null},{name:"short$subexpression$1",symbols:[r.lexerAny.has("H")?{type:"H"}:H]},{name:"short$subexpression$1",symbols:[r.lexerAny.has("M")?{type:"M"}:M]},{name:"short$subexpression$1",symbols:[r.lexerAny.has("S")?{type:"S"}:S]},{name:"short",symbols:["short$ebnf$1","num","short$subexpression$1"],postprocess:([u,g,x])=>{switch(g=parseFloat(g[0].value),x=x[0].type,x){case"H":return["hours",g];case"M":return["minutes",g];case"S":return["seconds",g];default:throw new Error("Unexpected unit "+x)}}}],ParserStart:"num"};p.default=n}),(function(_,p,h){Object.defineProperty(p,"__esModule",{value:!0}),p.lexerAny=p.lexer=void 0;const l=h(0);p.lexer=(0,l.compile)({int:/\-?\d+(?![\.\d])/,float:/\-?(?:(?:\d*\.\d+)|(?:\d+\.\d*))/,P:"P",Y:"Y",M:"M",W:"W",D:"D",H:"H",S:"S",T:"T"}),p.lexerAny=p.lexer}),(function(_,p,h){Object.defineProperty(p,"__esModule",{value:!0}),p.toSql=void 0;const l=h(2),r=h(5),n=h(6),u=h(20),g=h(3),x=new Set(g.sqlKeywords.map(o=>o.toLowerCase()));let s=[];function $(o){return i(o.name)}function i(o,t){if(!t){const c=o.toLowerCase();if(c===o&&!x.has(c)&&/^[a-z][a-z0-9_]*$/.test(c))return o}return'"'+o+'"'}function a(o,t,c){c&&s.push("(");let f=!0;for(const A of o)f||s.push(", "),f=!1,t(A);c&&s.push(")")}function m(o,t){switch(o.type){case"foreign key":s.push(" foreign key (",...o.localColumns.map($).join(", "),")");case"reference":s.push(" REFERENCES "),t.tableRef(o.foreignTable),s.push("(",...o.foreignColumns.map($).join(", "),") "),o.match&&s.push(" MATCH ",o.match.toUpperCase()),o.onDelete&&s.push(" ON DELETE ",o.onDelete),o.onUpdate&&s.push(" ON UPDATE ",o.onUpdate);break;case"primary key":case"unique":s.push(" ",o.type," "),"columns"in o&&s.push("(",...o.columns.map($).join(", "),") ");break;case"check":s.push(" check "),t.expr(o.expr);break;case"not null":case"null":s.push(" ",o.type," ");break;case"default":s.push(" default "),t.expr(o.default);break;case"add generated":s.push(" GENERATED "),L(t,o);break;default:throw n.NotSupported.never(o)}s.push(" ")}function b(o,t){o.schema&&s.push(i(o.schema),"."),s.push(i(o.name,t)," ")}function d(o){b(o),o.alias&&s.push(" AS ",i(o.alias)," ")}function E(o,t){s.push(" ORDER BY "),a(t,c=>{o.expr(c.by),c.order&&s.push(" ",c.order," "),c.nulls&&s.push(" NULLS ",c.nulls," ")},!1)}function C(o){switch(o.type){case"default":s.push("DEFAULT ");break;case"identifier":s.push(o.name);break;case"list":let t=!0;for(const c of o.values)t||s.push(", "),t=!1,C(c);break;case"value":s.push(typeof o.value=="number"?o.value.toString():(0,u.literal)(o.value));break;default:throw n.NotSupported.never(o)}}function L(o,t){t.always&&s.push(t.always.toUpperCase()," "),s.push("AS IDENTITY "),t.sequence&&(s.push("("),t.sequence.name&&(s.push("SEQUENCE NAME "),b(t.sequence.name),s.push(" ")),w(o,t.sequence),s.push(") "))}function w(o,t){t.as&&(s.push("AS "),o.dataType(t.as),s.push(" ")),typeof t.incrementBy=="number"&&s.push("INCREMENT BY ",t.incrementBy.toString()," "),t.minValue==="no minvalue"&&s.push("NO MINVALUE "),typeof t.minValue=="number"&&s.push("MINVALUE ",t.minValue.toString()," "),t.maxValue==="no maxvalue"&&s.push("NO MAXVALUE "),typeof t.maxValue=="number"&&s.push("MAXVALUE ",t.maxValue.toString()," "),typeof t.startWith=="number"&&s.push("START WITH ",t.startWith.toString()," "),typeof t.cache=="number"&&s.push("CACHE ",t.cache.toString()," "),t.cycle&&s.push(t.cycle," "),t.ownedBy==="none"?s.push("OWNED BY NONE "):t.ownedBy&&(s.push("OWNED BY "),k(t.ownedBy)),"restart"in t&&(t.restart===!0?s.push("RESTART "):t.restart&&s.push("RESTART WITH ",t.restart.toString()," "))}function k(o){o.schema&&s.push(i(o.schema),"."),s.push(i(o.table),".",i(o.column)," ")}function v(o,t,c){if(!t){c();return}s.push(t.type," "),c(),t.on&&(s.push("ON "),o.expr(t.on)),t.using&&(s.push("USING ("),a(t.using,f=>s.push($(f)),!1),s.push(") ")),s.push(" ")}function N(o){o.opSchema?s.push(" operator(",i(o.opSchema),".",o.op,") "):s.push(" ",o.op," ")}const U=(0,r.astVisitor)(o=>({addColumn:(...t)=>{s.push(" ADD COLUMN "),t[0].ifNotExists&&s.push("IF NOT EXISTS "),o.super().addColumn(...t)},createExtension:t=>{s.push("CREATE EXTENSION "),t.ifNotExists&&s.push(" IF NOT EXISTS "),s.push($(t.extension)),!(!t.from&&!t.version&&!t.schema)&&(s.push(" WITH"),t.schema&&s.push(" SCHEMA ",$(t.schema)),t.version&&s.push(" VERSION ",(0,u.literal)(t.version.value)),t.from&&s.push(" FROM ",(0,u.literal)(t.from.value)))},tablespace:t=>{s.push("TABLESPACE ",$(t.tablespace))},addConstraint:t=>{s.push(" ADD ");const c=t.constraint.constraintName;c&&s.push(" CONSTRAINT ",$(c)," "),m(t.constraint,o)},alterColumn:(t,c)=>{s.push(" ALTER COLUMN ",$(t.column)," "),o.super().alterColumn(t,c)},setColumnDefault:(t,c,f)=>{if(s.push(" SET DEFAULT "),o.expr(t.default),t.updateExisting)throw new Error("Not implemented: updateExisting on set column default")},createEnum:t=>{s.push("CREATE TYPE "),b(t.name),s.push(" AS ENUM "),a(t.values,c=>s.push((0,u.literal)(c.value)),!0),s.push(" ")},alterEnum:t=>{s.push("ALTER TYPE "),b(t.name),t.change.type==="rename"?(s.push(" RENAME TO "),b(t.change.to)):s.push(" ADD VALUE ",(0,u.literal)(t.change.add.value))},createCompositeType:t=>{s.push("CREATE TYPE "),b(t.name),s.push(" AS "),a(t.attributes,c=>{s.push($(c.name)," "),o.dataType(c.dataType),c.collate&&(s.push("COLLATE "),b(c.collate))},!0),s.push(" ")},setTableOwner:t=>{s.push(" OWNER TO ",$(t.to))},alterColumnSimple:t=>s.push(t.type),alterColumnAddGenerated:t=>{s.push(" ADD GENERATED "),L(o,t)},setColumnType:t=>{s.push(" SET DATA TYPE "),o.dataType(t.dataType),s.push(" ")},alterTable:t=>{s.push("ALTER TABLE "),t.ifExists&&s.push(" IF EXISTS "),t.only&&s.push(" ONLY "),d(t.table),a(t.changes,c=>o.tableAlteration(c,t.table),!1)},alterIndex:t=>{switch(s.push("ALTER INDEX "),t.ifExists&&s.push(" IF EXISTS "),d(t.index),t.change.type){case"rename":s.push(" RENAME TO "),b(t.change.to),s.push(" ");break;case"set tablespace":s.push(" SET TABLESPACE "),b(t.change.tablespace),s.push(" ");break;default:throw n.NotSupported.never(t.change,"Alter index type not supported: ")}},tableAlteration:(t,c)=>{switch(t.type){case"add column":return o.addColumn(t,c);case"add constraint":return o.addConstraint(t,c);case"alter column":return o.alterColumn(t,c);case"rename":return o.renameTable(t,c);case"rename column":return o.renameColumn(t,c);case"rename constraint":return o.renameConstraint(t,c);case"drop column":return o.dropColumn(t,c);case"drop constraint":return o.dropConstraint(t,c);case"owner":return o.setTableOwner(t,c);default:throw n.NotSupported.never(t)}},array:t=>{s.push(t.type==="array"?"ARRAY[":"("),a(t.expressions,c=>o.expr(c),!1),s.push(t.type==="array"?"]":")")},arrayIndex:t=>{o.expr(t.array),s.push("["),o.expr(t.index),s.push("] ")},expr:t=>{if(t.type==="ref"){o.ref(t);return}if(t.type==="list"){o.super().expr(t);return}s.push("("),o.super().expr(t),s.push(")")},callOverlay:t=>{s.push("OVERLAY("),o.expr(t.value),s.push(" PLACING "),o.expr(t.placing),s.push(" FROM "),o.expr(t.from),t.for&&(s.push(" FOR "),o.expr(t.for)),s.push(")")},callSubstring:t=>{s.push("SUBSTRING("),o.expr(t.value),t.from&&(s.push(" FROM "),o.expr(t.from)),t.for&&(s.push(" FOR "),o.expr(t.for)),s.push(")")},binary:t=>{o.expr(t.left),N(t),o.expr(t.right)},call:t=>{b(t.function),s.push("("),t.distinct&&s.push(t.distinct," "),a(t.args,c=>o.expr(c),!1),t.orderBy&&E(o,t.orderBy),s.push(") "),t.filter&&(s.push("filter (where "),o.expr(t.filter),s.push(") ")),t.withinGroup&&(s.push("WITHIN GROUP ("),E(o,[t.withinGroup]),s.push(") ")),t.over&&(s.push("over ("),t.over.partitionBy&&(s.push("PARTITION BY "),a(t.over.partitionBy,c=>o.expr(c),!1),s.push(" ")),t.over.orderBy&&(E(o,t.over.orderBy),s.push(" ")),s.push(") "))},case:t=>{s.push("CASE "),t.value&&o.expr(t.value);for(const c of t.whens)s.push(" WHEN "),o.expr(c.when),s.push(" THEN "),o.expr(c.value);t.else&&(s.push(" ELSE "),o.expr(t.else)),s.push(" END ")},cast:t=>{o.expr(t.operand),s.push("::"),o.dataType(t.to)},constant:t=>{switch(t.type){case"boolean":s.push(t.value?"true":"false");break;case"integer":s.push(t.value.toString(10));break;case"numeric":s.push(t.value.toString()),Number.isInteger(t.value)&&s.push(".");break;case"null":s.push("null");break;case"constant":break;case"string":s.push((0,u.literal)(t.value));break;default:throw n.NotSupported.never(t)}},valueKeyword:t=>{s.push(t.keyword," ")},comment:t=>{s.push("COMMENT ON ",t.on.type.toUpperCase()," "),t.on.type==="column"?k(t.on.column):b(t.on.name),s.push(" IS ",(0,u.literal)(t.comment)," ")},extract:t=>{s.push("EXTRACT (",t.field.name.toUpperCase()," FROM "),o.expr(t.from),s.push(") ")},createColumn:t=>{var c;s.push($(t.name)," "),o.dataType(t.dataType),s.push(" "),t.collate&&(s.push("COLLATE "),b(t.collate));for(const f of(c=t.constraints)!==null&&c!==void 0?c:[])o.constraint(f)},begin:t=>{s.push("BEGIN "),t.isolationLevel&&s.push("ISOLATION LEVEL ",t.isolationLevel.toUpperCase()," "),t.writeable&&s.push(t.writeable.toUpperCase()," "),typeof t.deferrable=="boolean"&&(t.deferrable||s.push("NOT "),s.push("DEFERRABLE "))},alterSequence:t=>{switch(s.push("ALTER SEQUENCE "),t.ifExists&&s.push("IF EXISTS "),b(t.name),t.change.type){case"set options":w(o,t.change);break;case"rename":s.push("RENAME TO ",$(t.change.newName)," ");break;case"set schema":s.push("SET SCHEMA ",$(t.change.newSchema)," ");break;case"owner to":t.change.owner,s.push("OWNER TO ",$(t.change.owner)," ");break;default:throw n.NotSupported.never(t.change)}},createSequence:t=>{s.push("CREATE "),t.temp&&s.push("TEMPORARY "),s.push("SEQUENCE "),t.ifNotExists&&s.push("IF NOT EXISTS "),b(t.name),w(o,t.options)},drop:t=>{s.push(t.type.toUpperCase()," "),t.concurrently&&s.push("CONCURRENTLY "),t.ifExists&&s.push("IF EXISTS "),a(t.names,c=>o.tableRef(c),!1),t.cascade&&s.push(t.cascade.toUpperCase()," ")},constraint:t=>{t.constraintName&&s.push(" CONSTRAINT ",$(t.constraintName)," "),m(t,o)},do:t=>{s.push("DO"),t.language&&s.push(" LANGUAGE ",t.language.name),s.push(" $$",t.code,"$$")},createFunction:t=>{var c;if(s.push(t.orReplace?"CREATE OR REPLACE FUNCTION ":"CREATE FUNCTION "),b(t.name),a(t.arguments,f=>{f.mode&&s.push(f.mode," "),f.name&&s.push($(f.name)," "),o.dataType(f.type),f.default&&(s.push(" = "),o.expr(f.default))},!0),t.returns)switch(t.returns.kind){case"table":s.push(" RETURNS TABLE "),a(t.returns.columns,f=>{s.push($(f.name)," "),o.dataType(f.type)},!0);break;case void 0:case null:case"array":s.push(" RETURNS "),o.dataType(t.returns);break;default:throw n.NotSupported.never(t.returns)}switch(s.push(" AS $$",(c=t.code)!==null&&c!==void 0?c:"","$$"),t.language&&s.push("LANGUAGE ",t.language.name," "),t.purity&&s.push(t.purity.toUpperCase()," "),typeof t.leakproof=="boolean"&&s.push(t.leakproof?"LEAKPROOF ":"NOT LEAKPROOF "),t.onNullInput){case"call":s.push("CALLED ON NULL INPUT ");break;case"null":s.push("RETURNS NULL ON NULL INPUT ");break;case"strict":s.push("STRICT ");break;case null:case void 0:break;default:throw n.NotSupported.never(t.onNullInput)}},dropFunction:t=>{s.push("DROP FUNCTION "),t.ifExists&&s.push("IF EXISTS "),b(t.name),t.arguments&&a(t.arguments,c=>{c.name&&(b(c.name),s.push(" ")),o.dataType(c.type)},!0),s.push(" ")},with:t=>{s.push("WITH "),a(t.bind,c=>{s.push($(c.alias)," AS ("),o.statement(c.statement),s.push(") ")},!1),o.statement(t.in)},withRecursive:t=>{s.push("WITH RECURSIVE ",$(t.alias),"(",...t.columnNames.map($).join(", "),") AS ("),o.union(t.bind),s.push(") "),o.statement(t.in)},setGlobal:t=>{s.push("SET "),t.scope&&s.push(t.scope.toUpperCase()+" "),s.push($(t.variable)," = "),C(t.set)},setTimezone:t=>{switch(s.push("SET TIME ZONE "),t.to.type){case"default":case"local":s.push(t.to.type.toUpperCase()," ");break;case"value":s.push(typeof t.to.value=="string"?(0,u.literal)(t.to.value):t.to.value.toString(10));break;case"interval":s.push("INTERVAL ",(0,u.literal)(t.to.value)," HOUR TO MINUTE");break;default:throw n.NotSupported.never(t.to)}},setNames:t=>{s.push("SET NAMES "),t.to.type==="value"&&s.push((0,u.literal)(t.to.value))},dataType:t=>{var c,f;if(t?.kind==="array"){o.dataType(t.arrayOf),s.push("[]");return}if(!t?.name){s.push("unkown");return}let A=!0;if(t.schema)b(t,t.doubleQuoted);else if(t.doubleQuoted)b(t,!0);else switch(t.name){case"double precision":case"character varying":case"bit varying":s.push(t.name," ");break;case"time without time zone":case"timestamp without time zone":case"time with time zone":case"timestamp with time zone":const q=t.name.split(" ");s.push(q.shift()),!((c=t.config)===null||c===void 0)&&c.length&&a(t.config,R=>s.push(R.toString(10)),!0),s.push(" "),s.push(q.join(" ")," "),A=!1;break;default:b(t);break}A&&!((f=t.config)===null||f===void 0)&&f.length&&a(t.config,q=>s.push(q.toString(10)),!0)},createIndex:t=>{s.push(t.unique?"CREATE UNIQUE INDEX ":"CREATE INDEX "),t.concurrently&&s.push("CONCURRENTLY "),t.ifNotExists&&s.push(" IF NOT EXISTS "),t.indexName&&s.push($(t.indexName)," "),s.push("ON "),o.tableRef(t.table),t.using&&s.push("USING ",$(t.using)," "),a(t.expressions,c=>{o.expr(c.expression),s.push(" "),c.collate&&(s.push("COLLATE "),b(c.collate)),c.opclass&&b(c.opclass),c.order&&s.push(c.order," "),c.nulls&&s.push("nulls ",c.nulls," ")},!0),t.with&&(s.push("WITH "),a(t.with,c=>{s.push(c.parameter," = ",(0,u.literal)(c.value))},!0)),t.tablespace&&s.push("TABLESPACE ",i(t.tablespace)),t.where&&(s.push(" WHERE "),o.expr(t.where)),s.push(" ")},createTable:t=>{var c;s.push("CREATE "),t.locality&&s.push(t.locality.toUpperCase()," "),t.temporary&&s.push("TEMPORARY "),t.unlogged&&s.push("UNLOGGED "),s.push(t.ifNotExists?"TABLE IF NOT EXISTS ":"TABLE "),o.tableRef(t.name),s.push("("),a(t.columns,f=>{switch(f.kind){case"column":return o.createColumn(f);case"like table":return o.likeTable(f);default:throw n.NotSupported.never(f)}},!1),t.constraints&&(s.push(", "),a(t.constraints,f=>{const A=f.constraintName;A&&s.push("CONSTRAINT ",$(A)," "),m(f,o)},!1)),s.push(") "),!((c=t.inherits)===null||c===void 0)&&c.length&&(s.push(" INHERITS "),a(t.inherits,f=>b(f),!0))},likeTable:t=>{s.push(" LIKE "),o.tableRef(t.like),s.push(" ");for(const{verb:c,option:f}of t.options)s.push(c.toUpperCase()," ",f.toUpperCase()," ")},createSchema:t=>{s.push(t.ifNotExists?"CREATE SCHEMA IF NOT EXISTS ":"CREATE SCHEMA "),s.push($(t.name))},truncateTable:t=>{s.push("TRUNCATE TABLE ");let c=!0;for(const f of t.tables)c||s.push(", "),c=!1,o.tableRef(f);if(t.identity)switch(t.identity){case"restart":s.push(" RESTART IDENTITY ");break;case"continue":s.push(" CONTINUE IDENTITY ");break}t.cascade&&s.push(" ",t.cascade," ")},delete:t=>{s.push("DELETE FROM "),o.tableRef(t.from),t.where&&(s.push(" WHERE "),o.expr(t.where)),t.returning&&(s.push(" RETURNING "),a(t.returning,c=>o.selectionColumn(c),!1)),s.push(" ")},dropColumn:t=>{s.push(" DROP COLUMN "),t.ifExists&&s.push(" IF EXISTS "),s.push($(t.column)),t.behaviour&&s.push(" ",t.behaviour),s.push(" ")},dropConstraint:t=>{s.push(" DROP CONSTRAINT "),t.ifExists&&s.push(" IF EXISTS "),s.push($(t.constraint)),t.behaviour&&s.push(" ",t.behaviour.toUpperCase()," ")},from:t=>o.super().from(t),fromCall:t=>{v(o,t.join,()=>{var c,f;if(t.lateral&&s.push("LATERAL "),o.call(t),t.withOrdinality&&s.push(" WITH ORDINALITY"),t.alias){s.push(" AS ",$(t.alias)," ");const A=(f=(c=t.alias.columns)===null||c===void 0?void 0:c.length)!==null&&f!==void 0?f:0;if(A>0){s.push("(");for(let q=0;q<A;++q)q!==0&&s.push(", "),s.push($(t.alias.columns[q]));s.push(")")}}}),s.push(" ")},fromStatement:t=>{v(o,t.join,()=>{t.lateral&&s.push("LATERAL "),s.push("("),o.select(t.statement),s.push(") "),t.alias&&(s.push(" AS ",i(t.alias)),t.columnNames&&a(t.columnNames,c=>s.push($(c)),!0),s.push(" "))}),s.push(" ")},values:t=>{s.push("VALUES "),a(t.values,c=>{a(c,f=>{o.expr(f)},!0)},!1)},fromTable:t=>{v(o,t.join,()=>{if(o.tableRef(t.name),t.name.columnNames){if(!t.name.alias)throw new Error("Cannot specify aliased column names without an alias");a(t.name.columnNames,c=>s.push($(c)),!0)}})},join:t=>{throw new Error("Should not happen 💀")},insert:t=>{if(s.push("INSERT INTO "),o.tableRef(t.into),t.columns&&s.push("(",t.columns.map($).join(", "),")"),s.push(" "),t.overriding&&s.push("OVERRIDING ",t.overriding.toUpperCase()," VALUE "),o.select(t.insert),s.push(" "),t.onConflict){s.push("ON CONFLICT ");const c=t.onConflict.on;switch(c?.type){case"on expr":a(c.exprs,f=>o.expr(f),!0);break;case"on constraint":s.push("ON CONSTRAINT "),b(c.constraint);case null:case void 0:break;default:throw n.NotSupported.never(c)}t.onConflict.do==="do nothing"?s.push(" DO NOTHING"):(s.push(" DO UPDATE SET "),a(t.onConflict.do.sets,f=>o.set(f),!1),t.onConflict.where&&(s.push(" WHERE "),o.expr(t.onConflict.where))),s.push(" ")}t.returning&&(s.push(" RETURNING "),a(t.returning,c=>o.selectionColumn(c),!1))},raise:t=>{var c,f;s.push("RAISE "),t.level&&s.push(t.level.toUpperCase()," "),s.push((0,u.literal)(t.format)," "),!((c=t.formatExprs)===null||c===void 0)&&c.length&&(s.push(", "),a(t.formatExprs,A=>o.expr(A),!1)),!((f=t.using)===null||f===void 0)&&f.length&&(s.push(" USING "),a(t.using,({type:A,value:q})=>{s.push(A.toUpperCase(),"="),o.expr(q)},!1)),s.push(" ")},default:()=>{s.push(" DEFAULT ")},member:t=>{o.expr(t.operand),s.push(t.op),s.push(typeof t.member=="number"?t.member.toString(10):(0,u.literal)(t.member))},ref:t=>{t.table&&(b(t.table),s.push(".")),s.push(t.name==="*"?"*":i(t.name))},parameter:t=>{s.push(t.name)},renameColumn:t=>{s.push(" RENAME COLUMN ",$(t.column)," TO ",$(t.to))},renameConstraint:t=>{s.push(" RENAME CONSTRAINT ",$(t.constraint)," TO ",$(t.to))},renameTable:t=>{s.push(" RENAME TO ",$(t.to))},createView:t=>{s.push("CREATE "),t.orReplace&&s.push("OR REPLACE "),t.temp&&s.push("TEMP "),t.recursive&&s.push("RECURSIVE "),s.push("VIEW "),o.tableRef(t.name),t.columnNames&&a(t.columnNames,f=>s.push($(f)),!0);const c=t.parameters&&Object.entries(t.parameters);c?.length&&(s.push(" WITH "),a(c,([f,A])=>s.push(f,"=",A),!1)),s.push(" AS "),o.select(t.query),t.checkOption&&s.push(" WITH ",t.checkOption.toUpperCase()," CHECK OPTION")},createMaterializedView:t=>{s.push("CREATE MATERIALIZED VIEW "),t.ifNotExists&&s.push("IF NOT EXISTS "),o.tableRef(t.name),t.columnNames&&a(t.columnNames,f=>s.push($(f)),!0);const c=t.parameters&&Object.entries(t.parameters);c?.length&&(s.push(" WITH "),a(c,([f,A])=>s.push(f,"=",A),!1)),t.tablespace&&s.push(" TABLESPACE ",$(t.tablespace)),s.push(" AS "),o.select(t.query),typeof t.withData=="boolean"&&s.push(t.withData?" WITH DATA":" WITH NO DATA")},refreshMaterializedView:t=>{s.push("REFRESH MATERIALIZED VIEW "),t.concurrently&&s.push("CONCURRENTLY "),o.tableRef(t.name),typeof t.withData=="boolean"&&s.push(t.withData?" WITH DATA":" WITH NO DATA")},select:t=>o.super().select(t),selection:t=>{if(s.push("SELECT "),t.distinct&&(typeof t.distinct=="string"?s.push(t.distinct.toUpperCase()):(s.push(" DISTINCT ON "),a(t.distinct,c=>o.expr(c),!0)),s.push(" ")),t.columns&&a(t.columns,c=>o.selectionColumn(c),!1),s.push(" "),t.from){s.push("FROM ");const c=t.from.length;for(let f=0;f<c;f++){const A=t.from[f];f>0&&!A.join&&s.push(","),o.from(A)}s.push(" ")}t.where&&(s.push("WHERE "),o.expr(t.where),s.push(" ")),t.groupBy&&(s.push("GROUP BY "),a(t.groupBy,c=>o.expr(c),!1),s.push(" "),t.having&&(s.push(" HAVING "),o.expr(t.having),s.push(" "))),t.orderBy&&(E(o,t.orderBy),s.push(" ")),t.limit&&(t.limit.offset&&(s.push("OFFSET "),o.expr(t.limit.offset)),t.limit.limit&&(s.push("LIMIT "),o.expr(t.limit.limit))),t.for&&(s.push("FOR ",t.for.type.toUpperCase()),t.skip&&s.push(" ",t.skip.type.toUpperCase()))},show:t=>{s.push("SHOW ",$(t.variable))},prepare:t=>{var c;s.push("PREPARE ",$(t.name)),!((c=t.args)===null||c===void 0)&&c.length&&a(t.args,f=>o.dataType(f),!0),s.push(" AS "),o.statement(t.statement)},deallocate:t=>{if(s.push("DEALLOCATE "),"name"in t.target){s.push(t.target.name);return}s.push("ALL")},arraySelect:t=>{s.push("array("),o.select(t.select),s.push(")")},union:t=>{s.push("("),o.statement(t.left),s.push(") ",t.type.toUpperCase()," "),t.right.type==="union"||t.right.type==="union all"?o.union(t.right):(s.push("("),o.statement(t.right),s.push(")"))},selectionColumn:t=>{o.expr(t.expr),t.alias&&s.push(" AS ",$(t.alias)),s.push(" ")},set:t=>{s.push($(t.column)," = "),o.expr(t.value),s.push(" ")},statement:t=>o.super().statement(t),tableRef:t=>{b(t),t.alias&&s.push(" AS ",i(t.alias)),s.push(" ")},ternary:t=>{o.expr(t.value),s.push(" ",t.op," "),o.expr(t.lo),s.push(" AND "),o.expr(t.hi),s.push(" ")},transaction:t=>{s.push(t.type)},unary:t=>{switch(t.op){case"+":case"-":N(t),o.expr(t.operand);break;case"NOT":s.push(t.op),s.push(" "),o.expr(t.operand);break;default:o.expr(t.operand),s.push(" "),s.push(t.op)}},update:t=>{s.push("UPDATE "),o.tableRef(t.table),s.push(" SET "),a(t.sets,c=>o.set(c),!1),s.push(" "),t.from&&(s.push("FROM "),o.from(t.from),s.push(" ")),t.where&&(s.push("WHERE "),o.expr(t.where),s.push(" ")),t.returning&&(s.push(" RETURNING "),a(t.returning,c=>o.selectionColumn(c),!1),s.push(" "))}}));p.toSql={};const e=l.AstDefaultMapper.prototype;for(const o of Object.getOwnPropertyNames(e)){const t=e[o];o==="constructor"||o==="super"||typeof t!="function"||(p.toSql[o]=function(...c){try{return U[o].apply(U,c),s.join("").trim()}finally{s=[]}})}}),(function(_,p,h){Object.defineProperty(p,"__esModule",{value:!0}),p.literal=void 0;function l(r){if(r==null)return"NULL";if(Array.isArray(r)){var n=r.map(l);return"("+n.join(", ")+")"}var u=~r.indexOf("\\"),g=u?"E":"";return r=r.replace(/'/g,"''"),r=r.replace(/\\/g,"\\\\"),g+"'"+r+"'"}p.literal=l}),(function(_,p,h){Object.defineProperty(p,"__esModule",{value:!0}),p.locationOf=void 0;function l(r){const n=r._location;if(!n)throw new Error("This statement has not been parsed using location tracking (which has a small performance hit). ");return n}p.locationOf=l})]))})(fe)),fe}var Ne=Je();function Qe(y){return y.replace(/_([a-z])/g,(_,p)=>p.toUpperCase())}function ke(y){return y.split("_").map(_=>_.charAt(0).toUpperCase()+_.slice(1).toLowerCase()).join(" ")}function Xe(y){const _=Qe(y);let p;if(y.endsWith("_id")){const h=y.slice(0,-3);p=ke(h)}else p=ke(y);return{fieldname:_,label:p,originalName:y}}function Ke(y){return y.split(/[-_\s]+/).map(_=>_.charAt(0).toUpperCase()+_.slice(1).toLowerCase()).join("")}function qe(y){return y.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}const ae={text:{component:"ATextInput",fieldtype:"Text"},varchar:{component:"ATextInput",fieldtype:"Data"},char:{component:"ATextInput",fieldtype:"Data"},citext:{component:"ATextInput",fieldtype:"Data"},smallint:{component:"ANumericInput",fieldtype:"Int"},integer:{component:"ANumericInput",fieldtype:"Int"},bigint:{component:"ANumericInput",fieldtype:"Int"},serial:{component:"ANumericInput",fieldtype:"Int"},bigserial:{component:"ANumericInput",fieldtype:"Int"},smallserial:{component:"ANumericInput",fieldtype:"Int"},numeric:{component:"ADecimalInput",fieldtype:"Decimal",_unmapped:!0},decimal:{component:"ADecimalInput",fieldtype:"Decimal",_unmapped:!0},money:{component:"ADecimalInput",fieldtype:"Decimal",_unmapped:!0},real:{component:"ANumericInput",fieldtype:"Float"},"double precision":{component:"ANumericInput",fieldtype:"Float"},boolean:{component:"ACheckbox",fieldtype:"Check"},date:{component:"ADatePicker",fieldtype:"Date"},time:{component:"ATimeInput",fieldtype:"Time",_unmapped:!0},timetz:{component:"ATimeInput",fieldtype:"Time",_unmapped:!0},timestamp:{component:"ADatetimePicker",fieldtype:"Datetime",_unmapped:!0},timestamptz:{component:"ADatetimePicker",fieldtype:"Datetime",_unmapped:!0},interval:{component:"ADurationInput",fieldtype:"Duration",_unmapped:!0},int4range:{component:"ATextInput",fieldtype:"Data",_unmapped:!0},int8range:{component:"ATextInput",fieldtype:"Data",_unmapped:!0},numrange:{component:"ATextInput",fieldtype:"Data",_unmapped:!0},daterange:{component:"ADateRangePicker",fieldtype:"DateRange",_unmapped:!0},tsrange:{component:"ADateRangePicker",fieldtype:"DateRange",_unmapped:!0},tstzrange:{component:"ADateRangePicker",fieldtype:"DateRange",_unmapped:!0},bytea:{component:"ATextInput",fieldtype:"Data"},uuid:{component:"ATextInput",fieldtype:"Data"},json:{component:"ACodeEditor",fieldtype:"JSON",_unmapped:!0},jsonb:{component:"ACodeEditor",fieldtype:"JSON",_unmapped:!0},bit:{component:"ATextInput",fieldtype:"Data"},varbit:{component:"ATextInput",fieldtype:"Data"},xml:{component:"ACodeEditor",fieldtype:"Code",_unmapped:!0},unit:{component:"AQuantityInput",fieldtype:"Quantity",_unmapped:!0},cube:{component:"ATextInput",fieldtype:"JSON",_unmapped:!0},unknown:{component:"ATextInput",fieldtype:"Data",_unmapped:!0}},te={int:"integer",int2:"smallint",int4:"integer",int8:"bigint",serial4:"serial",serial8:"bigserial",serial2:"smallserial",float:"real",float4:"real",float8:"double precision",bool:"boolean",character:"char","character varying":"varchar","timestamp without time zone":"timestamp","timestamp with time zone":"timestamptz","time without time zone":"time","time with time zone":"timetz","bit varying":"varbit"};function Ce(y){const _=y.toLowerCase().trim();if(_ in ae)return _;if(_ in te)return te[_];const p=_.replace(/\([^)]*\)/,"").trim();return p in ae?p:p in te?te[p]:"unknown"}function $e(y,_,p={}){const{fieldname:h,label:l}=p.useCamelCase?Xe(y.name):{fieldname:y.name,label:Ze(y.name)};if(y.reference)return{fieldname:h,label:l,component:"ALink",fieldtype:"Link",options:qe(y.reference.table),required:!y.nullable};if(y.arrayDimensions>0){const u={fieldname:h,label:l,component:"ATable",fieldtype:"Doctype",required:!y.nullable};return p.includeUnmappedMeta&&(u._pgType=`${y.dataType}[]`.repeat(y.arrayDimensions)),u}const r=ae[y.normalizedType]??ae.unknown,n={fieldname:h,label:l,component:r.component,fieldtype:r.fieldtype,required:!y.nullable&&!y.isGenerated,readOnly:y.isGenerated,default:es(y.defaultValue,y.normalizedType)};return y.precision!==void 0&&(n.options={precision:y.precision},y.scale!==void 0&&(n.options.scale=y.scale)),p.includeUnmappedMeta&&r._unmapped&&(n._unmapped=!0,n._pgType=y.dataType),n}function Ze(y){return y.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,_=>_.toUpperCase())}function es(y,_){if(y&&!(y.includes("(")||y.includes("::")))switch(_){case"boolean":return y.toLowerCase()==="true";case"smallint":case"integer":case"bigint":case"serial":case"bigserial":case"smallserial":{const p=parseInt(y,10);return isNaN(p)?void 0:p}case"real":case"double precision":{const p=parseFloat(y);return isNaN(p)?void 0:p}case"numeric":case"decimal":case"money":return y.replace(/^'|'$/g,"");default:return y.startsWith("'")&&y.endsWith("'")?y.slice(1,-1):void 0}}function ss(y){return y.match(/@doctype\s+([A-Za-z][A-Za-z0-9]*)/)?.[1]}function Re(y){const _=Ne.parse(y,{locationTracking:!1}),p=[],h=new Map;for(const l of _)if(rs(l)&&l.on.type==="table"){const r=l.on.name.name;h.set(r,l.comment)}for(const l of _)if(ts(l))try{const r=as(l),n=h.get(r.name);n&&(r.comment=n,r.doctypeName=ss(n)),p.push(r)}catch(r){console.warn(`Failed to parse table ${l.name?.name}: ${r}`)}return p}function ts(y){return y.type==="create table"}function rs(y){return y.type==="comment"}function as(y){const _=[];for(const p of y.columns??[])p.kind!=="like table"&&p.kind==="column"&&_.push(ns(p));return{name:y.name.name,schema:y.name.schema,columns:_,inherits:y.inherits?.map(p=>p.name)}}function ns(y){const _=y.constraints??[],{rawType:p,arrayDimensions:h,precision:l,scale:r,length:n}=os(y.dataType);return{name:y.name.name,dataType:p,normalizedType:Ce(p),nullable:!ls(_,"not null"),isGenerated:ps(_),defaultValue:cs(_),arrayDimensions:h,reference:ms(_),precision:l,scale:r,length:n}}function os(y){let _=0,p=y;for(;p.kind==="array";)_++,p=p.arrayOf;const h=p,l=h.name,r=h.config??[];let n,u,g;return r.length>0&&(l==="numeric"||l==="decimal"?(n=r[0],u=r[1]):(l==="varchar"||l==="char"||l==="character varying"||l==="character"||l==="bit"||l==="varbit"||l==="bit varying")&&(g=r[0])),{rawType:l,arrayDimensions:_,precision:n,scale:u,length:g}}function ls(y,_){return y.some(p=>p.type===_)}function ps(y){return y.some(_=>_.type==="add generated")}function cs(y){const _=y.find(p=>p.type==="default");if(_?.default)try{return Ne.toSql.expr(_.default)}catch{return}}function ms(y){const _=y.find(l=>l.type==="reference");if(!_)return;const p=_.foreignTable,h=_.foreignColumns??[];return{schema:p.schema,table:p.name,column:h[0]?.name??"id",onDelete:_.onDelete}}function is(y,_={inheritanceMode:"flatten"}){const p=Re(y),h=new Map(p.map(r=>[r.name,r]));let l=p;return _.schema&&(l=l.filter(r=>r.schema===_.schema)),_.exclude&&(l=l.filter(r=>!_.exclude.includes(r.name))),l.map(r=>$s(r,h,_))}function $s(y,_,p){const h=new Map;if(p.inheritanceMode==="flatten"&&y.inherits)for(const r of y.inherits){const n=_.get(r);if(n)for(const u of n.columns){const g=$e(u,_,{includeUnmappedMeta:p.includeUnmappedMeta,useCamelCase:p.useCamelCase});h.set(g.fieldname,g)}}for(const r of y.columns){const n=$e(r,_,{includeUnmappedMeta:p.includeUnmappedMeta,useCamelCase:p.useCamelCase});h.set(n.fieldname,n)}let l=Array.from(h.values());return p.typeOverrides&&(l=l.map(r=>{const n=p.typeOverrides[r.fieldname];return n?{...r,...n}:r})),l=l.map(_s),{name:y.doctypeName??Ke(y.name),slug:qe(y.name),tableName:y.name,fields:l,inherits:y.inherits?.[0]}}function _s(y){const _={fieldname:y.fieldname,component:y.component,fieldtype:y.fieldtype};return y.label!==void 0&&(_.label=y.label),y.required===!0&&(_.required=!0),y.default!==void 0&&(_.default=y.default),y.readOnly===!0&&(_.readOnly=!0),y.options!==void 0&&(_.options=y.options),y._pgType!==void 0&&(_._pgType=y._pgType),y._unmapped===!0&&(_._unmapped=!0),_}const V=new Map;class oe extends Error{constructor(_,p){const h=p.map(l=>` ${l.path.join(".")}: ${l.message}`).join(`
27
+ `);super(`Invalid doctype definition in ${_}:
28
+ ${h}`),this.file=_,this.errors=p,this.name="DoctypeValidationError"}}function Oe(y,_={}){const p=ce.readdirSync(y);for(const h of p){const l=Pe.join(y,h);ce.statSync(l).isDirectory()?Oe(l,_):h.endsWith(".json")&&bs(l,_)}}function bs(y,_){const p=ce.readFileSync(y,"utf-8");let h;try{h=JSON.parse(p)}catch(n){const u={path:[],message:`Invalid JSON: ${n instanceof Error?n.message:String(n)}`};if(_.continueOnError){_.onError?.(y,[u]);return}throw new oe(y,[u])}const l=be(h);if(!l.success){if(_.continueOnError){_.onError?.(y,l.errors);return}throw new oe(y,l.errors)}const r=ue(h);V.set(r.name,r)}function us(y,_={}){for(const[p,h]of Object.entries(y)){const l={...h,name:p},r=be(l);if(!r.success){if(_.continueOnError){_.onError?.(p,r.errors);continue}throw new oe(p,r.errors)}const n=ue(l);V.set(n.name,n)}}function re(y){return V.get(y)}function Ie(){return Array.from(V.values())}function ys(y){return V.has(y)}function ds(){V.clear()}function fs(){const y=[];for(const _ of V.values()){_.inherits&&!V.has(_.inherits)&&y.push({path:[_.name,"inherits"],message:`References unknown doctype: ${_.inherits}`}),_.listDoctype&&!V.has(_.listDoctype)&&y.push({path:[_.name,"listDoctype"],message:`References unknown doctype: ${_.listDoctype}`}),_.parentDoctype&&!V.has(_.parentDoctype)&&y.push({path:[_.name,"parentDoctype"],message:`References unknown doctype: ${_.parentDoctype}`});for(const p of _.fields)p.fieldtype==="Link"&&typeof p.options=="string"&&(V.has(p.options)||y.push({path:[_.name,"fields",p.fieldname,"options"],message:`Link references unknown doctype: ${p.options}`}))}return y}const pe=new Map;function je(y,_){pe.set(y,_)}function De(y){return pe.get(y)}function xs(y){return pe.has(y)}function ws(){pe.clear()}const hs=async(y,_)=>{const[p]=y,{doctype:h}=_,l=[];for(const r of h.fields)r.required&&(p[r.fieldname]===void 0||p[r.fieldname]===null)&&l.push(r.label??r.fieldname);if(l.length>0)throw new Error(`Missing required fields: ${l.join(", ")}`);return{valid:!0}},ks=async(y,_)=>{const[p]=y,{doctype:h}=_,l=[];for(const r of h.fields){const n=p[r.fieldname];if(n==null)continue;const u=gs(r.fieldname,n,r.fieldtype);u&&l.push(u)}if(l.length>0)throw new Error(`Field type validation failed:
29
+ ${l.join(`
30
+ `)}`);return{valid:!0}};function gs(y,_,p){switch(p){case"Int":if(typeof _!="number"||!Number.isInteger(_))return`${y}: expected integer, got ${typeof _}`;break;case"Float":case"Decimal":case"Currency":case"Quantity":if(typeof _!="number"&&typeof _!="string")return`${y}: expected number, got ${typeof _}`;break;case"Check":if(typeof _!="boolean")return`${y}: expected boolean, got ${typeof _}`;break;case"Data":case"Text":case"Code":case"Link":if(typeof _!="string")return`${y}: expected string, got ${typeof _}`;break;case"Date":case"Time":case"Datetime":if(typeof _!="string"&&!(_ instanceof Date))return`${y}: expected date string or Date, got ${typeof _}`;break;case"JSON":if(typeof _!="object")return`${y}: expected object, got ${typeof _}`;break;case"Table":if(!Array.isArray(_))return`${y}: expected array, got ${typeof _}`;break}return null}const As=async()=>({ok:!0}),Me={validateRequiredFields:hs,validateFieldTypes:ks,noop:As};function vs(){for(const[y,_]of Object.entries(Me))je(y,_)}const Es=y=>de.makeExtendSchemaPlugin(()=>({typeDefs:de.gql`
31
+ scalar JSON
32
+
33
+ type FieldMeta {
34
+ fieldname: String!
35
+ fieldtype: String!
36
+ label: String
37
+ required: Boolean
38
+ options: JSON
39
+ }
40
+
41
+ type ActionDefinition {
42
+ label: String!
43
+ handler: String!
44
+ requiredFields: [String!]
45
+ allowedStates: [String!]
46
+ confirm: Boolean
47
+ args: JSON
48
+ }
49
+
50
+ type WorkflowMeta {
51
+ states: [String!]
52
+ actions: JSON
53
+ }
54
+
55
+ type DoctypeMeta {
56
+ name: String!
57
+ tableName: String
58
+ fields: [FieldMeta!]!
59
+ workflow: WorkflowMeta
60
+ listDoctype: String
61
+ parentDoctype: String
62
+ }
63
+
64
+ type RecordResult {
65
+ data: JSON
66
+ doctype: String!
67
+ }
68
+
69
+ type RecordsResult {
70
+ data: [JSON!]!
71
+ doctype: String!
72
+ count: Int!
73
+ }
74
+
75
+ type ActionResult {
76
+ success: Boolean!
77
+ data: JSON
78
+ error: String
79
+ }
80
+
81
+ type Query {
82
+ stonecropMeta(doctype: String!): DoctypeMeta
83
+ stonecropAllMeta: [DoctypeMeta!]!
84
+ stonecropRecord(doctype: String!, id: String!): RecordResult
85
+ stonecropRecords(doctype: String!, filters: JSON, orderBy: String, limit: Int, offset: Int): RecordsResult
86
+ }
87
+
88
+ type Mutation {
89
+ stonecropAction(doctype: String!, action: String!, args: JSON): ActionResult!
90
+ }
91
+ `,resolvers:{Query:{stonecropMeta(_,p){return re(p.doctype)??null},stonecropAllMeta(){return Ie()},async stonecropRecord(_,p){const h=re(p.doctype);if(!h)throw new Error(`Unknown doctype: ${p.doctype}`);if(!h.tableName)throw new Error(`Doctype ${p.doctype} has no table mapping`);const l=Ts(h),r=await y.executor.query(l,{id:p.id});return{data:Ns(r,h),doctype:p.doctype}},async stonecropRecords(_,p){const h=re(p.doctype);if(!h)throw new Error(`Unknown doctype: ${p.doctype}`);if(!h.tableName)throw new Error(`Doctype ${p.doctype} has no table mapping`);const l=Ss(h,p),r=await y.executor.query(l,p),n=qs(r,h);return{data:n,doctype:p.doctype,count:n.length}}},Mutation:{async stonecropAction(_,p){const h=re(p.doctype);if(!h)return{success:!1,data:null,error:`Unknown doctype: ${p.doctype}`};const l=h.workflow?.actions?.[p.action];if(!l)return{success:!1,data:null,error:`Unknown action: ${p.action} on ${p.doctype}`};const r=De(l.handler);if(!r)return{success:!1,data:null,error:`Handler not registered: ${l.handler}`};const n={doctype:h,executor:y.executor};try{return{success:!0,data:await r(p.args??[],n),error:null}}catch(u){return{success:!1,data:null,error:u instanceof Error?u.message:String(u)}}}}}}));function ye(y){return y.replace(/_([a-z])/g,(_,p)=>p.toUpperCase())}function Le(y){const _=ye(y);return`all${_.charAt(0).toUpperCase()}${_.slice(1)}`}function Ue(y){const _=y.replace(/s$/,"");return ye(_)}function Ts(y){const _=y.fields.map(h=>h.fieldname).join(`
92
+ `);return`
93
+ query GetRecord($id: UUID!) {
94
+ ${`${Ue(y.tableName)}ById`}(id: $id) {
95
+ ${_}
96
+ }
97
+ }
98
+ `}function Ss(y,_){const p=y.fields.map(n=>n.fieldname).join(`
99
+ `),h=Le(y.tableName),l=[];_.limit&&l.push("first: $limit"),_.offset&&l.push("offset: $offset"),_.orderBy&&l.push("orderBy: $orderBy");const r=l.length>0?`(${l.join(", ")})`:"";return`
100
+ query GetRecords($limit: Int, $offset: Int, $orderBy: [${ye(y.tableName)}OrderBy!]) {
101
+ ${h}${r} {
102
+ nodes {
103
+ ${p}
104
+ }
105
+ }
106
+ }
107
+ `}function Ns(y,_){const p=`${Ue(_.tableName)}ById`;return y[p]}function qs(y,_){const p=Le(_.tableName);return y[p]?.nodes??[]}class Cs{endpoint;headers;metaCache=new Map;constructor(_){this.endpoint=_.endpoint,this.headers={"Content-Type":"application/json",..._.headers}}async query(_,p){const l=await(await fetch(this.endpoint,{method:"POST",headers:this.headers,body:JSON.stringify({query:_,variables:p})})).json();if(l.errors?.length)throw new Error(l.errors[0].message);return l.data}async mutate(_,p){return this.query(_,p)}async getMeta(_){const p=this.metaCache.get(_.doctype);if(p)return p;const h=await this.query(`
108
+ query GetMeta($doctype: String!) {
109
+ stonecropMeta(doctype: $doctype) {
110
+ name
111
+ slug
112
+ tableName
113
+ fields {
114
+ fieldname
115
+ fieldtype
116
+ component
117
+ label
118
+ required
119
+ readOnly
120
+ options
121
+ precision
122
+ scale
123
+ }
124
+ workflow {
125
+ states
126
+ actions
127
+ }
128
+ inherits
129
+ listDoctype
130
+ parentDoctype
131
+ }
132
+ }
133
+ `,{doctype:_.doctype});return h.stonecropMeta&&this.metaCache.set(_.doctype,h.stonecropMeta),h.stonecropMeta}async getAllMeta(){const _=await this.query(`
134
+ query GetAllMeta {
135
+ stonecropAllMeta {
136
+ name
137
+ slug
138
+ tableName
139
+ fields {
140
+ fieldname
141
+ fieldtype
142
+ component
143
+ label
144
+ required
145
+ readOnly
146
+ options
147
+ precision
148
+ scale
149
+ }
150
+ workflow {
151
+ states
152
+ actions
153
+ }
154
+ inherits
155
+ listDoctype
156
+ parentDoctype
157
+ }
158
+ }
159
+ `);for(const p of _.stonecropAllMeta)this.metaCache.set(p.name,p);return _.stonecropAllMeta}async getRecord(_,p){return(await this.query(`
160
+ query GetRecord($doctype: String!, $id: String!) {
161
+ stonecropRecord(doctype: $doctype, id: $id) {
162
+ data
163
+ }
164
+ }
165
+ `,{doctype:_.name,id:p})).stonecropRecord.data}async getRecords(_,p){return(await this.query(`
166
+ query GetRecords(
167
+ $doctype: String!
168
+ $filters: JSON
169
+ $orderBy: String
170
+ $limit: Int
171
+ $offset: Int
172
+ ) {
173
+ stonecropRecords(
174
+ doctype: $doctype
175
+ filters: $filters
176
+ orderBy: $orderBy
177
+ limit: $limit
178
+ offset: $offset
179
+ ) {
180
+ data
181
+ count
182
+ }
183
+ }
184
+ `,{doctype:_.name,...p})).stonecropRecords.data}async runAction(_,p,h){return(await this.query(`
185
+ mutation RunAction($doctype: String!, $action: String!, $args: JSON) {
186
+ stonecropAction(doctype: $doctype, action: $action, args: $args) {
187
+ success
188
+ data
189
+ error
190
+ }
191
+ }
192
+ `,{doctype:_.name,action:p,args:h})).stonecropAction}clearMetaCache(){this.metaCache.clear()}}exports.ActionDefinition=Te;exports.DoctypeMeta=_e;exports.DoctypeValidationError=oe;exports.FieldMeta=le;exports.FieldOptions=ve;exports.FieldValidation=Ee;exports.PG_TYPE_MAP=ae;exports.StonecropClient=Cs;exports.StonecropFieldType=ge;exports.TYPE_ALIASES=te;exports.TYPE_MAP=Ae;exports.WorkflowMeta=Se;exports.builtinHandlers=Me;exports.clearHandlers=ws;exports.clearRegistry=ds;exports.convertSchema=is;exports.createStonecropPlugin=Es;exports.getAllMeta=Ie;exports.getDefaultComponent=Fe;exports.getHandler=De;exports.getMeta=re;exports.hasHandler=xs;exports.hasMeta=ys;exports.loadDoctypes=Oe;exports.loadDoctypesFromObject=us;exports.mapColumnToField=$e;exports.normalizeType=Ce;exports.parseDDL=Re;exports.parseDoctype=ue;exports.parseField=He;exports.registerBuiltinHandlers=vs;exports.registerHandler=je;exports.validateDoctype=be;exports.validateField=Be;exports.validateReferences=fs;