Closed xxoxx closed 3 months ago
I understand the appeal of this, and it could definitely be implemented somewhat easily, but the question is why this would be helpful? For most queries you'd execute against a database, you would likely prefer/use a SQL WHERE
clause to filter the fields. Even for metadata such as this, there's usually a pure SQL query that can be executed to filter the rows/columns.
I'm sure that in SQL statements, it's possible to achieve the desired outcome by adding WHERE conditions and LIKE statements, etc. However, this kind of filtering, similar to pipe filtering in Linux commands, would be simpler. For example, I don't need to pay attention to field names. For instance, when I want to view MySQL processes with select * from information_schema.processlist, I don't need to focus on the content of a specific field; I only want to focus on whether the result should contain a certain string or not contain a certain string. This would be a bit more convenient.
@xxoxx BTW -- are you aware that you can already pipe the output to any command? Use \g
instead of a ;
:
Connected with driver mysql (11.3.2-MariaDB-1:11.3.2+maria~ubu2204)
Type "help" for help.
my:root@=> show variables \g |grep log_bin
log_bin | OFF
log_bin_basename |
log_bin_compress | OFF
log_bin_compress_min_len | 256
log_bin_index |
log_bin_trust_function_creators | OFF
sql_log_bin | ON
my:root@=>
For example, similar to the following operations.
grep:
grep -v exclude: