1
0
Fork 0

magic: use pgcli.connect_uri instead of connect (#1375)

This makes %pgcli work even if you use non-password (e.g. TLS cert)
authentication
This commit is contained in:
Anna Glasgall 2022-10-27 20:40:19 -04:00 committed by GitHub
parent 1726ff5397
commit 285e62559e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 1 deletions

View File

@ -124,6 +124,7 @@ Contributors:
* Kian-Meng Ang (kianmeng)
* Liu Zhao (astroshot)
* Rigo Neri (rigoneri)
* Anna Glasgall (annathyst)
Creator:
--------

View File

@ -7,6 +7,7 @@ Features:
* Changed the `destructive_warning` config to be a list of commands that are considered
destructive. This would allow you to be warned on `create`, `grant`, or `insert` queries.
* Destructive warnings will now include the alias dsn connection string name if provided (-D option).
* pgcli.magic will now work with connection URLs that use TLS client certificates for authentication
3.5.0 (2022/09/15):
===================

View File

@ -43,7 +43,7 @@ def pgcli_line_magic(line):
u = conn.session.engine.url
_logger.debug("New pgcli: %r", str(u))
pgcli.connect(u.database, u.host, u.username, u.port, u.password)
pgcli.connect_uri(str(u._replace(drivername="postgres")))
conn._pgcli = pgcli
# For convenience, print the connection alias