const mariadb = require('mariadb');
const pool = mariadb.createPool({
     host: '192.168.50.190',
     database: 'db',
     port: '3306', 
     user:'alpha', 
     password: '!Plop2099',
     connectionLimit: 5
});
async function asyncFunction() {
  let conn;
  try {
	conn = await pool.getConnection();
	const rows = await conn.query("SELECT *");
	console.log(rows); //[ {val: 1}, meta: ... ]
	// const res = await conn.query("INSERT INTO myTable value (?, ?)", [1, "mariadb"]);
	// console.log(res); // { affectedRows: 1, insertId: 1, warningStatus: 0 }

  } catch (err) {
	throw err;
  } finally {
	if (conn) return conn.end();
  }
}