'How to remove connection string info from ipython-sql output?
I'm using the wonderful ipython-sql
But when I get some data from the database I always see the connection string printed out. See image.
How can I stop the connection string from being shown?
Solution 1:[1]
The extension can handle multiple connections. If you omit the connection string from the magic statement, it wants to tell you which connection the query was applied to (even if you only had one open). But if you include the connection string, then the output won't have the connection string, your statement would need to look like:
%sql postgresql://rl_odin_admin:***@localhost:5432/odin select * from heimdall.vw_time_series_type_v1;
To save typing, you can assign the connection string to a variable, and then use $ in the magic statement, like so:
con = 'postgresql://rl_odin_admin:***@localhost:5432/odin'
%sql $con select * from heimdall.vw_time_series_type_v1;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Simon Garcia |

