New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
explore
: adopt anyhow
, support CustomValue
, remove help system
#12692
Conversation
One sec, I added a few |
OK, I bit off more than I can chew in 1 evening. Making |
explore
improvements: adopt anyhow
, support CustomValue
explore
: adopt anyhow
, support CustomValue
, remove help system
@rgwood Thanks for cleaning this up more. I'm anxious to play with the new sqlite functionality. I do have some questions though. If I'm following the code correctly, which I may not be, it seems that we've gone from hard-to-find help to impossible to find help or no help at all. What I mean by that are these things. Granted, you had to know where to look to find help before, but now, I'm not sure how you know these exist. expand (e)
Shortcode::new("Up", "", "Moves the viewport one row up"),
Shortcode::new("Down", "", "Moves the viewport one row down"),
Shortcode::new("Left", "", "Moves the viewport one column left"),
Shortcode::new("Right", "", "Moves the viewport one column right"),
Shortcode::new("PgDown", "", "Moves the viewport one page of rows down"),
Shortcode::new("PgUp", "", "Moves the cursor or viewport one page of rows up"),
Shortcode::new("Esc", "", "Exits cursor mode. Exits the currently explored data."),
table (t)
Shortcode::new("Up", "", "Moves the cursor or viewport one row up"),
Shortcode::new("Down", "", "Moves the cursor or viewport one row down"),
Shortcode::new("Left", "", "Moves the cursor or viewport one column left"),
Shortcode::new("Right", "", "Moves the cursor or viewport one column right"),
Shortcode::new("PgDown", "view", "Moves the cursor or viewport one page of rows down"),
Shortcode::new("PgUp", "view", "Moves the cursor or viewport one page of rows up"),
Shortcode::new("Esc", "", "Exits cursor mode. Exits the just explored dataset."),
Shortcode::new("i", "view", "Enters cursor mode to inspect individual cells"),
Shortcode::new("t", "view", "Transpose table, so that columns become rows and vice versa"),
Shortcode::new("e", "view", "Open expand view (equivalent of :expand)"),
Shortcode::new("Enter", "cursor", "In cursor mode, explore the data of the selected cell"),
:try
Shortcode::new("Up", "", "Switches between input and a output panes"),
Shortcode::new("Down", "", "Switches between input and a output panes"),
Shortcode::new("Esc", "", "Switches between input and a output panes"),
Shortcode::new("Tab", "", "Switches between input and a output panes"), Is there a plan to augment the help screen or something to show people what commands and shortcuts/aliases do? Speaking of which, seems like the aliases aren't discoverable either like |
You are following the code correctly! I think we're better off with no help than what was there before. I really, really want to simplify the I can add some more info to the
Is the Likewise, is it important that we document+support both |
I think saying that most screens support Up, Down, Left, Right, PgUp, PgDown and maybe a blurb about Esc is probably enough for navigation. Tables have I don't see RE: I think your new help screen is a step in the right direction. |
Yes, I agree. The challenge comes in that when you do |
ok, I'm fine with that for now then. |
How's this (as both the help page and the landing page when opening I can make it nicer with styling later, just don't have time right now to wrap my head around what |
The only thing that isn't mentioned is |
Yeah, idk… I am really not a Vim person and Edit: to elaborate, |
If Enter does the same as |
@rgwood are you ready to land this? |
Yes! Good to go if we're far enough away from the release to merge things 👍 |
Remove a small (20kb) SQLite database that was accidentally added as part of #12692
This PR:
CustomValue
toexplore
. Previouslyopen foo.db | explore
didn't really work, now we "materialize" the whole database to aValue
before loading itanyhow
for error handling inexplore
. Previously we were kind of rolling our own version ofanyhow
by shoving all errors into astd::io::Error
; I think this is much nicer. This was necessary because as part of 1), collecting input is now fallible...explore
's fancy command help system.:help
,:try
, etc.) had a sophisticated help system with examples etc... but this was not very visible to users. You had to know to run:help :try
or view a list of commands with:help :
explore
, without the Vim-like commands. And so I don't think it's worth keeping this command help system around (it's intertwined with other stuff, and making these changes would have been harder if keeping it).--reverse
flag to--tail
. The flag scrolls to the end of the data, which IMO is described better by "tail"explore
codeI initially thought 1) would be just a few lines, and then this PR blew up into much more extensive changes 😅
Before
The whole database was being displayed as a single Nuon/JSON line 🤔
After
The database gets displayed like a record
Future work
It is sort of annoying that we have to load a whole SQLite database into memory to make this work; it will be impractical for large databases. I'd like to explore improvements to
CustomValue
that can make this work more efficiently.