How to use pspg for mycli pager

214 views Asked by At

I have this config on my .myclirc

table_format = psql
enable_pager = True

This the output is not what I expeceted, I tried to set pspg on the [client] section on the .my.cnf but mysqldump will complain about.

[client]
pager = pspg -X --quit-if-one-screen
1

There are 1 answers

0
zer09 On

This answer in github works great.

In my .my.cnf I added this

[client_visidata]
pager = pspg -X --quit-if-one-screen

Then use the --default-group-suffix on mycli.

In my .bash_alias I just added this alias m='mycli --defaults-group-suffix="_visidata"'. This basically call the [client_visidata] contents while using the mycli client. While the mysqldump wont read it, so it wont rise any error.