perf(core): Make execution queries faster (#9817)

This commit is contained in:
Iván Ovejero
2024-08-22 13:27:45 +02:00
committed by GitHub
parent 3428f28a73
commit dc7dc995d5
11 changed files with 167 additions and 12 deletions
@@ -93,6 +93,8 @@ function parseJson<T>(data: string | T): T {
const globalConfig = Container.get(GlobalConfig);
const dbType = globalConfig.database.type;
const isMysql = ['mariadb', 'mysqldb'].includes(dbType);
const isSqlite = dbType === 'sqlite';
const isPostgres = dbType === 'postgresdb';
const dbName = globalConfig.database[dbType === 'mariadb' ? 'mysqldb' : dbType].database;
const tablePrefix = globalConfig.database.tablePrefix;
@@ -101,6 +103,8 @@ const createContext = (queryRunner: QueryRunner, migration: Migration): Migratio
tablePrefix,
dbType,
isMysql,
isSqlite,
isPostgres,
dbName,
migrationName: migration.name,
queryRunner,