GlareDB / glaredb

GlareDB: An analytics DBMS for distributed data
https://glaredb.com
GNU Affero General Public License v3.0
637 stars 36 forks source link

tab completions in REPL #2492

Open universalmind303 opened 7 months ago

universalmind303 commented 7 months ago

Description

Most cli/shells have some form of tab completion (psql, mongosh, mysql, cassandra, ...). It'd be nice to have one too.

Details.

I'm not sure to what extent we want completions (sql keywords, functions, columns, tables, ...)

We can probably just start with table completion for now.

greyscaled commented 7 months ago

Something I'd like to see higher up on the list (after tables) is relative path completion. Right now if I start glaredb in a dir with files I want to query, I have to know the file names.

universalmind303 commented 7 months ago

Something I'd like to see higher up on the list (after tables) is relative path completion. Right now if I start glaredb in a dir with files I want to query, I have to know the file names.

yeah i think that's a great idea. We'd definitely need some context around what should be autocompleted. I'm wondering what would trigger that completer context though?

for tables + catalogs, I think the context trigger would just be ... FROM <KC_TAB> for just tables: ... FROM <catalog>.<KC_TAB>

I'd imagine we could just regex match to find out if it's a path? from\s+'(?:\.?/|file://).*<KC_TAB>