feat: test psql without defineProperty (#7815)

* feat: test psql without defineProperty

* feat: refactor psql

remove .bind calls, use module.pool.query directly
move requires to top of file
move promisify to bottom so .init etc are promisified

* feat: mongodb

move requires to bottom

* feat: redis
This commit is contained in:
Barış Soner Uşaklı
2019-08-05 09:20:00 -04:00
committed by GitHub
parent 52a2e5d61d
commit af1f7249a7
33 changed files with 301 additions and 341 deletions

View File

@@ -1,12 +1,12 @@
'use strict';
module.exports = function (db, module) {
module.exports = function (module) {
module.sortedSetIntersectCard = async function (keys) {
if (!Array.isArray(keys) || !keys.length) {
return 0;
}
const res = await db.query({
const res = await module.pool.query({
name: 'sortedSetIntersectCard',
text: `
WITH A AS (SELECT z."value" v,
@@ -55,7 +55,7 @@ SELECT COUNT(*) c
limit = null;
}
const res = await db.query({
const res = await module.pool.query({
name: 'getSortedSetIntersect' + aggregate + (params.sort > 0 ? 'Asc' : 'Desc') + 'WithScores',
text: `
WITH A AS (SELECT z."value",