How to use the getConnectionManager function from typeorm
Find comprehensive JavaScript typeorm.getConnectionManager code examples handpicked from public code repositorys.
40 41 42 43 44 45 46 47 48 49
cfg.entities[i] = Util.getAbsPath([item]); } }); } const {getConnectionManager} = require('typeorm'); this.connection = getConnectionManager().create(cfg); } /** * 获取连接
7
52
3
57 58 59 60 61 62 63 64 65 66
} function getDatabaseConnection() { try { ormConfig.name = 'seed-connection'; // to avoid using the 'default' connection const connectionManager = typeorm.getConnectionManager(); return connectionManager.has(ormConfig.name) ? connectionManager.get(ormConfig.name) : connectionManager.create(ormConfig); } catch (error) { console.log('Cannot find ormconfig.js'); throw error;
0
6
4
+ 15 other calls in file
9 10 11 12 13 14 15 16 17 18
logType = ['error', 'warn']; } else { logType = ['error']; } const pool = getConnectionManager().create({ name: 'default', type: process.env.DB_CONNECTION, host: process.env.DB_HOST, port: process.env.DB_PORT,
3
2
4
typeorm.getCustomRepository is the most popular function in typeorm (5799 examples)