.. changelog::
:version: 1.1.0b1
+ .. change::
+ :tags: change, postgresql
+
+ 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.
+
.. change::
:tags: bug, sqlite
:tickets: 3634
some issues may be moved to later milestones in order to allow
for a timely release.
- Document last updated: January 19, 2016
+ Document last updated: January 29, 2016
Introduction
============
:ticket:`2729`
+The "postgres" module is removed
+---------------------------------
+
+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.
+
Dialect Improvements and Changes - MySQL
=============================================
from .. import util
+_translates = {'postgres': 'postgresql'}
def _auto_fn(name):
"""default dialect importer.
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:
+++ /dev/null
-# 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
import logging.handlers
from sqlalchemy.testing.mock import Mock
from sqlalchemy.engine import engine_from_config
+from sqlalchemy.engine import url
+from sqlalchemy.testing import is_
+from sqlalchemy.testing import expect_deprecated
class MiscTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiledSQL):
psycopg2.Error)
assert isinstance(exception, exc.OperationalError)
+ def test_deprecated_dialect_name_still_loads(self):
+ with expect_deprecated(
+ "The 'postgres' dialect name "
+ "has been renamed to 'postgresql'"):
+ dialect = url.URL("postgres").get_dialect()
+ is_(dialect, postgresql.dialect)
+
# currently not passing with pg 9.3 that does not seem to generate
# any notices here, would rather find a way to mock this
@testing.requires.no_coverage