lambdaorm
Version:
1 lines • 8.3 kB
JavaScript
'use strict';const a16p=a16y;(function(s,y){const o=a16y,g=s();while(!![]){try{const x=-parseInt(o(0x205))/0x1*(-parseInt(o(0x1f5))/0x2)+parseInt(o(0x1eb))/0x3*(parseInt(o(0x207))/0x4)+parseInt(o(0x1fa))/0x5*(-parseInt(o(0x1e6))/0x6)+-parseInt(o(0x1fc))/0x7+-parseInt(o(0x1f8))/0x8+-parseInt(o(0x1fe))/0x9*(parseInt(o(0x206))/0xa)+parseInt(o(0x1e9))/0xb;if(x===y)break;else g['push'](g['shift']());}catch(m){g['push'](g['shift']());}}}(a16s,0xc046e));var __awaiter=this&&this[a16p(0x1d6)]||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=a16y;function t(c){const f=a16y;try{a(g[f(0x20b)](c));}catch(k){w(k);}}function v(c){const q=a16y;try{a(g[q(0x1c2)](c));}catch(k){w(k);}}function a(c){const j=a16y;c['done']?m(c['value']):x(c[j(0x201)])[j(0x1cf)](t,v);}a((g=g[b(0x1d1)](s,y||[]))['next']());});};Object['defineProperty'](exports,a16p(0x1e8),{'value':!![]}),exports[a16p(0x1bf)]=exports['PostgreSQLConnectionPoolAdapter']=void 0x0;const connectionPool_1=require('./base/connectionPool'),connection_1=require(a16p(0x1d4)),typ3s_1=require(a16p(0x1d0)),lambdaorm_base_1=require(a16p(0x1b1));class PostgreSQLConnectionPoolAdapter extends connectionPool_1[a16p(0x1b2)]{constructor(s,y){const l=a16p;super(s,y);if(!PostgreSQLConnectionPoolAdapter['lib']){const g=require('pg');g['types']['setTypeParser'](g[l(0x1f4)][l(0x1fd)][l(0x1bb)],x=>{return parseInt(x);}),g[l(0x1f4)][l(0x1ff)](g[l(0x1f4)][l(0x1fd)][l(0x1b6)],x=>{return parseInt(x);}),g[l(0x1f4)][l(0x1ff)](g[l(0x1f4)]['builtins']['INT8'],x=>{return parseInt(x);}),g[l(0x1f4)]['setTypeParser'](g[l(0x1f4)][l(0x1fd)]['FLOAT4'],x=>{return parseFloat(x);}),g[l(0x1f4)][l(0x1ff)](g[l(0x1f4)]['builtins']['FLOAT8'],x=>{return parseFloat(x);}),g[l(0x1f4)]['setTypeParser'](g[l(0x1f4)][l(0x1fd)]['NUMERIC'],x=>{return parseFloat(x);}),g[l(0x1f4)]['setTypeParser'](g['types']['builtins'][l(0x1b8)],x=>{return parseFloat(x);}),PostgreSQLConnectionPoolAdapter[l(0x1ce)]=g;}}[a16p(0x1f7)](){return __awaiter(this,void 0x0,void 0x0,function*(){const u=a16y;yield this[u(0x1f3)][u(0x204)]['log'](u(0x1c6));});}[a16p(0x1da)](s){return __awaiter(this,void 0x0,void 0x0,function*(){const e=a16y,y=new PostgreSQLConnectionPoolAdapter[(e(0x1ce))][(e(0x1e0))](this[e(0x1e5)][e(0x1ca)]);return y[e(0x1bd)](),new PostgreSQLConnectionAdapter(s,y,this,this[e(0x1f3)]);});}}exports[a16p(0x1d5)]=PostgreSQLConnectionPoolAdapter;function a16s(){const sg=['name','::INTEGER[])))','inTransaction','lambdaorm-base','ConnectionPoolAdapter','parameters','bulkMerge','update','INT4','insert','MONEY','getFieldIds','Method\x20not\x20implemented.','INT2','LogLevel','connect','writeDateTime','PostgreSQLConnectionAdapter','upsert','ERROR','throw','rows','select','string','PostgreSQL\x20init\x20pool\x20not\x20Implemented','rowCount','commit','\x20AS\x20\x22','connection','length','rollback','true','lib','then','typ3s','apply','executeSentence','escape','./base/connection','PostgreSQLConnectionPoolAdapter','__awaiter','Primitive','log','RETURNING\x20','create','bigint','writeDate','arrayToRows','date','type','Client','(SELECT(UNNEST($','delete','insertConditional','query','config','6wuJnTK','getItemValue','__esModule','14683394IUhFdf','sentence','479052BDhLqV','ROLLBACK','push','_execute','time','BEGIN','any','boolean','helper','types','10PUZjCw','::VARCHAR[])))','init','9058536bljkcn','cnx','2091435qFjqQG','replace','6014113ZKTIsp','builtins','9441jhoBHb','setTypeParser','isList','value','str','join','logger','307478vqRjQi','2990BQpGem','16TWeqKB','executeDDL','dataToParameters','Type','next'];a16s=function(){return sg;};return a16s();}function a16y(s,y){const O=a16s();return a16y=function(D,g){D=D-0x1ae;let M=O[D];return M;},a16y(s,y);}class PostgreSQLConnectionAdapter extends connection_1['ConnectionAdapter']{[a16p(0x1e3)](s,y,g,x){const n=a16p;throw new Error(n(0x1ba));}[a16p(0x1c0)](s,y,g,x){const h=a16p;throw new Error(h(0x1ba));}['merge'](s,y,g,x){throw new Error('Method\x20not\x20implemented.');}[a16p(0x1b4)](s,y,g,x){throw new Error('Method\x20not\x20implemented.');}[a16p(0x1c4)](s,y,g,x){return __awaiter(this,void 0x0,void 0x0,function*(){const s0=a16y,m=yield this[s0(0x1ee)](s,y,g,x);return m[s0(0x1c3)];});}[a16p(0x1b7)](s,y,g,x){return __awaiter(this,void 0x0,void 0x0,function*(){const s1=a16y;try{const m=yield this[s1(0x1ee)](s,y,g,x);return m[s1(0x1c3)][s1(0x1cb)]>0x0?m[s1(0x1c3)][0x0]['id']:null;}catch(w){yield this[s1(0x1f3)]['logger'][s1(0x1d8)](w,lambdaorm_base_1[s1(0x1bc)][s1(0x1c1)]);throw w;}});}['bulkInsert'](s,y,g,x){return __awaiter(this,void 0x0,void 0x0,function*(){const s2=a16y,m=s[s2(0x1b9)](g['entity']),w=m&&m[s2(0x1cb)]===0x1?m[0x0]:null,t=g[s2(0x1ea)];let v='';try{const a=this[s2(0x1dd)](s,y,g,x),c=w?s2(0x1d9)+w['mapping']+s2(0x1c9)+w[s2(0x1ae)]+'\x22':'';v=t+'\x20'+a[s2(0x203)](',')+'\x20'+c+';';const k=yield this['cnx'][s2(0x1e4)](v),r=[];if(w)for(const z in k[s2(0x1c3)]){const d=k['rows'][z][w[s2(0x1ae)]];r[s2(0x1ed)](d);}return r;}catch(i){yield this[s2(0x1f3)][s2(0x204)][s2(0x1d8)](v,lambdaorm_base_1[s2(0x1bc)][s2(0x1c1)]);throw i;}});}[a16p(0x1dd)](s,y,g,x){const s3=a16p,m=[];for(const w of x){const t=[];for(const v of g[s3(0x1b3)]){const a=this['getItemValue'](s,y,w,v);t[s3(0x1ed)](a);}m[s3(0x1ed)]('('+t[s3(0x203)](',')+')');}return m;}[a16p(0x1e7)](s,y,g,x){const s4=a16p;let m=g[x[s4(0x1ae)]];if(m==null||m===undefined)m='null';else switch(x[s4(0x1df)]){case typ3s_1['Primitive'][s4(0x1f2)]:m=m?s4(0x1cd):'false';break;case typ3s_1['Primitive'][s4(0x1c5)]:m['includes']('\x27')?m='\x27'+this[s4(0x1f3)]['str']['replace'](m,'\x27','\x27\x27')+'\x27':m='\x27'+m+'\x27';break;case typ3s_1[s4(0x1d7)]['dateTime']:m=this['helper'][s4(0x1e4)][s4(0x1d3)](this[s4(0x1be)](m,s,y));break;case typ3s_1[s4(0x1d7)][s4(0x1de)]:m=this['helper'][s4(0x1e4)][s4(0x1d3)](this[s4(0x1dc)](m,s,y));break;case typ3s_1[s4(0x1d7)][s4(0x1ef)]:m=this[s4(0x1f3)][s4(0x1e4)][s4(0x1d3)](this['writeTime'](m,s,y));break;}return m;}[a16p(0x1b5)](s,y,g,x){return __awaiter(this,void 0x0,void 0x0,function*(){const s5=a16y,m=yield this[s5(0x1ee)](s,y,g,x);return m[s5(0x1c7)];});}[a16p(0x1e2)](s,y,g,x){return __awaiter(this,void 0x0,void 0x0,function*(){const s6=a16y,m=yield this[s6(0x1ee)](s,y,g,x);return m[s6(0x1c7)];});}['execute'](s){return __awaiter(this,void 0x0,void 0x0,function*(){const s7=a16y;return this[s7(0x1f9)][s7(0x1e4)](s[s7(0x1ea)]);});}[a16p(0x208)](s){return __awaiter(this,void 0x0,void 0x0,function*(){const s8=a16y;return this[s8(0x1f9)][s8(0x1e4)](s[s8(0x1ea)]);});}[a16p(0x1d2)](s){return __awaiter(this,void 0x0,void 0x0,function*(){const s9=a16y;return this[s9(0x1f9)][s9(0x1e4)](s);});}['beginTransaction'](){return __awaiter(this,void 0x0,void 0x0,function*(){const ss=a16y;yield this[ss(0x1f9)][ss(0x1e4)](ss(0x1f0)),this[ss(0x1b0)]=!![];});}[a16p(0x1c8)](){return __awaiter(this,void 0x0,void 0x0,function*(){const sy=a16y;yield this[sy(0x1f9)][sy(0x1e4)]('COMMIT'),this[sy(0x1b0)]=![];});}[a16p(0x1cc)](){return __awaiter(this,void 0x0,void 0x0,function*(){const sO=a16y;yield this[sO(0x1f9)][sO(0x1e4)](sO(0x1ec)),this[sO(0x1b0)]=![];});}[a16p(0x1ee)](s,y,g,x){return __awaiter(this,void 0x0,void 0x0,function*(){const sD=a16y,m=[];let w=g[sD(0x1ea)];const t=this[sD(0x209)](s,y,g,x);for(let v=0x0;v<t[sD(0x1cb)];v++){const a=t[v];if(typ3s_1[sD(0x20a)][sD(0x200)](a[sD(0x1df)])||a[sD(0x1df)]===typ3s_1[sD(0x1d7)][sD(0x1f1)]&&Array['isArray'](a['value'])){if(a[sD(0x201)][sD(0x1cb)]===0x0){m[sD(0x1ed)]([]);continue;}if(a[sD(0x201)][sD(0x1cb)]===0x1){m['push'](a[sD(0x201)][0x0]);continue;}const c=typeof a[sD(0x201)][0x0];switch(c){case typ3s_1[sD(0x1d7)]['string']:w=this[sD(0x1f3)]['str'][sD(0x1fb)](w,'($'+(v+0x1)+')','(SELECT(UNNEST($'+(v+0x1)+sD(0x1f6)),m['push'](a[sD(0x201)]);break;case sD(0x1db):case typ3s_1[sD(0x1d7)]['number']:w=this[sD(0x1f3)][sD(0x202)]['replace'](w,'($'+(v+0x1)+')',sD(0x1e1)+(v+0x1)+sD(0x1af)),m['push'](a[sD(0x201)]);break;default:m[sD(0x1ed)](a[sD(0x201)]);}}else m[sD(0x1ed)](a[sD(0x201)]);}try{let k=null;return m&&m[sD(0x1cb)]>0x0?k=yield this[sD(0x1f9)][sD(0x1e4)](w,m):k=yield this[sD(0x1f9)][sD(0x1e4)](w),k;}catch(r){yield this[sD(0x1f3)][sD(0x204)]['log'](r,lambdaorm_base_1[sD(0x1bc)]['ERROR']);throw r;}});}}exports[a16p(0x1bf)]=PostgreSQLConnectionAdapter;