Live data from Hacker News

Rainfrog – a database management TUI for Postgres

github.com

31–40 of 52 posts

Re: Rainfrog – a database management TUI for Postgres

#31

I'm new to Rust, can someone tell me if that's good Rust code I could learn from? https://github.com/achristmascarl/rainfrog/blob/main/src/app...

I only looked at the linked file, so I'm not going to speak to the rest of the code and don't really have a good grasp of the architecture here.

This seems mostly ok. The only thing that (imo) wouldn't pass code review is that big honking loop at https://github.com/achristmascarl/rainfrog/blob/main/src/app.... That thing needs to be refactored down to be readable, with individual logic chunks being put into their own functions and tidied up a bit.

That's not really Rust-specific, obviously, but all the `match` and `if let` and whatever other Rust stuff looks fine, so it's what I've got.

Re: Rainfrog – a database management TUI for Postgres

#33

I'm new to Rust, can someone tell me if that's good Rust code I could learn from? https://github.com/achristmascarl/rainfrog/blob/main/src/app...

nope :)

on a more serious note, the library i used for the query editor, tui-textarea [0], is very well done, and the other db tui i drew inspiration from, gobang[1], is a great example of a ratatui app. would recommend checking those out

[0] https://github.com/rhysd/tui-textarea

[1] https://github.com/TaKO8Ki/gobang

Re: Rainfrog – a database management TUI for Postgres

#36
post #20
post #17

Earlier quoted context omitted.

popups are windows. selecting+copying text from the results-table does not work the first time. clicking in the left pane on a connection sometimes picks the wrong one (really weird this one as it is not consistent). i only see the standard wayland icon (not the worst).

Sorry for the dumb question, but what is the significance of this issue, "popups are windows"? Has something changed in Wayland which makes child windows unworkable?

Why dumb? Just a question to me, I gladly elaborate.

If I loose a connection I used to get a little popup in the bottom right corner when I try to execute a query, explaining why it's not executing.

They now popup in the middle of the screen and are much larger. I remember I had to close them by hand at some point, but maybe I'm wrong because I just reproduced it and they closed themselves quickly.

Only this little popups annoy me. The bigger child windows behave the same.

(The 2-3 child windows that show on app startup --flash, tip-of-the-day, and another one-- are quite annoying though and according to my colleagues it's not possible to enforce a setting that stop them from showing; but these were already annoying on Xorg)

Re: Rainfrog – a database management TUI for Postgres

#39

Earlier quoted context omitted.

Not OP, but I personally put off using a UI for years before finally trying a few and eventually settling on Postico for Mac. I still jump to psql often, but for me it's an accumulation of small quality-of-life improvements: - results are formatted nicely by default; no more doing a first query, getting too many columns so results wrap unreadably, then changing the columns for a second query, and so on - manually edi…

would symlinks in that global location help, maybe?

It’s a good idea! For some reason Postico’s built-in query viewer doesn’t seem to follow them, unfortunately.

Re: Rainfrog – a database management TUI for Postgres

#40
post #35

Looks pretty cool. I could see this being useful for some of my coworkers. I might try it with read-only access. I pretty much always use DataGrip or pgcli and don't see that changing, but will keep an eye on this.

Yeah. Reminds me of k9s.
Post reply on HN