import { Connection , ConnectionOptions , createConnection } from 'typeorm' ; import * as config from './ormconfig' ; let connection ; /**
 * Creates the DB connnection to use in an app
 */ export async function getDBConnectionAsync ( ) { if ( ! connection ) { connection = await createConnection ( config as any as ConnectionOptions ) ; } return connection ; }