]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Use importlib_metadata; add namespace for mariadb
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 12 Aug 2020 22:46:25 +0000 (18:46 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 13 Aug 2020 18:25:44 +0000 (14:25 -0400)
commitcd03b8f0cecbf72ecd6c99c4d3a6338c8278b40d
tree32b50cef944f41b1cfd5bd7b0dfd45af448e793b
parent65da69910944ccbad0c6d008b94ae8271aae4762
Use importlib_metadata; add namespace for mariadb

The ``importlib_metadata`` library is used to scan for setuptools
entrypoints rather than pkg_resources.   as importlib_metadata is a small
library that is included as of Python 3.8, the compatibility library is
installed as a dependency for Python versions older than 3.8.

Unfortunately setuptools "attr:" is broken because it tries to import
the module; seems like this is fixed as part of
https://github.com/pypa/setuptools/pull/1753 however this is too recent
to rely upon for now.

Added a new dialect token "mariadb" that may be used in place of "mysql" in
the :func:`_sa.create_engine` URL.  This will deliver a MariaDB dialect
subclass of the MySQLDialect in use that forces the "is_mariadb" flag to
True.  The dialect will raise an error if a server version string that does
not indicate MariaDB in use is received.   This is useful for
MariaDB-specific testing scenarios as well as to support applications that
are hardcoding to MariaDB-only concepts.  As MariaDB and MySQL featuresets
and usage patterns continue to diverge, this pattern may become more
prominent.

Fixes: #5400
Fixes: #5496
Change-Id: I330815ebe572b6a9818377da56621397335fa702
13 files changed:
doc/build/changelog/unreleased_14/5400.rst [new file with mode: 0644]
doc/build/changelog/unreleased_14/5496.rst [new file with mode: 0644]
doc/build/dialects/mysql.rst
lib/sqlalchemy/dialects/__init__.py
lib/sqlalchemy/dialects/mysql/base.py
lib/sqlalchemy/dialects/mysql/mariadb.py [new file with mode: 0644]
lib/sqlalchemy/util/compat.py
lib/sqlalchemy/util/langhelpers.py
setup.cfg
setup.py
test/dialect/mysql/test_compiler.py
test/dialect/mysql/test_dialect.py
tox.ini