UNPKG

lambdaorm

Version:
1 lines 11.5 kB
'use strict';const a149z=a149y;(function(s,y){const r=a149y,g=s();while(!![]){try{const x=parseInt(r(0x1c3))/0x1*(-parseInt(r(0x1e6))/0x2)+-parseInt(r(0x1d2))/0x3*(parseInt(r(0x1e7))/0x4)+parseInt(r(0x1b4))/0x5+-parseInt(r(0x1de))/0x6*(parseInt(r(0x1b1))/0x7)+-parseInt(r(0x1d7))/0x8*(-parseInt(r(0x1e0))/0x9)+-parseInt(r(0x1e2))/0xa*(-parseInt(r(0x1dc))/0xb)+parseInt(r(0x1bc))/0xc;if(x===y)break;else g['push'](g['shift']());}catch(m){g['push'](g['shift']());}}}(a149s,0x3f4c6));var __awaiter=this&&this[a149z(0x1db)]||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 p=a149y;function t(c){const d=a149y;try{a(g[d(0x1b0)](c));}catch(k){w(k);}}function v(c){const i=a149y;try{a(g[i(0x1d3)](c));}catch(k){w(k);}}function a(c){const o=a149y;c[o(0x1bb)]?m(c['value']):x(c[o(0x1e9)])[o(0x1c0)](t,v);}a((g=g['apply'](s,y||[]))[p(0x1b0)]());});};Object[a149z(0x1e3)](exports,'__esModule',{'value':!![]});const __1=require('../../..');function a149y(s,y){const O=a149s();return a149y=function(D,g){D=D-0x1b0;let M=O[D];return M;},a149y(s,y);}function a149s(){const s3=['Produce','groupBy\x207','Products.filter(p\x20=>\x20p.id\x20===\x20id).map(p\x20=>\x20({\x20name:\x20p.name,\x20source:\x20p.price,\x20result:\x20abs(p.price)\x20}))','MongoDB','groupBy\x203','./config/northwind.yaml','groupBy\x204','dotenv','Meat/Poultry','Beverages','795vJTdrH','throw','PostgreSQL','Products.map(p\x20=>\x20({\x20average:\x20round(avg(p.price),\x204)\x20}))','Confections','4059248CYmFts','Products.map(p\x20=>\x20({\x20category:\x20p.category.name,\x20largestPrice:\x20max(p.price)\x20}))','execute','Products.map(p\x20=>\x20({\x20minPrice:\x20min(p.price)\x20}))','__awaiter','44NyVtVW','./config/northwind.env','96174dubMEO','groupBy\x201','9uVPAPS','Products.map(p\x20=>\x20({\x20count:\x20count(1)\x20}))','134790aCMAyi','defineProperty','config','SqlServer','254346YfsOjG','2080eOXpuX','groupBy\x206','value','MySQL','next','175IrZWGD','orm','groupBy\x208','1333120OBfBQd','Oracle','MariaDB','init','toEqual','Products.map(p\x20=>\x20({\x20total:\x20sum(p.price)\x20}))','Grains/Cereals','done','1164264ZYYzLo','Condiments','Execute','groupBy\x209','then','Chai','groupBy\x202','1igwtMz','Products.map(p\x20=>\x20({\x20maxPrice:\x20max(p.price)\x20}))','Seafood','query\x2010','Products.map(p\x20=>\x20({\x20category:\x20p.categoryId,\x20largestPrice:\x20max(p.price)\x20}))'];a149s=function(){return s3;};return a149s();}beforeAll(()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const f=a149z;require(f(0x1cf))[f(0x1e4)]({'path':f(0x1dd)}),yield __1['orm'][f(0x1b7)](f(0x1cd));})),describe(a149z(0x1be),()=>{const q=a149z,s={'a':{'id':0x1}};test(q(0x1df),()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const j=q,y=j(0x1c4),g=[{'maxPrice':263.5}],MySQLResult=yield __1[j(0x1b2)][j(0x1d9)](y,s,{'stage':j(0x1ea)});expect(g)[j(0x1b8)](MySQLResult);const MariaDBResult=yield __1['orm'][j(0x1d9)](y,s,{'stage':'MariaDB'});expect(g)[j(0x1b8)](MariaDBResult);const PostgreSQLResult=yield __1[j(0x1b2)][j(0x1d9)](y,s,{'stage':j(0x1d4)});expect(g)[j(0x1b8)](PostgreSQLResult);const SqlServerResult=yield __1[j(0x1b2)][j(0x1d9)](y,s,{'stage':'SqlServer'});expect(g)[j(0x1b8)](SqlServerResult);const MongoDBResult=yield __1['orm'][j(0x1d9)](y,s,{'stage':j(0x1cb)});expect(g)[j(0x1b8)](MongoDBResult);const OracleResult=yield __1[j(0x1b2)][j(0x1d9)](y,s,{'stage':j(0x1b5)});expect(g)['toEqual'](OracleResult);})),test(q(0x1c2),()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const b=q,y=b(0x1da),g=[{'minPrice':2.5}],MySQLResult=yield __1[b(0x1b2)][b(0x1d9)](y,s,{'stage':b(0x1ea)});expect(g)[b(0x1b8)](MySQLResult);const MariaDBResult=yield __1[b(0x1b2)]['execute'](y,s,{'stage':b(0x1b6)});expect(g)[b(0x1b8)](MariaDBResult);const PostgreSQLResult=yield __1['orm'][b(0x1d9)](y,s,{'stage':b(0x1d4)});expect(g)['toEqual'](PostgreSQLResult);const SqlServerResult=yield __1[b(0x1b2)][b(0x1d9)](y,s,{'stage':b(0x1e5)});expect(g)['toEqual'](SqlServerResult);const MongoDBResult=yield __1['orm'][b(0x1d9)](y,s,{'stage':b(0x1cb)});expect(g)[b(0x1b8)](MongoDBResult);const OracleResult=yield __1[b(0x1b2)]['execute'](y,s,{'stage':'Oracle'});expect(g)[b(0x1b8)](OracleResult);})),test(q(0x1cc),()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const l=q,y=l(0x1b9),g=[{'total':2222.71}],MySQLResult=yield __1['orm'][l(0x1d9)](y,s,{'stage':l(0x1ea)});expect(g)[l(0x1b8)](MySQLResult);const MariaDBResult=yield __1[l(0x1b2)][l(0x1d9)](y,s,{'stage':'MariaDB'});expect(g)[l(0x1b8)](MariaDBResult);const PostgreSQLResult=yield __1[l(0x1b2)][l(0x1d9)](y,s,{'stage':'PostgreSQL'});expect(g)['toEqual'](PostgreSQLResult);const SqlServerResult=yield __1[l(0x1b2)][l(0x1d9)](y,s,{'stage':l(0x1e5)});expect(g)[l(0x1b8)](SqlServerResult);const MongoDBResult=yield __1[l(0x1b2)][l(0x1d9)](y,s,{'stage':'MongoDB'});expect(g)['toEqual'](MongoDBResult);const OracleResult=yield __1[l(0x1b2)][l(0x1d9)](y,s,{'stage':l(0x1b5)});expect(g)['toEqual'](OracleResult);})),test(q(0x1ce),()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const u=q,y=u(0x1d5),g=[{'average':28.8664}],MySQLResult=yield __1[u(0x1b2)][u(0x1d9)](y,s,{'stage':'MySQL'});expect(g)['toEqual'](MySQLResult);const MariaDBResult=yield __1[u(0x1b2)]['execute'](y,s,{'stage':'MariaDB'});expect(g)[u(0x1b8)](MariaDBResult);const PostgreSQLResult=yield __1[u(0x1b2)]['execute'](y,s,{'stage':u(0x1d4)});expect(g)[u(0x1b8)](PostgreSQLResult);const SqlServerResult=yield __1[u(0x1b2)][u(0x1d9)](y,s,{'stage':u(0x1e5)});expect(g)[u(0x1b8)](SqlServerResult);const MongoDBResult=yield __1[u(0x1b2)][u(0x1d9)](y,s,{'stage':u(0x1cb)});expect(g)['toEqual'](MongoDBResult);const OracleResult=yield __1[u(0x1b2)][u(0x1d9)](y,s,{'stage':'Oracle'});expect(g)[u(0x1b8)](OracleResult);})),test('groupBy\x205',()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const e=q,y=e(0x1e1),g=[{'count':0x4d}],MySQLResult=yield __1[e(0x1b2)]['execute'](y,s,{'stage':'MySQL'});expect(g)[e(0x1b8)](MySQLResult);const MariaDBResult=yield __1[e(0x1b2)][e(0x1d9)](y,s,{'stage':e(0x1b6)});expect(g)[e(0x1b8)](MariaDBResult);const PostgreSQLResult=yield __1[e(0x1b2)][e(0x1d9)](y,s,{'stage':'PostgreSQL'});expect(g)[e(0x1b8)](PostgreSQLResult);const SqlServerResult=yield __1[e(0x1b2)][e(0x1d9)](y,s,{'stage':'SqlServer'});expect(g)[e(0x1b8)](SqlServerResult);const MongoDBResult=yield __1[e(0x1b2)][e(0x1d9)](y,s,{'stage':'MongoDB'});expect(g)['toEqual'](MongoDBResult);const OracleResult=yield __1[e(0x1b2)][e(0x1d9)](y,s,{'stage':'Oracle'});expect(g)['toEqual'](OracleResult);})),test(q(0x1e8),()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const n=q,y=n(0x1c7),g=[{'category':0x1,'largestPrice':263.5},{'category':0x2,'largestPrice':43.9},{'category':0x3,'largestPrice':0x51},{'category':0x4,'largestPrice':0x37},{'category':0x5,'largestPrice':0x26},{'category':0x6,'largestPrice':123.79},{'category':0x7,'largestPrice':0x35},{'category':0x8,'largestPrice':62.5}],MySQLResult=yield __1['orm'][n(0x1d9)](y,s,{'stage':n(0x1ea)});expect(g)[n(0x1b8)](MySQLResult);const MariaDBResult=yield __1[n(0x1b2)][n(0x1d9)](y,s,{'stage':n(0x1b6)});expect(g)[n(0x1b8)](MariaDBResult);const PostgreSQLResult=yield __1[n(0x1b2)][n(0x1d9)](y,s,{'stage':n(0x1d4)});expect(g)[n(0x1b8)](PostgreSQLResult);const SqlServerResult=yield __1[n(0x1b2)]['execute'](y,s,{'stage':'SqlServer'});expect(g)[n(0x1b8)](SqlServerResult);const MongoDBResult=yield __1[n(0x1b2)][n(0x1d9)](y,s,{'stage':n(0x1cb)});expect(g)[n(0x1b8)](MongoDBResult);const OracleResult=yield __1[n(0x1b2)][n(0x1d9)](y,s,{'stage':'Oracle'});expect(g)[n(0x1b8)](OracleResult);})),test(q(0x1c9),()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const h=q,y=h(0x1d8),g=[{'category':h(0x1d1),'largestPrice':263.5},{'category':h(0x1bd),'largestPrice':43.9},{'category':h(0x1d6),'largestPrice':0x51},{'category':'Dairy\x20Products','largestPrice':0x37},{'category':h(0x1ba),'largestPrice':0x26},{'category':h(0x1d0),'largestPrice':123.79},{'category':h(0x1c8),'largestPrice':0x35},{'category':h(0x1c5),'largestPrice':62.5}],MySQLResult=yield __1[h(0x1b2)][h(0x1d9)](y,s,{'stage':h(0x1ea)});expect(g)[h(0x1b8)](MySQLResult);const MariaDBResult=yield __1[h(0x1b2)]['execute'](y,s,{'stage':h(0x1b6)});expect(g)[h(0x1b8)](MariaDBResult);const PostgreSQLResult=yield __1['orm']['execute'](y,s,{'stage':h(0x1d4)});expect(g)[h(0x1b8)](PostgreSQLResult);const SqlServerResult=yield __1[h(0x1b2)][h(0x1d9)](y,s,{'stage':h(0x1e5)});expect(g)[h(0x1b8)](SqlServerResult);const MongoDBResult=yield __1[h(0x1b2)][h(0x1d9)](y,s,{'stage':h(0x1cb)});expect(g)[h(0x1b8)](MongoDBResult);const OracleResult=yield __1[h(0x1b2)][h(0x1d9)](y,s,{'stage':h(0x1b5)});expect(g)['toEqual'](OracleResult);})),test(q(0x1b3),()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const s0=q,y=s0(0x1ca),g=[{'name':s0(0x1c1),'source':0x12,'result':0x12}],MySQLResult=yield __1[s0(0x1b2)][s0(0x1d9)](y,s,{'stage':'MySQL'});expect(g)[s0(0x1b8)](MySQLResult);const MariaDBResult=yield __1[s0(0x1b2)]['execute'](y,s,{'stage':s0(0x1b6)});expect(g)[s0(0x1b8)](MariaDBResult);const PostgreSQLResult=yield __1[s0(0x1b2)]['execute'](y,s,{'stage':'PostgreSQL'});expect(g)['toEqual'](PostgreSQLResult);const SqlServerResult=yield __1['orm']['execute'](y,s,{'stage':'SqlServer'});expect(g)['toEqual'](SqlServerResult);const MongoDBResult=yield __1[s0(0x1b2)][s0(0x1d9)](y,s,{'stage':s0(0x1cb)});expect(g)[s0(0x1b8)](MongoDBResult);const OracleResult=yield __1[s0(0x1b2)]['execute'](y,s,{'stage':s0(0x1b5)});expect(g)[s0(0x1b8)](OracleResult);})),test(q(0x1bf),()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const s1=q,y='Products.having(p\x20=>\x20max(p.price)\x20>\x20100).map(p\x20=>\x20({\x20category:\x20p.category.name,\x20largestPrice:\x20max(p.price)\x20}))',g=[{'category':s1(0x1d1),'largestPrice':263.5},{'category':'Meat/Poultry','largestPrice':123.79}],MySQLResult=yield __1['orm'][s1(0x1d9)](y,s,{'stage':s1(0x1ea)});expect(g)[s1(0x1b8)](MySQLResult);const MariaDBResult=yield __1[s1(0x1b2)][s1(0x1d9)](y,s,{'stage':s1(0x1b6)});expect(g)[s1(0x1b8)](MariaDBResult);const PostgreSQLResult=yield __1['orm'][s1(0x1d9)](y,s,{'stage':s1(0x1d4)});expect(g)[s1(0x1b8)](PostgreSQLResult);const SqlServerResult=yield __1[s1(0x1b2)]['execute'](y,s,{'stage':s1(0x1e5)});expect(g)[s1(0x1b8)](SqlServerResult);const MongoDBResult=yield __1[s1(0x1b2)][s1(0x1d9)](y,s,{'stage':s1(0x1cb)});expect(g)[s1(0x1b8)](MongoDBResult);const OracleResult=yield __1[s1(0x1b2)]['execute'](y,s,{'stage':s1(0x1b5)});expect(g)[s1(0x1b8)](OracleResult);})),test(q(0x1c6),()=>__awaiter(void 0x0,void 0x0,void 0x0,function*(){const s2=q,y='Orders.details.map(p\x20=>\x20({\x20subTotal:\x20sum((p.unitPrice\x20*\x20p.quantity\x20*\x20(1\x20-\x20p.discount\x20/\x20100))\x20*\x20100)\x20})).sort(p\x20=>\x20p.subTotal)',g=[{'subTotal':0x812bd63}],MySQLResult=yield __1['orm']['execute'](y,s,{'stage':s2(0x1ea)});expect(g)[s2(0x1b8)](MySQLResult);const MariaDBResult=yield __1['orm'][s2(0x1d9)](y,s,{'stage':s2(0x1b6)});expect(g)[s2(0x1b8)](MariaDBResult);const PostgreSQLResult=yield __1[s2(0x1b2)][s2(0x1d9)](y,s,{'stage':'PostgreSQL'});expect(g)[s2(0x1b8)](PostgreSQLResult);const SqlServerResult=yield __1[s2(0x1b2)][s2(0x1d9)](y,s,{'stage':s2(0x1e5)});expect(g)[s2(0x1b8)](SqlServerResult);const MongoDBResult=yield __1[s2(0x1b2)][s2(0x1d9)](y,s,{'stage':'MongoDB'});expect(g)['toEqual'](MongoDBResult);const OracleResult=yield __1[s2(0x1b2)][s2(0x1d9)](y,s,{'stage':s2(0x1b5)});expect(g)[s2(0x1b8)](OracleResult);}));});