lambdaorm
Version:
1 lines • 6.77 kB
JavaScript
'use strict';const a14l=a14y;(function(s,y){const p=a14y,g=s();while(!![]){try{const x=parseInt(p(0x15d))/0x1+parseInt(p(0x13d))/0x2+-parseInt(p(0x130))/0x3+-parseInt(p(0x157))/0x4+parseInt(p(0x162))/0x5*(-parseInt(p(0x137))/0x6)+parseInt(p(0x149))/0x7*(-parseInt(p(0x143))/0x8)+parseInt(p(0x12e))/0x9;if(x===y)break;else g['push'](g['shift']());}catch(m){g['push'](g['shift']());}}}(a14s,0xf0803));function a14s(){const sm=['\x20error:\x20','Primitive','name','./base/connectionPool','inTransaction','84kEDnGv','merge','getFieldIds','any','rollback','cnx','2668792IvnKaQ','ConnectionPoolAdapter','value','pool','release','columnType','16iHuyHm','executeDDL','resultToRows','typ3s','type','delete','4943351fNyAmF','sentence','dataToParameters','insertId','throw','upsert','execute','affectedRows','createPool','length','then','string','commit','Method\x20not\x20implemented.','32024lJxQXj','done','query','_execute','sentence:\x20','next','1708196GUGULv','MySqlConnectionAdapter','bulkInsert','insertConditional','beginTransaction','627110YQeKcH','end','getConnection','lib','init','assign','isArray','entity','config','15563115GScNca','push','1831308wBvEFs','select'];a14s=function(){return sm;};return a14s();}var __awaiter=this&&this['__awaiter']||function(s,y,P,g){function x(m){return m instanceof P?m:new P(function(w){w(m);});}return new(P||(P=Promise))(function(m,w){const b=a14y;function t(c){const f=a14y;try{a(g[f(0x15c)](c));}catch(k){w(k);}}function v(c){const q=a14y;try{a(g[q(0x14d)](c));}catch(k){w(k);}}function a(c){const j=a14y;c[j(0x158)]?m(c[j(0x13f)]):x(c[j(0x13f)])[j(0x153)](t,v);}a((g=g['apply'](s,y||[]))[b(0x15c)]());});};function a14y(s,y){const O=a14s();return a14y=function(D,g){D=D-0x12a;let M=O[D];return M;},a14y(s,y);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['MySqlConnectionAdapter']=exports['MySQLConnectionPoolAdapter']=void 0x0;const typ3s_1=require(a14l(0x146)),connectionPool_1=require(a14l(0x135)),connection_1=require('./base/connection'),DECIMAL=0x0,TINY=0x1,LONG=0x3,FLOAT=0x4,DOUBLE=0x5,TIMESTAMP=0x7,LONGLONG=0x8,INT24=0x9,DATE=0xa,TIME=0xb,DATETIME=0xc,NEWDATE=0xe,BIT=0x10,NEWDECIMAL=0xf6;class MySQLConnectionPoolAdapter extends connectionPool_1[a14l(0x13e)]{constructor(s,y){const u=a14l;super(s,y),!MySQLConnectionPoolAdapter[u(0x165)]&&(MySQLConnectionPoolAdapter[u(0x165)]=require('mysql2/promise'));}[a14l(0x166)](){return __awaiter(this,void 0x0,void 0x0,function*(){const n=a14y,s={'typeCast':function(y,g){const e=a14y;if(y[e(0x147)]==='DECIMAL'){const x=y[e(0x154)]();return x===null?null:Number(x);}return g();}};this['pool']=MySQLConnectionPoolAdapter[n(0x165)][n(0x151)](Object[n(0x12a)](Object[n(0x12a)]({},this[n(0x12d)]['connection']),s));});}['create'](s){return __awaiter(this,void 0x0,void 0x0,function*(){const h=a14y;this[h(0x140)]===undefined&&(yield this[h(0x166)]());const y=yield this[h(0x140)][h(0x164)]();return new MySqlConnectionAdapter(s,y,this,this['helper']);});}[a14l(0x163)](){const s0=a14l,s=Object['create'](null,{'end':{'get':()=>super[s0(0x163)]}});return __awaiter(this,void 0x0,void 0x0,function*(){const s1=s0;s[s1(0x163)]['call'](this),this[s1(0x140)]!==undefined&&this[s1(0x140)][s1(0x163)]();});}}exports['MySQLConnectionPoolAdapter']=MySQLConnectionPoolAdapter;class MySqlConnectionAdapter extends connection_1['ConnectionAdapter']{[a14l(0x163)](){return __awaiter(this,void 0x0,void 0x0,function*(){const s2=a14y;yield this[s2(0x13c)][s2(0x141)]();});}[a14l(0x160)](s,y,g,x){throw new Error('Method\x20not\x20implemented.');}[a14l(0x14e)](s,y,g,x){const s3=a14l;throw new Error(s3(0x156));}[a14l(0x138)](s,y,g,x){const s4=a14l;throw new Error(s4(0x156));}['bulkMerge'](s,y,g,x){throw new Error('Method\x20not\x20implemented.');}[a14l(0x131)](s,y,g,x){return __awaiter(this,void 0x0,void 0x0,function*(){const s5=a14y;return this[s5(0x15a)](s,y,g,x);});}['insert'](s,y,g,x){return __awaiter(this,void 0x0,void 0x0,function*(){const s6=a14y,m=yield this['_execute'](s,y,g,x);return m[s6(0x14c)];});}[a14l(0x15f)](s,y,g,x){return __awaiter(this,void 0x0,void 0x0,function*(){const s7=a14y;try{const m=s[s7(0x139)](g[s7(0x12c)]),w=m&&m[s7(0x152)]===0x1?m[0x0]:null;if(!x||x['length']===0x0)return[];const t=this['arrayToRows'](s,y,g,x),v=yield this[s7(0x13c)]['query'](g['sentence'],[t]);if(w===null||w===void 0x0?void 0x0:w['autoIncrement']){const a=v[0x0][s7(0x14c)],c=v[0x0][s7(0x14c)]+(v[0x0][s7(0x150)]-0x1),k=[];for(let r=a;r<=c;r++)k[s7(0x12f)](r);return k;}else{const z=[];if(w)for(const d of x){z[s7(0x12f)](d[w[s7(0x134)]]);}return z;}}catch(o){throw new Error(s7(0x15b)+g[s7(0x14a)]+s7(0x132)+o['message']);}});}['update'](s,y,g,x){return __awaiter(this,void 0x0,void 0x0,function*(){const s8=a14y,m=yield this[s8(0x15a)](s,y,g,x);return m[s8(0x150)];});}[a14l(0x148)](s,y,g,x){return __awaiter(this,void 0x0,void 0x0,function*(){const s9=a14y,m=yield this[s9(0x15a)](s,y,g,x);return m[s9(0x150)];});}[a14l(0x14f)](s){return __awaiter(this,void 0x0,void 0x0,function*(){const ss=a14y;return this[ss(0x13c)][ss(0x159)](s['sentence']);});}[a14l(0x144)](s){return __awaiter(this,void 0x0,void 0x0,function*(){const sy=a14y;return this[sy(0x13c)][sy(0x159)](s[sy(0x14a)]);});}['executeSentence'](s){return __awaiter(this,void 0x0,void 0x0,function*(){const sO=a14y;return this['cnx'][sO(0x159)](s);});}[a14l(0x161)](){return __awaiter(this,void 0x0,void 0x0,function*(){const sD=a14y;yield this[sD(0x13c)][sD(0x161)](),this['inTransaction']=!![];});}[a14l(0x155)](){return __awaiter(this,void 0x0,void 0x0,function*(){const sg=a14y;yield this[sg(0x13c)][sg(0x155)](),this[sg(0x136)]=![];});}[a14l(0x13b)](){return __awaiter(this,void 0x0,void 0x0,function*(){const sM=a14y;yield this['cnx'][sM(0x13b)](),this[sM(0x136)]=![];});}[a14l(0x15a)](s,y,g,x){return __awaiter(this,void 0x0,void 0x0,function*(){const sE=a14y;let m=!![];const w=[],t=this[sE(0x14b)](s,y,g,x);for(const a of t){if(typ3s_1['Type']['isList'](a[sE(0x147)])||a[sE(0x147)]===typ3s_1[sE(0x133)][sE(0x13a)]&&Array[sE(0x12b)](a[sE(0x13f)])){m=![];break;}}for(const c of t){w['push'](c[sE(0x13f)]);}const v=m?yield this[sE(0x13c)][sE(0x14f)](g[sE(0x14a)],w):yield this['cnx']['query'](g['sentence'],w);return!Array['isArray'](v[0x0])?v[0x0]:this[sE(0x145)](v);});}['resultToRows'](s){const sx=a14l,y=s[0x0],g=s[0x1];for(const x of y){for(const m of g){const w=x[m['name']];if(w!==null)switch(m[sx(0x142)]){case TINY:x[m[sx(0x134)]]=w===0x1;break;case DECIMAL:case LONG:case FLOAT:case DOUBLE:case LONGLONG:case INT24:case NEWDECIMAL:x[m[sx(0x134)]]=Number(w);break;case TIME:x[m['name']]=w;break;case DATE:case NEWDATE:case DATETIME:case TIMESTAMP:x[m[sx(0x134)]]=new Date(w);break;case BIT:x[m[sx(0x134)]]=Boolean(w);break;}}}return y;}}exports[a14l(0x15e)]=MySqlConnectionAdapter;