News for hackers. Stuff that matters.
Re:Usql – A universal command-line interface for SQL databases by makmanalp on Friday March 03, 2017 @12:10AM (#13780896)
Man, what I really would love is some ipython console with SQLAlchemy stuff built in that auto-sets up the connections and session objects, and that has convenience functions for table / database info and dumping data out to CSV/TSV - that'd come close, I think.
Re:Usql – A universal command-line interface for SQL databases by amjith on Friday March 03, 2017 @01:18AM (#13781102)
You know this actually exists: https://github.com/catherinedevlin/ipython-sql

I found out about this from one of the core-devs of pgcli. He made it possible to embed pgcli inside ipython. We wrote a blog post about how to use this: http://pgcli.com/embedding-pgcli-in-ipython.html

Re:Usql – A universal command-line interface for SQL databases by makmanalp on Friday March 03, 2017 @08:48AM (#13782785)
Wow, I even had this repo starred but somehow ignored the contents entirely. Thank you, kind stranger! This'll be so useful to me.
Re:Usql – A universal command-line interface for SQL databases by blitzd on Friday March 03, 2017 @12:44PM (#13784572)
Using pandas you can do a lot of that with a query and a connection, dumping to CSV/Excel/JSON etc is pretty trivial once you have your data in a dataframe. It also supports writing data back to tables via SQLAlchemy as well, and any kind of data manipulation you can imagine in between. I'm currently using it to migrate a Mongo database to PostgreSQL.