How to use the format function from mysql2
Find comprehensive JavaScript mysql2.format code examples handpicked from public code repositorys.
GitHub: Selenium39/nodejs-github
103 104 105 106 107 108 109 110 111 112
// [rows, fields] = values ? await conn.query(sql, values) : await conn.query(sql); [rows, fields] = await conn.query(sql, values); stop = Date.now(); } finally { if (rows && this.logging) { let sqlString = mysql.format(typeof sql === 'object' ? sql.sql : sql, values || sql.values).trim().replace(/\n/g, ' ').replace(/\s+/g, ' ').replace(/,\s/g, ','); if (sqlString.lastIndexOf(';') !== sqlString.length - 1) { sqlString = sqlString + ';'; } const cmd = sqlString.split(' ')[0].toUpperCase();
0
0
1
mysql2.createConnection is the most popular function in mysql2 (458 examples)