jorgerojas26 / lazysql

A cross-platform TUI database management tool written in Go.
MIT License
916 stars 51 forks source link

Add connecting to database by connectionString given as an argument to cli #120

Open Kuchteq opened 1 week ago

Kuchteq commented 1 week ago

Thanks for the amazing tool! I'd like to see a feature like this get merged as I find it easier to just pass the path to the database I want to open as an argument, so I made this request. This implementation works but perhaps is doing a bit too much in the main.go file. I first tried doing most of this connection initialization inside Pages.go but the init() functions run before main.go's main() function.

I'd love to hear your feedback on this!

jorgerojas26 commented 1 week ago

I think your intuition is right, the main.go file need to be keep small, can you please move the command args processing to another file?. Also, can you please expand the "usage" section in the readme to include this?

Thank you for the PR.

Kuchteq commented 6 days ago

I am facing an issue where only sqlite databases work with passing the argument. Postgresql connects without any problem but can't open unfold the left menu for listing the tables.