mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
feat: processes list tool
This commit is contained in:
@ -956,6 +956,25 @@ export class MySQLClient extends AntaresCore {
|
||||
}, {});
|
||||
}
|
||||
|
||||
async getProcesses () {
|
||||
const sql = 'SELECT `ID`, `USER`, `HOST`, `DB`, `COMMAND`, `TIME`, `STATE`, LEFT(`INFO`, 51200) AS `INFO` FROM `information_schema`.`PROCESSLIST`';
|
||||
|
||||
const { rows } = await this.raw(sql);
|
||||
|
||||
return rows.map(row => {
|
||||
return {
|
||||
id: row.ID,
|
||||
user: row.USER,
|
||||
host: row.HOST,
|
||||
db: row.DB,
|
||||
command: row.COMMAND,
|
||||
time: row.TIME,
|
||||
state: row.STATE,
|
||||
info: row.INFO
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* CREATE TABLE
|
||||
*
|
||||
|
Reference in New Issue
Block a user