Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support cli args to establish DB connection #46

Closed
dbarnett opened this issue Mar 1, 2024 · 4 comments · Fixed by #53
Closed

Support cli args to establish DB connection #46

dbarnett opened this issue Mar 1, 2024 · 4 comments · Fixed by #53
Labels
enhancement New feature or request

Comments

@dbarnett
Copy link
Contributor

dbarnett commented Mar 1, 2024

Could there be an option to pass a DB path to TableX as a cli argument and have it directly open into a connection to that DB path, as an alternative to opening to the landing page and then going through the UI to "Start a connection" > "Select a Database Driver" > enter connection details > "Connect"?

For example, allowing you to run commands like:

table-x mydb.sqlite
table-x postgresql://localhost:5432/mydb

?

@dbarnett
Copy link
Contributor Author

dbarnett commented Mar 1, 2024

Would also need to figure out if this connection somehow gets a name and gets saved in the list of known connections or what. Personally when I was working with SQLite files for a particular tool, I found it cumbersome picking a name and adding it to a persisted global list of TableX's connections and would've preferred to just invoke table-x ./somefile.sqlite any time I wanted to view it without having the connection persisted to open it from the UI in a later TableX session.

@kareemmahlees
Copy link
Owner

kareemmahlees commented Apr 2, 2024

Yoo!
I just implemented this and the assets are building as web speak 🚀 .
You will now be able to do something like:

$ TableX sqlite:./test.db --conn-name test --save

Try it out and lmk what you think!

@dbarnett
Copy link
Contributor Author

Yay, thanks! Just tried it out (finally) and it works great.

One nice-to-have: it doesn't seem to interpret homedir-relative paths like sqlite:~/some/path properly (but does work fine as sqlite:$HOME/some/path, at least in my terminal).

@kareemmahlees
Copy link
Owner

One nice-to-have: it doesn't seem to interpret homedir-relative paths like sqlite:~/some/path properly (but does work fine as sqlite:$HOME/some/path, at least in my terminal).

Fixed and coming in the next release 🚀.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants