diff options
author | Gord Thompson <gord@gordthompson.com> | 2021-11-08 11:03:54 -0700 |
---|---|---|
committer | Gord Thompson <gord@gordthompson.com> | 2021-11-09 06:12:39 -0700 |
commit | bd1be0b7e0ecd76bdf6d26fd11cc42e1a473b319 (patch) | |
tree | bcb527a334bb3da906b8c450f93f3dc3ed683a27 /lib/sqlalchemy/dialects/postgresql | |
parent | cf404d840c15fe167518dd884b295dc99ee26178 (diff) | |
download | sqlalchemy-bd1be0b7e0ecd76bdf6d26fd11cc42e1a473b319.tar.gz |
De-emphasize notion of "default driver" (DBAPI)
Fixes: #6960
Even though a default driver still exists for
each dialect, remove most usages of `dialect://`
to encourage users to explicitly specify
`dialect+driver://`
Change-Id: I0ad42167582df509138fca64996bbb53e379b1af
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql')
-rw-r--r-- | lib/sqlalchemy/dialects/postgresql/base.py | 2 | ||||
-rw-r--r-- | lib/sqlalchemy/dialects/postgresql/json.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index 87afa0293..a00c26e87 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -346,7 +346,7 @@ were set to include ``test_schema``, and we invoked a table reflection process as follows:: >>> from sqlalchemy import Table, MetaData, create_engine, text - >>> engine = create_engine("postgresql://scott:tiger@localhost/test") + >>> engine = create_engine("postgresql+psycopg2://scott:tiger@localhost/test") >>> with engine.connect() as conn: ... conn.execute(text("SET search_path TO test_schema, public")) ... meta = MetaData() diff --git a/lib/sqlalchemy/dialects/postgresql/json.py b/lib/sqlalchemy/dialects/postgresql/json.py index 2acf177f5..ef046e3ae 100644 --- a/lib/sqlalchemy/dialects/postgresql/json.py +++ b/lib/sqlalchemy/dialects/postgresql/json.py @@ -159,7 +159,7 @@ class JSON(sqltypes.JSON): using psycopg2, the DBAPI only allows serializers at the per-cursor or per-connection level. E.g.:: - engine = create_engine("postgresql://scott:tiger@localhost/test", + engine = create_engine("postgresql+psycopg2://scott:tiger@localhost/test", json_serializer=my_serialize_fn, json_deserializer=my_deserialize_fn ) |