feat: add database manager with per plugin config

This commit introduces:
- a new backwards compatible database manager which allows the end-user
  to set global and per plugin database configuration.
- an early iteration of a database connector interface.
- provides helper functions for each of the database connectors to
  meet the new interface.

Signed-off-by: Minn Soe <contributions@minn.io>
This commit is contained in:
Minn Soe
2021-05-17 18:16:06 +01:00
parent 399abf9670
commit 772dbdb511
14 changed files with 1159 additions and 226 deletions
+2 -2
View File
@@ -29,7 +29,7 @@ import {
getRootLogger,
loadBackendConfig,
notFoundHandler,
SingleConnectionDatabaseManager,
PluginConnectionDatabaseManager,
SingleHostDiscovery,
UrlReaders,
useHotMemoize,
@@ -59,7 +59,7 @@ function makeCreateEnv(config: Config) {
root.info(`Created UrlReader ${reader}`);
const databaseManager = SingleConnectionDatabaseManager.fromConfig(config);
const databaseManager = PluginConnectionDatabaseManager.fromConfig(config);
const cacheManager = CacheManager.fromConfig(config);
return (plugin: string): PluginEnvironment => {