How to use the getConnection function from typeorm
Find comprehensive JavaScript typeorm.getConnection code examples handpicked from public code repositorys.
GitHub: UrosHCS/nest-starter
![UrosHCS profile picture](/UrosHCS.png?size=40)
18 19 20 21 22 23 24 25 26
await (new UserSeed().run()) await (new CredentialSeed().run()) }).then(async () => { await getConnection().close() console.log('done') }).catch(async reason => {
+ 31 other calls in file
34 35 36 37 38 39 40 41 42
await new CredentialFactory().create({ user }) }).then(() => { getConnection().close() console.log('done') }).catch(reason => {
+ 31 other calls in file
GitHub: ShipChain/engine
![ShipChain profile picture](/ShipChain.png?size=40)
112 113 114 115 116 117 118 119 120 121
if (config.get('DEPLOY_CONTRACTS')) { logger.info(`Deploying local contracts`); const deployedContracts = await test_net_utils.setupLocalTestNetContracts( { LOAD: LATEST_LOAD, ShipToken: LATEST_SHIPTOKEN, NOTARY: LATEST_NOTARY }, await typeorm.getConnection().getRepository(Wallet).find(), contractMetaData, ); network = deployedContracts.LOAD.network.title;
+ 9 other calls in file
12 13 14 15 16 17 18 19 20 21
const xf_user_upgrade_active = require("./../models/xf_upgrade").xf_user_upgrade_active; const xf_user_group = require("./../models/xf_group").xf_user_group; const xf_user_upgrade = require("./../models/xf_user_upgrade").xf_user_upgrade; const {converttotimestamp,addtotimestampdays,convertfromtimestamp} = require("./../dates/date"); async function getusergroups(username) { const connection = typeorm.getConnection(); const userRepository = connection.getRepository(backend); const user = await userRepository.findOne({ where: { username: username,
+ 5 other calls in file
15 16 17 18 19 20 21 22 23 24 25 26
entities: [ new EntitySchema(Users) ] }).then(() => { const dbConnection = typeorm.getConnection('mysql') const repo = dbConnection.getRepository("Users") return repo }).then((repo) => {
GitHub: debayan3/node-goof
22 23 24 25 26 27 28 29 30 31 32 33 34
}) router.post('/', async (req, res, next) => { try { const mongoConnection = typeorm.getConnection('mysql') const repo = mongoConnection.getRepository("Users") const user = {} user.name = req.body.name
typeorm.getCustomRepository is the most popular function in typeorm (5799 examples)