From e7b37a1b2ab79693e7cbc5eeed16ecfdb0cd6f12 Mon Sep 17 00:00:00 2001 From: Damien Baty Date: Sun, 26 Apr 2026 11:30:07 +0200 Subject: [PATCH] Fix integration with IPython pgcli now requires psycopg3, whose `Connection` object does not have a `session` attribute. We can retrieve the URL directly from the `Connection` object. --- pgcli/magic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pgcli/magic.py b/pgcli/magic.py index 09902a295..7c0d047c5 100644 --- a/pgcli/magic.py +++ b/pgcli/magic.py @@ -40,7 +40,7 @@ def pgcli_line_magic(line): # from the sqlalchemy connection, so just grab the url and make a # new connection pgcli = PGCli() - u = conn.session.engine.url + u = conn.url _logger.debug("New pgcli: %r", str(u)) pgcli.connect_uri(str(u._replace(drivername="postgres")))