ipython-sql
ipython-sql copied to clipboard
allow passing an engine directly to Connection
Hello--I've really enjoyed using ipython-sql! One challenge I have is that it requires creating a new engine, rather than using an existing one.
I can work around this by having Connection create the engine, and the grabbing it off of that. However, working with all the tools that can take a sqlalchemy engine feels bit easier, if I can make it upfront and then pass it to them.
Thanks for all your work on this tool!
edit: here's the current workaround:
from sql.connection import Connection
con = Connection("duckdb:///:memory:")
con.session.engine
This has been added to JupySQL 0.5.1 (a fork of ipython-sql):
pip install jupysql --upgrade
import pandas as pd
from sqlalchemy.engine import create_engine
engine = create_engine("sqlite://")
df = pd.DataFrame({"x": range(5)})
df.to_sql("numbers", engine)
%load_ext SQL
%sql engine
%%sql
SELECT * FROM numbers
Ah thanks! I noticed one of the other additions is telemetry from ploomber_core that is opt out. Can you say more about what that's doing?