text: "use strict";var a=Object.defineProperty;var n=(r,s)=>a(r,"name",{value:s,configurable:!0});const b=require("wkx"),L=require("lodash"),I=require("moment-timezone");module.exports=r=>{r.ABSTRACT.prototype.dialectTypes="https://mariadb.com/kb/en/library/resultset/#field-types",r.DATE.types.mariadb=["DATETIME"],r.STRING.types.mariadb=["VAR_STRING"],r.CHAR.types.mariadb=["STRING"],r.TEXT.types.mariadb=["BLOB"],r.TINYINT.types.mariadb=["TINY"],r.SMALLINT.types.mariadb=["SHORT"],r.MEDIUMINT.types.mariadb=["INT24"],r.INTEGER.types.mariadb=["LONG"],r.BIGINT.types.mariadb=["LONGLONG"],r.FLOAT.types.mariadb=["FLOAT"],r.TIME.types.mariadb=["TIME"],r.DATEONLY.types.mariadb=["DATE"],r.BOOLEAN.types.mariadb=["TINY"],r.BLOB.types.mariadb=["TINYBLOB","BLOB","LONGBLOB"],r.DECIMAL.types.mariadb=["NEWDECIMAL"],r.UUID.types.mariadb=!1,r.ENUM.types.mariadb=!1,r.REAL.types.mariadb=["DOUBLE"],r.DOUBLE.types.mariadb=["DOUBLE"],r.GEOMETRY.types.mariadb=["GEOMETRY"],r.JSON.types.mariadb=["JSON"];class s extends r.DECIMAL{toSql(){let t=super.toSql();return this._unsigned&&(t+=" UNSIGNED"),this._zerofill&&(t+=" ZEROFILL"),t}}n(s,"DECIMAL");class m extends r.DATE{toSql(){return this._length?`DATETIME(${this._length})`:"DATETIME"}_stringify(t,i){return t=this._applyTimezone(t,i),t.format("YYYY-MM-DD HH:mm:ss.SSS")}static parse(t,i){return t=t.string(),t===null||(I.tz.zone(i.timezone)?t=I.tz(t,i.timezone).toDate():t=new Date(`${t} ${i.timezone}`)),t}}n(m,"DATE");class E extends r.DATEONLY{static parse(t){return t.string()}}n(E,"DATEONLY");class N extends r.UUID{toSql(){return"CHAR(36) BINARY"}}n(N,"UUID");class d extends r.GEOMETRY{constructor(t,i){super(t,i);L.isEmpty(this.type)?this.sqlType=this.key:this.sqlType=this.type}static parse(t){return t=t.buffer(),!t||t.length===0?null:(t=t.slice(4),b.Geometry.parse(t).toGeoJSON({shortCrs:!0}))}toSql(){return this.sqlType}}n(d,"GEOMETRY");class o extends r.ENUM{toSql(t){return`ENUM(${this.values.map(i=>t.escape(i)).join(", ")})`}}n(o,"ENUM");class O extends r.JSON{_stringify(t,i){return i.operation==="where"&&typeof t=="string"?t:JSON.stringify(t)}}return n(O,"JSONTYPE"),{ENUM:o,DATE:m,DATEONLY:E,UUID:N,GEOMETRY:d,DECIMAL:s,JSON:O}};
  //# sourceMappingURL=data-types.js.map
  