]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commit
Add dialect_options to environment; set paramstyle=named for offline
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 20 Jul 2019 16:54:37 +0000 (12:54 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 21 Jul 2019 16:07:30 +0000 (12:07 -0400)
commit7995199012173d77e2dcaf02d4ded5d2d7a6f634
tree40d52590ef9ff7d4e4708318eb0f924f95e7033c
parent02a1bf3454acb7b02942e246c19326630a8f9175
Add dialect_options to environment; set paramstyle=named for offline

Fixed bug where the double-percent logic applied to some dialects such as
psycopg2 would be rendered in ``--sql`` mode, by allowing dialect options
to be passed through to the dialect used to generate SQL and then providing
``paramstyle="named"`` so that percent signs need not be doubled.   For
users having this issue, existing env.py scripts need to add
``dialect_opts={"paramstyle": "named"}`` to their offline
context.configure().  See the ``alembic/templates/generic/env.py`` template
for an example.

Change-Id: Ia6a495704b029eaff43fb3b6df602ca667002b7a
Fixes: #562
alembic/runtime/environment.py
alembic/runtime/migration.py
alembic/templates/generic/env.py
alembic/templates/multidb/env.py
alembic/templates/pylons/env.py
alembic/testing/requirements.py
docs/build/unreleased/562.rst [new file with mode: 0644]
tests/test_environment.py