api-testing icon indicating copy to clipboard operation
api-testing copied to clipboard

Support to show the status of a database

Open LinuxSuRen opened this issue 9 months ago • 2 comments

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;

LinuxSuRen avatar Mar 08 '25 01:03 LinuxSuRen

Show the query

EXPLAIN ANALYZE select * from test_suites limit 10

LinuxSuRen avatar Mar 08 '25 03:03 LinuxSuRen

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'

LinuxSuRen avatar Mar 17 '25 09:03 LinuxSuRen