title: create connection pool TypeOrm
body: <p>How to create a connection pool using TypeOrm? While exploring TypeOrm, I wanted to create pool of connections for working with MySql </p>
  
  <p>Below is the code snippet : </p>
  
  <pre><code>import { createConnection } from 'typeorm';
  
  export const databaseProviders = [
    {
      provide: 'DbConnectionToken',
      useFactory: async () =&gt; await createConnection({
        type: 'mysql',
        host: 'localhost',
        port: 8889,
        username: 'root',
        password: 'root',
        database: 'typeorm_test',
        entities: [
          __dirname + '/../**/**.entity{.ts,.js}',
        ],
        autoSchemaSync: true,
        logging: 'all',
      }),
    },
  ];
  </code></pre>