joeferner / redis-commander

Redis management tool written in node.js
http://joeferner.github.io/redis-commander/
MIT License
3.63k stars 468 forks source link

Is there a way to edit multi-line commands in the CLI? #367

Open nwinkler opened 5 years ago

nwinkler commented 5 years ago

When working with complex Redis queries, e.g. the ones for Redisearch, it would be great if the CLI supported multi-line editing.

As an example, the search queries from this chapter from the Redisearch Aggregations documentation has a nice multi-line format:

FT.AGGREGATE myIndex "*"
  APPLY "@timestamp - (@timestamp % 3600)" AS hour

  GROUPBY 1 @hour
    REDUCE COUNT_DISTINCT 1 @user_id AS num_users

Is it possible to edit queries in Redis Commander like this? So far, I think I've only been able to edit one line at a time, which works, but makes it difficult to handle complex queries.

sseide commented 5 years ago

Sorry - not possible right now. Than we need to decide somehow if this command is complete or will be continued on the next line....

Would probably need a special multi-line mode with extra "Execute" button. Toggle between one-line and multi-line-Mode via another button/switch?

nwinkler commented 5 years ago

Toggle between single and multi-line edit mode would be fine with me!

I understand the concerns with parsing and figuring out whether the command is complete - since there's not terminating semicolon or anything like that...

sseide commented 5 years ago

As i do not know if/when i will find time for this a PR is welcome. If there are questions feel free to ask.