refactor: cleanup & renames to common db code

This commit is contained in:
Andrew Thauer
2020-08-29 16:59:14 -04:00
parent 0f91193bc6
commit 329b663c93
8 changed files with 184 additions and 134 deletions
+8 -5
View File
@@ -23,7 +23,7 @@
*/
import {
createDatabase,
createDatabaseClient,
createServiceBuilder,
loadBackendConfig,
getRootLogger,
@@ -48,11 +48,14 @@ function makeCreateEnv(loadedConfigs: AppConfig[]) {
return (plugin: string): PluginEnvironment => {
const logger = getRootLogger().child({ type: 'plugin', plugin });
const database = createDatabase(config.getConfig('backend.database'), {
connection: {
database: `backstage_plugin_${plugin}`,
const database = createDatabaseClient(
config.getConfig('backend.database'),
{
connection: {
database: `backstage_plugin_${plugin}`,
},
},
});
);
return { logger, database, config };
};
}