Skip to content

feat: rtk mysql — MySQL client output compression#395

Closed
dazld wants to merge 1 commit intortk-ai:developfrom
dazld:feat/mysql-add-client-filter
Closed

feat: rtk mysql — MySQL client output compression#395
dazld wants to merge 1 commit intortk-ai:developfrom
dazld:feat/mysql-add-client-filter

Conversation

@dazld
Copy link
Copy Markdown

@dazld dazld commented Mar 6, 2026

mysql cli support

Strip box-drawing borders, compress tables to tab-separated, collapse vertical (--vertical/\G) output to key=val one-liners.

Tested against live MySQL with 56-58% token savings on real queries. I'm looking into if I can bump that up a bit more, noticed that you want minimum 60% savings. mysql is a bit terser than psql, so there's not quite as much to save there, but the truncation and stripping is still useful.

-h flag conflict fix

MySQL's -h (host) is one of the most common flags, but clap intercepts it as --help. This PR adds #[command(disable_help_flag = true)] on the Mysql variant so -h passes through to mysql correctly.

Note: rtk psql has the same bug — rtk psql -h localhost shows rtk help instead of connecting to the host. Happy to fix that in a follow-up PR if you'd like.

Docs

Updated README with mysql + psql in the database clients section and hook mapping table.

If docs / readme updates aren't appropriate please do say, and happy to back those out.

Strip box-drawing borders, compress tables to tab-separated,
collapse vertical (--vertical/\G) output to key=val one-liners.
Disable clap help flag to avoid -h conflict with mysql's -h (host).

Tested against live MySQL with 56-58% token savings on real queries.

Signed-off-by: Dan Peddle <dan@flarework.com>
@dazld dazld force-pushed the feat/mysql-add-client-filter branch from 399dead to 78934be Compare March 6, 2026 23:07
@pszymkowiak pszymkowiak force-pushed the develop branch 3 times, most recently from dc20fc4 to cc93afc Compare March 10, 2026 19:59
@dazld
Copy link
Copy Markdown
Author

dazld commented Mar 12, 2026

I can fix these conflicts - but is there any interest in adding this, or should I close?

Gentle ping @pszymkowiak

@dazld dazld closed this Mar 16, 2026
@dazld dazld deleted the feat/mysql-add-client-filter branch March 16, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant