refactor(core): Move backend config to a separate package (no-changelog) (#9325)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-07-05 11:43:27 +02:00
committed by GitHub
parent 1d5b9836ca
commit c7d4b471c4
48 changed files with 941 additions and 556 deletions

View File

@@ -1,10 +1,11 @@
import 'tsconfig-paths/register';
import { Container } from 'typedi';
import { GlobalConfig } from '@n8n/config';
import { DataSource as Connection } from '@n8n/typeorm';
import config from '@/config';
import { getBootstrapDBOptions, testDbPrefix } from './integration/shared/testDb';
export default async () => {
const dbType = config.getEnv('database.type');
const { type: dbType } = Container.get(GlobalConfig).database;
if (dbType !== 'postgresdb' && dbType !== 'mysqldb') return;
const connection = new Connection(getBootstrapDBOptions(dbType));