mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-09-23 22:14:40 -04:00
[MySQL monitor] Split password into a standalone field (#3899)
This commit is contained in:
parent
4ccf263481
commit
18169c59a1
5 changed files with 38 additions and 31 deletions
|
@ -468,11 +468,15 @@ exports.postgresQuery = function (connectionString, query) {
|
|||
* Run a query on MySQL/MariaDB
|
||||
* @param {string} connectionString The database connection string
|
||||
* @param {string} query The query to validate the database with
|
||||
* @param {?string} password The password to use
|
||||
* @returns {Promise<(string)>}
|
||||
*/
|
||||
exports.mysqlQuery = function (connectionString, query) {
|
||||
exports.mysqlQuery = function (connectionString, query, password = undefined) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const connection = mysql.createConnection(connectionString);
|
||||
const connection = mysql.createConnection({
|
||||
uri: connectionString,
|
||||
password
|
||||
});
|
||||
|
||||
connection.on("error", (err) => {
|
||||
reject(err);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue