feat: rtk mysql — MySQL client output compression#395
Closed
dazld wants to merge 1 commit intortk-ai:developfrom
Closed
feat: rtk mysql — MySQL client output compression#395dazld wants to merge 1 commit intortk-ai:developfrom
rtk mysql — MySQL client output compression#395dazld wants to merge 1 commit intortk-ai:developfrom
Conversation
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>
399dead to
78934be
Compare
dc20fc4 to
cc93afc
Compare
Author
|
I can fix these conflicts - but is there any interest in adding this, or should I close? Gentle ping @pszymkowiak |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
-hflag conflict fixMySQL'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 theMysqlvariant so-hpasses through to mysql correctly.Note:
rtk psqlhas the same bug —rtk psql -h localhostshows 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.