News for hackers. Stuff that matters.
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by mathaou on Friday September 03, 2021 @09:43PM (#28411355)
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!
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by throwawaybutwhy on Saturday September 04, 2021 @12:26AM (#28412069)
Please add instructions on how to build it. Looking forward to trying it out!
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by mathaou on Saturday September 04, 2021 @03:54AM (#28413053)
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.

I'll remedy that!

Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by GrayShade on Saturday September 04, 2021 @05:36AM (#28413550)
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.
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by unixsheikh on Saturday September 04, 2021 @01:40AM (#28412381)
Very well done! Great project!
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by faizshah on Friday September 03, 2021 @09:50PM (#28411387)
Really cool, I’m a big user of SQLite. Reminds me of visidata but for SQLite: https://github.com/saulpw/visidata
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by antattack on Friday September 03, 2021 @10:12PM (#28411471)
Visidata can view SQLite too: https://www.visidata.org/docs/formats/
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by mathaou on Saturday September 04, 2021 @04:50AM (#28413326)
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!
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by photojosh on Saturday September 04, 2021 @06:17AM (#28413746)
a vote for Postgres here!
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by mathaou on Saturday September 04, 2021 @06:45AM (#28413886)
Added to the list!
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by mathaou on Saturday September 04, 2021 @04:51AM (#28413328)
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by mathaou on Saturday September 04, 2021 @04:56AM (#28413347)
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...
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by dotancohen on Saturday September 04, 2021 @05:58AM (#28413663)
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.

Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by mathaou on Saturday September 04, 2021 @06:46AM (#28413897)
I can easily do all those but references and foreign keys. Not even going to think about that until alpha 3.
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by dotancohen on Saturday September 04, 2021 @11:21AM (#28415882)
Yeah, that is definitely an advanced feature. I'll be watching this repo, thank you!
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by eeiac928 on Saturday September 04, 2021 @09:15PM (#28420883)
mySQLite ; name suggestion
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by Aeolun on Saturday September 04, 2021 @01:53AM (#28412452)
Large databases are thousands of rows? My small database already has a few tens of thousands.

Who considers a few thousand rows large?

Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by hanche on Saturday September 04, 2021 @02:18AM (#28412560)
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.
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by zerr on Saturday September 04, 2021 @04:10AM (#28413126)
For SQLite seems reasonable? I remember it advertised as ini file replacement as well :)
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by laumars on Saturday September 04, 2021 @04:30AM (#28413222)
Sqlite easily manages millions of rows. I’ve used it in the past as part of a lazier implementation of an ELK-like stack and it worked fine.
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by mathaou on Saturday September 04, 2021 @03:56AM (#28413064)
Optimizations like that will be part of the next alpha release after the one I'm working on.
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by Aeolun on Saturday September 04, 2021 @07:10AM (#28414014)
I just honestly cannot imagine how it could start to be slow at a few thousand rows. Calling it an optimization feels wrong somehow.

Glad you hear you are planning to look at it though :)

Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by laumars on Saturday September 04, 2021 @08:12AM (#28414374)
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.
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by mathaou on Saturday September 04, 2021 @08:52AM (#28414630)
I have no control over which portions of the screen get updated when without updating the library I'm using.
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by laumars on Sunday September 05, 2021 @05:13PM (#28427856)
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).

Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by mathaou on Sunday September 05, 2021 @05:33PM (#28428025)
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).
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by say_it_as_it_is on Saturday September 04, 2021 @01:09PM (#28416857)
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.
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by thristian on Friday September 03, 2021 @10:50PM (#28411668)
> 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.

Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by enduku on Friday September 03, 2021 @11:42PM (#28411888)
Me too. Maybe it is the latency that affected this decision. If the cause for ignoring mouse events is latency, Mosh may be a bit better.

https://mosh.org/

Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by mathaou on Saturday September 04, 2021 @03:59AM (#28413074)
I haven't looked into that one too much, I'll thoroughly test it soon.

For whatever reason I only tested Windows ssh, since it's what I use for work. I'll test Linux soon.

Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by GrayShade on Saturday September 04, 2021 @05:33AM (#28413536)
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
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by mathaou on Saturday September 04, 2021 @06:49AM (#28413912)
Not sure if your data is not sensitive enough that you'd open an issue and attach it? I'd use it for testing.
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by mukundesh on Saturday September 04, 2021 @08:55AM (#28414657)
Very nice ! Wish I could build the schema, then this would be Microsoft Access in a terminal !
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by mathaou on Saturday September 04, 2021 @10:25AM (#28415381)
I have lots of plans including database creation. It's in its infancy now but 2-3 months from now that should be possible.
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by Crontab on Friday September 03, 2021 @10:00PM (#28411426)
Very nice!
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by mathaou on Saturday September 04, 2021 @03:59AM (#28413075)
Thank you!
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by tanin on Saturday September 04, 2021 @03:41AM (#28412973)
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.

If you are interested, please check it out: https://superintendent.app

Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by trevyn on Saturday September 04, 2021 @03:46AM (#28413000)
Not open source? Hard pass. Welcome to 2021.
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by pjmlp on Saturday September 04, 2021 @06:04AM (#28413686)
The supermarket down the street is now taking Git Pull Requests for grocery.
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by ergocoder on Saturday September 04, 2021 @03:56PM (#28418518)
The legend still lives on. We've heard they still goes through shops in their town and shout "Hard pass" to this day.
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by gizdan on Saturday September 04, 2021 @07:47AM (#28414231)
Now fully automated using SuperMarket X FLOSS tool written in Go.
Re:SQLite-TUI: A TUI for viewing SQLite databases, written i... by pjmlp on Saturday September 04, 2021 @08:16AM (#28414398)
Here is your opportunity to make it happen then,

https://www.rewe-digital.com/stellenangebote/649-go-develope...