From 64211e3e97e55614c68d876e294e73c532a3196d Mon Sep 17 00:00:00 2001 From: james-owen Date: Thu, 3 Dec 2020 10:59:20 -0500 Subject: [PATCH 01/16] add postgres paginate --- index.js | 1 + postgres/client.js | 45 +++++++++++++++++++++++++++++++++++++++++++-- services/db.js | 1 + 3 files changed, 45 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 9024587..1d58c84 100644 --- a/index.js +++ b/index.js @@ -12,3 +12,4 @@ module.exports.patchMeta = db.patchMeta; module.exports.getMeta = db.getMeta; module.exports.raw = db.raw; module.exports.createReadStream = db.createReadStream; +module.exports.paginate = db.paginate; diff --git a/postgres/client.js b/postgres/client.js index 3d55edb..8fa92d6 100644 --- a/postgres/client.js +++ b/postgres/client.js @@ -1,6 +1,15 @@ 'use strict'; -const { POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_HOST, POSTGRES_PORT, POSTGRES_DB, CONNECTION_POOL_MIN, CONNECTION_POOL_MAX } = require('../services/constants'), +const { + POSTGRES_USER, + POSTGRES_PASSWORD, + POSTGRES_HOST, + POSTGRES_PORT, + POSTGRES_DB, + CONNECTION_POOL_MIN, + CONNECTION_POOL_MAX, + PAGE_SIZE, + } = require('../services/constants'), { notFoundError } = require('../services/errors'), { parseOrNot, wrapInObject, decode } = require('../services/utils'), { findSchemaAndTable, wrapJSONStringInObject } = require('../services/utils'), @@ -8,7 +17,8 @@ const { POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_HOST, POSTGRES_PORT, POSTGRES { isList, isUri } = require('clayutils'), TransformStream = require('../services/list-transform-stream'), META_PUT_PATCH_FN = patch('meta'); -var knex, log = require('../services/log').setup({ file: __filename }); +var knex, + log = require('../services/log').setup({ file: __filename }); /** * Connect to the default DB and create the Clay @@ -252,6 +262,36 @@ function createReadStream(options) { return transform; } +/** + * Gets a list of components as a readable stream, can handle pagination. + * @param {Object} options + */ +function paginate(options) { + const { prefix, values, keys, previous, size } = options; + const transform = TransformStream(options); + const selects = []; + const pageSize = size || PAGE_SIZE; // TODO add range, other checks + + if (keys) selects.push('id'); + if (values) selects.push('data'); + + const query = baseQuery(prefix) + .select(...selects) + .where('id', 'like', `${prefix}%`); // site + + if (previous) { + query.where('id', '>', previous); // TODO validation of previous id + } + + if (pageSize) { + query.limit(pageSize); + query.orderBy('id', 'asc'); + } + + query.pipe(transform); + + return transform; +} /** * [putMeta description] @@ -342,6 +382,7 @@ module.exports.getMeta = getMeta; module.exports.putMeta = putMeta; module.exports.patchMeta = META_PUT_PATCH_FN; module.exports.createReadStream = createReadStream; +module.exports.paginate = paginate; // Knex methods module.exports.createSchema = createSchema; diff --git a/services/db.js b/services/db.js index 46a90f3..8976207 100644 --- a/services/db.js +++ b/services/db.js @@ -101,3 +101,4 @@ module.exports.putMeta = postgres.putMeta; module.exports.getMeta = postgres.getMeta; module.exports.patchMeta = postgres.patchMeta; module.exports.createReadStream = postgres.createReadStream; +module.exports.paginate = postgres.paginate; From 2a430c0989cb6b43d47c9419e51971a9995cb469 Mon Sep 17 00:00:00 2001 From: james-owen Date: Thu, 3 Dec 2020 10:59:35 -0500 Subject: [PATCH 02/16] add page size env var --- services/constants.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/constants.js b/services/constants.js index 9233f49..037a54c 100644 --- a/services/constants.js +++ b/services/constants.js @@ -11,6 +11,8 @@ module.exports.POSTGRES_DB = process.env.CLAY_STORAGE_POSTGRES_DB || module.exports.CONNECTION_POOL_MIN = parseInt(process.env.CLAY_STORAGE_CONNECTION_POOL_MIN, 10) || 2; module.exports.CONNECTION_POOL_MAX = parseInt(process.env.CLAY_STORAGE_CONNECTION_POOL_MAX, 10) || 10; +module.exports.PAGE_SIZE = parseInt(process.env.CLAY_STORAGE_PAGE_SIZE) || null; + // Redis module.exports.CACHE_ENABLED = process.env.CLAY_STORAGE_POSTGRES_CACHE_ENABLED || false; module.exports.REDIS_URL = process.env.CLAY_STORAGE_POSTGRES_CACHE_HOST; From 5ce0c3f978bfc5bed9ea294485b44f98cbea02a9 Mon Sep 17 00:00:00 2001 From: james-owen Date: Thu, 3 Dec 2020 11:08:21 -0500 Subject: [PATCH 03/16] document env var --- docs/environment-setup.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/environment-setup.md b/docs/environment-setup.md index 6a24ff2..a0d025c 100644 --- a/docs/environment-setup.md +++ b/docs/environment-setup.md @@ -9,6 +9,7 @@ To define where Postgres and Redis clients will connect to you can define the fo - [`CLAY_STORAGE_POSTGRES_DB`](#clay_storage_postgres_db) - [`CLAY_STORAGE_POSTGRES_CACHE_ENABLED`](#clay_storage_postgres_cache_enabled) - [`CLAY_STORAGE_POSTGRES_CACHE_HOST`](#clay_storage_postgres_cache_host) +- [`CLAY_STORAGE_POSTGRES_PAGE_SIZE`](#clay_storage_postgres_page_size) --- ## Postgres @@ -43,6 +44,12 @@ The port where your Postgres instance resides on its host. The database within Postgres to connect to. +### `CLAY_STORAGE_PAGE_SIZE` + +**Default:** `null` _(Number)_ + +Default page size for list queries. Enables pagination by default on list endpoints. + --- ## Redis From 2bd2c6a68e94f9ab7b50a819fdb8deef23ac386e Mon Sep 17 00:00:00 2001 From: james-owen Date: Fri, 4 Dec 2020 16:07:38 -0500 Subject: [PATCH 04/16] move query around for testing --- postgres/client.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/postgres/client.js b/postgres/client.js index 8fa92d6..fa0e5c5 100644 --- a/postgres/client.js +++ b/postgres/client.js @@ -275,9 +275,10 @@ function paginate(options) { if (keys) selects.push('id'); if (values) selects.push('data'); - const query = baseQuery(prefix) - .select(...selects) - .where('id', 'like', `${prefix}%`); // site + const query = baseQuery(prefix); + + query.select(...selects); + query.where('id', 'like', `${prefix}%`); // site if (previous) { query.where('id', '>', previous); // TODO validation of previous id From 66867d7153ddad7904f50c146f226ca35557f800 Mon Sep 17 00:00:00 2001 From: james-owen Date: Fri, 4 Dec 2020 16:07:50 -0500 Subject: [PATCH 05/16] paginate tests --- postgres/client.test.js | 94 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/postgres/client.test.js b/postgres/client.test.js index 0ce693b..716fee6 100644 --- a/postgres/client.test.js +++ b/postgres/client.test.js @@ -488,6 +488,100 @@ describe('postgres/client', () => { }); }); + describe.only('paginate', () => { + const pipe = jest.fn(() => ({})), + where = jest.fn(() => ({})), + select = jest.fn(() => ({})), + withSchema = jest.fn(() => ({})), + limit = jest.fn(() => ({})), + orderBy = jest.fn(() => ({})), + knex = jest.fn(() => ({ + withSchema, + select, + where, + limit, + orderBy, + pipe, + })), + mockedTransform = {}; + + beforeEach(() => { + client.setClient(knex); + }); + + test('creates a read stream of query results with id and data columns', () => { + TransformStream.mockReturnValueOnce(mockedTransform); + + const options = { + prefix: 'nymag.com/_uris', + values: true, + keys: true, + }, + transform = client.paginate(options); + + expect(withSchema.mock.calls.length).toBe(0); + expect(select.mock.calls.length).toBe(1); + expect(select.mock.calls[0][0]).toBe('id'); + expect(select.mock.calls[0][1]).toBe('data'); + expect(where.mock.calls.length).toBe(1); + expect(where.mock.calls[0][1]).toBe('like'); + expect(where.mock.calls[0][2]).toBe(`${options.prefix}%`); + expect(transform).toBe(mockedTransform); + }); + + test('creates a read stream of query results without id and data columns', () => { + TransformStream.mockReturnValueOnce(mockedTransform); + + const options = { + prefix: 'nymag.com/_uris', + values: false, + keys: false, + }, + transform = client.paginate(options); + + expect(withSchema.mock.calls.length).toBe(0); + expect(select.mock.calls.length).toBe(1); + expect(select.mock.calls[0][0]).toBe(undefined); + expect(where.mock.calls.length).toBe(1); + expect(where.mock.calls[0][1]).toBe('like'); + expect(where.mock.calls[0][2]).toBe(`${options.prefix}%`); + expect(transform).toBe(mockedTransform); + }); + + test('queries with a limit and order when page size is set', () => { + TransformStream.mockReturnValueOnce(mockedTransform); + + const options = { + prefix: 'nymag.com/_uris', + values: false, + keys: false, + size: 20, + }; + + client.paginate(options); + + expect(limit.mock.calls[0][0]).toBe(20); + expect(orderBy.mock.calls.length).toBe(1); + expect(orderBy.mock.calls[0]).toEqual(['id', 'asc']); + }); + + test('queries with where id > previous when previous is set', () => { + const options = { + prefix: 'nymag.com/_uris', + values: false, + keys: false, + size: 20, + previous: 'nymag.com/components/ad/instances/aaa', + }; + + client.paginate(options); + + expect(where.mock.calls[1]).toEqual(['id', '>', options.previous]); + expect(orderBy.mock.calls.length).toBe(1); + expect(orderBy.mock.calls[0]).toEqual(['id', 'asc']); + }); + }); + describe('put', () => { const update = jest.fn(() => 'update sql'), insert = jest.fn(() => 'insert sql'), From ecf148578bfe964cbf853d65dca7a734994cb603 Mon Sep 17 00:00:00 2001 From: james-owen Date: Mon, 7 Dec 2020 09:34:28 -0500 Subject: [PATCH 06/16] linting --- postgres/client.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/postgres/client.js b/postgres/client.js index fa0e5c5..867124c 100644 --- a/postgres/client.js +++ b/postgres/client.js @@ -262,9 +262,11 @@ function createReadStream(options) { return transform; } + /** - * Gets a list of components as a readable stream, can handle pagination. - * @param {Object} options + * Gets a list of components as a readable stream, can handle pagination. + * @param {Object} options + * @returns {Stream} */ function paginate(options) { const { prefix, values, keys, previous, size } = options; From 2be32f4cc9aedae65090591903673009cc4dfc1b Mon Sep 17 00:00:00 2001 From: james-owen Date: Mon, 7 Dec 2020 09:35:45 -0500 Subject: [PATCH 07/16] remove one-var --- .eslintrc | 1 - 1 file changed, 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index ab4fb41..8976c15 100644 --- a/.eslintrc +++ b/.eslintrc @@ -51,7 +51,6 @@ "no-trailing-spaces": 2, "no-underscore-dangle": 0, "no-unneeded-ternary": 1, - "one-var": 2, "quotes": [2, "single", "avoid-escape"], "semi": [2, "always"], "keyword-spacing": 2, From 57f751feb3a43671e4410cb77b5d1cb6474b546c Mon Sep 17 00:00:00 2001 From: james-owen Date: Mon, 7 Dec 2020 17:28:18 -0500 Subject: [PATCH 08/16] remove comments --- postgres/client.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/postgres/client.js b/postgres/client.js index 867124c..e8a5b95 100644 --- a/postgres/client.js +++ b/postgres/client.js @@ -272,7 +272,7 @@ function paginate(options) { const { prefix, values, keys, previous, size } = options; const transform = TransformStream(options); const selects = []; - const pageSize = size || PAGE_SIZE; // TODO add range, other checks + const pageSize = size || PAGE_SIZE; if (keys) selects.push('id'); if (values) selects.push('data'); @@ -280,10 +280,10 @@ function paginate(options) { const query = baseQuery(prefix); query.select(...selects); - query.where('id', 'like', `${prefix}%`); // site + query.where('id', 'like', `${prefix}%`); if (previous) { - query.where('id', '>', previous); // TODO validation of previous id + query.where('id', '>', previous); } if (pageSize) { From 64e296fcd965e90b197cd0e86b6938fb71723d63 Mon Sep 17 00:00:00 2001 From: james-owen Date: Mon, 7 Dec 2020 17:31:39 -0500 Subject: [PATCH 09/16] fix var name --- docs/environment-setup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/environment-setup.md b/docs/environment-setup.md index a0d025c..f4d20f7 100644 --- a/docs/environment-setup.md +++ b/docs/environment-setup.md @@ -9,7 +9,7 @@ To define where Postgres and Redis clients will connect to you can define the fo - [`CLAY_STORAGE_POSTGRES_DB`](#clay_storage_postgres_db) - [`CLAY_STORAGE_POSTGRES_CACHE_ENABLED`](#clay_storage_postgres_cache_enabled) - [`CLAY_STORAGE_POSTGRES_CACHE_HOST`](#clay_storage_postgres_cache_host) -- [`CLAY_STORAGE_POSTGRES_PAGE_SIZE`](#clay_storage_postgres_page_size) +- [`CLAY_STORAGE_PAGE_SIZE`](#clay_storage_page_size) --- ## Postgres From 4fcd895e575290d7af1172ae4e0783342663262b Mon Sep 17 00:00:00 2001 From: james-owen Date: Mon, 7 Dec 2020 17:32:59 -0500 Subject: [PATCH 10/16] doc for page size 0 --- docs/environment-setup.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/environment-setup.md b/docs/environment-setup.md index f4d20f7..663c3e3 100644 --- a/docs/environment-setup.md +++ b/docs/environment-setup.md @@ -48,7 +48,7 @@ The database within Postgres to connect to. **Default:** `null` _(Number)_ -Default page size for list queries. Enables pagination by default on list endpoints. +Default page size for list queries. Enables pagination by default on list endpoints. Setting a page size of `0` will disable pagination. --- From 0ca7ad5c59be20e5082fe1120d96580e4cc7e5c5 Mon Sep 17 00:00:00 2001 From: james-owen Date: Tue, 8 Dec 2020 13:39:04 -0500 Subject: [PATCH 11/16] switch createReadStream to do pagination --- postgres/client.js | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/postgres/client.js b/postgres/client.js index e8a5b95..b7c8aaf 100644 --- a/postgres/client.js +++ b/postgres/client.js @@ -240,39 +240,15 @@ function batch(ops) { return Promise.all(commands); } -/** - * Return a readable stream of query results - * from the db - * - * @param {Object} options - * @return {Stream} - */ -function createReadStream(options) { - const { prefix, values, keys } = options, - transform = TransformStream(options), - selects = []; - - if (keys) selects.push('id'); - if (values) selects.push('data'); - - baseQuery(prefix) - .select(...selects) - .where('id', 'like', `${prefix}%`) - .pipe(transform); - - return transform; -} - /** * Gets a list of components as a readable stream, can handle pagination. * @param {Object} options * @returns {Stream} */ -function paginate(options) { +function createReadStream(options) { const { prefix, values, keys, previous, size } = options; const transform = TransformStream(options); const selects = []; - const pageSize = size || PAGE_SIZE; if (keys) selects.push('id'); if (values) selects.push('data'); @@ -286,8 +262,8 @@ function paginate(options) { query.where('id', '>', previous); } - if (pageSize) { - query.limit(pageSize); + if (size) { + query.limit(size); query.orderBy('id', 'asc'); } From d1bb57dbd7c1d0ba65ae992f93bf4be6a4f9ee4d Mon Sep 17 00:00:00 2001 From: james-owen Date: Tue, 8 Dec 2020 13:39:47 -0500 Subject: [PATCH 12/16] remove page size from docs --- docs/environment-setup.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/docs/environment-setup.md b/docs/environment-setup.md index 663c3e3..6a24ff2 100644 --- a/docs/environment-setup.md +++ b/docs/environment-setup.md @@ -9,7 +9,6 @@ To define where Postgres and Redis clients will connect to you can define the fo - [`CLAY_STORAGE_POSTGRES_DB`](#clay_storage_postgres_db) - [`CLAY_STORAGE_POSTGRES_CACHE_ENABLED`](#clay_storage_postgres_cache_enabled) - [`CLAY_STORAGE_POSTGRES_CACHE_HOST`](#clay_storage_postgres_cache_host) -- [`CLAY_STORAGE_PAGE_SIZE`](#clay_storage_page_size) --- ## Postgres @@ -44,12 +43,6 @@ The port where your Postgres instance resides on its host. The database within Postgres to connect to. -### `CLAY_STORAGE_PAGE_SIZE` - -**Default:** `null` _(Number)_ - -Default page size for list queries. Enables pagination by default on list endpoints. Setting a page size of `0` will disable pagination. - --- ## Redis From b6af182631d6375ffc3c70e21d90096f48912bf4 Mon Sep 17 00:00:00 2001 From: james-owen Date: Tue, 8 Dec 2020 13:42:29 -0500 Subject: [PATCH 13/16] switch createReadStream tests to paginate --- postgres/client.test.js | 65 ++++------------------------------------- 1 file changed, 5 insertions(+), 60 deletions(-) diff --git a/postgres/client.test.js b/postgres/client.test.js index 716fee6..710e556 100644 --- a/postgres/client.test.js +++ b/postgres/client.test.js @@ -433,62 +433,7 @@ describe('postgres/client', () => { }); }); - describe('createReadStream', () => { - const pipe = jest.fn(() => ({})), - where = jest.fn(() => ({ pipe })), - select = jest.fn(() => ({ where })), - withSchema = jest.fn(() => ({ select })), - knex = jest.fn(() => ({ - withSchema, - select - })), - mockedTransform = {}; - - beforeEach(() => { - client.setClient(knex); - }); - - test('creates a read stream of query results with id and data columns', () => { - TransformStream.mockReturnValueOnce(mockedTransform); - - const options = { - prefix: 'nymag.com/_uris', - values: true, - keys: true - }, - transform = client.createReadStream(options); - - expect(withSchema.mock.calls.length).toBe(0); - expect(select.mock.calls.length).toBe(1); - expect(select.mock.calls[0][0]).toBe('id'); - expect(select.mock.calls[0][1]).toBe('data'); - expect(where.mock.calls.length).toBe(1); - expect(where.mock.calls[0][1]).toBe('like'); - expect(where.mock.calls[0][2]).toBe(`${options.prefix}%`); - expect(transform).toBe(mockedTransform); - }); - - test('creates a read stream of query results without id and data columns', () => { - TransformStream.mockReturnValueOnce(mockedTransform); - - const options = { - prefix: 'nymag.com/_uris', - values: false, - keys: false - }, - transform = client.createReadStream(options); - - expect(withSchema.mock.calls.length).toBe(0); - expect(select.mock.calls.length).toBe(1); - expect(select.mock.calls[0][0]).toBe(undefined); - expect(where.mock.calls.length).toBe(1); - expect(where.mock.calls[0][1]).toBe('like'); - expect(where.mock.calls[0][2]).toBe(`${options.prefix}%`); - expect(transform).toBe(mockedTransform); - }); - }); - - describe.only('paginate', () => { + describe.only('createReadStream', () => { const pipe = jest.fn(() => ({})), where = jest.fn(() => ({})), select = jest.fn(() => ({})), @@ -517,7 +462,7 @@ describe('postgres/client', () => { values: true, keys: true, }, - transform = client.paginate(options); + transform = client.createReadStream(options); expect(withSchema.mock.calls.length).toBe(0); expect(select.mock.calls.length).toBe(1); @@ -537,7 +482,7 @@ describe('postgres/client', () => { values: false, keys: false, }, - transform = client.paginate(options); + transform = client.createReadStream(options); expect(withSchema.mock.calls.length).toBe(0); expect(select.mock.calls.length).toBe(1); @@ -558,7 +503,7 @@ describe('postgres/client', () => { size: 20, }; - client.paginate(options); + client.createReadStream(options); expect(limit.mock.calls[0][0]).toBe(20); expect(orderBy.mock.calls.length).toBe(1); @@ -574,7 +519,7 @@ describe('postgres/client', () => { previous: 'nymag.com/components/ad/instances/aaa', }; - client.paginate(options); + client.createReadStream(options); expect(where.mock.calls[1]).toEqual(['id', '>', options.previous]); expect(orderBy.mock.calls.length).toBe(1); From 2e22107f41f9264e02392484bdf53de0ad99cde3 Mon Sep 17 00:00:00 2001 From: james-owen Date: Tue, 8 Dec 2020 13:47:03 -0500 Subject: [PATCH 14/16] remove references to paginate --- index.js | 1 - postgres/client.js | 1 - services/db.js | 1 - 3 files changed, 3 deletions(-) diff --git a/index.js b/index.js index 1d58c84..9024587 100644 --- a/index.js +++ b/index.js @@ -12,4 +12,3 @@ module.exports.patchMeta = db.patchMeta; module.exports.getMeta = db.getMeta; module.exports.raw = db.raw; module.exports.createReadStream = db.createReadStream; -module.exports.paginate = db.paginate; diff --git a/postgres/client.js b/postgres/client.js index b7c8aaf..7fe4b8e 100644 --- a/postgres/client.js +++ b/postgres/client.js @@ -361,7 +361,6 @@ module.exports.getMeta = getMeta; module.exports.putMeta = putMeta; module.exports.patchMeta = META_PUT_PATCH_FN; module.exports.createReadStream = createReadStream; -module.exports.paginate = paginate; // Knex methods module.exports.createSchema = createSchema; diff --git a/services/db.js b/services/db.js index 8976207..46a90f3 100644 --- a/services/db.js +++ b/services/db.js @@ -101,4 +101,3 @@ module.exports.putMeta = postgres.putMeta; module.exports.getMeta = postgres.getMeta; module.exports.patchMeta = postgres.patchMeta; module.exports.createReadStream = postgres.createReadStream; -module.exports.paginate = postgres.paginate; From ec7c677ac901e24d1347749d0760ad9630a71286 Mon Sep 17 00:00:00 2001 From: james-owen Date: Tue, 8 Dec 2020 13:52:08 -0500 Subject: [PATCH 15/16] remove declarations of PAGE_SIZE --- postgres/client.js | 1 - services/constants.js | 2 -- 2 files changed, 3 deletions(-) diff --git a/postgres/client.js b/postgres/client.js index 7fe4b8e..0d11a36 100644 --- a/postgres/client.js +++ b/postgres/client.js @@ -8,7 +8,6 @@ const { POSTGRES_DB, CONNECTION_POOL_MIN, CONNECTION_POOL_MAX, - PAGE_SIZE, } = require('../services/constants'), { notFoundError } = require('../services/errors'), { parseOrNot, wrapInObject, decode } = require('../services/utils'), diff --git a/services/constants.js b/services/constants.js index 037a54c..9233f49 100644 --- a/services/constants.js +++ b/services/constants.js @@ -11,8 +11,6 @@ module.exports.POSTGRES_DB = process.env.CLAY_STORAGE_POSTGRES_DB || module.exports.CONNECTION_POOL_MIN = parseInt(process.env.CLAY_STORAGE_CONNECTION_POOL_MIN, 10) || 2; module.exports.CONNECTION_POOL_MAX = parseInt(process.env.CLAY_STORAGE_CONNECTION_POOL_MAX, 10) || 10; -module.exports.PAGE_SIZE = parseInt(process.env.CLAY_STORAGE_PAGE_SIZE) || null; - // Redis module.exports.CACHE_ENABLED = process.env.CLAY_STORAGE_POSTGRES_CACHE_ENABLED || false; module.exports.REDIS_URL = process.env.CLAY_STORAGE_POSTGRES_CACHE_HOST; From 8ddf4069d88cb8f70d554fc21dc2cce8aacae55c Mon Sep 17 00:00:00 2001 From: james-owen Date: Tue, 5 Jan 2021 13:07:34 -0500 Subject: [PATCH 16/16] remove describe only --- postgres/client.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/postgres/client.test.js b/postgres/client.test.js index 710e556..1d222bb 100644 --- a/postgres/client.test.js +++ b/postgres/client.test.js @@ -433,7 +433,7 @@ describe('postgres/client', () => { }); }); - describe.only('createReadStream', () => { + describe('createReadStream', () => { const pipe = jest.fn(() => ({})), where = jest.fn(() => ({})), select = jest.fn(() => ({})),