basementdevs / scyllash

14 stars 1 forks source link

feat: query text editor #4

Open DanielHe4rt opened 3 months ago

DanielHe4rt commented 3 months ago

Feature: Query Text Editor

reedline ratatui-weird-stuff

The primary and only feature of CQLSH is his powerful REPL integration, thinking on that IMHO this will be the hardest feature to be implementing.

Here we have a couple of possibilities:

Let's use this issue to discuss about this feature for now.

Tomcat-42 commented 3 months ago

IMHO reedline will be the best option for something like that. If we can achieve at least 10% of the Nushell experience, that would be great.

Tomcat-42 commented 3 months ago

If no one has started working on this, I would like to tackle it.

Daniel-Boll commented 3 months ago

@Tomcat-42 Could you try to create a POC integrating the reedline terminal in the defined layout?

Also apart from reedline there is also rustyline, but I think reedline is more mature.

Another positive point about reedline is that there is already a repo that implements a REPL on top of it reedline-repl-rs

DanielHe4rt commented 3 months ago

@Tomcat-42 let us know if you have any WIP. You can also open a draft in case you make some progress there :p

Tomcat-42 commented 3 months ago

@DanielHe4rt Ok, will do that.

Daniel-Boll commented 3 months ago

From what I tested it may be difficult, reedline kinda wants to occupy everything, at least with the defaults. We need to find a way to render it only within our constraints, sort of like a iframe.

DanielHe4rt commented 3 weeks ago

We'll have to copy some behaviors from Database Like shells, like: when to actually send the query?

It's not when you press enter, but when the last character is an semicolon ";" and I'm just thinking how would be an UI for that.

PS: I know that we stopped this project for now, but I'll be feeding it with information later.

Daniel-Boll commented 3 weeks ago

What if it's less like a REPL and more like an editor, similar to the scylladb studio itself? The user would be able to maintain multiple queries in the editor and selecting which one they want to run, or just ctrl+enter on the currently hovered one.