types / mysql2

Typings for https://github.com/sidorares/node-mysql2
ISC License
41 stars 23 forks source link

Added ping() definition #29

Closed izzymg closed 5 years ago

izzymg commented 5 years ago

The connection interface definition in mysql doesn't actually include ping, but it does exist on both Connection and PoolConnection

const connection = mysql2.createConnection({...});
connection.ping((error) => console.error);
const pool = mysql2.createPool({...});
const conn = await pool.getConnection();
try {
  await conn.ping();
} catch(error) {
  console.error(error);
}
unional commented 5 years ago

Thanks!