summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2016-01-29 11:44:58 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2016-01-29 11:44:58 -0500
commitc59bf0007f0148b73c80a3d6b86d6c66ae0ab422 (patch)
treeb08546beb64fc526fcee16a32eb2d98d408a902b /lib/sqlalchemy/dialects
parent859379e2fcc4506d036700ba1eca4c0ae526a8ee (diff)
downloadsqlalchemy-c59bf0007f0148b73c80a3d6b86d6c66ae0ab422.tar.gz
- The ``sqlalchemy.dialects.postgres`` module, long deprecated, is
removed; this has emitted a warning for many years and projects should be calling upon ``sqlalchemy.dialects.postgresql``. Engine URLs of the form ``postgres://`` will still continue to function, however.
Diffstat (limited to 'lib/sqlalchemy/dialects')
-rw-r--r--lib/sqlalchemy/dialects/__init__.py9
-rw-r--r--lib/sqlalchemy/dialects/postgres.py18
2 files changed, 9 insertions, 18 deletions
diff --git a/lib/sqlalchemy/dialects/__init__.py b/lib/sqlalchemy/dialects/__init__.py
index af20c3906..bf9c6d38e 100644
--- a/lib/sqlalchemy/dialects/__init__.py
+++ b/lib/sqlalchemy/dialects/__init__.py
@@ -17,6 +17,7 @@ __all__ = (
from .. import util
+_translates = {'postgres': 'postgresql'}
def _auto_fn(name):
"""default dialect importer.
@@ -30,6 +31,14 @@ def _auto_fn(name):
else:
dialect = name
driver = "base"
+
+ if dialect in _translates:
+ translated = _translates[dialect]
+ util.warn_deprecated(
+ "The '%s' dialect name has been "
+ "renamed to '%s'" % (dialect, translated)
+ )
+ dialect = translated
try:
module = __import__('sqlalchemy.dialects.%s' % (dialect, )).dialects
except ImportError:
diff --git a/lib/sqlalchemy/dialects/postgres.py b/lib/sqlalchemy/dialects/postgres.py
deleted file mode 100644
index 04d37a2e6..000000000
--- a/lib/sqlalchemy/dialects/postgres.py
+++ /dev/null
@@ -1,18 +0,0 @@
-# dialects/postgres.py
-# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
-# <see AUTHORS file>
-#
-# This module is part of SQLAlchemy and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
-
-# backwards compat with the old name
-from sqlalchemy.util import warn_deprecated
-
-warn_deprecated(
- "The SQLAlchemy PostgreSQL dialect has been renamed from 'postgres' to "
- "'postgresql'. The new URL format is "
- "postgresql[+driver]://<user>:<pass>@<host>/<dbname>"
-)
-
-from sqlalchemy.dialects.postgresql import *
-from sqlalchemy.dialects.postgresql import base