wesql / wescale

WeScale is a Modern MySQL proxy that supports read-write-split, read-after-write-consistency, load balancing and OnlineDDL.
Apache License 2.0
199 stars 8 forks source link

[Enhancement Request] Format the output of 'show create filter [filterName]' #505

Closed earayu closed 3 months ago

earayu commented 4 months ago

Background

Currently, when executing the command 'show create filter [filterName]' in MySQL, the output is unformatted. This makes it difficult to read and understand the filter configuration and its associated patterns.

mysql> create filter foo(
    ->         desc='The description of the filter foo',
    ->         priority='1000',
    ->         status='ACTIVE'
    -> )
    -> with_pattern(
    ->         plans='Select,Insert',
    ->         fully_qualified_table_names='d1.t1'
    -> )
    -> execute(
    ->         action='FAIL'
    -> );

mysql> show create filter foo\G;
*************************** 1. row ***************************
        Filer: foo
Create Filter: create filter foo ( desc='The description of the filter foo', priority='1000', status='ACTIVE' ) with_pattern ( plans='Select,Insert', fully_qualified_table_names='d1.t1', query_regex='', query_template='', request_ip_regex='', user_regex='', leading_comment_regex='', trailing_comment_regex='', bind_var_conds='' ) execute ( action='FAIL', action_args='' )
1 row in set (0.00 sec)

Proposal

I propose improving the formatting of the output generated by the 'show create filter [filterName]' command to enhance readability and clarity.