title: Using mysql pool with async\await | nodeJS
body: <p>I am using mysql2 with nodejs and currently using simple connection like the following:</p>
  <p>mysql.ts</p>
  <pre><code>    const Connect = () =&gt; {
    if (!connection)
      return mysql.createConnection(params);
    return connection;
  };
  </code></pre>
  <p>someQuery.ts</p>
  <pre><code> const connection = Connect();
      const asyncQuery = util.promisify(connection.query).bind(connection);
  </code></pre>
  <p>Now, after a while that the server is running the app just crashes because of the connection loss, I read some online and understood that in order to solve it and also as a better practice I should use a connection pool.
  The thing is that I haven't really found anything that works like the above with async-await.</p>
  <p>Does anyone have a solution for this?
  await asyncQuery('query here');</p>