Hey thanks for posting this! This is my project I started and the goal is to have it be an eventually database agnostic terminal spreadsheet kind of program. Lots planned for the future!
I absolutely will as soon as I can! I just started it two days ago and was kind of blown away by the response, so the readme definitely didn't get a lot of attention.
Cloning to `~/go` and running `go build` worked for me. But I can never remember how to build Go projects, so adding more details in the README would be nice.
Hey everyone! Author here. In order to better reflect my future plans for the project, I have rebranded of sorts. It is now called termdbms (suggestions on a better name welcome), because eventually I would like to become database agnostic. MySQL support is planned for the alpha 1.0 release!
You will eventually be able to run SQL queries on the database within the application. I hope to blend that with spreadsheet-like user interface so its easy to add or remove rows, columns, values, rename, etc...
Thank you for your work, this looks terrific for exploring databases that one is unfamiliar with. Like we do when joining an extant project.
If there was a nice way to explore the tables that would be great. Such as filter by table name, and show how many records are in each table. Or even a way to show which tables reference other tables.
One person’s small is another person’s large. It all comes down to your typical use cases; no surprise there. I have lots of tiny sqlite databases myself, so for me, a few tens of thousands rows is large. But at least I am well aware that multi-gigabyte sqlite databases can and do exist.
Larger querying larger databases should be a problem for the RDBMS not for the UI wrapper. So I’d wager he is processing every record on the db irrespective of whether it’s visible on screen or not. It would explain the TUI panic posted elsewhere too.
One way to optimise this is to pull back the entire SQL results in an [][]interface{} (row, column) but then only pass a sub-slice to your TUI (depending on how many rows are visible).
I assume your term library doesn’t create the actual table? So you’d know the term height and you’re then plotting the cells? If that’s not the case then I don’t think you’ll get much further with this project without switching to another term library (or rolling your own — which is actually easier than it sounds).
Lol I just did this. Now way faster and can handle arbitrary amounts of data (there is some flickering on scroll for large data sets I'm trying to sort out).
That it was written at all is what matters. Mentioning that it was written in Go simply tells us that it's fast enough for a cli and is a single binary. Yet, many existing python utilities in this class are also fast enough and not backed by a single binary.
> NOTE: Mouse controls don't work for remote sessions like serial or SSH.
That's weird. I'm having a hard time imagining how it would be possible to break mouse controls over SSH, since the escape sequences used to signal mouse events are transport-agnostic.
I just tested it. Mouse works in Linux over SSH, but I'm not really sure how to use the app otherwise (:.
And yeah, it crashes on larger databases:
panic: runtime error: slice bounds out of range [:-1]
goroutine 54 [running]:
sqlite3-viewer/viewer.TruncateIfApplicable(0xc02037ef70, {0xc000126038, 0x7})
~/go/tuitty/viewer/util.go:99 +0x192
sqlite3-viewer/viewer.TuiModel.View.func2(0xc000818f60)
~/go/tuitty/viewer/viewer.go:121 +0xae5
created by sqlite3-viewer/viewer.TuiModel.View
~/go/tuitty/viewer/viewer.go:106 +0x272
I've built a similar project (backed by Sqlite), though it's full GUI.
At work, I work with a lot of CSVs. I often hit the limit of Excel and Google Sheets. Plus, using formula is difficult. The ergonomics around it is also not great (e.g. am I suppose to write long formula in a one-line box at the top?)
Eventually, I've decided to create Superintendent that enables me to write SQL on CSVs.
I'm working on optimizing it to be faster and faster. Currently, it can load 1GB CSV on Mac Pro 2020 within 10 seconds because it basically goes to C code.
I'm looking to make it feel more and more like a spreadsheet (e.g. click to sort, copy row, copy column, edit it directly) while giving focus to SQL writing. I'm loving it so far, but there are still a lot of improvements to be made.