sqlingo 0.15.0 → 0.15.2
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/CHANGELOG.md +17 -3
- package/README.md +46 -42
- package/README.npm.md +46 -42
- package/README.repo.md +46 -42
- package/dist/chunk-3AQZGJOE.js +2 -0
- package/dist/chunk-3AQZGJOE.js.map +1 -0
- package/dist/chunk-3QM5KG7E.cjs +2 -0
- package/dist/chunk-3QM5KG7E.cjs.map +1 -0
- package/dist/chunk-3QPO4PHG.cjs +2 -0
- package/dist/{chunk-HM2LPF3F.cjs.map → chunk-3QPO4PHG.cjs.map} +1 -1
- package/dist/chunk-3UWWG7AW.cjs +2 -0
- package/dist/{chunk-3OQRIAK6.cjs.map → chunk-3UWWG7AW.cjs.map} +1 -1
- package/dist/{chunk-UZQQGWEG.js → chunk-4GEW5JA6.js} +2 -2
- package/dist/chunk-4OWUZIBT.cjs +2 -0
- package/dist/chunk-4OWUZIBT.cjs.map +1 -0
- package/dist/chunk-57QCCXIJ.cjs +2 -0
- package/dist/{chunk-HOS6YPLH.cjs.map → chunk-57QCCXIJ.cjs.map} +1 -1
- package/dist/{chunk-T4CYUMP3.js → chunk-5UEGDJPA.js} +2 -2
- package/dist/{chunk-M7GQSFMU.js → chunk-6KKXEKNM.js} +2 -2
- package/dist/chunk-AHVZOF3N.cjs +2 -0
- package/dist/{chunk-OZSCBCO2.cjs.map → chunk-AHVZOF3N.cjs.map} +1 -1
- package/dist/{chunk-L5WMOHKN.js → chunk-AXLGFQDQ.js} +2 -2
- package/dist/chunk-BLUVFIA7.cjs +2 -0
- package/dist/chunk-BLUVFIA7.cjs.map +1 -0
- package/dist/chunk-DI2QZRFR.cjs +4 -0
- package/dist/{chunk-66JALKFB.cjs.map → chunk-DI2QZRFR.cjs.map} +1 -1
- package/dist/{chunk-AVPDMWUK.js → chunk-EZ7VKF2X.js} +2 -2
- package/dist/chunk-FERVZ62T.cjs +2 -0
- package/dist/{chunk-2S7D555U.cjs.map → chunk-FERVZ62T.cjs.map} +1 -1
- package/dist/chunk-GVRTGQV6.cjs +2 -0
- package/dist/chunk-GVRTGQV6.cjs.map +1 -0
- package/dist/chunk-HN5OT37U.js +2 -0
- package/dist/chunk-HN5OT37U.js.map +1 -0
- package/dist/{chunk-2RVEXDCA.js → chunk-I3W3TYLQ.js} +2 -2
- package/dist/{chunk-QRPJHVZJ.js → chunk-JLPP24SP.js} +2 -2
- package/dist/chunk-KCIBVGFH.cjs +2 -0
- package/dist/{chunk-LULCN2QF.cjs.map → chunk-KCIBVGFH.cjs.map} +1 -1
- package/dist/chunk-L3QLTSDN.cjs +2 -0
- package/dist/{chunk-NV4JJPNH.cjs.map → chunk-L3QLTSDN.cjs.map} +1 -1
- package/dist/{chunk-DA4ACCPJ.js → chunk-LXNDZZBH.js} +4 -4
- package/dist/chunk-LXNDZZBH.js.map +1 -0
- package/dist/chunk-MFCEAG7X.cjs +2 -0
- package/dist/{chunk-HMK6HRF2.cjs.map → chunk-MFCEAG7X.cjs.map} +1 -1
- package/dist/chunk-MVIZ3OGF.cjs +2 -0
- package/dist/{chunk-46KA45SQ.cjs.map → chunk-MVIZ3OGF.cjs.map} +1 -1
- package/dist/{chunk-2JB6PWW5.js → chunk-NJEMK7XN.js} +2 -2
- package/dist/chunk-OEILKTSQ.cjs +2 -0
- package/dist/chunk-OEILKTSQ.cjs.map +1 -0
- package/dist/{chunk-H23TMB7T.js → chunk-OY3TUTWZ.js} +2 -2
- package/dist/chunk-QBQHDSEC.js +3 -0
- package/dist/chunk-QBQHDSEC.js.map +1 -0
- package/dist/{chunk-U7IPR2BW.js → chunk-QZPWUNHV.js} +2 -2
- package/dist/chunk-RCVHOYS7.js +2 -0
- package/dist/chunk-RCVHOYS7.js.map +1 -0
- package/dist/chunk-SBCEJTHD.js +2 -0
- package/dist/chunk-SBCEJTHD.js.map +1 -0
- package/dist/chunk-T4W65P5Z.cjs +3 -0
- package/dist/chunk-T4W65P5Z.cjs.map +1 -0
- package/dist/chunk-U2DYJPRT.js +2 -0
- package/dist/chunk-U2DYJPRT.js.map +1 -0
- package/dist/chunk-UN6XWES6.js +2 -0
- package/dist/chunk-UN6XWES6.js.map +1 -0
- package/dist/chunk-WEST5GIF.cjs +2 -0
- package/dist/chunk-WEST5GIF.cjs.map +1 -0
- package/dist/{chunk-BHZRPLYB.js → chunk-XHLLQOF5.js} +2 -2
- package/dist/{chunk-PPEQJWF2.cjs → chunk-Y3TUKXK4.cjs} +4 -4
- package/dist/{chunk-PPEQJWF2.cjs.map → chunk-Y3TUKXK4.cjs.map} +1 -1
- package/dist/chunk-Z3MZONPC.cjs +2 -0
- package/dist/{chunk-EZ4BXKV6.cjs.map → chunk-Z3MZONPC.cjs.map} +1 -1
- package/dist/dialects/athena.cjs +1 -1
- package/dist/dialects/athena.js +1 -1
- package/dist/dialects/bigquery.cjs +2 -2
- package/dist/dialects/bigquery.cjs.map +1 -1
- package/dist/dialects/bigquery.js +2 -2
- package/dist/dialects/bigquery.js.map +1 -1
- package/dist/dialects/clickhouse.cjs +1 -1
- package/dist/dialects/clickhouse.cjs.map +1 -1
- package/dist/dialects/clickhouse.js +1 -1
- package/dist/dialects/clickhouse.js.map +1 -1
- package/dist/dialects/databricks.cjs +1 -1
- package/dist/dialects/databricks.cjs.map +1 -1
- package/dist/dialects/databricks.js +1 -1
- package/dist/dialects/databricks.js.map +1 -1
- package/dist/dialects/doris.cjs +1 -1
- package/dist/dialects/doris.cjs.map +1 -1
- package/dist/dialects/doris.js +1 -1
- package/dist/dialects/doris.js.map +1 -1
- package/dist/dialects/dremio.cjs +1 -1
- package/dist/dialects/dremio.cjs.map +1 -1
- package/dist/dialects/dremio.js +1 -1
- package/dist/dialects/dremio.js.map +1 -1
- package/dist/dialects/drill.cjs +1 -1
- package/dist/dialects/drill.cjs.map +1 -1
- package/dist/dialects/drill.js +1 -1
- package/dist/dialects/drill.js.map +1 -1
- package/dist/dialects/druid.cjs +1 -1
- package/dist/dialects/druid.js +1 -1
- package/dist/dialects/duckdb.cjs +13 -13
- package/dist/dialects/duckdb.cjs.map +1 -1
- package/dist/dialects/duckdb.js +4 -4
- package/dist/dialects/duckdb.js.map +1 -1
- package/dist/dialects/dune.cjs +1 -1
- package/dist/dialects/dune.js +1 -1
- package/dist/dialects/exasol.cjs +1 -1
- package/dist/dialects/exasol.cjs.map +1 -1
- package/dist/dialects/exasol.js +1 -1
- package/dist/dialects/exasol.js.map +1 -1
- package/dist/dialects/fabric.cjs +1 -1
- package/dist/dialects/fabric.js +1 -1
- package/dist/dialects/hive.cjs +1 -1
- package/dist/dialects/hive.js +1 -1
- package/dist/dialects/materialize.cjs +1 -1
- package/dist/dialects/materialize.js +1 -1
- package/dist/dialects/mysql.cjs +1 -1
- package/dist/dialects/mysql.js +1 -1
- package/dist/dialects/oracle.cjs +1 -1
- package/dist/dialects/oracle.cjs.map +1 -1
- package/dist/dialects/oracle.js +1 -1
- package/dist/dialects/oracle.js.map +1 -1
- package/dist/dialects/postgres.cjs +1 -1
- package/dist/dialects/postgres.js +1 -1
- package/dist/dialects/presto.cjs +1 -1
- package/dist/dialects/presto.js +1 -1
- package/dist/dialects/prql.cjs +1 -1
- package/dist/dialects/prql.js +1 -1
- package/dist/dialects/redshift.cjs +1 -1
- package/dist/dialects/redshift.js +1 -1
- package/dist/dialects/risingwave.cjs +1 -1
- package/dist/dialects/risingwave.js +1 -1
- package/dist/dialects/singlestore.cjs +1 -1
- package/dist/dialects/singlestore.cjs.map +1 -1
- package/dist/dialects/singlestore.js +1 -1
- package/dist/dialects/singlestore.js.map +1 -1
- package/dist/dialects/snowflake.cjs +2 -2
- package/dist/dialects/snowflake.cjs.map +1 -1
- package/dist/dialects/snowflake.js +2 -2
- package/dist/dialects/snowflake.js.map +1 -1
- package/dist/dialects/solr.cjs +1 -1
- package/dist/dialects/solr.js +1 -1
- package/dist/dialects/spark.cjs +1 -1
- package/dist/dialects/spark.js +1 -1
- package/dist/dialects/spark2.cjs +1 -1
- package/dist/dialects/spark2.js +1 -1
- package/dist/dialects/sqlite.cjs +1 -1
- package/dist/dialects/sqlite.js +1 -1
- package/dist/dialects/starrocks.cjs +1 -1
- package/dist/dialects/starrocks.js +1 -1
- package/dist/dialects/tableau.cjs +1 -1
- package/dist/dialects/tableau.js +1 -1
- package/dist/dialects/teradata.cjs +1 -1
- package/dist/dialects/teradata.js +1 -1
- package/dist/dialects/trino.cjs +1 -1
- package/dist/dialects/trino.js +1 -1
- package/dist/dialects/tsql.cjs +1 -1
- package/dist/dialects/tsql.js +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-2FE3OGCV.js +0 -2
- package/dist/chunk-2FE3OGCV.js.map +0 -1
- package/dist/chunk-2S7D555U.cjs +0 -2
- package/dist/chunk-3OQRIAK6.cjs +0 -2
- package/dist/chunk-46KA45SQ.cjs +0 -2
- package/dist/chunk-66JALKFB.cjs +0 -4
- package/dist/chunk-77XUJKMQ.cjs +0 -2
- package/dist/chunk-77XUJKMQ.cjs.map +0 -1
- package/dist/chunk-BHISYWYZ.cjs +0 -2
- package/dist/chunk-BHISYWYZ.cjs.map +0 -1
- package/dist/chunk-CLLF2IN3.cjs +0 -2
- package/dist/chunk-CLLF2IN3.cjs.map +0 -1
- package/dist/chunk-D7NVJBEB.js +0 -2
- package/dist/chunk-D7NVJBEB.js.map +0 -1
- package/dist/chunk-DA4ACCPJ.js.map +0 -1
- package/dist/chunk-DDF3BPGK.js +0 -2
- package/dist/chunk-DDF3BPGK.js.map +0 -1
- package/dist/chunk-EZ4BXKV6.cjs +0 -2
- package/dist/chunk-HM2LPF3F.cjs +0 -2
- package/dist/chunk-HMK6HRF2.cjs +0 -2
- package/dist/chunk-HOS6YPLH.cjs +0 -2
- package/dist/chunk-IESGDKWQ.js +0 -2
- package/dist/chunk-IESGDKWQ.js.map +0 -1
- package/dist/chunk-LULCN2QF.cjs +0 -2
- package/dist/chunk-M7AD2I25.js +0 -3
- package/dist/chunk-M7AD2I25.js.map +0 -1
- package/dist/chunk-MFTYEAPA.cjs +0 -2
- package/dist/chunk-MFTYEAPA.cjs.map +0 -1
- package/dist/chunk-NV4JJPNH.cjs +0 -2
- package/dist/chunk-OSSS3YFP.cjs +0 -2
- package/dist/chunk-OSSS3YFP.cjs.map +0 -1
- package/dist/chunk-OZSCBCO2.cjs +0 -2
- package/dist/chunk-PDRVLDIW.cjs +0 -3
- package/dist/chunk-PDRVLDIW.cjs.map +0 -1
- package/dist/chunk-S7RAXCVR.cjs +0 -2
- package/dist/chunk-S7RAXCVR.cjs.map +0 -1
- package/dist/chunk-VKYVJYC4.js +0 -2
- package/dist/chunk-VKYVJYC4.js.map +0 -1
- package/dist/chunk-XWPR4ZK3.js +0 -2
- package/dist/chunk-XWPR4ZK3.js.map +0 -1
- /package/dist/{chunk-UZQQGWEG.js.map → chunk-4GEW5JA6.js.map} +0 -0
- /package/dist/{chunk-T4CYUMP3.js.map → chunk-5UEGDJPA.js.map} +0 -0
- /package/dist/{chunk-M7GQSFMU.js.map → chunk-6KKXEKNM.js.map} +0 -0
- /package/dist/{chunk-L5WMOHKN.js.map → chunk-AXLGFQDQ.js.map} +0 -0
- /package/dist/{chunk-AVPDMWUK.js.map → chunk-EZ7VKF2X.js.map} +0 -0
- /package/dist/{chunk-2RVEXDCA.js.map → chunk-I3W3TYLQ.js.map} +0 -0
- /package/dist/{chunk-QRPJHVZJ.js.map → chunk-JLPP24SP.js.map} +0 -0
- /package/dist/{chunk-2JB6PWW5.js.map → chunk-NJEMK7XN.js.map} +0 -0
- /package/dist/{chunk-H23TMB7T.js.map → chunk-OY3TUTWZ.js.map} +0 -0
- /package/dist/{chunk-U7IPR2BW.js.map → chunk-QZPWUNHV.js.map} +0 -0
- /package/dist/{chunk-BHZRPLYB.js.map → chunk-XHLLQOF5.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i,g as Re,i as xe,j as a}from"../chunk-XWPR4ZK3.js";import"../chunk-U7IPR2BW.js";import{$i as k,$m as Pt,$n as Ht,$p as $t,Bq as Kt,Bx as q,Cr as rt,Ct as Te,Dr as st,Er as it,Ew as de,Ft as Et,Fw as w,Gt as _e,Hr as te,Ht as he,Im as Nt,Jm as Ct,Jn as Jt,Kn as jt,Lq as Z,Lr as ee,Mq as Q,Nq as tt,Nr as re,Om as yt,Op as W,Or as g,Po as Xt,Pq as et,Qq as Wt,Qr as se,Qw as ge,Rb as mt,Rr as ie,Sa as s,Se as Rt,Tr as ne,Un as Bt,Vj as xt,Vn as X,Vq as Zt,Wo as Yt,Wr as ae,Yo as Y,Yr as nt,Yv as o,Zo as V,Zs as ot,_m as Dt,_o as $,_s as pe,a as n,an as Lt,as as oe,ax as Ae,b as C,bj as F,bq as zt,c as y,cc as dt,ck as St,cn as H,d as D,dw as u,e as E,em as m,en as Mt,fj as J,fn as Ut,fs as ce,gl as j,gs as at,hn as Gt,hs as Ee,hu as me,in as bt,is as le,iu as lt,jd as At,jm as Ot,jn as wt,kn as qt,mn as vt,mp as Vt,nn as kt,nx as h,on as Ft,op as U,ox as P,pb as ht,pe as ft,px as fe,qe as f,qp as R,qt as ct,qu as pt,rp as z,s as l,sc as gt,sm as B,sp as G,tp as K,um as It,ut as ue,vg as c,vp as b,xr as Qt,zw as x}from"../chunk-DA4ACCPJ.js";function I(ze,N="time"){return new m({this:ze,to:f.build(N,{expressions:[new ft({this:c.number(6)})]})})}n(I,"castToTime6");var Se,Oe,Ie,v,S=class S extends(Ie=a.Tokenizer,Oe=[l],Se=[l],Ie){static get BYTE_STRINGS(){return[["e'","'"],["E'","'"]]}static get ORIGINAL_KEYWORDS(){return{...a.Tokenizer.KEYWORDS,BSON:"jsonb",GEOGRAPHYPOINT:"geographypoint",TIMESTAMP:"timestamp",UTC_DATE:"utcDate",UTC_TIME:"utcTime",UTC_TIMESTAMP:"utcTimestamp",":>":"colonGt","!:>":"ncolonGt","::$":"dcolondollar","::%":"dcolonpercent","::?":"dcolonqmark",RECORD:"struct"}}};v=C(Ie),E(v,10,"BYTE_STRINGS",Oe,S),E(v,10,"ORIGINAL_KEYWORDS",Se,S),y(v,S),D(v,3,S),n(S,"SingleStoreTokenizer");var ut=S,Ne,Ce,ye,De,Pe,Le,Me,Ue,Ge,be,d,T=class T extends(be=a.Parser,Ge=[l],Ue=[l],Me=[l],Le=[l],Pe=[l],De=[l],ye=[l],Ce=[l],Ne=[l],be){static get ID_VAR_TOKENS(){return new Set([...ht.ID_VAR_TOKENS,"sessionUser","currentCatalog","straightJoin"])}static get FUNCTIONS(){return{...a.Parser.FUNCTIONS,TO_DATE:x(nt,{dialect:"singlestore"}),TO_TIMESTAMP:x(st,{dialect:"singlestore"}),TO_CHAR:x(j,{dialect:"singlestore"}),STR_TO_DATE:x(rt,{dialect:"mysql"}),DATE_FORMAT:x(g,{dialect:"mysql"}),TIME_FORMAT:n(t=>new g({this:I(s(t,0)),format:a.formatTime(s(t,1))}),"TIME_FORMAT"),HOUR:n(t=>new m({this:new g({this:I(s(t,0)),format:a.formatTime(c.string("%k"))}),to:f.build("int")}),"HOUR"),MICROSECOND:n(t=>new m({this:new g({this:I(s(t,0)),format:a.formatTime(c.string("%f"))}),to:f.build("int")}),"MICROSECOND"),SECOND:n(t=>new m({this:new g({this:I(s(t,0)),format:a.formatTime(c.string("%s"))}),to:f.build("int")}),"SECOND"),MINUTE:n(t=>new m({this:new g({this:I(s(t,0)),format:a.formatTime(c.string("%i"))}),to:f.build("int")}),"MINUTE"),MONTHNAME:n(t=>new g({this:s(t,0),format:a.formatTime(c.string("%M"))}),"MONTHNAME"),WEEKDAY:n(t=>new St({this:new vt({this:s(t,0)}).add(5)}).mod(7),"WEEKDAY"),UNIX_TIMESTAMP:n(t=>it.fromArgList(t),"UNIX_TIMESTAMP"),FROM_UNIXTIME:x(at,{dialect:"mysql"}),TIME_BUCKET:n(t=>new H({this:s(t,0),expression:s(t,1),origin:s(t,2)}),"TIME_BUCKET"),BSON_EXTRACT_BSON:h(z),BSON_EXTRACT_STRING:h(G,{jsonType:"STRING"}),BSON_EXTRACT_DOUBLE:h(G,{jsonType:"DOUBLE"}),BSON_EXTRACT_BIGINT:h(G,{jsonType:"BIGINT"}),JSON_EXTRACT_JSON:h(U),JSON_EXTRACT_STRING:h(R,{jsonType:"STRING"}),JSON_EXTRACT_DOUBLE:h(R,{jsonType:"DOUBLE"}),JSON_EXTRACT_BIGINT:h(R,{jsonType:"BIGINT"}),JSON_ARRAY_CONTAINS_STRING:n(t=>new b({this:s(t,1),expression:s(t,0),jsonType:"STRING"}),"JSON_ARRAY_CONTAINS_STRING"),JSON_ARRAY_CONTAINS_DOUBLE:n(t=>new b({this:s(t,1),expression:s(t,0),jsonType:"DOUBLE"}),"JSON_ARRAY_CONTAINS_DOUBLE"),JSON_ARRAY_CONTAINS_JSON:n(t=>new b({this:s(t,1),expression:s(t,0),jsonType:"JSON"}),"JSON_ARRAY_CONTAINS_JSON"),JSON_KEYS:n(t=>new Yt({this:s(t,0),expressions:t.slice(1)}),"JSON_KEYS"),JSON_PRETTY:n(t=>K.fromArgList(t),"JSON_PRETTY"),JSON_BUILD_ARRAY:n(t=>new V({expressions:t}),"JSON_BUILD_ARRAY"),JSON_BUILD_OBJECT:n(t=>new Y({expressions:t}),"JSON_BUILD_OBJECT"),DATE:n(t=>X.fromArgList(t),"DATE"),DAYNAME:n(t=>new g({this:s(t,0),format:a.formatTime(c.string("%W"))}),"DAYNAME"),TIMESTAMPDIFF:n(t=>new Jt({this:s(t,2),expression:s(t,1),unit:s(t,0)}),"TIMESTAMPDIFF"),APPROX_COUNT_DISTINCT:n(t=>ot.fromArgList(t),"APPROX_COUNT_DISTINCT"),APPROX_PERCENTILE:n(t=>new pt({this:s(t,0),quantile:s(t,1),errorTolerance:s(t,2)}),"APPROX_PERCENTILE"),VARIANCE:n(t=>lt.fromArgList(t),"VARIANCE"),INSTR:n(t=>B.fromArgList(t),"INSTR"),REGEXP_MATCH:n(t=>new tt({this:s(t,0),expression:s(t,1),parameters:s(t,2)}),"REGEXP_MATCH"),REGEXP_SUBSTR:n(t=>new Q({this:s(t,0),expression:s(t,1),position:s(t,2),occurrence:s(t,3),parameters:s(t,4)}),"REGEXP_SUBSTR"),REDUCE:n(t=>new Z({initial:s(t,0),this:s(t,1),merge:s(t,2)}),"REDUCE")}}static get FUNCTION_PARSERS(){return{...a.Parser.FUNCTION_PARSERS,JSON_AGG:n(function(){return this.expression(Et,{this:this.parseTerm(),order:this.parseOrder()})},"JSON_AGG")}}static get NO_PAREN_FUNCTIONS(){return{...a.Parser.NO_PAREN_FUNCTIONS,utcDate:Dt,utcTime:Pt,utcTimestamp:Lt}}static get CAST_COLUMN_OPERATORS(){return new Set(["colonGt","ncolonGt"])}static get COLUMN_OPERATORS(){return(()=>{let e={...a.Parser.COLUMN_OPERATORS,colonGt:function(t,r){return this.expression(m,{this:t,to:r})},ncolonGt:function(t,r){return this.expression(ct,{this:t,to:r})},dcolon:function(t,r){return h(U)([t,c.string(r.name)])},dcolondollar:function(t,r){return h(R,{jsonType:"STRING"})([t,c.string(r.name)])},dcolonpercent:function(t,r){return h(R,{jsonType:"DOUBLE"})([t,c.string(r.name)])},dcolonqmark:function(t,r){return this.expression($,{this:t,path:r?.name,fromDcolonqmark:!0})}};return delete e.arrow,delete e.darrow,delete e.hashArrow,delete e.dhashArrow,delete e.placeholder,e})()}static get SHOW_PARSERS(){return{...a.Parser.SHOW_PARSERS,AGGREGATES:i("AGGREGATES"),"CDC EXTRACTOR POOL":i("CDC EXTRACTOR POOL"),"CREATE AGGREGATE":i("CREATE AGGREGATE",{target:!0}),"CREATE PIPELINE":i("CREATE PIPELINE",{target:!0}),"CREATE PROJECTION":i("CREATE PROJECTION",{target:!0}),"DATABASE STATUS":i("DATABASE STATUS"),"DISTRIBUTED_PLANCACHE STATUS":i("DISTRIBUTED_PLANCACHE STATUS"),"FULLTEXT SERVICE METRICS LOCAL":i("FULLTEXT SERVICE METRICS LOCAL"),"FULLTEXT SERVICE METRICS FOR NODE":i("FULLTEXT SERVICE METRICS FOR NODE",{target:!0}),"FULLTEXT SERVICE STATUS":i("FULLTEXT SERVICE STATUS"),FUNCTIONS:i("FUNCTIONS"),GROUPS:i("GROUPS"),"GROUPS FOR ROLE":i("GROUPS FOR ROLE",{target:!0}),"GROUPS FOR USER":i("GROUPS FOR USER",{target:!0}),INDEXES:i("INDEX",{target:"FROM"}),KEYS:i("INDEX",{target:"FROM"}),LINKS:i("LINKS",{target:"ON"}),"LOAD ERRORS":i("LOAD ERRORS"),"LOAD WARNINGS":i("LOAD WARNINGS"),PARTITIONS:i("PARTITIONS",{target:"ON"}),PIPELINES:i("PIPELINES"),PLAN:i("PLAN",{target:!0}),PLANCACHE:i("PLANCACHE"),PROCEDURES:i("PROCEDURES"),PROJECTIONS:i("PROJECTIONS",{target:"ON TABLE"}),"REPLICATION STATUS":i("REPLICATION STATUS"),REPRODUCTION:i("REPRODUCTION"),"RESOURCE POOLS":i("RESOURCE POOLS"),ROLES:i("ROLES"),"ROLES FOR USER":i("ROLES FOR USER",{target:!0}),"ROLES FOR GROUP":i("ROLES FOR GROUP",{target:!0}),"STATUS EXTENDED":i("STATUS EXTENDED"),USERS:i("USERS"),"USERS FOR ROLE":i("USERS FOR ROLE",{target:!0}),"USERS FOR GROUP":i("USERS FOR GROUP",{target:!0})}}static get ALTER_PARSERS(){return{...a.Parser.ALTER_PARSERS,CHANGE:n(function(){return this.expression(gt,{this:this.parseColumn(),to:this.parseColumn()})},"CHANGE")}}parseVectorExpressions(e){let t=e[1].name.toUpperCase(),r=this.dialect._constructor.VECTOR_TYPE_ALIASES;return t in r&&(t=r[t]),[f.build(t,{dialect:this.dialect}),e[0]]}static get TABLE_ALIAS_TOKENS(){return new Set([...a.Parser.TABLE_ALIAS_TOKENS,"straightJoin"])}};d=C(be),E(d,10,"ID_VAR_TOKENS",Ge,T),E(d,10,"FUNCTIONS",Ue,T),E(d,10,"FUNCTION_PARSERS",Me,T),E(d,10,"NO_PAREN_FUNCTIONS",Le,T),E(d,10,"CAST_COLUMN_OPERATORS",Pe,T),E(d,10,"COLUMN_OPERATORS",De,T),E(d,10,"SHOW_PARSERS",ye,T),E(d,10,"ALTER_PARSERS",Ce,T),E(d,10,"TABLE_ALIAS_TOKENS",Ne,T),y(d,T),D(d,3,T),n(T,"SingleStoreParser");var Tt=T,we,qe,ve,ke,Fe,Je,je,Be,He,A,p=class p extends(He=a.Generator,Be=[l],je=[l],Je=[l],Fe=[l],ke=[l],ve=[l],qe=[l],we=[l],He){static get AFTER_HAVING_MODIFIER_TRANSFORMS(){let e=new Map(super.AFTER_HAVING_MODIFIER_TRANSFORMS);return["cluster","distribute","sort"].forEach(t=>e.delete(t)),e}static get NULL_ORDERING_SUPPORTED(){return"supported"}static get STRUCT_DELIMITER(){return["(",")"]}static get SUPPORTED_JSON_PATH_PARTS(){return new Set([k,F,J])}static get ORIGINAL_TRANSFORMS(){let e=new Map([...a.Generator.TRANSFORMS,[nt,function(t){return t.args.format?this.func("TO_DATE",[t.args.this,this.formatTime(t)]):this.func("DATE",[t.args.this])}],[st,function(t){return this.func("TO_TIMESTAMP",[t.args.this,this.formatTime(t)])}],[j,function(t){return this.func("TO_CHAR",[t.args.this,this.formatTime(t)])}],[rt,function(t){return this.func("STR_TO_DATE",[t.args.this,this.formatTime(t,a.INVERSE_TIME_MAPPING,a.INVERSE_TIME_TRIE)])}],[g,function(t){return this.func("DATE_FORMAT",[t.args.this,this.formatTime(t,a.INVERSE_TIME_MAPPING,a.INVERSE_TIME_TRIE)])}],[X,function(t){return o.call(this,t,"zone","expressions"),u("DATE").call(this,t)}],[m,function(t){return o.call(this,t,"format","action","default"),`${this.sql(t.args.this)} :> ${this.sql(t.args.to)}`}],[ct,function(t){return o.call(this,t,"format","action","default"),`${this.sql(t.args.this)} !:> ${this.sql(t.args.to)}`}],[Ot,function(t){return this.sql(new m({this:t.args.this,to:f.build(t.args.to?.name)}))}],[it,function(t){return o.call(this,t,"format"),u("UNIX_TIMESTAMP").call(this,t)}],[se,u("UNIX_TIMESTAMP")],[ne,u("UNIX_TIMESTAMP")],[le,u("UNIX_TIMESTAMP")],[ce,function(t){return this.func("FROM_UNIXTIME",[t.args.this,this.formatTime(t,a.INVERSE_TIME_MAPPING,a.INVERSE_TIME_TRIE)])}],[at,function(t){return o.call(this,t,"scale","zone","hours","minutes"),this.func("FROM_UNIXTIME",[t.args.this,this.formatTime(t,a.INVERSE_TIME_MAPPING,a.INVERSE_TIME_TRIE)])}],[Ee,function(t){return`FROM_UNIXTIME(${this.sql(t.args.this)}) :> TEXT`}],[H,function(t){return o.call(this,t,"unit","zone"),this.func("TIME_BUCKET",[t.args.this,t.args.expression,t.args.origin])}],[ie,function(t){return this.sql(new m({this:t.args.this,to:f.build("date")}))}],[Rt,function(t){return this.func("CONVERT_TZ",[t.args.this,t.args.zone,"'UTC'"])}],[Ht,function(t){return`STR_TO_DATE(${this.sql(t.args.this)}, ${M.DATEINT_FORMAT})`}],[Bt,function(t){return`(DATE_FORMAT(${this.sql(t.args.this)}, ${M.DATEINT_FORMAT}) :> INT)`}],[oe,function(t){return`(DATE_FORMAT(${this.sql(t.args.this)}, ${M.DATEINT_FORMAT}) :> INT)`}],[re,function(t){return o.call(this,t,"zone"),`${this.sql(t.args.this)} :> TIME`}],[Gt,xe(Re("ADD"))],[qt,function(t){return o.call(this,t,"zone"),w().call(this,t)}],[bt,de("DATE","SUB")],[wt,q],[Ut,function(t){return o.call(this,t,"zone"),w().call(this,t)}],[Mt,function(t){return o.call(this,t,"zone"),t.args.unit!==void 0?q.call(this,t):this.func("DATEDIFF",[t.args.this,t.args.expression])}],[ae,function(t){return t.args.unit!==void 0?q.call(this,t):this.func("DATEDIFF",[t.args.this,t.args.expression])}],[jt,function(t){return o.call(this,t,"zone"),w().call(this,t)}],[Ct,function(t){return this.sql(I(new yt({this:c.number(6)}),"datetime"))}],[U,function(t){return o.call(this,t,"onlyJsonTypes","expressions","variantExtract","jsonQuery","option","quote","onCondition","requiresJson"),P("JSON_EXTRACT_JSON").call(this,t)}],[z,P("BSON_EXTRACT_BSON")],[k,fe],[J,function(t){return this.jsonPathPart(t.args.this)}],[F,()=>""],[K,function(t){return o.call(this,t,"options","isJson"),u("JSON_PRETTY").call(this,t)}],[Et,function(t){return o.call(this,t,"nullHandling","returnType","strict"),this.func("JSON_AGG",[t.args.this],{suffix:`${this.sql(t.args.order)})`})}],[V,function(t){return o.call(this,t,"nullHandling","returnType","strict"),u("JSON_BUILD_ARRAY").call(this,t)}],[Vt,function(t){return this.func("BSON_MATCH_ANY_EXISTS",[t.args.this,t.args.path])}],[$,function(t){return t.args.fromDcolonqmark?`${this.sql(t.args.this)}::?${this.sql(t.args.path)}`:this.func("JSON_MATCH_ANY_EXISTS",[t.args.this,t.args.path])}],[Y,function(t){return o.call(this,t,"nullHandling","uniqueKeys","returnType","encoding"),u("JSON_BUILD_OBJECT").call(this,t)}],[kt,function(t){return`((${this.func("DAYOFWEEK",[t.args.this])} % 7) + 1)`}],[Ft,u("DAY")],[ot,u("APPROX_COUNT_DISTINCT")],[pe,u("APPROX_COUNT_DISTINCT")],[ue,ge],[_e,function(t){return`MAX(ABS(${this.sql(t.args.this)}))`}],[he,function(t){return`MIN(ABS(${this.sql(t.args.this)}))`}],[pt,function(t){return o.call(this,t,"accuracy","weight"),this.func("APPROX_PERCENTILE",[t.args.this,t.args.quantile,t.args.errorTolerance])}],[me,u("VAR_SAMP")],[lt,u("VAR_POP")],[Te,Ae],[It,function(t){return this.sql(new Kt({this:t.args.this,expression:c.number(1).div(c.number(3))}))}],[et,function(t){return this.binary(t,"RLIKE")}],[Zt,function(t){return this.func("LPAD",[c.string(""),new xt({this:this.func("LENGTH",[t.args.this]),expression:Array.isArray(t.args.times)?t.args.times[0]:t.args.times}),t.args.this])}],[Xt,function(t){return`(${this.sql(t.args.this)} RLIKE '^[\0-\x7F]*$')`}],[zt,function(t){return this.func("UNHEX",[this.func("MD5",[t.args.this])])}],[B,u("INSTR")],[tt,function(t){return o.call(this,t,"position","occurrence","group"),this.func("REGEXP_MATCH",[t.args.this,t.args.expression,t.args.parameters])}],[Q,function(t){return o.call(this,t,"group"),this.func("REGEXP_SUBSTR",[t.args.this,t.args.expression,t.args.position,t.args.occurrence,t.args.parameters])}],[Qt,function(t){return this.func("REGEXP_INSTR",[t.args.this,this.func("CONCAT",[c.string("^"),t.args.expression])])}],[te,function(t){return this.func("CONV",[t.args.this,t.args.expression,c.number(10)])}],[Wt,function(t){return this.binary(new et({this:new W({this:t.args.this}),expression:new W({this:t.args.expression})}),"RLIKE")}],[ee,function(t){return this.func("CONCAT",[this.func("SUBSTRING",[t.args.this,c.number(1),t.args.start?.sub(1)]),t.args.expression,this.func("SUBSTRING",[t.args.this,t.args.start?.add(t.args.length)])])}],[At,function(t){return this.nationalSql(t,{prefix:""})}],[Z,function(t){return o.call(this,t,"finish"),this.func("REDUCE",[t.args.initial,t.args.this,t.args.merge])}],[$t,function(t){return o.call(this,t,"modifier"),this.matchAgainstSql(t)}],[dt,function(t){return o.call(this,t,"history","terse","offset","startsWith","limit","from","scope","scopeKind","mutex","query","channel","log","types","privileges"),this.showSql(t)}],[mt,function(t){return o.call(this,t,"style","kind","expressions","partition","format"),this.describeSql(t)}]]);return e.delete(R),e.delete(Nt),e}static get UNSUPPORTED_TYPES(){return new Set(["array","aggregatefunction","simpleaggregatefunction","bigserial","bpchar","datemultirange","daterange","dynamic","hllsketch","hstore","image","inet","int128","int256","int4multirange","int4range","int8multirange","int8range","interval","ipaddress","ipprefix","ipv4","ipv6","list","map","lowcardinality","money","multilinestring","name","nested","nothing","null","nummultirange","numrange","object","range","rowversion","serial","smallserial","smallmoney","super","timetz","timestampntz","timestampltz","timestamptz","timestampNs","tsmultirange","tsrange","tstzmultirange","tstzrange","uint128","uint256","union","unknown","user-defined","uuid","variant","xml","tdigest"])}static get TYPE_MAPPING(){return new Map([...a.Generator.TYPE_MAPPING,["bigdecimal","DECIMAL"],["bit","BOOLEAN"],["date32","DATE"],["datetime64","DATETIME"],["decimal32","DECIMAL"],["decimal64","DECIMAL"],["decimal128","DECIMAL"],["decimal256","DECIMAL"],["enum8","ENUM"],["enum16","ENUM"],["fixedstring","TEXT"],["geometry","GEOGRAPHY"],["point","GEOGRAPHYPOINT"],["ring","GEOGRAPHY"],["linestring","GEOGRAPHY"],["polygon","GEOGRAPHY"],["multipolygon","GEOGRAPHY"],["struct","RECORD"],["jsonb","BSON"],["timestamp","TIMESTAMP"],["timestampS","TIMESTAMP"],["timestampMs","TIMESTAMP(6)"]])}static get RESERVED_KEYWORDS(){return new Set(["abs","absolute","access","account","acos","action","add","adddate","addtime","admin","aes_decrypt","aes_encrypt","after","against","aggregate","aggregates","aggregator","aggregator_id","aggregator_plan_hash","aggregators","algorithm","all","also","alter","always","analyse","analyze","and","anti_join","any","any_value","approx_count_distinct","approx_count_distinct_accumulate","approx_count_distinct_combine","approx_count_distinct_estimate","approx_geography_intersects","approx_percentile","arghistory","arrange","arrangement","array","as","asc","ascii","asensitive","asin","asm","assertion","assignment","ast","asymmetric","async","at","atan","atan2","attach","attribute","authorization","auto","auto_increment","auto_reprovision","autostats","autostats_cardinality_mode","autostats_enabled","autostats_histogram_mode","autostats_sampling","availability","avg","avg_row_length","avro","azure","background","_background_threads_for_cleanup","backup","backup_history","backup_id","backward","batch","batches","batch_interval","_batch_size_limit","before","begin","between","bigint","bin","binary","_binary","bit","bit_and","bit_count","bit_or","bit_xor","blob","bool","boolean","bootstrap","both","_bt","btree","bucket_count","by","byte","byte_length","cache","call","call_for_pipeline","called","capture","cascade","cascaded","case","cast","catalog","ceil","ceiling","chain","change","char","character","characteristics","character_length","char_length","charset","check","checkpoint","_check_can_connect","_check_consistency","checksum","_checksum","class","clear","client","client_found_rows","close","cluster","clustered","cnf","coalesce","coercibility","collate","collation","collect","column","columnar","columns","columnstore","columnstore_segment_rows","comment","comments","commit","committed","_commit_log_tail","compact","compile","compressed","compression","concat","concat_ws","concurrent","concurrently","condition","configuration","connection","connection_id","connections","config","constraint","constraints","content","continue","_continue_replay","conv","conversion","convert","convert_tz","copy","_core","cos","cost","cot","count","create","credentials","cross","cube","csv","cume_dist","curdate","current","current_catalog","current_date","current_role","current_schema","current_security_groups","current_security_roles","current_time","current_timestamp","current_user","cursor","curtime","cycle","data","database","databases","date","date_add","datediff","date_format","date_sub","date_trunc","datetime","day","day_hour","day_microsecond","day_minute","dayname","dayofmonth","dayofweek","dayofyear","day_second","deallocate","dec","decimal","declare","decode","default","defaults","deferrable","deferred","defined","definer","degrees","delayed","delay_key_write","delete","delimiter","delimiters","dense_rank","desc","describe","detach","deterministic","dictionary","differential","directory","disable","discard","_disconnect","disk","distinct","distinctrow","distributed_joins","div","do","document","domain","dot_product","double","drop","_drop_profile","dual","dump","duplicate","dynamic","earliest","each","echo","election","else","elseif","elt","enable","enclosed","encoding","encrypted","end","engine","engines","enum","errors","escape","escaped","estimate","euclidean_distance","event","events","except","exclude","excluding","exclusive","execute","exists","exit","exp","explain","extended","extension","external","external_host","external_port","extract","extractor","extractors","extra_join","_failover","failed_login_attempts","failure","false","family","fault","fetch","field","fields","file","files","fill","first","first_value","fix_alter","fixed","float","float4","float8","floor","flush","following","for","force","force_compiled_mode","force_interpreter_mode","foreground","foreign","format","forward","found_rows","freeze","from","from_base64","from_days","from_unixtime","fs","_fsync","full","fulltext","function","functions","gc","gcs","get_format","_gc","_gcx","generate","geography","geography_area","geography_contains","geography_distance","geography_intersects","geography_latitude","geography_length","geography_longitude","geographypoint","geography_point","geography_within_distance","geometry","geometry_area","geometry_contains","geometry_distance","geometry_filter","geometry_intersects","geometry_length","geometrypoint","geometry_point","geometry_within_distance","geometry_x","geometry_y","global","_global_version_timestamp","grant","granted","grants","greatest","group","grouping","groups","group_concat","gzip","handle","handler","hard_cpu_limit_percentage","hash","has_temp_tables","having","hdfs","header","heartbeat_no_logging","hex","highlight","high_priority","hold","holding","host","hosts","hour","hour_microsecond","hour_minute","hour_second","identified","identity","if","ifnull","ignore","ifnull","ilike","immediate","immutable","implicit","import","in","including","increment","incremental","index","indexes","inet_aton","inet_ntoa","inet6_aton","inet6_ntoa","infile","inherit","inherits","_init_profile","init","initcap","initialize","initially","inject","inline","inner","inout","input","insensitive","insert","insert_method","instance","instead","instr","int","int1","int2","int3","int4","int8","integer","_internal_dynamic_typecast","interpreter_mode","intersect","interval","into","invoker","is","isnull","isolation","iterate","join","json","json_agg","json_array_contains_double","json_array_contains_json","json_array_contains_string","json_array_push_double","json_array_push_json","json_array_push_string","json_delete_key","json_extract_double","json_extract_json","json_extract_string","json_extract_bigint","json_get_type","json_length","json_set_double","json_set_json","json_set_string","json_splice_double","json_splice_json","json_splice_string","kafka","key","key_block_size","keys","kill","killall","label","lag","language","large","last","last_day","last_insert_id","last_value","lateral","latest","lc_collate","lc_ctype","lcase","lead","leading","leaf","leakproof","least","leave","leaves","left","length","level","license","like","limit","lines","listen","llvm","ln","load","loaddata_where","_load","local","localtime","localtimestamp","locate","location","lock","log","log10","log2","long","longblob","longtext","loop","lower","low_priority","lpad","_ls","ltrim","lz4","management","_management_thread","mapping","master","match","materialized","max","maxvalue","max_concurrency","max_errors","max_partitions_per_batch","max_queue_depth","max_retries_per_batch_partition","max_rows","mbc","md5","mpl","median","mediumblob","mediumint","mediumtext","member","memory","memory_percentage","_memsql_table_id_lookup","memsql","memsql_deserialize","memsql_imitating_kafka","memsql_serialize","merge","metadata","microsecond","middleint","min","min_rows","minus","minute","minute_microsecond","minute_second","minvalue","mod","mode","model","modifies","modify","month","monthname","months_between","move","mpl","names","named","namespace","national","natural","nchar","next","no","node","none","no_query_rewrite","noparam","not","nothing","notify","now","nowait","no_write_to_binlog","norely","nth_value","ntile","null","nullcols","nullif","nulls","numeric","nvarchar","object","octet_length","of","off","offline","offset","offsets","oids","on","online","only","open","operator","optimization","optimize","optimizer","optimizer_state","option","options","optionally","or","order","ordered_serialize","orphan","out","out_of_order","outer","outfile","over","overlaps","overlay","owned","owner","pack_keys","paired","parser","parquet","partial","partition","partition_id","partitioning","partitions","passing","password","password_lock_time","pause","_pause_replay","percent_rank","percentile_cont","percentile_disc","periodic","persisted","pi","pipeline","pipelines","pivot","placing","plan","plans","plancache","plugins","pool","pools","port","position","pow","power","preceding","precision","prepare","prepared","preserve","primary","prior","privileges","procedural","procedure","procedures","process","processlist","profile","profiles","program","promote","proxy","purge","quarter","queries","query","query_timeout","queue","quote","radians","rand","range","rank","read","_read","reads","real","reassign","rebalance","recheck","record","recursive","redundancy","redundant","ref","reference","references","refresh","regexp","reindex","relative","release","reload","rely","remote","remove","rename","repair","_repair_table","repeat","repeatable","_repl","_reprovisioning","replace","replica","replicate","replicating","replication","durability","require","resource","resource_pool","reset","restart","restore","restrict","result","_resurrect","retry","return","returning","returns","reverse","revoke","rg_pool","right","right_anti_join","right_semi_join","right_straight_join","rlike","role","roles","rollback","rollup","round","routine","row","row_count","row_format","row_number","rows","rowstore","rule","rpad","_rpc","rtrim","running","s3","safe","save","savepoint","scalar","schema","schemas","schema_binding","scroll","search","second","second_microsecond","sec_to_time","security","select","semi_join","_send_threads","sensitive","separator","sequence","sequences","serial","serializable","series","service_user","server","session","session_user","set","setof","security_lists_intersect","sha","sha1","sha2","shard","sharded","sharded_id","share","show","shutdown","sigmoid","sign","signal","similar","simple","site","signed","sin","skip","skipped_batches","sleep","_sleep","smallint","snapshot","_snapshot","_snapshots","soft_cpu_limit_percentage","some","soname","sparse","spatial","spatial_check_index","specific","split","sql","sql_big_result","sql_buffer_result","sql_cache","sql_calc_found_rows","sqlexception","sql_mode","sql_no_cache","sql_no_logging","sql_small_result","sqlstate","sqlwarning","sqrt","ssl","stable","standalone","start","starting","state","statement","statistics","stats","status","std","stddev","stddev_pop","stddev_samp","stdin","stdout","stop","storage","str_to_date","straight_join","strict","string","strip","subdate","substr","substring","substring_index","success","sum","super","symmetric","sync_snapshot","sync","_sync","_sync2","_sync_partitions","_sync_snapshot","synchronize","sysid","system","table","table_checksum","tables","tablespace","tags","tan","target_size","task","temp","template","temporary","temptable","_term_bump","terminate","terminated","test","text","then","time","timediff","time_bucket","time_format","timeout","timestamp","timestampadd","timestampdiff","timezone","time_to_sec","tinyblob","tinyint","tinytext","to","to_base64","to_char","to_date","to_days","to_json","to_number","to_seconds","to_timestamp","tracelogs","traditional","trailing","transform","transaction","_transactions_experimental","treat","trigger","triggers","trim","true","trunc","truncate","trusted","two_phase","_twopcid","type","types","ucase","unbounded","uncommitted","undefined","undo","unencrypted","unenforced","unhex","unhold","unicode","union","unique","_unittest","unix_timestamp","unknown","unlisten","_unload","unlock","unlogged","unpivot","unsigned","until","update","upgrade","upper","usage","use","user","users","using","utc_date","utc_time","utc_timestamp","_utf8","vacuum","valid","validate","validator","value","values","varbinary","varchar","varcharacter","variables","variadic","variance","var_pop","var_samp","varying","vector_sub","verbose","version","view","void","volatile","voting","wait","_wake","warnings","week","weekday","weekofyear","when","where","while","whitespace","window","with","without","within","_wm_heartbeat","work","workload","wrapper","write","xact_id","xor","year","year_month","yes","zerofill","zone"])}jsonExtractScalarSql(e){let t=e.args.jsonType,r=t===void 0?"JSON_EXTRACT_JSON":`JSON_EXTRACT_${t}`;return P(r).call(this,e)}jsonbExtractScalarSql(e){let t=e.args.jsonType,r=t===void 0?"BSON_EXTRACT_BSON":`BSON_EXTRACT_${t}`;return P(r).call(this,e)}jsonExtractArraySql(e){return this.unsupported("Arrays are not supported in SingleStore"),this.functionFallbackSql(e)}jsonValueSql(e){o.call(this,e,"onCondition");let t=new R({this:e.args.this,expression:e.args.path,jsonType:"STRING"}),r=e.args.returning;return r!==void 0&&(t=new m({this:t,to:r})),this.sql(t)}allSql(e){return this.unsupported("ALL subquery predicate is not supported in SingleStore"),super.allSql(e)}jsonArrayContainsSql(e){let t=e.text("jsonType").toUpperCase();return t?this.func(`JSON_ARRAY_CONTAINS_${t}`,[e.args.expression,e.args.this]):this.func("JSON_ARRAY_CONTAINS_JSON",[e.args.expression,this.func("TO_JSON",[e.args.this])])}dataTypeSql(e){if(o.call(this,e,"kind","values"),e.args.nested&&!e.isType("struct")&&this.unsupported(`Argument 'nested' is not supported for representation of '${e.args.this}' in SingleStore`),e.isType("varbinary")&&!e.args.expressions?.length)return"BLOB";if(e.isType(["decimal32","decimal64","decimal128","decimal256"])){let t=this.expressions(e,{flat:!0}),r;return e.isType("decimal32")?r="9":e.isType("decimal64")?r="18":e.isType("decimal128")?r="38":r="65",t?`DECIMAL(${r}, ${t[0]})`:`DECIMAL(${r})`}if(e.isType("vector")){let t=e.args.expressions||[];if(t.length===2){let r=this.sql(t[0]),O=this.dialect.constructor.INVERSE_VECTOR_TYPE_ALIASES;return r in O&&(r=O[r]),`VECTOR(${this.sql(t[1])}, ${r})`}}return super.dataTypeSql(e)}collateSql(e){return this.binary(e,":> LONGTEXT COLLATE")}currentDateSql(e){let t=e.args.this;if(t){if(t instanceof c&&t.args.this?.toLowerCase()==="utc")return this.func("UTC_DATE",[]);this.unsupported("CurrentDate with timezone is not supported in SingleStore")}return this.func("CURRENT_DATE",[])}currentTimeSql(e){let t=e.args.this;if(t){if(t instanceof c&&t.args.this?.toLowerCase()==="utc")return this.func("UTC_TIME",[]);if(t instanceof c&&t.isNumber)return this.func("CURRENT_TIME",[t]);this.unsupported("CurrentTime with timezone is not supported in SingleStore")}return this.func("CURRENT_TIME",[])}currentTimestampSql(e){let t=e.args.this;if(t){if(t instanceof c&&t.args.this?.toLowerCase()==="utc")return this.func("UTC_TIMESTAMP",[]);if(t instanceof c&&t.isNumber)return this.func("CURRENT_TIMESTAMP",[t]);this.unsupported("CurrentTimestamp with timezone is not supported in SingleStore")}return this.func("CURRENT_TIMESTAMP",[])}standardHashSql(e){let t=e.args.expression;if(t===void 0)return this.func("SHA",[e.args.this]);if(t instanceof c){let r=t.args.this?.toLowerCase();return r==="sha"?this.func("SHA",[e.args.this]):r==="md5"?this.func("MD5",[e.args.this]):(this.unsupported(`${t.args.this} hash method is not supported in SingleStore`),this.func("SHA",[e.args.this]))}return this.unsupported("STANDARD_HASH function is not supported in SingleStore"),this.func("SHA",[e.args.this])}truncateTableSql(e){o.call(this,e,"isDatabase","exists","cluster","identity","option","partition");let t=[];for(let r of e.args.expressions??[])t.push(`TRUNCATE ${this.sql(r)}`);return t.join("; ")}renameColumnSql(e){o.call(this,e,"exists");let t=this.sql(e,"this"),r=this.sql(e,"to");return`CHANGE ${t} ${r}`}alterColumnSql(e){o.call(this,e,"drop","comment","allowNull","visible","using");let t=super.alterColumnSql(e),r=this.sql(e,"collate"),O=r?` COLLATE ${r}`:"";return`${t}${O}`}computedColumnConstraintSql(e){let t=this.sql(e,"this"),r=e.args.notNull?" NOT NULL":"",O=this.sql(e,"dataType")||"AUTO";return`AS ${t} PERSISTED ${O}${r}`}};A=C(He),E(A,10,"AFTER_HAVING_MODIFIER_TRANSFORMS",Be,p),E(A,10,"NULL_ORDERING_SUPPORTED",je,p),E(A,10,"STRUCT_DELIMITER",Je,p),E(A,10,"SUPPORTED_JSON_PATH_PARTS",Fe,p),E(A,10,"ORIGINAL_TRANSFORMS",ke,p),E(A,10,"UNSUPPORTED_TYPES",ve,p),E(A,10,"TYPE_MAPPING",qe,p),E(A,10,"RESERVED_KEYWORDS",we,p),y(A,p),D(A,3,p),n(p,"SingleStoreGenerator"),p.SUPPORTS_DECODE_CASE=!1,p.TRY_SUPPORTED=!1,p.SUPPORTS_UESCAPE=!1,p.MATCH_AGAINST_TABLE_PREFIX="TABLE ",p.UNICODE_SUBSTITUTE=n((e,t)=>String.fromCharCode(parseInt(t,16)),"UNICODE_SUBSTITUTE");var _t=p,Xe,Ye,Ve,$e,L,_=class _ extends($e=a,Ve=[l],Ye=[l],Xe=[l],$e){static get TIME_MAPPING(){return{D:"%u",DD:"%d",DY:"%a",HH:"%I",HH12:"%I",HH24:"%H",MI:"%M",MM:"%m",MON:"%b",MONTH:"%B",SS:"%S",RR:"%y",YY:"%y",YYYY:"%Y",FF6:"%f"}}static get VECTOR_TYPE_ALIASES(){return{I8:"TINYINT",I16:"SMALLINT",I32:"INT",I64:"BIGINT",F32:"FLOAT",F64:"DOUBLE"}}static get INVERSE_VECTOR_TYPE_ALIASES(){return Object.fromEntries(Object.entries(_.VECTOR_TYPE_ALIASES).map(([e,t])=>[t,e]))}};L=C($e),E(L,10,"TIME_MAPPING",Ve,_),E(L,10,"VECTOR_TYPE_ALIASES",Ye,_),E(L,10,"INVERSE_VECTOR_TYPE_ALIASES",Xe,_),y(L,_),D(L,3,_),n(_,"SingleStore"),_.DIALECT_NAME="singlestore",_.SUPPORTS_ORDER_BY_ALL=!0,_.Tokenizer=ut,_.Parser=Tt,_.Generator=_t;var M=_;export{M as SingleStore};
|
|
1
|
+
import{a as i,g as Re,i as xe,j as a}from"../chunk-HN5OT37U.js";import"../chunk-QZPWUNHV.js";import{$i as k,$m as Pt,$n as Ht,$p as $t,Bq as Kt,Bx as q,Cr as rt,Ct as Te,Dr as st,Er as it,Ew as de,Ft as Et,Fw as w,Gt as _e,Hr as te,Ht as he,Im as Nt,Jm as Ct,Jn as Jt,Kn as jt,Lq as Z,Lr as ee,Mq as Q,Nq as tt,Nr as re,Om as yt,Op as W,Or as g,Po as Xt,Pq as et,Qq as Wt,Qr as se,Qw as ge,Rb as mt,Rr as ie,Sa as s,Se as Rt,Tr as ne,Un as Bt,Vj as xt,Vn as X,Vq as Zt,Wo as Yt,Wr as ae,Yo as Y,Yr as nt,Yv as o,Zo as V,Zs as ot,_m as Dt,_o as $,_s as le,a as n,an as Lt,as as oe,ax as Ae,b as y,bj as F,bq as zt,c as D,cc as dt,ck as St,cn as H,d as P,dw as u,e as E,em as m,en as Mt,fj as J,fn as Ut,fs as ce,gl as j,gs as at,hn as Gt,hs as Ee,hu as me,in as bt,is as pe,iu as pt,jd as At,jm as Ot,jn as wt,kn as qt,mn as vt,mp as Vt,nn as kt,nx as h,on as Ft,op as U,ox as L,pb as ht,pe as ft,px as fe,qe as f,qp as R,qt as ct,qu as lt,rp as z,s as p,sc as gt,sm as B,sp as G,tp as K,um as It,ut as ue,vg as c,vp as b,xr as Qt,zw as S}from"../chunk-LXNDZZBH.js";function N(ze,C="time"){return new m({this:ze,to:f.build(C,{expressions:[new ft({this:c.number(6)})]})})}n(N,"castToTime6");var Se,Oe,Ie,v,O=class O extends(Ie=a.Tokenizer,Oe=[p],Se=[p],Ie){static get BYTE_STRINGS(){return[["e'","'"],["E'","'"]]}static get ORIGINAL_KEYWORDS(){return{...a.Tokenizer.KEYWORDS,BSON:"jsonb",GEOGRAPHYPOINT:"geographypoint",TIMESTAMP:"timestamp",UTC_DATE:"utcDate",UTC_TIME:"utcTime",UTC_TIMESTAMP:"utcTimestamp",":>":"colonGt","!:>":"ncolonGt","::$":"dcolondollar","::%":"dcolonpercent","::?":"dcolonqmark",RECORD:"struct"}}};v=y(Ie),E(v,10,"BYTE_STRINGS",Oe,O),E(v,10,"ORIGINAL_KEYWORDS",Se,O),D(v,O),P(v,3,O),n(O,"SingleStoreTokenizer");var ut=O,Ne,Ce,ye,De,Pe,Le,Me,Ue,Ge,be,d,T=class T extends(be=a.Parser,Ge=[p],Ue=[p],Me=[p],Le=[p],Pe=[p],De=[p],ye=[p],Ce=[p],Ne=[p],be){static get ID_VAR_TOKENS(){return new Set([...ht.ID_VAR_TOKENS,"sessionUser","currentCatalog","straightJoin"])}static get FUNCTIONS(){return{...a.Parser.FUNCTIONS,TO_DATE:S(nt,{dialect:x}),TO_TIMESTAMP:S(st,{dialect:x}),TO_CHAR:S(j,{dialect:x}),STR_TO_DATE:S(rt,{dialect:a}),DATE_FORMAT:S(g,{dialect:a}),TIME_FORMAT:n(t=>new g({this:N(s(t,0)),format:a.formatTime(s(t,1))}),"TIME_FORMAT"),HOUR:n(t=>new m({this:new g({this:N(s(t,0)),format:a.formatTime(c.string("%k"))}),to:f.build("int")}),"HOUR"),MICROSECOND:n(t=>new m({this:new g({this:N(s(t,0)),format:a.formatTime(c.string("%f"))}),to:f.build("int")}),"MICROSECOND"),SECOND:n(t=>new m({this:new g({this:N(s(t,0)),format:a.formatTime(c.string("%s"))}),to:f.build("int")}),"SECOND"),MINUTE:n(t=>new m({this:new g({this:N(s(t,0)),format:a.formatTime(c.string("%i"))}),to:f.build("int")}),"MINUTE"),MONTHNAME:n(t=>new g({this:s(t,0),format:a.formatTime(c.string("%M"))}),"MONTHNAME"),WEEKDAY:n(t=>new St({this:new vt({this:s(t,0)}).add(5)}).mod(7),"WEEKDAY"),UNIX_TIMESTAMP:n(t=>it.fromArgList(t),"UNIX_TIMESTAMP"),FROM_UNIXTIME:S(at,{dialect:a}),TIME_BUCKET:n(t=>new H({this:s(t,0),expression:s(t,1),origin:s(t,2)}),"TIME_BUCKET"),BSON_EXTRACT_BSON:h(z),BSON_EXTRACT_STRING:h(G,{jsonType:"STRING"}),BSON_EXTRACT_DOUBLE:h(G,{jsonType:"DOUBLE"}),BSON_EXTRACT_BIGINT:h(G,{jsonType:"BIGINT"}),JSON_EXTRACT_JSON:h(U),JSON_EXTRACT_STRING:h(R,{jsonType:"STRING"}),JSON_EXTRACT_DOUBLE:h(R,{jsonType:"DOUBLE"}),JSON_EXTRACT_BIGINT:h(R,{jsonType:"BIGINT"}),JSON_ARRAY_CONTAINS_STRING:n(t=>new b({this:s(t,1),expression:s(t,0),jsonType:"STRING"}),"JSON_ARRAY_CONTAINS_STRING"),JSON_ARRAY_CONTAINS_DOUBLE:n(t=>new b({this:s(t,1),expression:s(t,0),jsonType:"DOUBLE"}),"JSON_ARRAY_CONTAINS_DOUBLE"),JSON_ARRAY_CONTAINS_JSON:n(t=>new b({this:s(t,1),expression:s(t,0),jsonType:"JSON"}),"JSON_ARRAY_CONTAINS_JSON"),JSON_KEYS:n(t=>new Yt({this:s(t,0),expressions:t.slice(1)}),"JSON_KEYS"),JSON_PRETTY:n(t=>K.fromArgList(t),"JSON_PRETTY"),JSON_BUILD_ARRAY:n(t=>new V({expressions:t}),"JSON_BUILD_ARRAY"),JSON_BUILD_OBJECT:n(t=>new Y({expressions:t}),"JSON_BUILD_OBJECT"),DATE:n(t=>X.fromArgList(t),"DATE"),DAYNAME:n(t=>new g({this:s(t,0),format:a.formatTime(c.string("%W"))}),"DAYNAME"),TIMESTAMPDIFF:n(t=>new Jt({this:s(t,2),expression:s(t,1),unit:s(t,0)}),"TIMESTAMPDIFF"),APPROX_COUNT_DISTINCT:n(t=>ot.fromArgList(t),"APPROX_COUNT_DISTINCT"),APPROX_PERCENTILE:n(t=>new lt({this:s(t,0),quantile:s(t,1),errorTolerance:s(t,2)}),"APPROX_PERCENTILE"),VARIANCE:n(t=>pt.fromArgList(t),"VARIANCE"),INSTR:n(t=>B.fromArgList(t),"INSTR"),REGEXP_MATCH:n(t=>new tt({this:s(t,0),expression:s(t,1),parameters:s(t,2)}),"REGEXP_MATCH"),REGEXP_SUBSTR:n(t=>new Q({this:s(t,0),expression:s(t,1),position:s(t,2),occurrence:s(t,3),parameters:s(t,4)}),"REGEXP_SUBSTR"),REDUCE:n(t=>new Z({initial:s(t,0),this:s(t,1),merge:s(t,2)}),"REDUCE")}}static get FUNCTION_PARSERS(){return{...a.Parser.FUNCTION_PARSERS,JSON_AGG:n(function(){return this.expression(Et,{this:this.parseTerm(),order:this.parseOrder()})},"JSON_AGG")}}static get NO_PAREN_FUNCTIONS(){return{...a.Parser.NO_PAREN_FUNCTIONS,utcDate:Dt,utcTime:Pt,utcTimestamp:Lt}}static get CAST_COLUMN_OPERATORS(){return new Set(["colonGt","ncolonGt"])}static get COLUMN_OPERATORS(){return(()=>{let e={...a.Parser.COLUMN_OPERATORS,colonGt:function(t,r){return this.expression(m,{this:t,to:r})},ncolonGt:function(t,r){return this.expression(ct,{this:t,to:r})},dcolon:function(t,r){return h(U)([t,c.string(r.name)])},dcolondollar:function(t,r){return h(R,{jsonType:"STRING"})([t,c.string(r.name)])},dcolonpercent:function(t,r){return h(R,{jsonType:"DOUBLE"})([t,c.string(r.name)])},dcolonqmark:function(t,r){return this.expression($,{this:t,path:r?.name,fromDcolonqmark:!0})}};return delete e.arrow,delete e.darrow,delete e.hashArrow,delete e.dhashArrow,delete e.placeholder,e})()}static get SHOW_PARSERS(){return{...a.Parser.SHOW_PARSERS,AGGREGATES:i("AGGREGATES"),"CDC EXTRACTOR POOL":i("CDC EXTRACTOR POOL"),"CREATE AGGREGATE":i("CREATE AGGREGATE",{target:!0}),"CREATE PIPELINE":i("CREATE PIPELINE",{target:!0}),"CREATE PROJECTION":i("CREATE PROJECTION",{target:!0}),"DATABASE STATUS":i("DATABASE STATUS"),"DISTRIBUTED_PLANCACHE STATUS":i("DISTRIBUTED_PLANCACHE STATUS"),"FULLTEXT SERVICE METRICS LOCAL":i("FULLTEXT SERVICE METRICS LOCAL"),"FULLTEXT SERVICE METRICS FOR NODE":i("FULLTEXT SERVICE METRICS FOR NODE",{target:!0}),"FULLTEXT SERVICE STATUS":i("FULLTEXT SERVICE STATUS"),FUNCTIONS:i("FUNCTIONS"),GROUPS:i("GROUPS"),"GROUPS FOR ROLE":i("GROUPS FOR ROLE",{target:!0}),"GROUPS FOR USER":i("GROUPS FOR USER",{target:!0}),INDEXES:i("INDEX",{target:"FROM"}),KEYS:i("INDEX",{target:"FROM"}),LINKS:i("LINKS",{target:"ON"}),"LOAD ERRORS":i("LOAD ERRORS"),"LOAD WARNINGS":i("LOAD WARNINGS"),PARTITIONS:i("PARTITIONS",{target:"ON"}),PIPELINES:i("PIPELINES"),PLAN:i("PLAN",{target:!0}),PLANCACHE:i("PLANCACHE"),PROCEDURES:i("PROCEDURES"),PROJECTIONS:i("PROJECTIONS",{target:"ON TABLE"}),"REPLICATION STATUS":i("REPLICATION STATUS"),REPRODUCTION:i("REPRODUCTION"),"RESOURCE POOLS":i("RESOURCE POOLS"),ROLES:i("ROLES"),"ROLES FOR USER":i("ROLES FOR USER",{target:!0}),"ROLES FOR GROUP":i("ROLES FOR GROUP",{target:!0}),"STATUS EXTENDED":i("STATUS EXTENDED"),USERS:i("USERS"),"USERS FOR ROLE":i("USERS FOR ROLE",{target:!0}),"USERS FOR GROUP":i("USERS FOR GROUP",{target:!0})}}static get ALTER_PARSERS(){return{...a.Parser.ALTER_PARSERS,CHANGE:n(function(){return this.expression(gt,{this:this.parseColumn(),to:this.parseColumn()})},"CHANGE")}}parseVectorExpressions(e){let t=e[1].name.toUpperCase(),r=this.dialect._constructor.VECTOR_TYPE_ALIASES;return t in r&&(t=r[t]),[f.build(t,{dialect:this.dialect}),e[0]]}static get TABLE_ALIAS_TOKENS(){return new Set([...a.Parser.TABLE_ALIAS_TOKENS,"straightJoin"])}};d=y(be),E(d,10,"ID_VAR_TOKENS",Ge,T),E(d,10,"FUNCTIONS",Ue,T),E(d,10,"FUNCTION_PARSERS",Me,T),E(d,10,"NO_PAREN_FUNCTIONS",Le,T),E(d,10,"CAST_COLUMN_OPERATORS",Pe,T),E(d,10,"COLUMN_OPERATORS",De,T),E(d,10,"SHOW_PARSERS",ye,T),E(d,10,"ALTER_PARSERS",Ce,T),E(d,10,"TABLE_ALIAS_TOKENS",Ne,T),D(d,T),P(d,3,T),n(T,"SingleStoreParser");var Tt=T,we,qe,ve,ke,Fe,Je,je,Be,He,A,l=class l extends(He=a.Generator,Be=[p],je=[p],Je=[p],Fe=[p],ke=[p],ve=[p],qe=[p],we=[p],He){static get AFTER_HAVING_MODIFIER_TRANSFORMS(){let e=new Map(super.AFTER_HAVING_MODIFIER_TRANSFORMS);return["cluster","distribute","sort"].forEach(t=>e.delete(t)),e}static get NULL_ORDERING_SUPPORTED(){return"supported"}static get STRUCT_DELIMITER(){return["(",")"]}static get SUPPORTED_JSON_PATH_PARTS(){return new Set([k,F,J])}static get ORIGINAL_TRANSFORMS(){let e=new Map([...a.Generator.TRANSFORMS,[nt,function(t){return t.args.format?this.func("TO_DATE",[t.args.this,this.formatTime(t)]):this.func("DATE",[t.args.this])}],[st,function(t){return this.func("TO_TIMESTAMP",[t.args.this,this.formatTime(t)])}],[j,function(t){return this.func("TO_CHAR",[t.args.this,this.formatTime(t)])}],[rt,function(t){return this.func("STR_TO_DATE",[t.args.this,this.formatTime(t,a.INVERSE_TIME_MAPPING,a.INVERSE_TIME_TRIE)])}],[g,function(t){return this.func("DATE_FORMAT",[t.args.this,this.formatTime(t,a.INVERSE_TIME_MAPPING,a.INVERSE_TIME_TRIE)])}],[X,function(t){return o.call(this,t,"zone","expressions"),u("DATE").call(this,t)}],[m,function(t){return o.call(this,t,"format","action","default"),`${this.sql(t.args.this)} :> ${this.sql(t.args.to)}`}],[ct,function(t){return o.call(this,t,"format","action","default"),`${this.sql(t.args.this)} !:> ${this.sql(t.args.to)}`}],[Ot,function(t){return this.sql(new m({this:t.args.this,to:f.build(t.args.to?.name)}))}],[it,function(t){return o.call(this,t,"format"),u("UNIX_TIMESTAMP").call(this,t)}],[se,u("UNIX_TIMESTAMP")],[ne,u("UNIX_TIMESTAMP")],[pe,u("UNIX_TIMESTAMP")],[ce,function(t){return this.func("FROM_UNIXTIME",[t.args.this,this.formatTime(t,a.INVERSE_TIME_MAPPING,a.INVERSE_TIME_TRIE)])}],[at,function(t){return o.call(this,t,"scale","zone","hours","minutes"),this.func("FROM_UNIXTIME",[t.args.this,this.formatTime(t,a.INVERSE_TIME_MAPPING,a.INVERSE_TIME_TRIE)])}],[Ee,function(t){return`FROM_UNIXTIME(${this.sql(t.args.this)}) :> TEXT`}],[H,function(t){return o.call(this,t,"unit","zone"),this.func("TIME_BUCKET",[t.args.this,t.args.expression,t.args.origin])}],[ie,function(t){return this.sql(new m({this:t.args.this,to:f.build("date")}))}],[Rt,function(t){return this.func("CONVERT_TZ",[t.args.this,t.args.zone,"'UTC'"])}],[Ht,function(t){return`STR_TO_DATE(${this.sql(t.args.this)}, ${x.DATEINT_FORMAT})`}],[Bt,function(t){return`(DATE_FORMAT(${this.sql(t.args.this)}, ${x.DATEINT_FORMAT}) :> INT)`}],[oe,function(t){return`(DATE_FORMAT(${this.sql(t.args.this)}, ${x.DATEINT_FORMAT}) :> INT)`}],[re,function(t){return o.call(this,t,"zone"),`${this.sql(t.args.this)} :> TIME`}],[Gt,xe(Re("ADD"))],[qt,function(t){return o.call(this,t,"zone"),w().call(this,t)}],[bt,de("DATE","SUB")],[wt,q],[Ut,function(t){return o.call(this,t,"zone"),w().call(this,t)}],[Mt,function(t){return o.call(this,t,"zone"),t.args.unit!==void 0?q.call(this,t):this.func("DATEDIFF",[t.args.this,t.args.expression])}],[ae,function(t){return t.args.unit!==void 0?q.call(this,t):this.func("DATEDIFF",[t.args.this,t.args.expression])}],[jt,function(t){return o.call(this,t,"zone"),w().call(this,t)}],[Ct,function(t){return this.sql(N(new yt({this:c.number(6)}),"datetime"))}],[U,function(t){return o.call(this,t,"onlyJsonTypes","expressions","variantExtract","jsonQuery","option","quote","onCondition","requiresJson"),L("JSON_EXTRACT_JSON").call(this,t)}],[z,L("BSON_EXTRACT_BSON")],[k,fe],[J,function(t){return this.jsonPathPart(t.args.this)}],[F,()=>""],[K,function(t){return o.call(this,t,"options","isJson"),u("JSON_PRETTY").call(this,t)}],[Et,function(t){return o.call(this,t,"nullHandling","returnType","strict"),this.func("JSON_AGG",[t.args.this],{suffix:`${this.sql(t.args.order)})`})}],[V,function(t){return o.call(this,t,"nullHandling","returnType","strict"),u("JSON_BUILD_ARRAY").call(this,t)}],[Vt,function(t){return this.func("BSON_MATCH_ANY_EXISTS",[t.args.this,t.args.path])}],[$,function(t){return t.args.fromDcolonqmark?`${this.sql(t.args.this)}::?${this.sql(t.args.path)}`:this.func("JSON_MATCH_ANY_EXISTS",[t.args.this,t.args.path])}],[Y,function(t){return o.call(this,t,"nullHandling","uniqueKeys","returnType","encoding"),u("JSON_BUILD_OBJECT").call(this,t)}],[kt,function(t){return`((${this.func("DAYOFWEEK",[t.args.this])} % 7) + 1)`}],[Ft,u("DAY")],[ot,u("APPROX_COUNT_DISTINCT")],[le,u("APPROX_COUNT_DISTINCT")],[ue,ge],[_e,function(t){return`MAX(ABS(${this.sql(t.args.this)}))`}],[he,function(t){return`MIN(ABS(${this.sql(t.args.this)}))`}],[lt,function(t){return o.call(this,t,"accuracy","weight"),this.func("APPROX_PERCENTILE",[t.args.this,t.args.quantile,t.args.errorTolerance])}],[me,u("VAR_SAMP")],[pt,u("VAR_POP")],[Te,Ae],[It,function(t){return this.sql(new Kt({this:t.args.this,expression:c.number(1).div(c.number(3))}))}],[et,function(t){return this.binary(t,"RLIKE")}],[Zt,function(t){return this.func("LPAD",[c.string(""),new xt({this:this.func("LENGTH",[t.args.this]),expression:Array.isArray(t.args.times)?t.args.times[0]:t.args.times}),t.args.this])}],[Xt,function(t){return`(${this.sql(t.args.this)} RLIKE '^[\0-\x7F]*$')`}],[zt,function(t){return this.func("UNHEX",[this.func("MD5",[t.args.this])])}],[B,u("INSTR")],[tt,function(t){return o.call(this,t,"position","occurrence","group"),this.func("REGEXP_MATCH",[t.args.this,t.args.expression,t.args.parameters])}],[Q,function(t){return o.call(this,t,"group"),this.func("REGEXP_SUBSTR",[t.args.this,t.args.expression,t.args.position,t.args.occurrence,t.args.parameters])}],[Qt,function(t){return this.func("REGEXP_INSTR",[t.args.this,this.func("CONCAT",[c.string("^"),t.args.expression])])}],[te,function(t){return this.func("CONV",[t.args.this,t.args.expression,c.number(10)])}],[Wt,function(t){return this.binary(new et({this:new W({this:t.args.this}),expression:new W({this:t.args.expression})}),"RLIKE")}],[ee,function(t){return this.func("CONCAT",[this.func("SUBSTRING",[t.args.this,c.number(1),t.args.start?.sub(1)]),t.args.expression,this.func("SUBSTRING",[t.args.this,t.args.start?.add(t.args.length)])])}],[At,function(t){return this.nationalSql(t,{prefix:""})}],[Z,function(t){return o.call(this,t,"finish"),this.func("REDUCE",[t.args.initial,t.args.this,t.args.merge])}],[$t,function(t){return o.call(this,t,"modifier"),this.matchAgainstSql(t)}],[dt,function(t){return o.call(this,t,"history","terse","offset","startsWith","limit","from","scope","scopeKind","mutex","query","channel","log","types","privileges"),this.showSql(t)}],[mt,function(t){return o.call(this,t,"style","kind","expressions","partition","format"),this.describeSql(t)}]]);return e.delete(R),e.delete(Nt),e}static get UNSUPPORTED_TYPES(){return new Set(["array","aggregatefunction","simpleaggregatefunction","bigserial","bpchar","datemultirange","daterange","dynamic","hllsketch","hstore","image","inet","int128","int256","int4multirange","int4range","int8multirange","int8range","interval","ipaddress","ipprefix","ipv4","ipv6","list","map","lowcardinality","money","multilinestring","name","nested","nothing","null","nummultirange","numrange","object","range","rowversion","serial","smallserial","smallmoney","super","timetz","timestampntz","timestampltz","timestamptz","timestampNs","tsmultirange","tsrange","tstzmultirange","tstzrange","uint128","uint256","union","unknown","user-defined","uuid","variant","xml","tdigest"])}static get TYPE_MAPPING(){return new Map([...a.Generator.TYPE_MAPPING,["bigdecimal","DECIMAL"],["bit","BOOLEAN"],["date32","DATE"],["datetime64","DATETIME"],["decimal32","DECIMAL"],["decimal64","DECIMAL"],["decimal128","DECIMAL"],["decimal256","DECIMAL"],["enum8","ENUM"],["enum16","ENUM"],["fixedstring","TEXT"],["geometry","GEOGRAPHY"],["point","GEOGRAPHYPOINT"],["ring","GEOGRAPHY"],["linestring","GEOGRAPHY"],["polygon","GEOGRAPHY"],["multipolygon","GEOGRAPHY"],["struct","RECORD"],["jsonb","BSON"],["timestamp","TIMESTAMP"],["timestampS","TIMESTAMP"],["timestampMs","TIMESTAMP(6)"]])}static get RESERVED_KEYWORDS(){return new Set(["abs","absolute","access","account","acos","action","add","adddate","addtime","admin","aes_decrypt","aes_encrypt","after","against","aggregate","aggregates","aggregator","aggregator_id","aggregator_plan_hash","aggregators","algorithm","all","also","alter","always","analyse","analyze","and","anti_join","any","any_value","approx_count_distinct","approx_count_distinct_accumulate","approx_count_distinct_combine","approx_count_distinct_estimate","approx_geography_intersects","approx_percentile","arghistory","arrange","arrangement","array","as","asc","ascii","asensitive","asin","asm","assertion","assignment","ast","asymmetric","async","at","atan","atan2","attach","attribute","authorization","auto","auto_increment","auto_reprovision","autostats","autostats_cardinality_mode","autostats_enabled","autostats_histogram_mode","autostats_sampling","availability","avg","avg_row_length","avro","azure","background","_background_threads_for_cleanup","backup","backup_history","backup_id","backward","batch","batches","batch_interval","_batch_size_limit","before","begin","between","bigint","bin","binary","_binary","bit","bit_and","bit_count","bit_or","bit_xor","blob","bool","boolean","bootstrap","both","_bt","btree","bucket_count","by","byte","byte_length","cache","call","call_for_pipeline","called","capture","cascade","cascaded","case","cast","catalog","ceil","ceiling","chain","change","char","character","characteristics","character_length","char_length","charset","check","checkpoint","_check_can_connect","_check_consistency","checksum","_checksum","class","clear","client","client_found_rows","close","cluster","clustered","cnf","coalesce","coercibility","collate","collation","collect","column","columnar","columns","columnstore","columnstore_segment_rows","comment","comments","commit","committed","_commit_log_tail","compact","compile","compressed","compression","concat","concat_ws","concurrent","concurrently","condition","configuration","connection","connection_id","connections","config","constraint","constraints","content","continue","_continue_replay","conv","conversion","convert","convert_tz","copy","_core","cos","cost","cot","count","create","credentials","cross","cube","csv","cume_dist","curdate","current","current_catalog","current_date","current_role","current_schema","current_security_groups","current_security_roles","current_time","current_timestamp","current_user","cursor","curtime","cycle","data","database","databases","date","date_add","datediff","date_format","date_sub","date_trunc","datetime","day","day_hour","day_microsecond","day_minute","dayname","dayofmonth","dayofweek","dayofyear","day_second","deallocate","dec","decimal","declare","decode","default","defaults","deferrable","deferred","defined","definer","degrees","delayed","delay_key_write","delete","delimiter","delimiters","dense_rank","desc","describe","detach","deterministic","dictionary","differential","directory","disable","discard","_disconnect","disk","distinct","distinctrow","distributed_joins","div","do","document","domain","dot_product","double","drop","_drop_profile","dual","dump","duplicate","dynamic","earliest","each","echo","election","else","elseif","elt","enable","enclosed","encoding","encrypted","end","engine","engines","enum","errors","escape","escaped","estimate","euclidean_distance","event","events","except","exclude","excluding","exclusive","execute","exists","exit","exp","explain","extended","extension","external","external_host","external_port","extract","extractor","extractors","extra_join","_failover","failed_login_attempts","failure","false","family","fault","fetch","field","fields","file","files","fill","first","first_value","fix_alter","fixed","float","float4","float8","floor","flush","following","for","force","force_compiled_mode","force_interpreter_mode","foreground","foreign","format","forward","found_rows","freeze","from","from_base64","from_days","from_unixtime","fs","_fsync","full","fulltext","function","functions","gc","gcs","get_format","_gc","_gcx","generate","geography","geography_area","geography_contains","geography_distance","geography_intersects","geography_latitude","geography_length","geography_longitude","geographypoint","geography_point","geography_within_distance","geometry","geometry_area","geometry_contains","geometry_distance","geometry_filter","geometry_intersects","geometry_length","geometrypoint","geometry_point","geometry_within_distance","geometry_x","geometry_y","global","_global_version_timestamp","grant","granted","grants","greatest","group","grouping","groups","group_concat","gzip","handle","handler","hard_cpu_limit_percentage","hash","has_temp_tables","having","hdfs","header","heartbeat_no_logging","hex","highlight","high_priority","hold","holding","host","hosts","hour","hour_microsecond","hour_minute","hour_second","identified","identity","if","ifnull","ignore","ifnull","ilike","immediate","immutable","implicit","import","in","including","increment","incremental","index","indexes","inet_aton","inet_ntoa","inet6_aton","inet6_ntoa","infile","inherit","inherits","_init_profile","init","initcap","initialize","initially","inject","inline","inner","inout","input","insensitive","insert","insert_method","instance","instead","instr","int","int1","int2","int3","int4","int8","integer","_internal_dynamic_typecast","interpreter_mode","intersect","interval","into","invoker","is","isnull","isolation","iterate","join","json","json_agg","json_array_contains_double","json_array_contains_json","json_array_contains_string","json_array_push_double","json_array_push_json","json_array_push_string","json_delete_key","json_extract_double","json_extract_json","json_extract_string","json_extract_bigint","json_get_type","json_length","json_set_double","json_set_json","json_set_string","json_splice_double","json_splice_json","json_splice_string","kafka","key","key_block_size","keys","kill","killall","label","lag","language","large","last","last_day","last_insert_id","last_value","lateral","latest","lc_collate","lc_ctype","lcase","lead","leading","leaf","leakproof","least","leave","leaves","left","length","level","license","like","limit","lines","listen","llvm","ln","load","loaddata_where","_load","local","localtime","localtimestamp","locate","location","lock","log","log10","log2","long","longblob","longtext","loop","lower","low_priority","lpad","_ls","ltrim","lz4","management","_management_thread","mapping","master","match","materialized","max","maxvalue","max_concurrency","max_errors","max_partitions_per_batch","max_queue_depth","max_retries_per_batch_partition","max_rows","mbc","md5","mpl","median","mediumblob","mediumint","mediumtext","member","memory","memory_percentage","_memsql_table_id_lookup","memsql","memsql_deserialize","memsql_imitating_kafka","memsql_serialize","merge","metadata","microsecond","middleint","min","min_rows","minus","minute","minute_microsecond","minute_second","minvalue","mod","mode","model","modifies","modify","month","monthname","months_between","move","mpl","names","named","namespace","national","natural","nchar","next","no","node","none","no_query_rewrite","noparam","not","nothing","notify","now","nowait","no_write_to_binlog","norely","nth_value","ntile","null","nullcols","nullif","nulls","numeric","nvarchar","object","octet_length","of","off","offline","offset","offsets","oids","on","online","only","open","operator","optimization","optimize","optimizer","optimizer_state","option","options","optionally","or","order","ordered_serialize","orphan","out","out_of_order","outer","outfile","over","overlaps","overlay","owned","owner","pack_keys","paired","parser","parquet","partial","partition","partition_id","partitioning","partitions","passing","password","password_lock_time","pause","_pause_replay","percent_rank","percentile_cont","percentile_disc","periodic","persisted","pi","pipeline","pipelines","pivot","placing","plan","plans","plancache","plugins","pool","pools","port","position","pow","power","preceding","precision","prepare","prepared","preserve","primary","prior","privileges","procedural","procedure","procedures","process","processlist","profile","profiles","program","promote","proxy","purge","quarter","queries","query","query_timeout","queue","quote","radians","rand","range","rank","read","_read","reads","real","reassign","rebalance","recheck","record","recursive","redundancy","redundant","ref","reference","references","refresh","regexp","reindex","relative","release","reload","rely","remote","remove","rename","repair","_repair_table","repeat","repeatable","_repl","_reprovisioning","replace","replica","replicate","replicating","replication","durability","require","resource","resource_pool","reset","restart","restore","restrict","result","_resurrect","retry","return","returning","returns","reverse","revoke","rg_pool","right","right_anti_join","right_semi_join","right_straight_join","rlike","role","roles","rollback","rollup","round","routine","row","row_count","row_format","row_number","rows","rowstore","rule","rpad","_rpc","rtrim","running","s3","safe","save","savepoint","scalar","schema","schemas","schema_binding","scroll","search","second","second_microsecond","sec_to_time","security","select","semi_join","_send_threads","sensitive","separator","sequence","sequences","serial","serializable","series","service_user","server","session","session_user","set","setof","security_lists_intersect","sha","sha1","sha2","shard","sharded","sharded_id","share","show","shutdown","sigmoid","sign","signal","similar","simple","site","signed","sin","skip","skipped_batches","sleep","_sleep","smallint","snapshot","_snapshot","_snapshots","soft_cpu_limit_percentage","some","soname","sparse","spatial","spatial_check_index","specific","split","sql","sql_big_result","sql_buffer_result","sql_cache","sql_calc_found_rows","sqlexception","sql_mode","sql_no_cache","sql_no_logging","sql_small_result","sqlstate","sqlwarning","sqrt","ssl","stable","standalone","start","starting","state","statement","statistics","stats","status","std","stddev","stddev_pop","stddev_samp","stdin","stdout","stop","storage","str_to_date","straight_join","strict","string","strip","subdate","substr","substring","substring_index","success","sum","super","symmetric","sync_snapshot","sync","_sync","_sync2","_sync_partitions","_sync_snapshot","synchronize","sysid","system","table","table_checksum","tables","tablespace","tags","tan","target_size","task","temp","template","temporary","temptable","_term_bump","terminate","terminated","test","text","then","time","timediff","time_bucket","time_format","timeout","timestamp","timestampadd","timestampdiff","timezone","time_to_sec","tinyblob","tinyint","tinytext","to","to_base64","to_char","to_date","to_days","to_json","to_number","to_seconds","to_timestamp","tracelogs","traditional","trailing","transform","transaction","_transactions_experimental","treat","trigger","triggers","trim","true","trunc","truncate","trusted","two_phase","_twopcid","type","types","ucase","unbounded","uncommitted","undefined","undo","unencrypted","unenforced","unhex","unhold","unicode","union","unique","_unittest","unix_timestamp","unknown","unlisten","_unload","unlock","unlogged","unpivot","unsigned","until","update","upgrade","upper","usage","use","user","users","using","utc_date","utc_time","utc_timestamp","_utf8","vacuum","valid","validate","validator","value","values","varbinary","varchar","varcharacter","variables","variadic","variance","var_pop","var_samp","varying","vector_sub","verbose","version","view","void","volatile","voting","wait","_wake","warnings","week","weekday","weekofyear","when","where","while","whitespace","window","with","without","within","_wm_heartbeat","work","workload","wrapper","write","xact_id","xor","year","year_month","yes","zerofill","zone"])}jsonExtractScalarSql(e){let t=e.args.jsonType,r=t===void 0?"JSON_EXTRACT_JSON":`JSON_EXTRACT_${t}`;return L(r).call(this,e)}jsonbExtractScalarSql(e){let t=e.args.jsonType,r=t===void 0?"BSON_EXTRACT_BSON":`BSON_EXTRACT_${t}`;return L(r).call(this,e)}jsonExtractArraySql(e){return this.unsupported("Arrays are not supported in SingleStore"),this.functionFallbackSql(e)}jsonValueSql(e){o.call(this,e,"onCondition");let t=new R({this:e.args.this,expression:e.args.path,jsonType:"STRING"}),r=e.args.returning;return r!==void 0&&(t=new m({this:t,to:r})),this.sql(t)}allSql(e){return this.unsupported("ALL subquery predicate is not supported in SingleStore"),super.allSql(e)}jsonArrayContainsSql(e){let t=e.text("jsonType").toUpperCase();return t?this.func(`JSON_ARRAY_CONTAINS_${t}`,[e.args.expression,e.args.this]):this.func("JSON_ARRAY_CONTAINS_JSON",[e.args.expression,this.func("TO_JSON",[e.args.this])])}dataTypeSql(e){if(o.call(this,e,"kind","values"),e.args.nested&&!e.isType("struct")&&this.unsupported(`Argument 'nested' is not supported for representation of '${e.args.this}' in SingleStore`),e.isType("varbinary")&&!e.args.expressions?.length)return"BLOB";if(e.isType(["decimal32","decimal64","decimal128","decimal256"])){let t=this.expressions(e,{flat:!0}),r;return e.isType("decimal32")?r="9":e.isType("decimal64")?r="18":e.isType("decimal128")?r="38":r="65",t?`DECIMAL(${r}, ${t[0]})`:`DECIMAL(${r})`}if(e.isType("vector")){let t=e.args.expressions||[];if(t.length===2){let r=this.sql(t[0]),I=this.dialect.constructor.INVERSE_VECTOR_TYPE_ALIASES;return r in I&&(r=I[r]),`VECTOR(${this.sql(t[1])}, ${r})`}}return super.dataTypeSql(e)}collateSql(e){return this.binary(e,":> LONGTEXT COLLATE")}currentDateSql(e){let t=e.args.this;if(t){if(t instanceof c&&t.args.this?.toLowerCase()==="utc")return this.func("UTC_DATE",[]);this.unsupported("CurrentDate with timezone is not supported in SingleStore")}return this.func("CURRENT_DATE",[])}currentTimeSql(e){let t=e.args.this;if(t){if(t instanceof c&&t.args.this?.toLowerCase()==="utc")return this.func("UTC_TIME",[]);if(t instanceof c&&t.isNumber)return this.func("CURRENT_TIME",[t]);this.unsupported("CurrentTime with timezone is not supported in SingleStore")}return this.func("CURRENT_TIME",[])}currentTimestampSql(e){let t=e.args.this;if(t){if(t instanceof c&&t.args.this?.toLowerCase()==="utc")return this.func("UTC_TIMESTAMP",[]);if(t instanceof c&&t.isNumber)return this.func("CURRENT_TIMESTAMP",[t]);this.unsupported("CurrentTimestamp with timezone is not supported in SingleStore")}return this.func("CURRENT_TIMESTAMP",[])}standardHashSql(e){let t=e.args.expression;if(t===void 0)return this.func("SHA",[e.args.this]);if(t instanceof c){let r=t.args.this?.toLowerCase();return r==="sha"?this.func("SHA",[e.args.this]):r==="md5"?this.func("MD5",[e.args.this]):(this.unsupported(`${t.args.this} hash method is not supported in SingleStore`),this.func("SHA",[e.args.this]))}return this.unsupported("STANDARD_HASH function is not supported in SingleStore"),this.func("SHA",[e.args.this])}truncateTableSql(e){o.call(this,e,"isDatabase","exists","cluster","identity","option","partition");let t=[];for(let r of e.args.expressions??[])t.push(`TRUNCATE ${this.sql(r)}`);return t.join("; ")}renameColumnSql(e){o.call(this,e,"exists");let t=this.sql(e,"this"),r=this.sql(e,"to");return`CHANGE ${t} ${r}`}alterColumnSql(e){o.call(this,e,"drop","comment","allowNull","visible","using");let t=super.alterColumnSql(e),r=this.sql(e,"collate"),I=r?` COLLATE ${r}`:"";return`${t}${I}`}computedColumnConstraintSql(e){let t=this.sql(e,"this"),r=e.args.notNull?" NOT NULL":"",I=this.sql(e,"dataType")||"AUTO";return`AS ${t} PERSISTED ${I}${r}`}};A=y(He),E(A,10,"AFTER_HAVING_MODIFIER_TRANSFORMS",Be,l),E(A,10,"NULL_ORDERING_SUPPORTED",je,l),E(A,10,"STRUCT_DELIMITER",Je,l),E(A,10,"SUPPORTED_JSON_PATH_PARTS",Fe,l),E(A,10,"ORIGINAL_TRANSFORMS",ke,l),E(A,10,"UNSUPPORTED_TYPES",ve,l),E(A,10,"TYPE_MAPPING",qe,l),E(A,10,"RESERVED_KEYWORDS",we,l),D(A,l),P(A,3,l),n(l,"SingleStoreGenerator"),l.SUPPORTS_DECODE_CASE=!1,l.TRY_SUPPORTED=!1,l.SUPPORTS_UESCAPE=!1,l.MATCH_AGAINST_TABLE_PREFIX="TABLE ",l.UNICODE_SUBSTITUTE=n((e,t)=>String.fromCharCode(parseInt(t,16)),"UNICODE_SUBSTITUTE");var _t=l,Xe,Ye,Ve,$e,M,_=class _ extends($e=a,Ve=[p],Ye=[p],Xe=[p],$e){static get TIME_MAPPING(){return{D:"%u",DD:"%d",DY:"%a",HH:"%I",HH12:"%I",HH24:"%H",MI:"%M",MM:"%m",MON:"%b",MONTH:"%B",SS:"%S",RR:"%y",YY:"%y",YYYY:"%Y",FF6:"%f"}}static get VECTOR_TYPE_ALIASES(){return{I8:"TINYINT",I16:"SMALLINT",I32:"INT",I64:"BIGINT",F32:"FLOAT",F64:"DOUBLE"}}static get INVERSE_VECTOR_TYPE_ALIASES(){return Object.fromEntries(Object.entries(_.VECTOR_TYPE_ALIASES).map(([e,t])=>[t,e]))}};M=y($e),E(M,10,"TIME_MAPPING",Ve,_),E(M,10,"VECTOR_TYPE_ALIASES",Ye,_),E(M,10,"INVERSE_VECTOR_TYPE_ALIASES",Xe,_),D(M,_),P(M,3,_),n(_,"SingleStore"),_.DIALECT_NAME="singlestore",_.SUPPORTS_ORDER_BY_ALL=!0,_.Tokenizer=ut,_.Parser=Tt,_.Generator=_t;var x=_;export{x as SingleStore};
|
|
2
2
|
//# sourceMappingURL=singlestore.js.map
|