UNPKG

lambdaorm

Version:
1 lines 5.76 kB
'use strict';const a17G=a17y;(function(s,y){const o=a17y,g=s();while(!![]){try{const x=-parseInt(o(0x1d7))/0x1*(-parseInt(o(0x1b4))/0x2)+-parseInt(o(0x1be))/0x3*(parseInt(o(0x1a8))/0x4)+-parseInt(o(0x1ba))/0x5+-parseInt(o(0x1d4))/0x6*(parseInt(o(0x1a3))/0x7)+-parseInt(o(0x1c9))/0x8+parseInt(o(0x1a1))/0x9*(parseInt(o(0x1ce))/0xa)+parseInt(o(0x1a0))/0xb*(parseInt(o(0x19d))/0xc);if(x===y)break;else g['push'](g['shift']());}catch(m){g['push'](g['shift']());}}}(a17s,0x2409a));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 j=a17y;function t(c){const p=a17y;try{a(g[p(0x1b5)](c));}catch(k){w(k);}}function v(c){const f=a17y;try{a(g[f(0x1b8)](c));}catch(k){w(k);}}function a(c){const q=a17y;c[q(0x1b2)]?m(c['value']):x(c[q(0x1a5)])[q(0x1b9)](t,v);}a((g=g['apply'](s,y||[]))[j(0x1b5)]());});};Object[a17G(0x1a9)](exports,a17G(0x1b1),{'value':!![]}),exports[a17G(0x1bd)]=exports['SQLjsConnectionPoolAdapter']=void 0x0;const connectionPool_1=require(a17G(0x1d6)),connection_1=require('./base/connection');class SQLjsConnectionPoolAdapter extends connectionPool_1[a17G(0x1d2)]{constructor(s,y){const b=a17G;super(s,y),!SQLjsConnectionPoolAdapter[b(0x19f)]&&(SQLjsConnectionPoolAdapter[b(0x19f)]=require(b(0x1bf)));}[a17G(0x1ad)](){return __awaiter(this,void 0x0,void 0x0,function*(){const l=a17y,s=this,y=yield this['helper']['fs']['read'](s[l(0x1d1)][l(0x1b0)]);this['db']=yield new Promise((g,x)=>{const u=l;SQLjsConnectionPoolAdapter[u(0x19f)][u(0x1b9)](function(SQL){const e=u;try{const m=new SQL[(e(0x1d0))](y);g(m);}catch(w){x(w);}});});});}[a17G(0x19e)](s){return __awaiter(this,void 0x0,void 0x0,function*(){const n=a17y;return new SQLjsConnectionAdapter(s,null,this,this[n(0x1cb)]);});}[a17G(0x1b7)](){const h=a17G,s=Object[h(0x19e)](null,{'end':{'get':()=>super[h(0x1b7)]}});return __awaiter(this,void 0x0,void 0x0,function*(){const s0=h;yield s[s0(0x1b7)][s0(0x1c0)](this);const y=this['db'][s0(0x1a2)]();yield this[s0(0x1cb)]['fs'][s0(0x1bc)](this['config']['connection'],y);});}}function a17s(){const sM=['end','throw','then','990175baKrxj','cnx','write','SQLjsConnectionAdapter','375288loDCzU','sql.js','call','inTransaction','insertId','_query','merge','bulkInsert','dataToParameters','sentence:\x20','push','651960laEZGy','query','helper','sentence','bulkMerge','20NGcbcW','arrayToRows','Database','config','ConnectionPoolAdapter','_execute','161574uadwZt','affectedRows','./base/connectionPool','23EyAusc','length','execute','update','1080YSvVdb','create','lib','33286DGTynb','566235sDCIIm','export','21olkLsp','\x20error:\x20','value','Method\x20not\x20implemented.','delete','4NCdMxO','defineProperty','run','message','commit','init','insert','columns','connection','__esModule','done','SQLjsConnectionPoolAdapter','20422ZtkqEp','next','values'];a17s=function(){return sM;};return a17s();}exports[a17G(0x1b3)]=SQLjsConnectionPoolAdapter;function a17y(s,y){const O=a17s();return a17y=function(D,g){D=D-0x19b;let M=O[D];return M;},a17y(s,y);}class SQLjsConnectionAdapter extends connection_1['ConnectionAdapter']{[a17G(0x1b7)](){return __awaiter(this,void 0x0,void 0x0,function*(){});}['insertConditional'](s,y,g,x){const s1=a17G;throw new Error(s1(0x1a6));}['upsert'](s,y,g,x){const s2=a17G;throw new Error(s2(0x1a6));}[a17G(0x1c4)](s,y,g,x){throw new Error('Method\x20not\x20implemented.');}[a17G(0x1cd)](s,y,g,x){const s3=a17G;throw new Error(s3(0x1a6));}['select'](s,y,g,x){return __awaiter(this,void 0x0,void 0x0,function*(){const s4=a17y;return this[s4(0x1d3)](s,y,g,x);});}[a17G(0x1ae)](s,y,g,x){return __awaiter(this,void 0x0,void 0x0,function*(){const s5=a17y,m=yield this[s5(0x1d3)](s,y,g,x);return m;});}[a17G(0x1c5)](s,y,g,x){return __awaiter(this,void 0x0,void 0x0,function*(){const s6=a17y,m=g[s6(0x1cc)];try{if(!x||x[s6(0x1d8)]===0x0)return[];const w=this[s6(0x1cf)](s,y,g,x),t=yield this['cnx'][s6(0x1ca)](m,[w]),v=t[0x0][s6(0x1c2)],a=t[0x0][s6(0x1c2)]+(t[0x0][s6(0x1d5)]-0x1),c=[];for(let k=v;k<=a;k++)c[s6(0x1c8)](k);return c;}catch(r){throw new Error(s6(0x1c7)+m+s6(0x1a4)+r[s6(0x1ab)]);}});}[a17G(0x19c)](s,y,g,x){return __awaiter(this,void 0x0,void 0x0,function*(){const s7=a17y;return this[s7(0x1d3)](s,y,g,x);});}[a17G(0x1a7)](s,y,g,x){return __awaiter(this,void 0x0,void 0x0,function*(){const s8=a17y;return this[s8(0x1d3)](s,y,g,x);});}[a17G(0x19b)](s){return __awaiter(this,void 0x0,void 0x0,function*(){const s9=a17y;return this[s9(0x1bb)][s9(0x1c3)](s);});}['executeDDL'](s){return __awaiter(this,void 0x0,void 0x0,function*(){const ss=a17y;return this[ss(0x1bb)]['db'][ss(0x1aa)](s[ss(0x1cc)]);});}['executeSentence'](s){return __awaiter(this,void 0x0,void 0x0,function*(){const sy=a17y;return this[sy(0x1bb)]['db']['run'](s);});}['beginTransaction'](){return __awaiter(this,void 0x0,void 0x0,function*(){const sO=a17y;this[sO(0x1c1)]=!![];});}[a17G(0x1ac)](){return __awaiter(this,void 0x0,void 0x0,function*(){this['inTransaction']=![];});}['rollback'](){return __awaiter(this,void 0x0,void 0x0,function*(){this['inTransaction']=![];});}[a17G(0x1d3)](s,y,g,x){return __awaiter(this,void 0x0,void 0x0,function*(){const sD=a17y,m=g['sentence'],w=this[sD(0x1c6)](s,y,g,x),t=[];for(const v of w){t[sD(0x1c8)](v[sD(0x1a5)]);}return this[sD(0x1bb)]['db'][sD(0x1aa)](m,t);});}[a17G(0x1c3)](s,y,g,x){return __awaiter(this,void 0x0,void 0x0,function*(){const sg=a17y,m=g['sentence'],w=this[sg(0x1c6)](s,y,g,x),t=[];for(const k of w){t[sg(0x1c8)](k[sg(0x1a5)]);}const v=this['cnx']['db']['run'](m,t),a=[],c=v[sg(0x1af)];for(const r of v[sg(0x1b6)]){const z={};for(let d=0x0;d<c[sg(0x1d8)];d++){const i=c[d];z[i]=r[d];}a['push'](z);}return a;});}}exports['SQLjsConnectionAdapter']=SQLjsConnectionAdapter;