diff options
author | Gord Thompson <gord@gordthompson.com> | 2021-05-30 14:43:36 -0600 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-06-01 16:15:53 -0400 |
commit | 32c09ed1c9e3b3efad9be63b32c1b36273de992c (patch) | |
tree | a567e0903b3c75f8df2968accd92e45c3538e805 /lib/sqlalchemy/dialects/postgresql/pg8000.py | |
parent | d8578fe0996718433cc8e0c440eb855f71fbc2c6 (diff) | |
download | sqlalchemy-32c09ed1c9e3b3efad9be63b32c1b36273de992c.tar.gz |
Clarify connection arg usage for postgresql
Change-Id: I417b4d19c2c17a73ba9c95d59f1562ad5dab2d35
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/pg8000.py')
-rw-r--r-- | lib/sqlalchemy/dialects/postgresql/pg8000.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/pg8000.py b/lib/sqlalchemy/dialects/postgresql/pg8000.py index e39f61ddc..7230c2ce2 100644 --- a/lib/sqlalchemy/dialects/postgresql/pg8000.py +++ b/lib/sqlalchemy/dialects/postgresql/pg8000.py @@ -42,7 +42,7 @@ passed to :func:`_sa.create_engine` using the ``client_encoding`` parameter:: .. _pg8000_ssl: SSL Connections ----------------- +--------------- pg8000 accepts a Python ``SSLContext`` object which may be specified using the :paramref:`_sa.create_engine.connect_args` dictionary:: @@ -50,8 +50,8 @@ pg8000 accepts a Python ``SSLContext`` object which may be specified using the import ssl ssl_context = ssl.create_default_context() engine = sa.create_engine( - "postgresql+pg8000://scott:tiger@192.168.0.199:5432/test, - connect_args={'ssl_context': ssl_context}, + "postgresql+pg8000://scott:tiger@192.168.0.199/test", + connect_args={"ssl_context": ssl_context}, ) If the server uses an automatically-generated certificate that is self-signed @@ -60,11 +60,11 @@ necessary to disable hostname checking:: import ssl ssl_context = ssl.create_default_context() - ssl_context.check_hostname=False + ssl_context.check_hostname = False ssl_context.verify_mode = ssl.CERT_NONE engine = sa.create_engine( - "postgresql+pg8000://scott:tiger@192.168.0.199:5432/test, - connect_args={'ssl_context': ssl_context}, + "postgresql+pg8000://scott:tiger@192.168.0.199/test", + connect_args={"ssl_context": ssl_context}, ) .. _pg8000_isolation_level: |