alembic 1.13.0__tar.gz → 1.13.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {alembic-1.13.0 → alembic-1.13.1}/.github/workflows/run-test.yaml +0 -1
- {alembic-1.13.0 → alembic-1.13.1}/PKG-INFO +1 -1
- {alembic-1.13.0 → alembic-1.13.1}/alembic/__init__.py +1 -1
- alembic-1.13.1/alembic/autogenerate/__init__.py +10 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/autogenerate/api.py +6 -4
- {alembic-1.13.0 → alembic-1.13.1}/alembic/autogenerate/compare.py +5 -4
- {alembic-1.13.0 → alembic-1.13.1}/alembic/autogenerate/render.py +9 -9
- {alembic-1.13.0 → alembic-1.13.1}/alembic/autogenerate/rewriter.py +26 -13
- {alembic-1.13.0 → alembic-1.13.1}/alembic/command.py +3 -1
- {alembic-1.13.0 → alembic-1.13.1}/alembic/config.py +20 -9
- {alembic-1.13.0 → alembic-1.13.1}/alembic/context.pyi +10 -5
- {alembic-1.13.0 → alembic-1.13.1}/alembic/ddl/__init__.py +1 -1
- {alembic-1.13.0 → alembic-1.13.1}/alembic/ddl/_autogen.py +4 -2
- {alembic-1.13.0 → alembic-1.13.1}/alembic/ddl/base.py +12 -9
- {alembic-1.13.0 → alembic-1.13.1}/alembic/ddl/impl.py +5 -2
- {alembic-1.13.0 → alembic-1.13.1}/alembic/ddl/mssql.py +4 -1
- {alembic-1.13.0 → alembic-1.13.1}/alembic/ddl/mysql.py +5 -3
- {alembic-1.13.0 → alembic-1.13.1}/alembic/ddl/oracle.py +4 -1
- {alembic-1.13.0 → alembic-1.13.1}/alembic/ddl/postgresql.py +16 -9
- {alembic-1.13.0 → alembic-1.13.1}/alembic/ddl/sqlite.py +8 -6
- {alembic-1.13.0 → alembic-1.13.1}/alembic/op.pyi +46 -8
- {alembic-1.13.0 → alembic-1.13.1}/alembic/operations/base.py +70 -14
- {alembic-1.13.0 → alembic-1.13.1}/alembic/operations/batch.py +7 -8
- {alembic-1.13.0 → alembic-1.13.1}/alembic/operations/ops.py +52 -30
- {alembic-1.13.0 → alembic-1.13.1}/alembic/operations/schemaobj.py +5 -4
- {alembic-1.13.0 → alembic-1.13.1}/alembic/operations/toimpl.py +3 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/runtime/environment.py +15 -6
- {alembic-1.13.0 → alembic-1.13.1}/alembic/runtime/migration.py +27 -11
- {alembic-1.13.0 → alembic-1.13.1}/alembic/script/base.py +13 -15
- {alembic-1.13.0 → alembic-1.13.1}/alembic/script/revision.py +30 -17
- {alembic-1.13.0 → alembic-1.13.1}/alembic/script/write_hooks.py +3 -0
- alembic-1.13.1/alembic/util/__init__.py +35 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/util/compat.py +25 -8
- {alembic-1.13.0 → alembic-1.13.1}/alembic/util/langhelpers.py +78 -33
- {alembic-1.13.0 → alembic-1.13.1}/alembic/util/messaging.py +6 -3
- {alembic-1.13.0 → alembic-1.13.1}/alembic/util/pyfiles.py +7 -3
- {alembic-1.13.0 → alembic-1.13.1}/alembic/util/sqla_compat.py +43 -14
- {alembic-1.13.0 → alembic-1.13.1}/alembic.egg-info/PKG-INFO +1 -1
- {alembic-1.13.0 → alembic-1.13.1}/docs/_sources/changelog.rst.txt +53 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_static/documentation_options.js +1 -1
- {alembic-1.13.0 → alembic-1.13.1}/docs/api/autogenerate.html +8 -8
- {alembic-1.13.0 → alembic-1.13.1}/docs/api/commands.html +5 -5
- {alembic-1.13.0 → alembic-1.13.1}/docs/api/config.html +7 -7
- {alembic-1.13.0 → alembic-1.13.1}/docs/api/ddl.html +5 -5
- {alembic-1.13.0 → alembic-1.13.1}/docs/api/index.html +4 -4
- {alembic-1.13.0 → alembic-1.13.1}/docs/api/operations.html +12 -12
- {alembic-1.13.0 → alembic-1.13.1}/docs/api/overview.html +4 -4
- {alembic-1.13.0 → alembic-1.13.1}/docs/api/runtime.html +13 -8
- {alembic-1.13.0 → alembic-1.13.1}/docs/api/script.html +6 -6
- {alembic-1.13.0 → alembic-1.13.1}/docs/autogenerate.html +4 -4
- {alembic-1.13.0 → alembic-1.13.1}/docs/batch.html +4 -4
- {alembic-1.13.0 → alembic-1.13.1}/docs/branches.html +4 -4
- {alembic-1.13.0 → alembic-1.13.1}/docs/build/changelog.rst +53 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/build/conf.py +2 -2
- {alembic-1.13.0 → alembic-1.13.1}/docs/changelog.html +53 -4
- {alembic-1.13.0 → alembic-1.13.1}/docs/cookbook.html +4 -4
- {alembic-1.13.0 → alembic-1.13.1}/docs/front.html +4 -4
- {alembic-1.13.0 → alembic-1.13.1}/docs/genindex.html +4 -4
- {alembic-1.13.0 → alembic-1.13.1}/docs/index.html +8 -4
- {alembic-1.13.0 → alembic-1.13.1}/docs/naming.html +4 -4
- {alembic-1.13.0 → alembic-1.13.1}/docs/offline.html +4 -4
- {alembic-1.13.0 → alembic-1.13.1}/docs/ops.html +16 -12
- {alembic-1.13.0 → alembic-1.13.1}/docs/py-modindex.html +4 -4
- {alembic-1.13.0 → alembic-1.13.1}/docs/search.html +4 -4
- alembic-1.13.1/docs/searchindex.js +1 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/tutorial.html +4 -4
- {alembic-1.13.0 → alembic-1.13.1}/pyproject.toml +6 -6
- {alembic-1.13.0 → alembic-1.13.1}/setup.cfg +0 -16
- {alembic-1.13.0 → alembic-1.13.1}/tests/test_autogen_diffs.py +9 -0
- {alembic-1.13.0 → alembic-1.13.1}/tests/test_environment.py +5 -0
- {alembic-1.13.0 → alembic-1.13.1}/tests/test_script_production.py +14 -1
- {alembic-1.13.0 → alembic-1.13.1}/tests/test_version_traversal.py +61 -0
- {alembic-1.13.0 → alembic-1.13.1}/tools/write_pyi.py +3 -3
- alembic-1.13.0/alembic/autogenerate/__init__.py +0 -10
- alembic-1.13.0/alembic/util/__init__.py +0 -35
- alembic-1.13.0/docs/searchindex.js +0 -1
- {alembic-1.13.0 → alembic-1.13.1}/.coveragerc +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/.github/FUNDING.yml +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/.github/ISSUE_TEMPLATE/use_case.md +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/.github/pull_request_template.md +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/.github/workflows/run-on-pr.yaml +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/.gitignore +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/.gitreview +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/.pre-commit-config.yaml +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/CHANGES +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/LICENSE +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/MANIFEST.in +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/README.rst +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/README.unittests.rst +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/__main__.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/context.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/environment.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/migration.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/op.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/operations/__init__.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/py.typed +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/runtime/__init__.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/script/__init__.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/templates/async/README +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/templates/async/alembic.ini.mako +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/templates/async/env.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/templates/async/script.py.mako +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/templates/generic/README +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/templates/generic/alembic.ini.mako +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/templates/generic/env.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/templates/generic/script.py.mako +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/templates/multidb/README +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/templates/multidb/alembic.ini.mako +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/templates/multidb/env.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/templates/multidb/script.py.mako +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/testing/__init__.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/testing/assertions.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/testing/env.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/testing/fixtures.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/testing/plugin/__init__.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/testing/plugin/bootstrap.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/testing/requirements.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/testing/schemacompare.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/testing/suite/__init__.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/testing/suite/_autogen_fixtures.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/testing/suite/test_autogen_comments.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/testing/suite/test_autogen_computed.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/testing/suite/test_autogen_diffs.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/testing/suite/test_autogen_fks.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/testing/suite/test_autogen_identity.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/testing/suite/test_environment.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/testing/suite/test_op.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/testing/util.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/testing/warnings.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/util/editor.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic/util/exc.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic.egg-info/SOURCES.txt +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic.egg-info/dependency_links.txt +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic.egg-info/entry_points.txt +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic.egg-info/not-zip-safe +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic.egg-info/requires.txt +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/alembic.egg-info/top_level.txt +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_images/api_overview.png +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_sources/api/autogenerate.rst.txt +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_sources/api/commands.rst.txt +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_sources/api/config.rst.txt +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_sources/api/ddl.rst.txt +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_sources/api/index.rst.txt +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_sources/api/operations.rst.txt +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_sources/api/overview.rst.txt +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_sources/api/runtime.rst.txt +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_sources/api/script.rst.txt +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_sources/autogenerate.rst.txt +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_sources/batch.rst.txt +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_sources/branches.rst.txt +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_sources/cookbook.rst.txt +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_sources/front.rst.txt +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_sources/index.rst.txt +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_sources/naming.rst.txt +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_sources/offline.rst.txt +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_sources/ops.rst.txt +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_sources/tutorial.rst.txt +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_static/basic.css +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_static/changelog.css +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_static/clipboard.min.js +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_static/copybutton.css +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_static/copybutton.js +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_static/copybutton_funcs.js +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_static/doctools.js +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_static/file.png +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_static/language_data.js +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_static/minus.png +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_static/nature.css +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_static/nature_override.css +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_static/plus.png +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_static/pygments.css +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_static/searchtools.js +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_static/site_custom_css.css +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_static/sphinx_highlight.js +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/_static/sphinx_paramlinks.css +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/build/Makefile +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/build/_static/nature_override.css +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/build/_static/site_custom_css.css +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/build/_templates/site_custom_sidebars.html +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/build/api/api_overview.png +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/build/api/autogenerate.rst +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/build/api/commands.rst +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/build/api/config.rst +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/build/api/ddl.rst +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/build/api/index.rst +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/build/api/operations.rst +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/build/api/overview.rst +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/build/api/runtime.rst +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/build/api/script.rst +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/build/assets/api_overview.graffle +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/build/autogenerate.rst +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/build/batch.rst +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/build/branches.rst +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/build/cookbook.rst +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/build/front.rst +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/build/index.rst +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/build/make.bat +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/build/naming.rst +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/build/offline.rst +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/build/ops.rst +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/build/requirements.txt +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/build/tutorial.rst +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/docs/build/unreleased/README.txt +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/reap_dbs.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/setup.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/tests/__init__.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/tests/_large_map.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/tests/conftest.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/tests/requirements.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/tests/test_autogen_composition.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/tests/test_autogen_indexes.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/tests/test_autogen_render.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/tests/test_batch.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/tests/test_bulk_insert.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/tests/test_command.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/tests/test_config.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/tests/test_editor.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/tests/test_external_dialect.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/tests/test_impl.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/tests/test_mssql.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/tests/test_mysql.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/tests/test_offline_environment.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/tests/test_op.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/tests/test_op_naming_convention.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/tests/test_oracle.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/tests/test_post_write.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/tests/test_postgresql.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/tests/test_revision.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/tests/test_script_consumption.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/tests/test_sqlite.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/tests/test_stubs.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/tests/test_suite.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/tests/test_version_table.py +0 -0
- {alembic-1.13.0 → alembic-1.13.1}/tox.ini +0 -0
@@ -0,0 +1,10 @@
|
|
1
|
+
from .api import _render_migration_diffs as _render_migration_diffs
|
2
|
+
from .api import compare_metadata as compare_metadata
|
3
|
+
from .api import produce_migrations as produce_migrations
|
4
|
+
from .api import render_python_code as render_python_code
|
5
|
+
from .api import RevisionContext as RevisionContext
|
6
|
+
from .compare import _produce_net_changes as _produce_net_changes
|
7
|
+
from .compare import comparators as comparators
|
8
|
+
from .render import render_op_text as render_op_text
|
9
|
+
from .render import renderers as renderers
|
10
|
+
from .rewriter import Rewriter as Rewriter
|
@@ -28,6 +28,7 @@ if TYPE_CHECKING:
|
|
28
28
|
from sqlalchemy.engine import Inspector
|
29
29
|
from sqlalchemy.sql.schema import MetaData
|
30
30
|
from sqlalchemy.sql.schema import SchemaItem
|
31
|
+
from sqlalchemy.sql.schema import Table
|
31
32
|
|
32
33
|
from ..config import Config
|
33
34
|
from ..operations.ops import DowngradeOps
|
@@ -165,6 +166,7 @@ def compare_metadata(context: MigrationContext, metadata: MetaData) -> Any:
|
|
165
166
|
"""
|
166
167
|
|
167
168
|
migration_script = produce_migrations(context, metadata)
|
169
|
+
assert migration_script.upgrade_ops is not None
|
168
170
|
return migration_script.upgrade_ops.as_diffs()
|
169
171
|
|
170
172
|
|
@@ -331,7 +333,7 @@ class AutogenContext:
|
|
331
333
|
self,
|
332
334
|
migration_context: MigrationContext,
|
333
335
|
metadata: Optional[MetaData] = None,
|
334
|
-
opts: Optional[
|
336
|
+
opts: Optional[Dict[str, Any]] = None,
|
335
337
|
autogenerate: bool = True,
|
336
338
|
) -> None:
|
337
339
|
if (
|
@@ -465,7 +467,7 @@ class AutogenContext:
|
|
465
467
|
run_filters = run_object_filters
|
466
468
|
|
467
469
|
@util.memoized_property
|
468
|
-
def sorted_tables(self):
|
470
|
+
def sorted_tables(self) -> List[Table]:
|
469
471
|
"""Return an aggregate of the :attr:`.MetaData.sorted_tables`
|
470
472
|
collection(s).
|
471
473
|
|
@@ -481,7 +483,7 @@ class AutogenContext:
|
|
481
483
|
return result
|
482
484
|
|
483
485
|
@util.memoized_property
|
484
|
-
def table_key_to_table(self):
|
486
|
+
def table_key_to_table(self) -> Dict[str, Table]:
|
485
487
|
"""Return an aggregate of the :attr:`.MetaData.tables` dictionaries.
|
486
488
|
|
487
489
|
The :attr:`.MetaData.tables` collection is a dictionary of table key
|
@@ -492,7 +494,7 @@ class AutogenContext:
|
|
492
494
|
objects contain the same table key, an exception is raised.
|
493
495
|
|
494
496
|
"""
|
495
|
-
result = {}
|
497
|
+
result: Dict[str, Table] = {}
|
496
498
|
for m in util.to_list(self.metadata):
|
497
499
|
intersect = set(result).intersection(set(m.tables))
|
498
500
|
if intersect:
|
@@ -1,3 +1,6 @@
|
|
1
|
+
# mypy: allow-untyped-defs, allow-incomplete-defs, allow-untyped-calls
|
2
|
+
# mypy: no-warn-return-any, allow-any-generics
|
3
|
+
|
1
4
|
from __future__ import annotations
|
2
5
|
|
3
6
|
import contextlib
|
@@ -577,9 +580,7 @@ def _compare_indexes_and_uniques(
|
|
577
580
|
# 5. index things by name, for those objects that have names
|
578
581
|
metadata_names = {
|
579
582
|
cast(str, c.md_name_to_sql_name(autogen_context)): c
|
580
|
-
for c in metadata_unique_constraints_sig.union(
|
581
|
-
metadata_indexes_sig # type:ignore[arg-type]
|
582
|
-
)
|
583
|
+
for c in metadata_unique_constraints_sig.union(metadata_indexes_sig)
|
583
584
|
if c.is_named
|
584
585
|
}
|
585
586
|
|
@@ -1240,7 +1241,7 @@ def _compare_foreign_keys(
|
|
1240
1241
|
obj.const, obj.name, "foreign_key_constraint", False, compare_to
|
1241
1242
|
):
|
1242
1243
|
modify_table_ops.ops.append(
|
1243
|
-
ops.CreateForeignKeyOp.from_constraint(const.const)
|
1244
|
+
ops.CreateForeignKeyOp.from_constraint(const.const) # type: ignore[has-type] # noqa: E501
|
1244
1245
|
)
|
1245
1246
|
|
1246
1247
|
log.info(
|
@@ -1,3 +1,6 @@
|
|
1
|
+
# mypy: allow-untyped-defs, allow-incomplete-defs, allow-untyped-calls
|
2
|
+
# mypy: no-warn-return-any, allow-any-generics
|
3
|
+
|
1
4
|
from __future__ import annotations
|
2
5
|
|
3
6
|
from io import StringIO
|
@@ -849,7 +852,7 @@ def _render_Variant_type(
|
|
849
852
|
) -> str:
|
850
853
|
base_type, variant_mapping = sqla_compat._get_variant_mapping(type_)
|
851
854
|
base = _repr_type(base_type, autogen_context, _skip_variants=True)
|
852
|
-
assert base is not None and base is not False
|
855
|
+
assert base is not None and base is not False # type: ignore[comparison-overlap] # noqa:E501
|
853
856
|
for dialect in sorted(variant_mapping):
|
854
857
|
typ = variant_mapping[dialect]
|
855
858
|
base += ".with_variant(%s, %r)" % (
|
@@ -946,7 +949,7 @@ def _fk_colspec(
|
|
946
949
|
won't fail if the remote table can't be resolved.
|
947
950
|
|
948
951
|
"""
|
949
|
-
colspec = fk._get_colspec()
|
952
|
+
colspec = fk._get_colspec()
|
950
953
|
tokens = colspec.split(".")
|
951
954
|
tname, colname = tokens[-2:]
|
952
955
|
|
@@ -1016,8 +1019,7 @@ def _render_foreign_key(
|
|
1016
1019
|
% {
|
1017
1020
|
"prefix": _sqlalchemy_autogenerate_prefix(autogen_context),
|
1018
1021
|
"cols": ", ".join(
|
1019
|
-
|
1020
|
-
for f in constraint.elements
|
1022
|
+
repr(_ident(f.parent.name)) for f in constraint.elements
|
1021
1023
|
),
|
1022
1024
|
"refcols": ", ".join(
|
1023
1025
|
repr(_fk_colspec(f, apply_metadata_schema, namespace_metadata))
|
@@ -1058,12 +1060,10 @@ def _render_check_constraint(
|
|
1058
1060
|
# ideally SQLAlchemy would give us more of a first class
|
1059
1061
|
# way to detect this.
|
1060
1062
|
if (
|
1061
|
-
constraint._create_rule
|
1062
|
-
and hasattr(
|
1063
|
-
constraint._create_rule, "target" # type:ignore[attr-defined]
|
1064
|
-
)
|
1063
|
+
constraint._create_rule
|
1064
|
+
and hasattr(constraint._create_rule, "target")
|
1065
1065
|
and isinstance(
|
1066
|
-
constraint._create_rule.target,
|
1066
|
+
constraint._create_rule.target,
|
1067
1067
|
sqltypes.TypeEngine,
|
1068
1068
|
)
|
1069
1069
|
):
|
@@ -4,7 +4,7 @@ from typing import Any
|
|
4
4
|
from typing import Callable
|
5
5
|
from typing import Iterator
|
6
6
|
from typing import List
|
7
|
-
from typing import
|
7
|
+
from typing import Tuple
|
8
8
|
from typing import Type
|
9
9
|
from typing import TYPE_CHECKING
|
10
10
|
from typing import Union
|
@@ -16,12 +16,18 @@ if TYPE_CHECKING:
|
|
16
16
|
from ..operations.ops import AddColumnOp
|
17
17
|
from ..operations.ops import AlterColumnOp
|
18
18
|
from ..operations.ops import CreateTableOp
|
19
|
+
from ..operations.ops import DowngradeOps
|
19
20
|
from ..operations.ops import MigrateOperation
|
20
21
|
from ..operations.ops import MigrationScript
|
21
22
|
from ..operations.ops import ModifyTableOps
|
22
23
|
from ..operations.ops import OpContainer
|
23
|
-
from ..
|
24
|
+
from ..operations.ops import UpgradeOps
|
24
25
|
from ..runtime.migration import MigrationContext
|
26
|
+
from ..script.revision import _GetRevArg
|
27
|
+
|
28
|
+
ProcessRevisionDirectiveFn = Callable[
|
29
|
+
["MigrationContext", "_GetRevArg", List["MigrationScript"]], None
|
30
|
+
]
|
25
31
|
|
26
32
|
|
27
33
|
class Rewriter:
|
@@ -52,15 +58,21 @@ class Rewriter:
|
|
52
58
|
|
53
59
|
_traverse = util.Dispatcher()
|
54
60
|
|
55
|
-
_chained:
|
61
|
+
_chained: Tuple[Union[ProcessRevisionDirectiveFn, Rewriter], ...] = ()
|
56
62
|
|
57
63
|
def __init__(self) -> None:
|
58
64
|
self.dispatch = util.Dispatcher()
|
59
65
|
|
60
|
-
def chain(
|
66
|
+
def chain(
|
67
|
+
self,
|
68
|
+
other: Union[
|
69
|
+
ProcessRevisionDirectiveFn,
|
70
|
+
Rewriter,
|
71
|
+
],
|
72
|
+
) -> Rewriter:
|
61
73
|
"""Produce a "chain" of this :class:`.Rewriter` to another.
|
62
74
|
|
63
|
-
This allows two rewriters to operate serially on a stream,
|
75
|
+
This allows two or more rewriters to operate serially on a stream,
|
64
76
|
e.g.::
|
65
77
|
|
66
78
|
writer1 = autogenerate.Rewriter()
|
@@ -89,7 +101,7 @@ class Rewriter:
|
|
89
101
|
"""
|
90
102
|
wr = self.__class__.__new__(self.__class__)
|
91
103
|
wr.__dict__.update(self.__dict__)
|
92
|
-
wr._chained
|
104
|
+
wr._chained += (other,)
|
93
105
|
return wr
|
94
106
|
|
95
107
|
def rewrites(
|
@@ -101,7 +113,7 @@ class Rewriter:
|
|
101
113
|
Type[CreateTableOp],
|
102
114
|
Type[ModifyTableOps],
|
103
115
|
],
|
104
|
-
) -> Callable:
|
116
|
+
) -> Callable[..., Any]:
|
105
117
|
"""Register a function as rewriter for a given type.
|
106
118
|
|
107
119
|
The function should receive three arguments, which are
|
@@ -146,8 +158,8 @@ class Rewriter:
|
|
146
158
|
directives: List[MigrationScript],
|
147
159
|
) -> None:
|
148
160
|
self.process_revision_directives(context, revision, directives)
|
149
|
-
|
150
|
-
|
161
|
+
for process_revision_directives in self._chained:
|
162
|
+
process_revision_directives(context, revision, directives)
|
151
163
|
|
152
164
|
@_traverse.dispatch_for(ops.MigrationScript)
|
153
165
|
def _traverse_script(
|
@@ -156,7 +168,7 @@ class Rewriter:
|
|
156
168
|
revision: _GetRevArg,
|
157
169
|
directive: MigrationScript,
|
158
170
|
) -> None:
|
159
|
-
upgrade_ops_list = []
|
171
|
+
upgrade_ops_list: List[UpgradeOps] = []
|
160
172
|
for upgrade_ops in directive.upgrade_ops_list:
|
161
173
|
ret = self._traverse_for(context, revision, upgrade_ops)
|
162
174
|
if len(ret) != 1:
|
@@ -164,9 +176,10 @@ class Rewriter:
|
|
164
176
|
"Can only return single object for UpgradeOps traverse"
|
165
177
|
)
|
166
178
|
upgrade_ops_list.append(ret[0])
|
167
|
-
directive.upgrade_ops = upgrade_ops_list
|
168
179
|
|
169
|
-
|
180
|
+
directive.upgrade_ops = upgrade_ops_list # type: ignore
|
181
|
+
|
182
|
+
downgrade_ops_list: List[DowngradeOps] = []
|
170
183
|
for downgrade_ops in directive.downgrade_ops_list:
|
171
184
|
ret = self._traverse_for(context, revision, downgrade_ops)
|
172
185
|
if len(ret) != 1:
|
@@ -174,7 +187,7 @@ class Rewriter:
|
|
174
187
|
"Can only return single object for DowngradeOps traverse"
|
175
188
|
)
|
176
189
|
downgrade_ops_list.append(ret[0])
|
177
|
-
directive.downgrade_ops = downgrade_ops_list
|
190
|
+
directive.downgrade_ops = downgrade_ops_list # type: ignore
|
178
191
|
|
179
192
|
@_traverse.dispatch_for(ops.OpContainer)
|
180
193
|
def _traverse_op_container(
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# mypy: allow-untyped-defs, allow-untyped-calls
|
2
|
+
|
1
3
|
from __future__ import annotations
|
2
4
|
|
3
5
|
import os
|
@@ -18,7 +20,7 @@ if TYPE_CHECKING:
|
|
18
20
|
from .runtime.environment import ProcessRevisionDirectiveFn
|
19
21
|
|
20
22
|
|
21
|
-
def list_templates(config: Config):
|
23
|
+
def list_templates(config: Config) -> None:
|
22
24
|
"""List available templates.
|
23
25
|
|
24
26
|
:param config: a :class:`.Config` object.
|
@@ -12,6 +12,7 @@ from typing import Dict
|
|
12
12
|
from typing import Mapping
|
13
13
|
from typing import Optional
|
14
14
|
from typing import overload
|
15
|
+
from typing import Sequence
|
15
16
|
from typing import TextIO
|
16
17
|
from typing import Union
|
17
18
|
|
@@ -104,7 +105,7 @@ class Config:
|
|
104
105
|
stdout: TextIO = sys.stdout,
|
105
106
|
cmd_opts: Optional[Namespace] = None,
|
106
107
|
config_args: Mapping[str, Any] = util.immutabledict(),
|
107
|
-
attributes: Optional[
|
108
|
+
attributes: Optional[Dict[str, Any]] = None,
|
108
109
|
) -> None:
|
109
110
|
"""Construct a new :class:`.Config`"""
|
110
111
|
self.config_file_name = file_
|
@@ -140,7 +141,7 @@ class Config:
|
|
140
141
|
"""
|
141
142
|
|
142
143
|
@util.memoized_property
|
143
|
-
def attributes(self):
|
144
|
+
def attributes(self) -> Dict[str, Any]:
|
144
145
|
"""A Python dictionary for storage of additional state.
|
145
146
|
|
146
147
|
|
@@ -159,7 +160,7 @@ class Config:
|
|
159
160
|
"""
|
160
161
|
return {}
|
161
162
|
|
162
|
-
def print_stdout(self, text: str, *arg) -> None:
|
163
|
+
def print_stdout(self, text: str, *arg: Any) -> None:
|
163
164
|
"""Render a message to standard out.
|
164
165
|
|
165
166
|
When :meth:`.Config.print_stdout` is called with additional args
|
@@ -183,7 +184,7 @@ class Config:
|
|
183
184
|
util.write_outstream(self.stdout, output, "\n", **self.messaging_opts)
|
184
185
|
|
185
186
|
@util.memoized_property
|
186
|
-
def file_config(self):
|
187
|
+
def file_config(self) -> ConfigParser:
|
187
188
|
"""Return the underlying ``ConfigParser`` object.
|
188
189
|
|
189
190
|
Direct access to the .ini file is available here,
|
@@ -321,7 +322,9 @@ class Config:
|
|
321
322
|
) -> Optional[str]:
|
322
323
|
...
|
323
324
|
|
324
|
-
def get_main_option(
|
325
|
+
def get_main_option(
|
326
|
+
self, name: str, default: Optional[str] = None
|
327
|
+
) -> Optional[str]:
|
325
328
|
"""Return an option from the 'main' section of the .ini file.
|
326
329
|
|
327
330
|
This defaults to being a key from the ``[alembic]``
|
@@ -351,7 +354,9 @@ class CommandLine:
|
|
351
354
|
self._generate_args(prog)
|
352
355
|
|
353
356
|
def _generate_args(self, prog: Optional[str]) -> None:
|
354
|
-
def add_options(
|
357
|
+
def add_options(
|
358
|
+
fn: Any, parser: Any, positional: Any, kwargs: Any
|
359
|
+
) -> None:
|
355
360
|
kwargs_opts = {
|
356
361
|
"template": (
|
357
362
|
"-t",
|
@@ -554,7 +559,9 @@ class CommandLine:
|
|
554
559
|
)
|
555
560
|
subparsers = parser.add_subparsers()
|
556
561
|
|
557
|
-
positional_translations = {
|
562
|
+
positional_translations: Dict[Any, Any] = {
|
563
|
+
command.stamp: {"revision": "revisions"}
|
564
|
+
}
|
558
565
|
|
559
566
|
for fn in [getattr(command, n) for n in dir(command)]:
|
560
567
|
if (
|
@@ -609,7 +616,7 @@ class CommandLine:
|
|
609
616
|
else:
|
610
617
|
util.err(str(e), **config.messaging_opts)
|
611
618
|
|
612
|
-
def main(self, argv=None):
|
619
|
+
def main(self, argv: Optional[Sequence[str]] = None) -> None:
|
613
620
|
options = self.parser.parse_args(argv)
|
614
621
|
if not hasattr(options, "cmd"):
|
615
622
|
# see http://bugs.python.org/issue9253, argparse
|
@@ -624,7 +631,11 @@ class CommandLine:
|
|
624
631
|
self.run_cmd(cfg, options)
|
625
632
|
|
626
633
|
|
627
|
-
def main(
|
634
|
+
def main(
|
635
|
+
argv: Optional[Sequence[str]] = None,
|
636
|
+
prog: Optional[str] = None,
|
637
|
+
**kwargs: Any,
|
638
|
+
) -> None:
|
628
639
|
"""The console runner function for Alembic."""
|
629
640
|
|
630
641
|
CommandLine(prog=prog).main(argv=argv)
|
@@ -160,8 +160,8 @@ def configure(
|
|
160
160
|
MigrationContext,
|
161
161
|
Column[Any],
|
162
162
|
Column[Any],
|
163
|
-
TypeEngine,
|
164
|
-
TypeEngine,
|
163
|
+
TypeEngine[Any],
|
164
|
+
TypeEngine[Any],
|
165
165
|
],
|
166
166
|
Optional[bool],
|
167
167
|
],
|
@@ -636,7 +636,8 @@ def configure(
|
|
636
636
|
"""
|
637
637
|
|
638
638
|
def execute(
|
639
|
-
sql: Union[Executable, str],
|
639
|
+
sql: Union[Executable, str],
|
640
|
+
execution_options: Optional[Dict[str, Any]] = None,
|
640
641
|
) -> None:
|
641
642
|
"""Execute the given SQL using the current change context.
|
642
643
|
|
@@ -759,7 +760,11 @@ def get_x_argument(
|
|
759
760
|
The return value is a list, returned directly from the ``argparse``
|
760
761
|
structure. If ``as_dictionary=True`` is passed, the ``x`` arguments
|
761
762
|
are parsed using ``key=value`` format into a dictionary that is
|
762
|
-
then returned.
|
763
|
+
then returned. If there is no ``=`` in the argument, value is an empty
|
764
|
+
string.
|
765
|
+
|
766
|
+
.. versionchanged:: 1.13.1 Support ``as_dictionary=True`` when
|
767
|
+
arguments are passed without the ``=`` symbol.
|
763
768
|
|
764
769
|
For example, to support passing a database URL on the command line,
|
765
770
|
the standard ``env.py`` script can be modified like this::
|
@@ -801,7 +806,7 @@ def is_offline_mode() -> bool:
|
|
801
806
|
|
802
807
|
"""
|
803
808
|
|
804
|
-
def is_transactional_ddl():
|
809
|
+
def is_transactional_ddl() -> bool:
|
805
810
|
"""Return True if the context is configured to expect a
|
806
811
|
transactional DDL capable backend.
|
807
812
|
|
@@ -1,3 +1,6 @@
|
|
1
|
+
# mypy: allow-untyped-defs, allow-incomplete-defs, allow-untyped-calls
|
2
|
+
# mypy: no-warn-return-any, allow-any-generics
|
3
|
+
|
1
4
|
from __future__ import annotations
|
2
5
|
|
3
6
|
from typing import Any
|
@@ -19,7 +22,6 @@ from sqlalchemy.sql.schema import Index
|
|
19
22
|
from sqlalchemy.sql.schema import UniqueConstraint
|
20
23
|
from typing_extensions import TypeGuard
|
21
24
|
|
22
|
-
from alembic.ddl.base import _fk_spec
|
23
25
|
from .. import util
|
24
26
|
from ..util import sqla_compat
|
25
27
|
|
@@ -275,7 +277,7 @@ class _fk_constraint_sig(_constraint_sig[ForeignKeyConstraint]):
|
|
275
277
|
ondelete,
|
276
278
|
deferrable,
|
277
279
|
initially,
|
278
|
-
) = _fk_spec(const)
|
280
|
+
) = sqla_compat._fk_spec(const)
|
279
281
|
|
280
282
|
self._sig: Tuple[Any, ...] = (
|
281
283
|
self.source_schema,
|
@@ -1,3 +1,6 @@
|
|
1
|
+
# mypy: allow-untyped-defs, allow-incomplete-defs, allow-untyped-calls
|
2
|
+
# mypy: no-warn-return-any, allow-any-generics
|
3
|
+
|
1
4
|
from __future__ import annotations
|
2
5
|
|
3
6
|
import functools
|
@@ -173,7 +176,7 @@ class ColumnComment(AlterColumn):
|
|
173
176
|
self.comment = comment
|
174
177
|
|
175
178
|
|
176
|
-
@compiles(RenameTable)
|
179
|
+
@compiles(RenameTable) # type: ignore[misc]
|
177
180
|
def visit_rename_table(
|
178
181
|
element: RenameTable, compiler: DDLCompiler, **kw
|
179
182
|
) -> str:
|
@@ -183,7 +186,7 @@ def visit_rename_table(
|
|
183
186
|
)
|
184
187
|
|
185
188
|
|
186
|
-
@compiles(AddColumn)
|
189
|
+
@compiles(AddColumn) # type: ignore[misc]
|
187
190
|
def visit_add_column(element: AddColumn, compiler: DDLCompiler, **kw) -> str:
|
188
191
|
return "%s %s" % (
|
189
192
|
alter_table(compiler, element.table_name, element.schema),
|
@@ -191,7 +194,7 @@ def visit_add_column(element: AddColumn, compiler: DDLCompiler, **kw) -> str:
|
|
191
194
|
)
|
192
195
|
|
193
196
|
|
194
|
-
@compiles(DropColumn)
|
197
|
+
@compiles(DropColumn) # type: ignore[misc]
|
195
198
|
def visit_drop_column(element: DropColumn, compiler: DDLCompiler, **kw) -> str:
|
196
199
|
return "%s %s" % (
|
197
200
|
alter_table(compiler, element.table_name, element.schema),
|
@@ -199,7 +202,7 @@ def visit_drop_column(element: DropColumn, compiler: DDLCompiler, **kw) -> str:
|
|
199
202
|
)
|
200
203
|
|
201
204
|
|
202
|
-
@compiles(ColumnNullable)
|
205
|
+
@compiles(ColumnNullable) # type: ignore[misc]
|
203
206
|
def visit_column_nullable(
|
204
207
|
element: ColumnNullable, compiler: DDLCompiler, **kw
|
205
208
|
) -> str:
|
@@ -210,7 +213,7 @@ def visit_column_nullable(
|
|
210
213
|
)
|
211
214
|
|
212
215
|
|
213
|
-
@compiles(ColumnType)
|
216
|
+
@compiles(ColumnType) # type: ignore[misc]
|
214
217
|
def visit_column_type(element: ColumnType, compiler: DDLCompiler, **kw) -> str:
|
215
218
|
return "%s %s %s" % (
|
216
219
|
alter_table(compiler, element.table_name, element.schema),
|
@@ -219,7 +222,7 @@ def visit_column_type(element: ColumnType, compiler: DDLCompiler, **kw) -> str:
|
|
219
222
|
)
|
220
223
|
|
221
224
|
|
222
|
-
@compiles(ColumnName)
|
225
|
+
@compiles(ColumnName) # type: ignore[misc]
|
223
226
|
def visit_column_name(element: ColumnName, compiler: DDLCompiler, **kw) -> str:
|
224
227
|
return "%s RENAME %s TO %s" % (
|
225
228
|
alter_table(compiler, element.table_name, element.schema),
|
@@ -228,7 +231,7 @@ def visit_column_name(element: ColumnName, compiler: DDLCompiler, **kw) -> str:
|
|
228
231
|
)
|
229
232
|
|
230
233
|
|
231
|
-
@compiles(ColumnDefault)
|
234
|
+
@compiles(ColumnDefault) # type: ignore[misc]
|
232
235
|
def visit_column_default(
|
233
236
|
element: ColumnDefault, compiler: DDLCompiler, **kw
|
234
237
|
) -> str:
|
@@ -241,7 +244,7 @@ def visit_column_default(
|
|
241
244
|
)
|
242
245
|
|
243
246
|
|
244
|
-
@compiles(ComputedColumnDefault)
|
247
|
+
@compiles(ComputedColumnDefault) # type: ignore[misc]
|
245
248
|
def visit_computed_column(
|
246
249
|
element: ComputedColumnDefault, compiler: DDLCompiler, **kw
|
247
250
|
):
|
@@ -251,7 +254,7 @@ def visit_computed_column(
|
|
251
254
|
)
|
252
255
|
|
253
256
|
|
254
|
-
@compiles(IdentityColumnDefault)
|
257
|
+
@compiles(IdentityColumnDefault) # type: ignore[misc]
|
255
258
|
def visit_identity_column(
|
256
259
|
element: IdentityColumnDefault, compiler: DDLCompiler, **kw
|
257
260
|
):
|
@@ -1,3 +1,6 @@
|
|
1
|
+
# mypy: allow-untyped-defs, allow-incomplete-defs, allow-untyped-calls
|
2
|
+
# mypy: no-warn-return-any, allow-any-generics
|
3
|
+
|
1
4
|
from __future__ import annotations
|
2
5
|
|
3
6
|
import logging
|
@@ -23,8 +26,8 @@ from sqlalchemy import text
|
|
23
26
|
|
24
27
|
from . import _autogen
|
25
28
|
from . import base
|
26
|
-
from ._autogen import _constraint_sig
|
27
|
-
from ._autogen import ComparisonResult
|
29
|
+
from ._autogen import _constraint_sig as _constraint_sig
|
30
|
+
from ._autogen import ComparisonResult as ComparisonResult
|
28
31
|
from .. import util
|
29
32
|
from ..util import sqla_compat
|
30
33
|
|
@@ -1,3 +1,6 @@
|
|
1
|
+
# mypy: allow-untyped-defs, allow-incomplete-defs, allow-untyped-calls
|
2
|
+
# mypy: no-warn-return-any, allow-any-generics
|
3
|
+
|
1
4
|
from __future__ import annotations
|
2
5
|
|
3
6
|
import re
|
@@ -9,7 +12,6 @@ from typing import TYPE_CHECKING
|
|
9
12
|
from typing import Union
|
10
13
|
|
11
14
|
from sqlalchemy import types as sqltypes
|
12
|
-
from sqlalchemy.ext.compiler import compiles
|
13
15
|
from sqlalchemy.schema import Column
|
14
16
|
from sqlalchemy.schema import CreateIndex
|
15
17
|
from sqlalchemy.sql.base import Executable
|
@@ -30,6 +32,7 @@ from .base import RenameTable
|
|
30
32
|
from .impl import DefaultImpl
|
31
33
|
from .. import util
|
32
34
|
from ..util import sqla_compat
|
35
|
+
from ..util.sqla_compat import compiles
|
33
36
|
|
34
37
|
if TYPE_CHECKING:
|
35
38
|
from typing import Literal
|
@@ -1,3 +1,6 @@
|
|
1
|
+
# mypy: allow-untyped-defs, allow-incomplete-defs, allow-untyped-calls
|
2
|
+
# mypy: no-warn-return-any, allow-any-generics
|
3
|
+
|
1
4
|
from __future__ import annotations
|
2
5
|
|
3
6
|
import re
|
@@ -8,7 +11,6 @@ from typing import Union
|
|
8
11
|
|
9
12
|
from sqlalchemy import schema
|
10
13
|
from sqlalchemy import types as sqltypes
|
11
|
-
from sqlalchemy.ext.compiler import compiles
|
12
14
|
|
13
15
|
from .base import alter_table
|
14
16
|
from .base import AlterColumn
|
@@ -23,6 +25,7 @@ from .. import util
|
|
23
25
|
from ..util import sqla_compat
|
24
26
|
from ..util.sqla_compat import _is_mariadb
|
25
27
|
from ..util.sqla_compat import _is_type_bound
|
28
|
+
from ..util.sqla_compat import compiles
|
26
29
|
|
27
30
|
if TYPE_CHECKING:
|
28
31
|
from typing import Literal
|
@@ -160,8 +163,7 @@ class MySQLImpl(DefaultImpl):
|
|
160
163
|
) -> bool:
|
161
164
|
return (
|
162
165
|
type_ is not None
|
163
|
-
and type_._type_affinity
|
164
|
-
is sqltypes.DateTime
|
166
|
+
and type_._type_affinity is sqltypes.DateTime
|
165
167
|
and server_default is not None
|
166
168
|
)
|
167
169
|
|
@@ -1,3 +1,6 @@
|
|
1
|
+
# mypy: allow-untyped-defs, allow-incomplete-defs, allow-untyped-calls
|
2
|
+
# mypy: no-warn-return-any, allow-any-generics
|
3
|
+
|
1
4
|
from __future__ import annotations
|
2
5
|
|
3
6
|
import re
|
@@ -5,7 +8,6 @@ from typing import Any
|
|
5
8
|
from typing import Optional
|
6
9
|
from typing import TYPE_CHECKING
|
7
10
|
|
8
|
-
from sqlalchemy.ext.compiler import compiles
|
9
11
|
from sqlalchemy.sql import sqltypes
|
10
12
|
|
11
13
|
from .base import AddColumn
|
@@ -22,6 +24,7 @@ from .base import format_type
|
|
22
24
|
from .base import IdentityColumnDefault
|
23
25
|
from .base import RenameTable
|
24
26
|
from .impl import DefaultImpl
|
27
|
+
from ..util.sqla_compat import compiles
|
25
28
|
|
26
29
|
if TYPE_CHECKING:
|
27
30
|
from sqlalchemy.dialects.oracle.base import OracleDDLCompiler
|