From d97e80c3a9b182d4b665684d39c1e209fc83db98 Mon Sep 17 00:00:00 2001 From: pmmlo <58242341+pmmlo@users.noreply.github.com> Date: Wed, 10 Nov 2021 02:28:48 -0800 Subject: [PATCH 1/3] Add postgresql protocol case to getDatabaseAdapter - This should allow developers to designate either postgres:// or postgresql:// prefixed URIs for PostgreSQL. --- src/Controllers/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Controllers/index.js b/src/Controllers/index.js index 89dc79c232..1d5ce80077 100644 --- a/src/Controllers/index.js +++ b/src/Controllers/index.js @@ -232,6 +232,12 @@ export function getDatabaseAdapter(databaseURI, collectionPrefix, databaseOption collectionPrefix, databaseOptions, }); + case 'postgresql:': + return new PostgresStorageAdapter({ + uri: databaseURI, + collectionPrefix, + databaseOptions, + }); default: return new MongoStorageAdapter({ uri: databaseURI, From 6934dadbdf5b99f10318cca07993ac69bd2a07a3 Mon Sep 17 00:00:00 2001 From: pmmlo <58242341+pmmlo@users.noreply.github.com> Date: Sun, 16 Jan 2022 22:29:58 -0800 Subject: [PATCH 2/3] Update SchemasRouter.js --- src/Routers/SchemasRouter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Routers/SchemasRouter.js b/src/Routers/SchemasRouter.js index 1b72b93a68..6c3b1b4283 100644 --- a/src/Routers/SchemasRouter.js +++ b/src/Routers/SchemasRouter.js @@ -16,7 +16,7 @@ function classNameMismatchResponse(bodyClass, pathClass) { function getAllSchemas(req) { return req.config.database .loadSchema({ clearCache: true }) - .then(schemaController => schemaController.getAllClasses({ clearCache: true })) + .then(schemaController => schemaController.getAllClasses({ clearCache: false })) .then(schemas => ({ response: { results: schemas } })); } From 683369ed0954a0b0bb0b94bf75f0ab5075bbc3a7 Mon Sep 17 00:00:00 2001 From: pmmlo <58242341+pmmlo@users.noreply.github.com> Date: Sun, 16 Jan 2022 23:08:21 -0800 Subject: [PATCH 3/3] Update SchemasRouter.js --- src/Routers/SchemasRouter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Routers/SchemasRouter.js b/src/Routers/SchemasRouter.js index 6c3b1b4283..54f73ceacc 100644 --- a/src/Routers/SchemasRouter.js +++ b/src/Routers/SchemasRouter.js @@ -16,7 +16,7 @@ function classNameMismatchResponse(bodyClass, pathClass) { function getAllSchemas(req) { return req.config.database .loadSchema({ clearCache: true }) - .then(schemaController => schemaController.getAllClasses({ clearCache: false })) + .then(schemaController => schemaController.getAllClasses(true)) .then(schemas => ({ response: { results: schemas } })); }