api-testing
api-testing copied to clipboard
Support to show the status of a database
Description:
Describe the desired behavior, what scenario it enables and how it would be used.
[optional Relevant Links:]
Any extra documentation required to understand the issue.
MySQL
Get status via the following SQL:
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
PostgresDB
SELECT
pid, -- Process ID
usename AS username, -- Connection user
datname AS database,
client_addr AS host,
state, -- e.g., 'active', 'idle', 'idle in transaction'
query -- Current/last executed query
FROM pg_stat_activity;
Show the query
EXPLAIN ANALYZE select * from test_suites limit 10
Show the table info:
select column_name as name, column_type as type, column_comment comment from information_schema.columns where table_schema = 'ai_ums' and table_name = 't_alarm_list'