rawsql-ts 0.11.20-beta → 0.11.21-beta

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/esm/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  // Entry point for rawsql-ts package
2
2
  export * from './parsers/SelectQueryParser';
3
3
  export * from './parsers/InsertQueryParser';
4
+ export * from './parsers/WithClauseParser';
4
5
  export * from './models/BinarySelectQuery';
5
6
  export * from './models/SelectQuery';
6
7
  export * from './models/ValueComponent';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAE5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAEhC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sCAAsC,CAAC;AACrD,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yCAAyC,CAAC;AACxD,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yCAAyC,CAAC;AACxD,cAAc,6BAA6B,CAAC,CAAC,0BAA0B;AACvE,cAAc,qCAAqC,CAAC;AACpD,cAAc,0CAA0C,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAClF,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,qCAAqC,CAAC;AACpD,cAAc,oCAAoC,CAAC;AACnD,OAAO,EAEH,yBAAyB,EACzB,0BAA0B,EAK7B,MAAM,uCAAuC,CAAC;AAC/C,OAAO;AACH,6DAA6D;AAC7D,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACjB,MAAM,mCAAmC,CAAC;AAE3C,qEAAqE;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,cAAc,0CAA0C,CAAC;AACzD,cAAc,gDAAgD,CAAC;AAE/D,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0CAA0C,CAAC;AACzD,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC;AAEnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AAGrC,oEAAoE"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAE3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAEhC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sCAAsC,CAAC;AACrD,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yCAAyC,CAAC;AACxD,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yCAAyC,CAAC;AACxD,cAAc,6BAA6B,CAAC,CAAC,0BAA0B;AACvE,cAAc,qCAAqC,CAAC;AACpD,cAAc,0CAA0C,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAClF,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,qCAAqC,CAAC;AACpD,cAAc,oCAAoC,CAAC;AACnD,OAAO,EAEH,yBAAyB,EACzB,0BAA0B,EAK7B,MAAM,uCAAuC,CAAC;AAC/C,OAAO;AACH,6DAA6D;AAC7D,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACjB,MAAM,mCAAmC,CAAC;AAE3C,qEAAqE;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,cAAc,0CAA0C,CAAC;AACzD,cAAc,gDAAgD,CAAC;AAE/D,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0CAA0C,CAAC;AACzD,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC;AAEnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AAGrC,oEAAoE"}
@@ -58,5 +58,5 @@ ${e}`}getCTEName(e){return e.aliasExpression.table.name}};var Rn=class{construct
58
58
  `);let r=this.edges.getMermaidRepresentation();return r&&(n+=` ${r}
59
59
  `),n}getOrCreateTable(e){let t=`table_${e}`,n=this.nodes.get(t);return n||(n=It.createTable(e),this.addNode(n)),n}getOrCreateCTE(e){let t=`cte_${e}`,n=this.nodes.get(t);return n||(n=It.createCTE(e),this.addNode(n)),n}getOrCreateSubquery(e){let t=`subquery_${e}`,n=this.nodes.get(t);return n||(n=It.createSubquery(e),this.addNode(n)),n}createProcessNode(e,t){let n=new jn(t,e);return this.addNode(n),n}createJoinNode(e,t){let n=Vt.createJoin(e,t);return this.addNode(n),n}createSetOperationNode(e,t){let n=Vt.createSetOperation(e,t);return this.addNode(n),n}createOutputNode(e="main"){let t=new Un(e);return this.addNode(t),t}};var Mt=class{constructor(e){this.graph=e}processSource(e,t,n){if(e.datasource instanceof L)return this.processTableSource(e.datasource,t);if(e.datasource instanceof J)return this.processSubquerySource(e,t,n);throw new Error("Unsupported source type")}processTableSource(e,t){let n=e.getSourceName();return t.has(n)?this.graph.getOrCreateCTE(n).id:this.graph.getOrCreateTable(n).id}processSubquerySource(e,t,n){let i=e.aliasExpression?.table.name||"subquery",r=this.graph.getOrCreateSubquery(i),s=n(e.datasource.query,`subquery_${i}_internal`,t);return s&&!this.graph.hasConnection(s,r.id)&&this.graph.addConnection(s,r.id),r.id}extractTableNodeIds(e,t){let n=[],i=e.source;if(i.datasource instanceof L){let r=i.datasource.getSourceName();if(t.has(r)){let s=this.graph.getOrCreateCTE(r);n.push(s.id)}else{let s=this.graph.getOrCreateTable(r);n.push(s.id)}}if(e.joins&&e.joins.length>0)for(let r of e.joins){let s=r.source;if(s.datasource instanceof L){let a=s.datasource.getSourceName();if(t.has(a)){let l=this.graph.getOrCreateCTE(a);n.push(l.id)}else{let l=this.graph.getOrCreateTable(a);n.push(l.id)}}}return n}};var Dt=class{constructor(e,t){this.graph=e;this.dataSourceHandler=t;this.joinIdCounter=0}resetJoinCounter(){this.joinIdCounter=0}getNextJoinId(){return String(++this.joinIdCounter)}processFromClause(e,t,n){let i=this.dataSourceHandler.processSource(e.source,t,n);return e.joins&&e.joins.length>0?this.processJoins(e.joins,i,t,n):i}processJoins(e,t,n,i){let r=t;for(let s of e){let a=this.dataSourceHandler.processSource(s.source,n,i),l=this.getNextJoinId(),u=this.graph.createJoinNode(l,s.joinType.value),{leftLabel:c,rightLabel:m}=this.getJoinNullabilityLabels(s.joinType.value);r&&!this.graph.hasConnection(r,u.id)&&this.graph.addConnection(r,u.id,c),a&&!this.graph.hasConnection(a,u.id)&&this.graph.addConnection(a,u.id,m),r=u.id}return r}getJoinNullabilityLabels(e){switch(e.toLowerCase()){case"left join":return{leftLabel:"NOT NULL",rightLabel:"NULLABLE"};case"right join":return{leftLabel:"NULLABLE",rightLabel:"NOT NULL"};case"inner join":case"join":return{leftLabel:"NOT NULL",rightLabel:"NOT NULL"};case"full join":case"full outer join":return{leftLabel:"NULLABLE",rightLabel:"NULLABLE"};case"cross join":return{leftLabel:"NOT NULL",rightLabel:"NOT NULL"};default:return{leftLabel:"",rightLabel:""}}}};var Wt=class{constructor(e,t){this.graph=e;this.dataSourceHandler=t}processQueryClauses(e,t,n,i,r){return n}};var jt=class{constructor(e){this.graph=e}processCTEs(e,t,n){for(let i=0;i<e.tables.length;i++){let s=e.tables[i].getSourceAliasName(),a=this.graph.getOrCreateCTE(s);t.add(s),e.recursive&&i===0&&a.addAnnotation("recursive")}for(let i=0;i<e.tables.length;i++){let r=e.tables[i],s=r.getSourceAliasName(),a=this.graph.getOrCreateCTE(s),l=n(r.query,`cte_${s}`,t);if(l&&!this.graph.hasConnection(l,a.id)){let c=e.recursive&&i===0?"RECURSIVE":void 0;this.graph.addConnection(l,a.id,c)}}}detectRecursiveReference(e,t){return e.toString().toLowerCase().includes(t.toLowerCase())}};var wi=class o{constructor(){this.graph=new $t,this.dataSourceHandler=new Mt(this.graph),this.joinHandler=new Dt(this.graph,this.dataSourceHandler),this.processHandler=new Wt(this.graph,this.dataSourceHandler),this.cteHandler=new jt(this.graph)}generateMermaidFlow(e,t){this.graph=new $t,this.dataSourceHandler=new Mt(this.graph),this.joinHandler=new Dt(this.graph,this.dataSourceHandler),this.processHandler=new Wt(this.graph,this.dataSourceHandler),this.cteHandler=new jt(this.graph),this.joinHandler.resetJoinCounter();let n=typeof e=="string"?Q.parse(e):e,i=new Set;return this.processQuery(n,"main",i),this.graph.generateMermaid(t?.direction||"TD",t?.title)}static generate(e){return new o().generateMermaidFlow(e)}processQuery(e,t,n){if(e instanceof w)return this.processSimpleQuery(e,t,n);if(e instanceof B)return this.processBinaryQuery(e,t,n);throw new Error("Unsupported query type")}processSimpleQuery(e,t,n){e.withClause&&this.cteHandler.processCTEs(e.withClause,n,this.processQuery.bind(this));let i="";return e.fromClause&&(e.fromClause.joins&&e.fromClause.joins.length>0?i=this.joinHandler.processFromClause(e.fromClause,n,this.processQuery.bind(this)):i=this.dataSourceHandler.processSource(e.fromClause.source,n,this.processQuery.bind(this))),i&&(i=this.processHandler.processQueryClauses(e,t,i,n,this.processQuery.bind(this))),this.handleOutputNode(i,t)}processBinaryQuery(e,t,n){let i=this.flattenBinaryChain(e,e.operator.value);return i.length>2?this.processMultiPartOperation(i,e.operator.value,t,n):this.processSimpleBinaryOperation(e,t,n)}processSimpleBinaryOperation(e,t,n){let i=this.processQuery(e.left,`${t}_left`,n),r=this.processQuery(e.right,`${t}_right`,n),s=t==="main"?"main":t.replace(/^cte_/,""),a=this.graph.createSetOperationNode(s,e.operator.value);return i&&!this.graph.hasConnection(i,a.id)&&this.graph.addConnection(i,a.id),r&&!this.graph.hasConnection(r,a.id)&&this.graph.addConnection(r,a.id),a.id}processMultiPartOperation(e,t,n,i){let r=[],s=n==="main"?"main":n.replace(/^cte_/,""),a=this.graph.createSetOperationNode(s,t);for(let l=0;l<e.length;l++){let u=`${n}_part${l+1}`,c=this.processQuery(e[l],u,i);r.push(c)}for(let l of r)l&&!this.graph.hasConnection(l,a.id)&&this.graph.addConnection(l,a.id);return a.id}handleOutputNode(e,t){if(t==="main"){let n=this.graph.createOutputNode(t);return e&&this.graph.addConnection(e,n.id),n.id}return e}flattenBinaryChain(e,t){let n=[],i=r=>{r instanceof B&&r.operator.value===t?(i(r.left),i(r.right)):n.push(r)};return i(e),n}};var Kn=class{constructor(e,t){typeof e=="function"?(this.tableColumnResolver=e,this.options=t||{}):(this.tableColumnResolver=void 0,this.options=e||{})}inject(e,t){typeof e=="string"&&(e=Q.parse(e));let n=new bt(this.tableColumnResolver,this.options),i=new Fe(this.tableColumnResolver),r=d=>this.options.ignoreCaseAndUnderscore?d.toLowerCase().replace(/_/g,""):d,s=["min","max","like","ilike","in","any","=","<",">","!=","<>","<=",">=","or","and","column"],a=Object.values(t);if(a.length>0&&a.every(d=>d===void 0)&&!this.options.allowAllUndefined)throw new Error("All parameters are undefined. This would result in fetching all records. Use allowAllUndefined: true option to explicitly allow this behavior.");for(let[d,y]of Object.entries(t))y!==void 0&&this.processStateParameter(d,y,e,n,i,r,s,m,c,g,b,h);function c(d,y,A,E,O,N){for(let V=0;V<A.length;V++){let v=A[V],I=v.column||y,Pt=O.find($=>E($.name)===E(I));if(!Pt)throw new Error(`Column '${I}' not found in query for AND condition`);let ge=Pt.value;if("="in v&&v["="]!==void 0){let $=`${y}_and_${V}_eq`,F=new T($,v["="]);d.appendWhere(new C(ge,"=",F))}if("min"in v&&v.min!==void 0){let $=`${y}_and_${V}_min`,F=new T($,v.min);d.appendWhere(new C(ge,">=",F))}if("max"in v&&v.max!==void 0){let $=`${y}_and_${V}_max`,F=new T($,v.max);d.appendWhere(new C(ge,"<=",F))}if("like"in v&&v.like!==void 0){let $=`${y}_and_${V}_like`,F=new T($,v.like);d.appendWhere(new C(ge,"like",F))}if("ilike"in v&&v.ilike!==void 0){let $=`${y}_and_${V}_ilike`,F=new T($,v.ilike);d.appendWhere(new C(ge,"ilike",F))}if("in"in v&&v.in!==void 0){let F=v.in.map((q,z)=>new T(`${y}_and_${V}_in_${z}`,q));d.appendWhere(new C(ge,"in",new G(new _(F))))}if("any"in v&&v.any!==void 0){let $=`${y}_and_${V}_any`,F=new T($,v.any);d.appendWhere(new C(ge,"=",new j(null,"any",F,null)))}if("<"in v&&v["<"]!==void 0){let $=`${y}_and_${V}_lt`,F=new T($,v["<"]);d.appendWhere(new C(ge,"<",F))}if(">"in v&&v[">"]!==void 0){let $=`${y}_and_${V}_gt`,F=new T($,v[">"]);d.appendWhere(new C(ge,">",F))}if("!="in v&&v["!="]!==void 0){let $=`${y}_and_${V}_neq`,F=new T($,v["!="]);d.appendWhere(new C(ge,"!=",F))}if("<>"in v&&v["<>"]!==void 0){let $=`${y}_and_${V}_ne`,F=new T($,v["<>"]);d.appendWhere(new C(ge,"<>",F))}if("<="in v&&v["<="]!==void 0){let $=`${y}_and_${V}_le`,F=new T($,v["<="]);d.appendWhere(new C(ge,"<=",F))}if(">="in v&&v[">="]!==void 0){let $=`${y}_and_${V}_ge`,F=new T($,v[">="]);d.appendWhere(new C(ge,">=",F))}}}function m(d,y,A,E,O,N){let V=[];for(let v=0;v<A.length;v++){let I=A[v],Pt=I.column||y,ge=O.find(q=>E(q.name)===E(Pt));if(!ge)throw new Error(`Column '${Pt}' not found in query for OR condition`);let $=ge.value,F=[];if("="in I&&I["="]!==void 0){let q=`${y}_or_${v}_eq`,z=new T(q,I["="]);F.push(new C($,"=",z))}if("min"in I&&I.min!==void 0){let q=`${y}_or_${v}_min`,z=new T(q,I.min);F.push(new C($,">=",z))}if("max"in I&&I.max!==void 0){let q=`${y}_or_${v}_max`,z=new T(q,I.max);F.push(new C($,"<=",z))}if("like"in I&&I.like!==void 0){let q=`${y}_or_${v}_like`,z=new T(q,I.like);F.push(new C($,"like",z))}if("ilike"in I&&I.ilike!==void 0){let q=`${y}_or_${v}_ilike`,z=new T(q,I.ilike);F.push(new C($,"ilike",z))}if("in"in I&&I.in!==void 0){let z=I.in.map((Ei,bi)=>new T(`${y}_or_${v}_in_${bi}`,Ei));F.push(new C($,"in",new G(new _(z))))}if("any"in I&&I.any!==void 0){let q=`${y}_or_${v}_any`,z=new T(q,I.any);F.push(new C($,"=",new j(null,"any",z,null)))}if("<"in I&&I["<"]!==void 0){let q=`${y}_or_${v}_lt`,z=new T(q,I["<"]);F.push(new C($,"<",z))}if(">"in I&&I[">"]!==void 0){let q=`${y}_or_${v}_gt`,z=new T(q,I[">"]);F.push(new C($,">",z))}if("!="in I&&I["!="]!==void 0){let q=`${y}_or_${v}_neq`,z=new T(q,I["!="]);F.push(new C($,"!=",z))}if("<>"in I&&I["<>"]!==void 0){let q=`${y}_or_${v}_ne`,z=new T(q,I["<>"]);F.push(new C($,"<>",z))}if("<="in I&&I["<="]!==void 0){let q=`${y}_or_${v}_le`,z=new T(q,I["<="]);F.push(new C($,"<=",z))}if(">="in I&&I[">="]!==void 0){let q=`${y}_or_${v}_ge`,z=new T(q,I[">="]);F.push(new C($,">=",z))}if(F.length>0){let q=F[0];for(let z=1;z<F.length;z++)q=new C(q,"and",F[z]);F.length>1?V.push(new G(q)):V.push(q)}}if(V.length>0){let v=V[0];for(let I=1;I<V.length;I++)v=new C(v,"or",V[I]);d.appendWhere(new G(v))}}function h(d,y,A){Object.keys(d).forEach(E=>{if(!y.includes(E))throw new Error(`Unsupported operator '${E}' for state key '${A}'`)})}function g(d,y,A,E){let O=new T(A,E);d.appendWhere(new C(y,"=",O))}function b(d,y,A,E){let O=[];if("="in E){let N=new T(A,E["="]);O.push(new C(y,"=",N))}if("min"in E){let N=new T(A+"_min",E.min);O.push(new C(y,">=",N))}if("max"in E){let N=new T(A+"_max",E.max);O.push(new C(y,"<=",N))}if("like"in E){let N=new T(A+"_like",E.like);O.push(new C(y,"like",N))}if("ilike"in E){let N=new T(A+"_ilike",E.ilike);O.push(new C(y,"ilike",N))}if("in"in E){let V=E.in.map((v,I)=>new T(`${A}_in_${I}`,v));O.push(new C(y,"in",new G(new _(V))))}if("any"in E){let N=new T(A+"_any",E.any);O.push(new C(y,"=",new j(null,"any",N,null)))}if("<"in E){let N=new T(A+"_lt",E["<"]);O.push(new C(y,"<",N))}if(">"in E){let N=new T(A+"_gt",E[">"]);O.push(new C(y,">",N))}if("!="in E){let N=new T(A+"_neq",E["!="]);O.push(new C(y,"!=",N))}if("<>"in E){let N=new T(A+"_ne",E["<>"]);O.push(new C(y,"<>",N))}if("<="in E){let N=new T(A+"_le",E["<="]);O.push(new C(y,"<=",N))}if(">="in E){let N=new T(A+"_ge",E[">="]);O.push(new C(y,">=",N))}if(O.length===1)d.appendWhere(O[0]);else if(O.length>1){let N=O[0];for(let V=1;V<O.length;V++)N=new C(N,"and",O[V]);d.appendWhere(new G(N))}}return e}isOrCondition(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&"or"in e}isAndCondition(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&"and"in e}isExplicitColumnMapping(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&"column"in e&&!("or"in e)}isValidatableObject(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&Object.getPrototypeOf(e)===Object.prototype}hasColumnMapping(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&"column"in e}isSimpleValue(e){return e===null||typeof e!="object"||Array.isArray(e)||e instanceof Date}processStateParameter(e,t,n,i,r,s,a,l,u,c,m,h){if(this.isOrCondition(t)){let g=t.or;if(g&&g.length>0){let b=this.findTargetQueryForLogicalCondition(i,n,e,g),d=this.getAllAvailableColumns(b,r);l(b,e,g,s,d,r);return}}if(this.isAndCondition(t)){let g=t.and;if(g&&g.length>0){let b=this.findTargetQueryForLogicalCondition(i,n,e,g),d=this.getAllAvailableColumns(b,r);u(b,e,g,s,d,r);return}}if(this.isExplicitColumnMapping(t)){let g=t.column;if(g){let b=i.find(n,g);if(b.length===0)throw new Error(`Explicit column '${g}' not found in query`);for(let d of b){let A=this.getAllAvailableColumns(d,r).find(E=>s(E.name)===s(g));if(!A)throw new Error(`Explicit column '${g}' not found in query`);this.isValidatableObject(t)&&h(t,a,e),m(d,A.value,e,t)}return}}this.processRegularColumnCondition(e,t,n,i,r,s,a,c,m,h)}processRegularColumnCondition(e,t,n,i,r,s,a,l,u,c){let m=i.find(n,e);if(m.length===0)throw new Error(`Column '${e}' not found in query`);for(let h of m){let g=this.getAllAvailableColumns(h,r),b=g.find(E=>s(E.name)===s(e));if(!b)throw new Error(`Column '${e}' not found in query`);let d=b.value;this.isValidatableObject(t)&&c(t,a,e);let y=d,A=e;if(this.hasColumnMapping(t)){let E=t.column;if(E){let O=g.find(N=>s(N.name)===s(E));O&&(y=O.value,A=E)}}this.isSimpleValue(t)?l(h,y,A,t):u(h,y,A,t)}}findTargetQueryForLogicalCondition(e,t,n,i){let r=i.map(a=>a.column||n).filter((a,l,u)=>u.indexOf(a)===l);for(let a of r){let l=e.find(t,a);if(l.length>0)return l[0]}let s=i===i.or?"OR":"AND";throw new Error(`None of the ${s} condition columns [${r.join(", ")}] found in query`)}getAllAvailableColumns(e,t){let n=t.collect(e),i=this.collectCTEColumns(e);return[...n,...i]}collectCTEColumns(e){let t=[];if(e.withClause)for(let n of e.withClause.tables)try{let i=this.collectColumnsFromSelectQuery(n.query);t.push(...i)}catch(i){console.warn(`Failed to collect columns from CTE '${n.getSourceAliasName()}':`,i)}return t}collectColumnsFromSelectQuery(e){return e instanceof w?new Fe(this.tableColumnResolver).collect(e):e instanceof B?this.collectColumnsFromSelectQuery(e.left):[]}};var _n=class{constructor(e){this.tableColumnResolver=e}static removeOrderBy(e){if(typeof e=="string"&&(e=Q.parse(e)),!(e instanceof w))throw new Error("Complex queries are not supported for ORDER BY removal");return new w({withClause:e.withClause,selectClause:e.selectClause,fromClause:e.fromClause,whereClause:e.whereClause,groupByClause:e.groupByClause,havingClause:e.havingClause,orderByClause:null,windowClause:e.windowClause,limitClause:e.limitClause,offsetClause:e.offsetClause,fetchClause:e.fetchClause,forClause:e.forClause})}inject(e,t){if(typeof e=="string"&&(e=Q.parse(e)),!(e instanceof w))throw new Error("Complex queries are not supported for sorting");let i=new Fe(this.tableColumnResolver).collect(e);for(let l of Object.keys(t))if(!i.find(c=>c.name===l))throw new Error(`Column or alias '${l}' not found in current query`);let r=[];for(let[l,u]of Object.entries(t)){let c=i.find(d=>d.name===l);if(!c)continue;let m=c.value;this.validateSortCondition(l,u);let h;u.desc?h="desc":h="asc";let g=null;u.nullsFirst?g="first":u.nullsLast&&(g="last");let b=new Ie(m,h,g);r.push(b)}let s=[];e.orderByClause?s=[...e.orderByClause.order,...r]:s=r;let a=s.length>0?new le(s):null;return new w({withClause:e.withClause,selectClause:e.selectClause,fromClause:e.fromClause,whereClause:e.whereClause,groupByClause:e.groupByClause,havingClause:e.havingClause,orderByClause:a,windowClause:e.windowClause,limitClause:e.limitClause,offsetClause:e.offsetClause,fetchClause:e.fetchClause,forClause:e.forClause})}validateSortCondition(e,t){if(t.asc&&t.desc)throw new Error(`Conflicting sort directions for column '${e}': both asc and desc specified`);if(t.nullsFirst&&t.nullsLast)throw new Error(`Conflicting nulls positions for column '${e}': both nullsFirst and nullsLast specified`);if(!t.asc&&!t.desc&&!t.nullsFirst&&!t.nullsLast)throw new Error(`Empty sort condition for column '${e}': at least one sort option must be specified`)}};var zn=class{inject(e,t){if(this.validatePaginationOptions(t),typeof e=="string"&&(e=Q.parse(e)),!(e instanceof w))throw new Error("Complex queries are not supported for pagination");if(e.limitClause||e.offsetClause)throw new Error("Query already contains LIMIT or OFFSET clause. Use removePagination() first if you want to override existing pagination.");let n=(t.page-1)*t.pageSize,i=new oe(new T("paging_limit",t.pageSize)),r=new Le(new T("paging_offset",n));return new w({withClause:e.withClause,selectClause:e.selectClause,fromClause:e.fromClause,whereClause:e.whereClause,groupByClause:e.groupByClause,havingClause:e.havingClause,orderByClause:e.orderByClause,windowClause:e.windowClause,limitClause:i,offsetClause:r,fetchClause:e.fetchClause,forClause:e.forClause})}static removePagination(e){if(typeof e=="string"&&(e=Q.parse(e)),!(e instanceof w))throw new Error("Complex queries are not supported for pagination removal");return new w({withClause:e.withClause,selectClause:e.selectClause,fromClause:e.fromClause,whereClause:e.whereClause,groupByClause:e.groupByClause,havingClause:e.havingClause,orderByClause:e.orderByClause,windowClause:e.windowClause,limitClause:null,offsetClause:null,fetchClause:e.fetchClause,forClause:e.forClause})}validatePaginationOptions(e){if(!e)throw new Error("Pagination options are required");if(typeof e.page!="number"||e.page<1)throw new Error("Page number must be a positive integer (1 or greater)");if(typeof e.pageSize!="number"||e.pageSize<1)throw new Error("Page size must be a positive integer (1 or greater)");if(e.pageSize>1e3)throw new Error("Page size cannot exceed 1000 items")}};var Nt=class{static extractParameterNames(e){return ot.collect(e).map(n=>n.name.value)}static hasParameter(e,t){return this.extractParameterNames(e).includes(t)}static separateFilters(e,t){let n=this.extractParameterNames(e),i={},r={};for(let[s,a]of Object.entries(t))n.includes(s)?i[s]=a:r[s]=a;return{hardcodedParams:i,dynamicFilters:r}}};var Hn=class{constructor(e={}){this.options={requireAllParameters:!0,...e}}bind(e,t){let n=e,i=Nt.extractParameterNames(n);if(this.options.requireAllParameters){let r=i.filter(s=>!(s in t)||t[s]===void 0);if(r.length>0)throw new Error(`Missing values for required parameters: ${r.join(", ")}`)}for(let[r,s]of Object.entries(t))if(i.includes(r))try{Ge.set(n,r,s)}catch(a){throw new Error(`Failed to bind parameter '${r}': ${a instanceof Error?a.message:"Unknown error"}`)}return n}bindToSimpleQuery(e,t){return this.bind(e,t)}};var gi=class{constructor(e){this.tableColumnResolver=e}buildQuery(e,t={}){let n;try{n=Q.parse(e)}catch(r){throw new Error(`Failed to parse SQL: ${r instanceof Error?r.message:"Unknown error"}`)}let i=n;if(t.filter&&Object.keys(t.filter).length>0){let{hardcodedParams:r,dynamicFilters:s}=Nt.separateFilters(i,t.filter);if(Object.keys(r).length>0&&(i=new Hn({requireAllParameters:!1}).bind(i,r)),Object.keys(s).length>0){let a=new Kn(this.tableColumnResolver),l=Qe.buildSimpleQuery(i);i=a.inject(l,s)}}if(t.sort&&Object.keys(t.sort).length>0){let r=new _n(this.tableColumnResolver),s=Qe.buildSimpleQuery(i);i=r.inject(s,t.sort)}if(t.paging){let{page:r=1,pageSize:s}=t.paging;if(s!==void 0){let a=new zn,l={page:r,pageSize:s},u=Qe.buildSimpleQuery(i);i=a.inject(u,l)}}if(t.serialize&&typeof t.serialize=="object"){let r=new Mn,s=Qe.buildSimpleQuery(i);i=r.buildJsonQuery(s,t.serialize)}return i}buildFilteredQuery(e,t){return this.buildQuery(e,{filter:t})}buildSortedQuery(e,t){return this.buildQuery(e,{sort:t})}buildPaginatedQuery(e,t){return this.buildQuery(e,{paging:t})}buildSerializedQuery(e,t){return this.buildQuery(e,{serialize:t})}validateSql(e){try{return Q.parse(e),!0}catch(t){throw new Error(`Invalid SQL: ${t instanceof Error?t.message:"Unknown error"}`)}}};var Si=class{static validate(e,t){let n=this.extractStructureFromJsonMapping(e);return this.compareStructures(n,t)}static validateStrict(e,t){let n=this.validate(e,t);if(!n.isValid){let i=["JsonMapping validation failed:",...n.errors].join(`
60
60
  `);throw new Error(i)}}static extractStructureFromJsonMapping(e){let t={};return e.rootEntity&&e.rootEntity.columns&&Object.keys(e.rootEntity.columns).forEach(n=>{t[n]="primitive"}),e.nestedEntities&&e.nestedEntities.filter(n=>n.parentId===e.rootEntity.id).forEach(n=>{n.propertyName&&n.columns&&(n.relationshipType==="object"?t[n.propertyName]=this.extractNestedEntityStructure(n,e):n.relationshipType==="array"&&(t[n.propertyName]=[this.extractNestedEntityStructure(n,e)]))}),t}static extractNestedEntityStructure(e,t){let n={};return e.columns&&Object.keys(e.columns).forEach(i=>{n[i]="primitive"}),t.nestedEntities&&t.nestedEntities.filter(i=>i.parentId===e.id).forEach(i=>{i.propertyName&&i.columns&&(i.relationshipType==="object"?n[i.propertyName]=this.extractNestedEntityStructure(i,t):i.relationshipType==="array"&&(n[i.propertyName]=[this.extractNestedEntityStructure(i,t)]))}),n}static compareStructures(e,t,n=""){let i=[],r=[],s=[];if(e==="primitive"&&t==="primitive")return{isValid:!0,errors:[],missingProperties:[],extraProperties:[]};if(Array.isArray(t)&&Array.isArray(e)){if(t.length>0&&e.length>0){let u=this.compareStructures(e[0],t[0],`${n}[]`);i.push(...u.errors),r.push(...u.missingProperties),s.push(...u.extraProperties)}return{isValid:i.length===0,errors:i,missingProperties:r,extraProperties:s}}if(typeof e!="object"||typeof t!="object"||Array.isArray(e)||Array.isArray(t)||e===null||t===null)return{isValid:!0,errors:[],missingProperties:[],extraProperties:[]};let a=e,l=t;return Object.keys(l).forEach(u=>{let c=n?`${n}.${u}`:u;if(!(u in a)){r.push(c),i.push(`Missing property: ${c}`);return}let m=a[u],h=l[u],g=this.compareStructures(m,h,c);i.push(...g.errors),r.push(...g.missingProperties),s.push(...g.extraProperties)}),Object.keys(a).forEach(u=>{let c=n?`${n}.${u}`:u;u in l||s.push(c)}),{isValid:i.length===0,errors:i,missingProperties:r,extraProperties:s}}static validateAgainstSample(e,t){let n=this.extractStructureFromSample(t);return this.validate(e,n)}static validateAgainstSampleStrict(e,t){let n=this.validateAgainstSample(e,t);if(!n.isValid){let i=["JsonMapping validation against sample object failed:",...n.errors].join(`
61
- `);throw new Error(i)}}static extractStructureFromSample(e){if(e==null)return"primitive";if(Array.isArray(e))return e.length===0?[]:[this.extractStructureFromSample(e[0])];if(typeof e=="object"){let t={};return Object.keys(e).forEach(n=>{t[n]=this.extractStructureFromSample(e[n])}),t}return"primitive"}};var Ut=class{constructor(e){this.schemas=e,this.validateSchemas()}validateSchemas(){let e=Object.keys(this.schemas),t=[];if(Object.entries(this.schemas).forEach(([n,i])=>{Object.entries(i.columns).filter(([s,a])=>a.isPrimaryKey).map(([s,a])=>s).length===0&&t.push(`Table '${n}' has no primary key defined`),i.relationships?.forEach(s=>{e.includes(s.table)||t.push(`Table '${n}' references unknown table '${s.table}' in relationship`)})}),t.length>0)throw new Error(`Schema validation failed:\\n${t.join("\\n")}`)}getTableColumns(e){let t=this.schemas[e];return t?Object.keys(t.columns):[]}createTableColumnResolver(){return e=>this.getTableColumns(e)}createJsonMapping(e){let t=this.schemas[e];if(!t)throw new Error(`Table '${e}' not found in schema registry`);let n={};Object.entries(t.columns).forEach(([r,s])=>{n[r]=s.jsonAlias||s.name});let i=[];return t.relationships?.forEach(r=>{let s=this.schemas[r.table];if(!s)throw new Error(`Related table '${r.table}' not found in schema registry`);let a={};Object.entries(s.columns).forEach(([u,c])=>{a[u]=c.jsonAlias||c.name});let l=r.type;i.push({id:r.propertyName,name:s.displayName||r.table,parentId:e,propertyName:r.propertyName,relationshipType:l,columns:a})}),{rootName:e,rootEntity:{id:e,name:t.displayName||e,columns:n},nestedEntities:i,resultFormat:"single"}}getTableNames(){return Object.keys(this.schemas)}getTable(e){return this.schemas[e]}getPrimaryKey(e){let t=this.schemas[e];if(!t)return;let n=Object.entries(t.columns).find(([i,r])=>r.isPrimaryKey);return n?n[0]:void 0}getForeignKeys(e){let t=this.schemas[e];if(!t)return[];let n=[];return Object.entries(t.columns).forEach(([i,r])=>{r.foreignKey&&n.push({column:i,referencedTable:r.foreignKey.table,referencedColumn:r.foreignKey.column})}),n}};function ry(o){return new Ut(o)}function sy(o){return new Ut(o).createTableColumnResolver()}function oy(o,e){return new Ut(o).createJsonMapping(e)}var vi=class{static{this.SQL_COMMANDS=new Set(["select","from","where","and","or","order","by","group","having","limit","offset","as","on","inner","left","right","join","union","insert","update","delete","into","values","set"])}static findLexemeAtPosition(e,t){if(t<0||t>=e.length)return null;let n=this.getAllLexemesWithPosition(e);for(let i of n)if(i.position&&t>=i.position.startPosition&&t<i.position.endPosition)return i;return null}static getAllLexemesWithPosition(e){if(!e?.trim())return[];try{let t=[],n=0;for(;n<e.length&&(n=this.skipWhitespace(e,n),!(n>=e.length));){let i=this.parseNextToken(e,n);i?(t.push(i),n=i.position.endPosition):n++}return t}catch{return[]}}static skipWhitespace(e,t){for(;t<e.length&&/\s/.test(e[t]);)t++;return t}static parseNextToken(e,t){let n=e[t];return n==="'"||n==='"'?this.parseStringLiteral(e,t):/[=<>!+\-*/%().*]/.test(n)?this.parseOperator(e,t):n===","?this.createLexeme(16,",",t,t+1):/[a-zA-Z0-9_]/.test(n)?this.parseWordToken(e,t):null}static parseStringLiteral(e,t){let n=e[t],i=t+1,r=n;for(;i<e.length&&e[i]!==n;)r+=e[i++];return i<e.length&&(r+=e[i++]),this.createLexeme(1,r,t,i)}static parseOperator(e,t){let n=e[t],i=t+1;i<e.length&&/[=<>!]/.test(e[i])&&/[=<>!]/.test(n)&&(n+=e[i++]);let r=this.getOperatorTokenType(n);return this.createLexeme(r,n,t,i)}static parseWordToken(e,t){let n=t,i="";for(;n<e.length&&/[a-zA-Z0-9_]/.test(e[n]);)i+=e[n++];let r=this.getWordTokenType(i,e,n),s=this.shouldLowercase(r)?i.toLowerCase():i;return this.createLexeme(r,s,t,n)}static getOperatorTokenType(e){switch(e){case"(":return 4;case")":return 8;case"*":return 64;default:return 2}}static getWordTokenType(e,t,n){let i=e.toLowerCase();if(this.SQL_COMMANDS.has(i))return 128;let r=this.skipWhitespace(t,n);return r<t.length&&t[r]==="("?2048:64}static shouldLowercase(e){return!!(e&128)||!!(e&2)||!!(e&2048)}static createLexeme(e,t,n,i){return{type:e,value:t,comments:null,position:{startPosition:n,endPosition:i}}}};export{fe as ArrayExpression,et as ArrayIndexExpression,Ce as ArrayQueryExpression,Ze as ArraySliceExpression,ye as BetweenExpression,C as BinaryExpression,B as BinarySelectQuery,ee as CTECollector,Bn as CTEComposer,lt as CTEDependencyAnalyzer,gt as CTEDisabler,He as CTENormalizer,Lt as CTENotFoundError,hi as CTEQueryDecomposer,fi as CTERenamer,re as CaseExpression,be as CaseKeyValuePair,ae as CastExpression,S as ColumnReference,Rn as ColumnReferenceCollector,Fn as CommentEditor,At as DuplicateCTEError,Zn as DuplicateDetectionMode,gi as DynamicQueryBuilder,at as Formatter,j as FunctionCall,x as IdentifierString,Se as InlineQuery,Ye as InsertQuery,di as InsertQueryParser,Et as InvalidCTENameError,Rt as JsonMappingConverter,Si as JsonSchemaValidator,vi as LexemeCursor,H as LiteralValue,T as ParameterExpression,G as ParenExpression,Mn as PostgresJsonQueryBuilder,Ve as QualifiedName,Qe as QueryBuilder,wi as QueryFlowDiagramGenerator,M as RawString,An as SchemaCollector,Ut as SchemaManager,Q as SelectQueryParser,Oe as SelectValueCollector,Fe as SelectableColumnCollector,w as SimpleSelectQuery,Ue as SqlFormatter,zn as SqlPaginationInjector,Kn as SqlParamInjector,Ln as SqlSchemaValidator,_n as SqlSortInjector,We as StringSpecifierExpression,Ee as SwitchCaseArgument,Qn as TableSchema,rt as TableSourceCollector,D as TokenType,Te as TupleExpression,Wn as TypeTransformationPostProcessor,zf as TypeTransformers,xe as TypeValue,te as UnaryExpression,bt as UpstreamSelectQueryFinder,xu as VALID_PRESETS,_ as ValueList,he as ValuesQuery,li as WindowFrameBound,dt as WindowFrameBoundStatic,ht as WindowFrameBoundaryValue,ve as WindowFrameExpression,Je as WindowFrameSpec,ai as WindowFrameType,Dn as convertColumnsToLegacy,ti as convertModelDrivenMapping,Bf as convertToLegacyJsonMapping,oy as createJsonMappingFromSchema,ry as createSchemaManager,sy as createTableColumnResolver,yi as extractTypeProtection,_i as isLegacyFormat,qi as isModelDrivenFormat,Ki as isUnifiedFormat,Ui as processJsonMapping,Ci as toLegacyMapping,_f as transformDatabaseResult,Ji as unifyJsonMapping,Wi as validateModelDrivenMapping};
61
+ `);throw new Error(i)}}static extractStructureFromSample(e){if(e==null)return"primitive";if(Array.isArray(e))return e.length===0?[]:[this.extractStructureFromSample(e[0])];if(typeof e=="object"){let t={};return Object.keys(e).forEach(n=>{t[n]=this.extractStructureFromSample(e[n])}),t}return"primitive"}};var Ut=class{constructor(e){this.schemas=e,this.validateSchemas()}validateSchemas(){let e=Object.keys(this.schemas),t=[];if(Object.entries(this.schemas).forEach(([n,i])=>{Object.entries(i.columns).filter(([s,a])=>a.isPrimaryKey).map(([s,a])=>s).length===0&&t.push(`Table '${n}' has no primary key defined`),i.relationships?.forEach(s=>{e.includes(s.table)||t.push(`Table '${n}' references unknown table '${s.table}' in relationship`)})}),t.length>0)throw new Error(`Schema validation failed:\\n${t.join("\\n")}`)}getTableColumns(e){let t=this.schemas[e];return t?Object.keys(t.columns):[]}createTableColumnResolver(){return e=>this.getTableColumns(e)}createJsonMapping(e){let t=this.schemas[e];if(!t)throw new Error(`Table '${e}' not found in schema registry`);let n={};Object.entries(t.columns).forEach(([r,s])=>{n[r]=s.jsonAlias||s.name});let i=[];return t.relationships?.forEach(r=>{let s=this.schemas[r.table];if(!s)throw new Error(`Related table '${r.table}' not found in schema registry`);let a={};Object.entries(s.columns).forEach(([u,c])=>{a[u]=c.jsonAlias||c.name});let l=r.type;i.push({id:r.propertyName,name:s.displayName||r.table,parentId:e,propertyName:r.propertyName,relationshipType:l,columns:a})}),{rootName:e,rootEntity:{id:e,name:t.displayName||e,columns:n},nestedEntities:i,resultFormat:"single"}}getTableNames(){return Object.keys(this.schemas)}getTable(e){return this.schemas[e]}getPrimaryKey(e){let t=this.schemas[e];if(!t)return;let n=Object.entries(t.columns).find(([i,r])=>r.isPrimaryKey);return n?n[0]:void 0}getForeignKeys(e){let t=this.schemas[e];if(!t)return[];let n=[];return Object.entries(t.columns).forEach(([i,r])=>{r.foreignKey&&n.push({column:i,referencedTable:r.foreignKey.table,referencedColumn:r.foreignKey.column})}),n}};function ry(o){return new Ut(o)}function sy(o){return new Ut(o).createTableColumnResolver()}function oy(o,e){return new Ut(o).createJsonMapping(e)}var vi=class{static{this.SQL_COMMANDS=new Set(["select","from","where","and","or","order","by","group","having","limit","offset","as","on","inner","left","right","join","union","insert","update","delete","into","values","set"])}static findLexemeAtPosition(e,t){if(t<0||t>=e.length)return null;let n=this.getAllLexemesWithPosition(e);for(let i of n)if(i.position&&t>=i.position.startPosition&&t<i.position.endPosition)return i;return null}static getAllLexemesWithPosition(e){if(!e?.trim())return[];try{let t=[],n=0;for(;n<e.length&&(n=this.skipWhitespace(e,n),!(n>=e.length));){let i=this.parseNextToken(e,n);i?(t.push(i),n=i.position.endPosition):n++}return t}catch{return[]}}static skipWhitespace(e,t){for(;t<e.length&&/\s/.test(e[t]);)t++;return t}static parseNextToken(e,t){let n=e[t];return n==="'"||n==='"'?this.parseStringLiteral(e,t):/[=<>!+\-*/%().*]/.test(n)?this.parseOperator(e,t):n===","?this.createLexeme(16,",",t,t+1):/[a-zA-Z0-9_]/.test(n)?this.parseWordToken(e,t):null}static parseStringLiteral(e,t){let n=e[t],i=t+1,r=n;for(;i<e.length&&e[i]!==n;)r+=e[i++];return i<e.length&&(r+=e[i++]),this.createLexeme(1,r,t,i)}static parseOperator(e,t){let n=e[t],i=t+1;i<e.length&&/[=<>!]/.test(e[i])&&/[=<>!]/.test(n)&&(n+=e[i++]);let r=this.getOperatorTokenType(n);return this.createLexeme(r,n,t,i)}static parseWordToken(e,t){let n=t,i="";for(;n<e.length&&/[a-zA-Z0-9_]/.test(e[n]);)i+=e[n++];let r=this.getWordTokenType(i,e,n),s=this.shouldLowercase(r)?i.toLowerCase():i;return this.createLexeme(r,s,t,n)}static getOperatorTokenType(e){switch(e){case"(":return 4;case")":return 8;case"*":return 64;default:return 2}}static getWordTokenType(e,t,n){let i=e.toLowerCase();if(this.SQL_COMMANDS.has(i))return 128;let r=this.skipWhitespace(t,n);return r<t.length&&t[r]==="("?2048:64}static shouldLowercase(e){return!!(e&128)||!!(e&2)||!!(e&2048)}static createLexeme(e,t,n,i){return{type:e,value:t,comments:null,position:{startPosition:n,endPosition:i}}}};export{fe as ArrayExpression,et as ArrayIndexExpression,Ce as ArrayQueryExpression,Ze as ArraySliceExpression,ye as BetweenExpression,C as BinaryExpression,B as BinarySelectQuery,ee as CTECollector,Bn as CTEComposer,lt as CTEDependencyAnalyzer,gt as CTEDisabler,He as CTENormalizer,Lt as CTENotFoundError,hi as CTEQueryDecomposer,fi as CTERenamer,re as CaseExpression,be as CaseKeyValuePair,ae as CastExpression,S as ColumnReference,Rn as ColumnReferenceCollector,Fn as CommentEditor,At as DuplicateCTEError,Zn as DuplicateDetectionMode,gi as DynamicQueryBuilder,at as Formatter,j as FunctionCall,x as IdentifierString,Se as InlineQuery,Ye as InsertQuery,di as InsertQueryParser,Et as InvalidCTENameError,Rt as JsonMappingConverter,Si as JsonSchemaValidator,vi as LexemeCursor,H as LiteralValue,T as ParameterExpression,G as ParenExpression,Mn as PostgresJsonQueryBuilder,Ve as QualifiedName,Qe as QueryBuilder,wi as QueryFlowDiagramGenerator,M as RawString,An as SchemaCollector,Ut as SchemaManager,Q as SelectQueryParser,Oe as SelectValueCollector,Fe as SelectableColumnCollector,w as SimpleSelectQuery,Ue as SqlFormatter,zn as SqlPaginationInjector,Kn as SqlParamInjector,Ln as SqlSchemaValidator,_n as SqlSortInjector,We as StringSpecifierExpression,Ee as SwitchCaseArgument,Qn as TableSchema,rt as TableSourceCollector,D as TokenType,Te as TupleExpression,Wn as TypeTransformationPostProcessor,zf as TypeTransformers,xe as TypeValue,te as UnaryExpression,bt as UpstreamSelectQueryFinder,xu as VALID_PRESETS,_ as ValueList,he as ValuesQuery,li as WindowFrameBound,dt as WindowFrameBoundStatic,ht as WindowFrameBoundaryValue,ve as WindowFrameExpression,Je as WindowFrameSpec,ai as WindowFrameType,Tt as WithClauseParser,Dn as convertColumnsToLegacy,ti as convertModelDrivenMapping,Bf as convertToLegacyJsonMapping,oy as createJsonMappingFromSchema,ry as createSchemaManager,sy as createTableColumnResolver,yi as extractTypeProtection,_i as isLegacyFormat,qi as isModelDrivenFormat,Ki as isUnifiedFormat,Ui as processJsonMapping,Ci as toLegacyMapping,_f as transformDatabaseResult,Ji as unifyJsonMapping,Wi as validateModelDrivenMapping};
62
62
  //# sourceMappingURL=index.min.js.map