alembic 1.16.1__tar.gz → 1.16.3__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.16.1/alembic.egg-info → alembic-1.16.3}/PKG-INFO +1 -1
- {alembic-1.16.1 → alembic-1.16.3}/alembic/__init__.py +1 -1
- {alembic-1.16.1 → alembic-1.16.3}/alembic/autogenerate/compare.py +2 -2
- {alembic-1.16.1 → alembic-1.16.3}/alembic/autogenerate/render.py +34 -11
- {alembic-1.16.1 → alembic-1.16.3}/alembic/autogenerate/rewriter.py +2 -2
- {alembic-1.16.1 → alembic-1.16.3}/alembic/config.py +14 -1
- {alembic-1.16.1 → alembic-1.16.3}/alembic/runtime/environment.py +1 -1
- {alembic-1.16.1 → alembic-1.16.3}/alembic/runtime/migration.py +5 -1
- {alembic-1.16.1 → alembic-1.16.3}/alembic/script/base.py +6 -2
- {alembic-1.16.1 → alembic-1.16.3}/alembic/script/write_hooks.py +42 -44
- {alembic-1.16.1/alembic/templates/generic → alembic-1.16.3/alembic/templates/async}/alembic.ini.mako +9 -3
- {alembic-1.16.1 → alembic-1.16.3}/alembic/templates/async/script.py.mako +1 -1
- {alembic-1.16.1/alembic/templates/async → alembic-1.16.3/alembic/templates/generic}/alembic.ini.mako +9 -3
- {alembic-1.16.1 → alembic-1.16.3}/alembic/templates/generic/script.py.mako +1 -1
- {alembic-1.16.1 → alembic-1.16.3}/alembic/templates/multidb/alembic.ini.mako +8 -2
- {alembic-1.16.1 → alembic-1.16.3}/alembic/templates/multidb/script.py.mako +1 -1
- {alembic-1.16.1 → alembic-1.16.3}/alembic/templates/pyproject/pyproject.toml.mako +9 -3
- {alembic-1.16.1 → alembic-1.16.3}/alembic/templates/pyproject/script.py.mako +1 -1
- alembic-1.16.3/alembic/templates/pyproject_async/README +1 -0
- alembic-1.16.3/alembic/templates/pyproject_async/alembic.ini.mako +44 -0
- alembic-1.16.3/alembic/templates/pyproject_async/env.py +89 -0
- alembic-1.16.3/alembic/templates/pyproject_async/pyproject.toml.mako +82 -0
- alembic-1.16.3/alembic/templates/pyproject_async/script.py.mako +28 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/util/pyfiles.py +4 -2
- {alembic-1.16.1 → alembic-1.16.3}/alembic/util/sqla_compat.py +2 -4
- {alembic-1.16.1 → alembic-1.16.3/alembic.egg-info}/PKG-INFO +1 -1
- {alembic-1.16.1 → alembic-1.16.3}/alembic.egg-info/SOURCES.txt +10 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_sources/autogenerate.rst +13 -6
- {alembic-1.16.1 → alembic-1.16.3}/docs/_sources/changelog.rst +66 -0
- {alembic-1.16.1/docs/build → alembic-1.16.3/docs/_sources}/cookbook.rst +2 -2
- {alembic-1.16.1/docs/build → alembic-1.16.3/docs/_sources}/tutorial.rst +159 -3
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/documentation_options.js +1 -1
- {alembic-1.16.1 → alembic-1.16.3}/docs/api/autogenerate.html +3 -3
- {alembic-1.16.1 → alembic-1.16.3}/docs/api/commands.html +3 -3
- {alembic-1.16.1 → alembic-1.16.3}/docs/api/config.html +17 -4
- {alembic-1.16.1 → alembic-1.16.3}/docs/api/ddl.html +3 -3
- {alembic-1.16.1 → alembic-1.16.3}/docs/api/index.html +3 -3
- {alembic-1.16.1 → alembic-1.16.3}/docs/api/operations.html +3 -3
- {alembic-1.16.1 → alembic-1.16.3}/docs/api/overview.html +3 -3
- {alembic-1.16.1 → alembic-1.16.3}/docs/api/runtime.html +3 -3
- {alembic-1.16.1 → alembic-1.16.3}/docs/api/script.html +3 -3
- {alembic-1.16.1 → alembic-1.16.3}/docs/autogenerate.html +18 -10
- {alembic-1.16.1 → alembic-1.16.3}/docs/batch.html +3 -3
- {alembic-1.16.1 → alembic-1.16.3}/docs/branches.html +3 -3
- {alembic-1.16.1 → alembic-1.16.3}/docs/build/autogenerate.rst +13 -6
- {alembic-1.16.1 → alembic-1.16.3}/docs/build/changelog.rst +66 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/build/conf.py +2 -2
- {alembic-1.16.1/docs/_sources → alembic-1.16.3/docs/build}/cookbook.rst +2 -2
- {alembic-1.16.1/docs/_sources → alembic-1.16.3/docs/build}/tutorial.rst +159 -3
- {alembic-1.16.1 → alembic-1.16.3}/docs/changelog.html +86 -3
- {alembic-1.16.1 → alembic-1.16.3}/docs/cookbook.html +5 -5
- {alembic-1.16.1 → alembic-1.16.3}/docs/front.html +3 -3
- {alembic-1.16.1 → alembic-1.16.3}/docs/genindex.html +7 -5
- {alembic-1.16.1 → alembic-1.16.3}/docs/index.html +16 -4
- {alembic-1.16.1 → alembic-1.16.3}/docs/naming.html +3 -3
- {alembic-1.16.1 → alembic-1.16.3}/docs/offline.html +3 -3
- {alembic-1.16.1 → alembic-1.16.3}/docs/ops.html +3 -3
- {alembic-1.16.1 → alembic-1.16.3}/docs/py-modindex.html +3 -3
- {alembic-1.16.1 → alembic-1.16.3}/docs/search.html +3 -3
- alembic-1.16.3/docs/searchindex.js +1 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/tutorial.html +167 -8
- {alembic-1.16.1 → alembic-1.16.3}/setup.cfg +1 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/test_autogen_render.py +53 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/test_command.py +40 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/test_mysql.py +18 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/test_post_write.py +191 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/test_postgresql.py +10 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/test_script_production.py +101 -0
- {alembic-1.16.1 → alembic-1.16.3}/tox.ini +2 -2
- alembic-1.16.1/docs/searchindex.js +0 -1
- {alembic-1.16.1 → alembic-1.16.3}/CHANGES +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/LICENSE +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/MANIFEST.in +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/README.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/README.unittests.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/__main__.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/autogenerate/__init__.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/autogenerate/api.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/command.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/context.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/context.pyi +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/ddl/__init__.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/ddl/_autogen.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/ddl/base.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/ddl/impl.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/ddl/mssql.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/ddl/mysql.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/ddl/oracle.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/ddl/postgresql.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/ddl/sqlite.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/environment.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/migration.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/op.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/op.pyi +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/operations/__init__.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/operations/base.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/operations/batch.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/operations/ops.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/operations/schemaobj.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/operations/toimpl.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/py.typed +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/runtime/__init__.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/script/__init__.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/script/revision.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/templates/async/README +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/templates/async/env.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/templates/generic/README +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/templates/generic/env.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/templates/multidb/README +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/templates/multidb/env.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/templates/pyproject/README +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/templates/pyproject/alembic.ini.mako +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/templates/pyproject/env.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/testing/__init__.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/testing/assertions.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/testing/env.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/testing/fixtures.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/testing/plugin/__init__.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/testing/plugin/bootstrap.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/testing/requirements.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/testing/schemacompare.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/testing/suite/__init__.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/testing/suite/_autogen_fixtures.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/testing/suite/test_autogen_comments.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/testing/suite/test_autogen_computed.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/testing/suite/test_autogen_diffs.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/testing/suite/test_autogen_fks.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/testing/suite/test_autogen_identity.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/testing/suite/test_environment.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/testing/suite/test_op.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/testing/util.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/testing/warnings.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/util/__init__.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/util/compat.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/util/editor.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/util/exc.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/util/langhelpers.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic/util/messaging.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic.egg-info/dependency_links.txt +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic.egg-info/entry_points.txt +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic.egg-info/not-zip-safe +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic.egg-info/requires.txt +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/alembic.egg-info/top_level.txt +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_images/api_overview.png +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_sources/api/autogenerate.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_sources/api/commands.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_sources/api/config.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_sources/api/ddl.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_sources/api/index.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_sources/api/operations.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_sources/api/overview.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_sources/api/runtime.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_sources/api/script.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_sources/batch.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_sources/branches.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_sources/front.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_sources/index.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_sources/naming.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_sources/offline.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_sources/ops.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/basic.css +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/changelog.css +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/clipboard.min.js +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/copybutton.css +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/copybutton.js +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/copybutton_funcs.js +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/doctools.js +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/file.png +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/images/logo_colab.png +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/language_data.js +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/minus.png +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/nature_override.css +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/plus.png +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/pygments.css +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/sbt-webpack-macros.html +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/scripts/bootstrap.js +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/scripts/bootstrap.js.LICENSE.txt +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/scripts/pydata-sphinx-theme.js +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/scripts/sphinx-book-theme.js +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/searchtools.js +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/site_custom_css.css +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/sphinx_highlight.js +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/sphinx_paramlinks.css +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/styles/bootstrap.css +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/styles/pydata-sphinx-theme.css +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/styles/sphinx-book-theme.css +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/styles/theme.css +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/vendor/fontawesome/6.5.2/LICENSE.txt +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/vendor/fontawesome/6.5.2/css/all.min.css +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/vendor/fontawesome/6.5.2/js/all.min.js +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/vendor/fontawesome/6.5.2/js/all.min.js.LICENSE.txt +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/_static/webpack-macros.html +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/build/Makefile +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/build/_static/nature_override.css +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/build/_static/site_custom_css.css +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/build/_templates/site_custom_sidebars.html +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/build/api/api_overview.png +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/build/api/autogenerate.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/build/api/commands.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/build/api/config.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/build/api/ddl.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/build/api/index.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/build/api/operations.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/build/api/overview.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/build/api/runtime.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/build/api/script.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/build/batch.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/build/branches.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/build/front.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/build/index.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/build/naming.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/build/offline.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/build/ops.rst +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/build/requirements.txt +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/docs/build/unreleased/README.txt +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/pyproject.toml +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/setup.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/__init__.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/_large_map.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/conftest.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/requirements.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/test_autogen_composition.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/test_autogen_diffs.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/test_autogen_indexes.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/test_batch.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/test_bulk_insert.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/test_config.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/test_editor.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/test_environment.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/test_external_dialect.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/test_impl.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/test_messaging.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/test_mssql.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/test_offline_environment.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/test_op.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/test_op_naming_convention.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/test_oracle.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/test_revision.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/test_script_consumption.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/test_sqlite.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/test_stubs.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/test_suite.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/test_version_table.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/tests/test_version_traversal.py +0 -0
- {alembic-1.16.1 → alembic-1.16.3}/tools/write_pyi.py +0 -0
@@ -683,7 +683,7 @@ def _compare_indexes_and_uniques(
|
|
683
683
|
):
|
684
684
|
modify_ops.ops.append(ops.CreateIndexOp.from_index(obj.const))
|
685
685
|
log.info(
|
686
|
-
"Detected added index
|
686
|
+
"Detected added index %r on '%s'",
|
687
687
|
obj.name,
|
688
688
|
obj.column_names,
|
689
689
|
)
|
@@ -1282,7 +1282,7 @@ def _compare_foreign_keys(
|
|
1282
1282
|
obj.const, obj.name, "foreign_key_constraint", False, compare_to
|
1283
1283
|
):
|
1284
1284
|
modify_table_ops.ops.append(
|
1285
|
-
ops.CreateForeignKeyOp.from_constraint(const.const)
|
1285
|
+
ops.CreateForeignKeyOp.from_constraint(const.const)
|
1286
1286
|
)
|
1287
1287
|
|
1288
1288
|
log.info(
|
@@ -18,6 +18,7 @@ from mako.pygen import PythonPrinter
|
|
18
18
|
from sqlalchemy import schema as sa_schema
|
19
19
|
from sqlalchemy import sql
|
20
20
|
from sqlalchemy import types as sqltypes
|
21
|
+
from sqlalchemy.sql.base import _DialectArgView
|
21
22
|
from sqlalchemy.sql.elements import conv
|
22
23
|
from sqlalchemy.sql.elements import Label
|
23
24
|
from sqlalchemy.sql.elements import quoted_name
|
@@ -31,7 +32,6 @@ if TYPE_CHECKING:
|
|
31
32
|
|
32
33
|
from sqlalchemy import Computed
|
33
34
|
from sqlalchemy import Identity
|
34
|
-
from sqlalchemy.sql.base import DialectKWArgs
|
35
35
|
from sqlalchemy.sql.elements import ColumnElement
|
36
36
|
from sqlalchemy.sql.elements import TextClause
|
37
37
|
from sqlalchemy.sql.schema import CheckConstraint
|
@@ -304,11 +304,11 @@ def _drop_table(autogen_context: AutogenContext, op: ops.DropTableOp) -> str:
|
|
304
304
|
|
305
305
|
|
306
306
|
def _render_dialect_kwargs_items(
|
307
|
-
autogen_context: AutogenContext,
|
307
|
+
autogen_context: AutogenContext, dialect_kwargs: _DialectArgView
|
308
308
|
) -> list[str]:
|
309
309
|
return [
|
310
310
|
f"{key}={_render_potential_expr(val, autogen_context)}"
|
311
|
-
for key, val in
|
311
|
+
for key, val in dialect_kwargs.items()
|
312
312
|
]
|
313
313
|
|
314
314
|
|
@@ -331,7 +331,7 @@ def _add_index(autogen_context: AutogenContext, op: ops.CreateIndexOp) -> str:
|
|
331
331
|
|
332
332
|
assert index.table is not None
|
333
333
|
|
334
|
-
opts = _render_dialect_kwargs_items(autogen_context, index)
|
334
|
+
opts = _render_dialect_kwargs_items(autogen_context, index.dialect_kwargs)
|
335
335
|
if op.if_not_exists is not None:
|
336
336
|
opts.append("if_not_exists=%r" % bool(op.if_not_exists))
|
337
337
|
text = tmpl % {
|
@@ -365,7 +365,7 @@ def _drop_index(autogen_context: AutogenContext, op: ops.DropIndexOp) -> str:
|
|
365
365
|
"%(prefix)sdrop_index(%(name)r, "
|
366
366
|
"table_name=%(table_name)r%(schema)s%(kwargs)s)"
|
367
367
|
)
|
368
|
-
opts = _render_dialect_kwargs_items(autogen_context, index)
|
368
|
+
opts = _render_dialect_kwargs_items(autogen_context, index.dialect_kwargs)
|
369
369
|
if op.if_exists is not None:
|
370
370
|
opts.append("if_exists=%r" % bool(op.if_exists))
|
371
371
|
text = tmpl % {
|
@@ -389,6 +389,7 @@ def _add_unique_constraint(
|
|
389
389
|
def _add_fk_constraint(
|
390
390
|
autogen_context: AutogenContext, op: ops.CreateForeignKeyOp
|
391
391
|
) -> str:
|
392
|
+
constraint = op.to_constraint()
|
392
393
|
args = [repr(_render_gen_name(autogen_context, op.constraint_name))]
|
393
394
|
if not autogen_context._has_batch:
|
394
395
|
args.append(repr(_ident(op.source_table)))
|
@@ -418,9 +419,16 @@ def _add_fk_constraint(
|
|
418
419
|
if value is not None:
|
419
420
|
args.append("%s=%r" % (k, value))
|
420
421
|
|
421
|
-
|
422
|
+
dialect_kwargs = _render_dialect_kwargs_items(
|
423
|
+
autogen_context, constraint.dialect_kwargs
|
424
|
+
)
|
425
|
+
|
426
|
+
return "%(prefix)screate_foreign_key(%(args)s%(dialect_kwargs)s)" % {
|
422
427
|
"prefix": _alembic_autogenerate_prefix(autogen_context),
|
423
428
|
"args": ", ".join(args),
|
429
|
+
"dialect_kwargs": (
|
430
|
+
", " + ", ".join(dialect_kwargs) if dialect_kwargs else ""
|
431
|
+
),
|
424
432
|
}
|
425
433
|
|
426
434
|
|
@@ -664,7 +672,9 @@ def _uq_constraint(
|
|
664
672
|
opts.append(
|
665
673
|
("name", _render_gen_name(autogen_context, constraint.name))
|
666
674
|
)
|
667
|
-
dialect_options = _render_dialect_kwargs_items(
|
675
|
+
dialect_options = _render_dialect_kwargs_items(
|
676
|
+
autogen_context, constraint.dialect_kwargs
|
677
|
+
)
|
668
678
|
|
669
679
|
if alter:
|
670
680
|
args = [repr(_render_gen_name(autogen_context, constraint.name))]
|
@@ -803,6 +813,8 @@ def _render_server_default(
|
|
803
813
|
return _render_potential_expr(
|
804
814
|
default.arg, autogen_context, is_server_default=True
|
805
815
|
)
|
816
|
+
elif isinstance(default, sa_schema.FetchedValue):
|
817
|
+
return _render_fetched_value(autogen_context)
|
806
818
|
|
807
819
|
if isinstance(default, str) and repr_:
|
808
820
|
default = repr(re.sub(r"^'|'$", "", default))
|
@@ -840,6 +852,12 @@ def _render_identity(
|
|
840
852
|
}
|
841
853
|
|
842
854
|
|
855
|
+
def _render_fetched_value(autogen_context: AutogenContext) -> str:
|
856
|
+
return "%(prefix)sFetchedValue()" % {
|
857
|
+
"prefix": _sqlalchemy_autogenerate_prefix(autogen_context),
|
858
|
+
}
|
859
|
+
|
860
|
+
|
843
861
|
def _repr_type(
|
844
862
|
type_: TypeEngine,
|
845
863
|
autogen_context: AutogenContext,
|
@@ -990,7 +1008,7 @@ def _render_primary_key(
|
|
990
1008
|
def _fk_colspec(
|
991
1009
|
fk: ForeignKey,
|
992
1010
|
metadata_schema: Optional[str],
|
993
|
-
namespace_metadata: MetaData,
|
1011
|
+
namespace_metadata: Optional[MetaData],
|
994
1012
|
) -> str:
|
995
1013
|
"""Implement a 'safe' version of ForeignKey._get_colspec() that
|
996
1014
|
won't fail if the remote table can't be resolved.
|
@@ -1014,7 +1032,10 @@ def _fk_colspec(
|
|
1014
1032
|
# the FK constraint needs to be rendered in terms of the column
|
1015
1033
|
# name.
|
1016
1034
|
|
1017
|
-
if
|
1035
|
+
if (
|
1036
|
+
namespace_metadata is not None
|
1037
|
+
and table_fullname in namespace_metadata.tables
|
1038
|
+
):
|
1018
1039
|
col = namespace_metadata.tables[table_fullname].c.get(colname)
|
1019
1040
|
if col is not None:
|
1020
1041
|
colname = _ident(col.name) # type: ignore[assignment]
|
@@ -1045,7 +1066,7 @@ def _populate_render_fk_opts(
|
|
1045
1066
|
def _render_foreign_key(
|
1046
1067
|
constraint: ForeignKeyConstraint,
|
1047
1068
|
autogen_context: AutogenContext,
|
1048
|
-
namespace_metadata: MetaData,
|
1069
|
+
namespace_metadata: Optional[MetaData],
|
1049
1070
|
) -> Optional[str]:
|
1050
1071
|
rendered = _user_defined_render("foreign_key", constraint, autogen_context)
|
1051
1072
|
if rendered is not False:
|
@@ -1059,7 +1080,9 @@ def _render_foreign_key(
|
|
1059
1080
|
|
1060
1081
|
_populate_render_fk_opts(constraint, opts)
|
1061
1082
|
|
1062
|
-
apply_metadata_schema =
|
1083
|
+
apply_metadata_schema = (
|
1084
|
+
namespace_metadata.schema if namespace_metadata is not None else None
|
1085
|
+
)
|
1063
1086
|
return (
|
1064
1087
|
"%(prefix)sForeignKeyConstraint([%(cols)s], "
|
1065
1088
|
"[%(refcols)s], %(args)s)"
|
@@ -177,7 +177,7 @@ class Rewriter:
|
|
177
177
|
)
|
178
178
|
upgrade_ops_list.append(ret[0])
|
179
179
|
|
180
|
-
directive.upgrade_ops = upgrade_ops_list
|
180
|
+
directive.upgrade_ops = upgrade_ops_list
|
181
181
|
|
182
182
|
downgrade_ops_list: List[DowngradeOps] = []
|
183
183
|
for downgrade_ops in directive.downgrade_ops_list:
|
@@ -187,7 +187,7 @@ class Rewriter:
|
|
187
187
|
"Can only return single object for DowngradeOps traverse"
|
188
188
|
)
|
189
189
|
downgrade_ops_list.append(ret[0])
|
190
|
-
directive.downgrade_ops = downgrade_ops_list
|
190
|
+
directive.downgrade_ops = downgrade_ops_list
|
191
191
|
|
192
192
|
@_traverse.dispatch_for(ops.OpContainer)
|
193
193
|
def _traverse_op_container(
|
@@ -75,7 +75,20 @@ class Config:
|
|
75
75
|
alembic_cfg.attributes['connection'] = connection
|
76
76
|
command.upgrade(alembic_cfg, "head")
|
77
77
|
|
78
|
-
:param file\_: name of the .ini file to open.
|
78
|
+
:param file\_: name of the .ini file to open if an ``alembic.ini`` is
|
79
|
+
to be used. This should refer to the ``alembic.ini`` file, either as
|
80
|
+
a filename or a full path to the file. This filename if passed must refer
|
81
|
+
to an **ini file in ConfigParser format** only.
|
82
|
+
|
83
|
+
:param toml\_file: name of the pyproject.toml file to open if a
|
84
|
+
``pyproject.toml`` file is to be used. This should refer to the
|
85
|
+
``pyproject.toml`` file, either as a filename or a full path to the file.
|
86
|
+
This file must be in toml format. Both :paramref:`.Config.file\_` and
|
87
|
+
:paramref:`.Config.toml\_file` may be passed simultaneously, or
|
88
|
+
exclusively.
|
89
|
+
|
90
|
+
.. versionadded:: 1.16.0
|
91
|
+
|
79
92
|
:param ini_section: name of the main Alembic section within the
|
80
93
|
.ini file
|
81
94
|
:param output_buffer: optional file-like input buffer which
|
@@ -338,7 +338,7 @@ class EnvironmentContext(util.ModuleClsProxy):
|
|
338
338
|
line.
|
339
339
|
|
340
340
|
"""
|
341
|
-
return self.context_opts.get("tag", None)
|
341
|
+
return self.context_opts.get("tag", None)
|
342
342
|
|
343
343
|
@overload
|
344
344
|
def get_x_argument(self, as_dictionary: Literal[False]) -> List[str]: ...
|
@@ -175,7 +175,11 @@ class MigrationContext:
|
|
175
175
|
opts["output_encoding"],
|
176
176
|
)
|
177
177
|
else:
|
178
|
-
self.output_buffer = opts.get(
|
178
|
+
self.output_buffer = opts.get(
|
179
|
+
"output_buffer", sys.stdout
|
180
|
+
) # type:ignore[assignment] # noqa: E501
|
181
|
+
|
182
|
+
self.transactional_ddl = transactional_ddl
|
179
183
|
|
180
184
|
self._user_compare_type = opts.get("compare_type", True)
|
181
185
|
self._user_compare_server_default = opts.get(
|
@@ -560,7 +560,11 @@ class ScriptDirectory:
|
|
560
560
|
**self.messaging_opts,
|
561
561
|
):
|
562
562
|
util.template_to_file(
|
563
|
-
src,
|
563
|
+
src,
|
564
|
+
dest,
|
565
|
+
self.output_encoding,
|
566
|
+
append_with_newlines=True,
|
567
|
+
**kw,
|
564
568
|
)
|
565
569
|
|
566
570
|
def _generate_template(self, src: Path, dest: Path, **kw: Any) -> None:
|
@@ -846,7 +850,7 @@ class Script(revision.Revision):
|
|
846
850
|
doc = doc.decode( # type: ignore[attr-defined]
|
847
851
|
self.module._alembic_source_encoding
|
848
852
|
)
|
849
|
-
return doc.strip()
|
853
|
+
return doc.strip()
|
850
854
|
else:
|
851
855
|
return ""
|
852
856
|
|
@@ -3,6 +3,7 @@
|
|
3
3
|
|
4
4
|
from __future__ import annotations
|
5
5
|
|
6
|
+
import importlib.util
|
6
7
|
import os
|
7
8
|
import shlex
|
8
9
|
import subprocess
|
@@ -112,17 +113,35 @@ def _parse_cmdline_options(cmdline_options_str: str, path: str) -> List[str]:
|
|
112
113
|
return cmdline_options_list
|
113
114
|
|
114
115
|
|
115
|
-
|
116
|
-
def console_scripts(
|
117
|
-
path: str, options: dict, ignore_output: bool = False
|
118
|
-
) -> None:
|
116
|
+
def _get_required_option(options: dict, name: str) -> str:
|
119
117
|
try:
|
120
|
-
|
118
|
+
return options[name]
|
121
119
|
except KeyError as ke:
|
122
120
|
raise util.CommandError(
|
123
|
-
f"Key {options['_hook_name']}.
|
121
|
+
f"Key {options['_hook_name']}.{name} is required for post "
|
124
122
|
f"write hook {options['_hook_name']!r}"
|
125
123
|
) from ke
|
124
|
+
|
125
|
+
|
126
|
+
def _run_hook(
|
127
|
+
path: str, options: dict, ignore_output: bool, command: List[str]
|
128
|
+
) -> None:
|
129
|
+
cwd: Optional[str] = options.get("cwd", None)
|
130
|
+
cmdline_options_str = options.get("options", "")
|
131
|
+
cmdline_options_list = _parse_cmdline_options(cmdline_options_str, path)
|
132
|
+
|
133
|
+
kw: Dict[str, Any] = {}
|
134
|
+
if ignore_output:
|
135
|
+
kw["stdout"] = kw["stderr"] = subprocess.DEVNULL
|
136
|
+
|
137
|
+
subprocess.run([*command, *cmdline_options_list], cwd=cwd, **kw)
|
138
|
+
|
139
|
+
|
140
|
+
@register("console_scripts")
|
141
|
+
def console_scripts(
|
142
|
+
path: str, options: dict, ignore_output: bool = False
|
143
|
+
) -> None:
|
144
|
+
entrypoint_name = _get_required_option(options, "entrypoint")
|
126
145
|
for entry in compat.importlib_metadata_get("console_scripts"):
|
127
146
|
if entry.name == entrypoint_name:
|
128
147
|
impl: Any = entry
|
@@ -131,48 +150,27 @@ def console_scripts(
|
|
131
150
|
raise util.CommandError(
|
132
151
|
f"Could not find entrypoint console_scripts.{entrypoint_name}"
|
133
152
|
)
|
134
|
-
cwd: Optional[str] = options.get("cwd", None)
|
135
|
-
cmdline_options_str = options.get("options", "")
|
136
|
-
cmdline_options_list = _parse_cmdline_options(cmdline_options_str, path)
|
137
|
-
|
138
|
-
kw: Dict[str, Any] = {}
|
139
|
-
if ignore_output:
|
140
|
-
kw["stdout"] = kw["stderr"] = subprocess.DEVNULL
|
141
153
|
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
+ cmdline_options_list,
|
149
|
-
cwd=cwd,
|
150
|
-
**kw,
|
151
|
-
)
|
154
|
+
command = [
|
155
|
+
sys.executable,
|
156
|
+
"-c",
|
157
|
+
f"import {impl.module}; {impl.module}.{impl.attr}()",
|
158
|
+
]
|
159
|
+
_run_hook(path, options, ignore_output, command)
|
152
160
|
|
153
161
|
|
154
162
|
@register("exec")
|
155
163
|
def exec_(path: str, options: dict, ignore_output: bool = False) -> None:
|
156
|
-
|
157
|
-
|
158
|
-
except KeyError as ke:
|
159
|
-
raise util.CommandError(
|
160
|
-
f"Key {options['_hook_name']}.executable is required for post "
|
161
|
-
f"write hook {options['_hook_name']!r}"
|
162
|
-
) from ke
|
163
|
-
cwd: Optional[str] = options.get("cwd", None)
|
164
|
-
cmdline_options_str = options.get("options", "")
|
165
|
-
cmdline_options_list = _parse_cmdline_options(cmdline_options_str, path)
|
164
|
+
executable = _get_required_option(options, "executable")
|
165
|
+
_run_hook(path, options, ignore_output, command=[executable])
|
166
166
|
|
167
|
-
kw: Dict[str, Any] = {}
|
168
|
-
if ignore_output:
|
169
|
-
kw["stdout"] = kw["stderr"] = subprocess.DEVNULL
|
170
167
|
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
168
|
+
@register("module")
|
169
|
+
def module(path: str, options: dict, ignore_output: bool = False) -> None:
|
170
|
+
module_name = _get_required_option(options, "module")
|
171
|
+
|
172
|
+
if importlib.util.find_spec(module_name) is None:
|
173
|
+
raise util.CommandError(f"Could not find module {module_name}")
|
174
|
+
|
175
|
+
command = [sys.executable, "-m", module_name]
|
176
|
+
_run_hook(path, options, ignore_output, command)
|
{alembic-1.16.1/alembic/templates/generic → alembic-1.16.3/alembic/templates/async}/alembic.ini.mako
RENAMED
@@ -18,7 +18,6 @@ script_location = ${script_location}
|
|
18
18
|
# is defined by "path_separator" below.
|
19
19
|
prepend_sys_path = .
|
20
20
|
|
21
|
-
|
22
21
|
# timezone to use when rendering the date within the migration file
|
23
22
|
# as well as the filename.
|
24
23
|
# If specified, requires the python>=3.9 or backports.zoneinfo library and tzdata library.
|
@@ -72,6 +71,7 @@ prepend_sys_path = .
|
|
72
71
|
# Use os.pathsep. Default configuration used for new projects.
|
73
72
|
path_separator = os
|
74
73
|
|
74
|
+
|
75
75
|
# set to 'true' to search source files recursively
|
76
76
|
# in each "version_locations" directory
|
77
77
|
# new in Alembic version 1.10
|
@@ -98,10 +98,16 @@ sqlalchemy.url = driver://user:pass@localhost/dbname
|
|
98
98
|
# black.entrypoint = black
|
99
99
|
# black.options = -l 79 REVISION_SCRIPT_FILENAME
|
100
100
|
|
101
|
-
# lint with attempts to fix using "ruff" - use the
|
101
|
+
# lint with attempts to fix using "ruff" - use the module runner, against the "ruff" module
|
102
|
+
# hooks = ruff
|
103
|
+
# ruff.type = module
|
104
|
+
# ruff.module = ruff
|
105
|
+
# ruff.options = check --fix REVISION_SCRIPT_FILENAME
|
106
|
+
|
107
|
+
# Alternatively, use the exec runner to execute a binary found on your PATH
|
102
108
|
# hooks = ruff
|
103
109
|
# ruff.type = exec
|
104
|
-
# ruff.executable =
|
110
|
+
# ruff.executable = ruff
|
105
111
|
# ruff.options = check --fix REVISION_SCRIPT_FILENAME
|
106
112
|
|
107
113
|
# Logging configuration. This is also consumed by the user-maintained
|
@@ -13,7 +13,7 @@ ${imports if imports else ""}
|
|
13
13
|
|
14
14
|
# revision identifiers, used by Alembic.
|
15
15
|
revision: str = ${repr(up_revision)}
|
16
|
-
down_revision: Union[str, None] = ${repr(down_revision)}
|
16
|
+
down_revision: Union[str, Sequence[str], None] = ${repr(down_revision)}
|
17
17
|
branch_labels: Union[str, Sequence[str], None] = ${repr(branch_labels)}
|
18
18
|
depends_on: Union[str, Sequence[str], None] = ${repr(depends_on)}
|
19
19
|
|
{alembic-1.16.1/alembic/templates/async → alembic-1.16.3/alembic/templates/generic}/alembic.ini.mako
RENAMED
@@ -18,6 +18,7 @@ script_location = ${script_location}
|
|
18
18
|
# is defined by "path_separator" below.
|
19
19
|
prepend_sys_path = .
|
20
20
|
|
21
|
+
|
21
22
|
# timezone to use when rendering the date within the migration file
|
22
23
|
# as well as the filename.
|
23
24
|
# If specified, requires the python>=3.9 or backports.zoneinfo library and tzdata library.
|
@@ -71,7 +72,6 @@ prepend_sys_path = .
|
|
71
72
|
# Use os.pathsep. Default configuration used for new projects.
|
72
73
|
path_separator = os
|
73
74
|
|
74
|
-
|
75
75
|
# set to 'true' to search source files recursively
|
76
76
|
# in each "version_locations" directory
|
77
77
|
# new in Alembic version 1.10
|
@@ -98,10 +98,16 @@ sqlalchemy.url = driver://user:pass@localhost/dbname
|
|
98
98
|
# black.entrypoint = black
|
99
99
|
# black.options = -l 79 REVISION_SCRIPT_FILENAME
|
100
100
|
|
101
|
-
# lint with attempts to fix using "ruff" - use the
|
101
|
+
# lint with attempts to fix using "ruff" - use the module runner, against the "ruff" module
|
102
|
+
# hooks = ruff
|
103
|
+
# ruff.type = module
|
104
|
+
# ruff.module = ruff
|
105
|
+
# ruff.options = check --fix REVISION_SCRIPT_FILENAME
|
106
|
+
|
107
|
+
# Alternatively, use the exec runner to execute a binary found on your PATH
|
102
108
|
# hooks = ruff
|
103
109
|
# ruff.type = exec
|
104
|
-
# ruff.executable =
|
110
|
+
# ruff.executable = ruff
|
105
111
|
# ruff.options = check --fix REVISION_SCRIPT_FILENAME
|
106
112
|
|
107
113
|
# Logging configuration. This is also consumed by the user-maintained
|
@@ -13,7 +13,7 @@ ${imports if imports else ""}
|
|
13
13
|
|
14
14
|
# revision identifiers, used by Alembic.
|
15
15
|
revision: str = ${repr(up_revision)}
|
16
|
-
down_revision: Union[str, None] = ${repr(down_revision)}
|
16
|
+
down_revision: Union[str, Sequence[str], None] = ${repr(down_revision)}
|
17
17
|
branch_labels: Union[str, Sequence[str], None] = ${repr(branch_labels)}
|
18
18
|
depends_on: Union[str, Sequence[str], None] = ${repr(depends_on)}
|
19
19
|
|
@@ -106,10 +106,16 @@ sqlalchemy.url = driver://user:pass@localhost/dbname2
|
|
106
106
|
# black.entrypoint = black
|
107
107
|
# black.options = -l 79 REVISION_SCRIPT_FILENAME
|
108
108
|
|
109
|
-
# lint with attempts to fix using "ruff" - use the
|
109
|
+
# lint with attempts to fix using "ruff" - use the module runner, against the "ruff" module
|
110
|
+
# hooks = ruff
|
111
|
+
# ruff.type = module
|
112
|
+
# ruff.module = ruff
|
113
|
+
# ruff.options = check --fix REVISION_SCRIPT_FILENAME
|
114
|
+
|
115
|
+
# Alternatively, use the exec runner to execute a binary found on your PATH
|
110
116
|
# hooks = ruff
|
111
117
|
# ruff.type = exec
|
112
|
-
# ruff.executable =
|
118
|
+
# ruff.executable = ruff
|
113
119
|
# ruff.options = check --fix REVISION_SCRIPT_FILENAME
|
114
120
|
|
115
121
|
# Logging configuration. This is also consumed by the user-maintained
|
@@ -16,7 +16,7 @@ ${imports if imports else ""}
|
|
16
16
|
|
17
17
|
# revision identifiers, used by Alembic.
|
18
18
|
revision: str = ${repr(up_revision)}
|
19
|
-
down_revision: Union[str, None] = ${repr(down_revision)}
|
19
|
+
down_revision: Union[str, Sequence[str], None] = ${repr(down_revision)}
|
20
20
|
branch_labels: Union[str, Sequence[str], None] = ${repr(branch_labels)}
|
21
21
|
depends_on: Union[str, Sequence[str], None] = ${repr(depends_on)}
|
22
22
|
|
@@ -67,10 +67,16 @@ prepend_sys_path = [
|
|
67
67
|
# options = "-l 79 REVISION_SCRIPT_FILENAME"
|
68
68
|
#
|
69
69
|
# [[tool.alembic.post_write_hooks]]
|
70
|
-
# lint with attempts to fix using "ruff" - use the
|
71
|
-
#
|
70
|
+
# lint with attempts to fix using "ruff" - use the module runner, against the "ruff" module
|
71
|
+
# name = "ruff"
|
72
|
+
# type = "module"
|
73
|
+
# module = "ruff"
|
74
|
+
# options = "check --fix REVISION_SCRIPT_FILENAME"
|
75
|
+
#
|
76
|
+
# [[tool.alembic.post_write_hooks]]
|
77
|
+
# Alternatively, use the exec runner to execute a binary found on your PATH
|
72
78
|
# name = "ruff"
|
73
79
|
# type = "exec"
|
74
|
-
# executable = "
|
80
|
+
# executable = "ruff"
|
75
81
|
# options = "check --fix REVISION_SCRIPT_FILENAME"
|
76
82
|
|
@@ -13,7 +13,7 @@ ${imports if imports else ""}
|
|
13
13
|
|
14
14
|
# revision identifiers, used by Alembic.
|
15
15
|
revision: str = ${repr(up_revision)}
|
16
|
-
down_revision: Union[str, None] = ${repr(down_revision)}
|
16
|
+
down_revision: Union[str, Sequence[str], None] = ${repr(down_revision)}
|
17
17
|
branch_labels: Union[str, Sequence[str], None] = ${repr(branch_labels)}
|
18
18
|
depends_on: Union[str, Sequence[str], None] = ${repr(depends_on)}
|
19
19
|
|
@@ -0,0 +1 @@
|
|
1
|
+
pyproject configuration, with an async dbapi.
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# A generic, single database configuration.
|
2
|
+
|
3
|
+
[alembic]
|
4
|
+
|
5
|
+
# database URL. This is consumed by the user-maintained env.py script only.
|
6
|
+
# other means of configuring database URLs may be customized within the env.py
|
7
|
+
# file.
|
8
|
+
sqlalchemy.url = driver://user:pass@localhost/dbname
|
9
|
+
|
10
|
+
|
11
|
+
# Logging configuration
|
12
|
+
[loggers]
|
13
|
+
keys = root,sqlalchemy,alembic
|
14
|
+
|
15
|
+
[handlers]
|
16
|
+
keys = console
|
17
|
+
|
18
|
+
[formatters]
|
19
|
+
keys = generic
|
20
|
+
|
21
|
+
[logger_root]
|
22
|
+
level = WARNING
|
23
|
+
handlers = console
|
24
|
+
qualname =
|
25
|
+
|
26
|
+
[logger_sqlalchemy]
|
27
|
+
level = WARNING
|
28
|
+
handlers =
|
29
|
+
qualname = sqlalchemy.engine
|
30
|
+
|
31
|
+
[logger_alembic]
|
32
|
+
level = INFO
|
33
|
+
handlers =
|
34
|
+
qualname = alembic
|
35
|
+
|
36
|
+
[handler_console]
|
37
|
+
class = StreamHandler
|
38
|
+
args = (sys.stderr,)
|
39
|
+
level = NOTSET
|
40
|
+
formatter = generic
|
41
|
+
|
42
|
+
[formatter_generic]
|
43
|
+
format = %(levelname)-5.5s [%(name)s] %(message)s
|
44
|
+
datefmt = %H:%M:%S
|
@@ -0,0 +1,89 @@
|
|
1
|
+
import asyncio
|
2
|
+
from logging.config import fileConfig
|
3
|
+
|
4
|
+
from sqlalchemy import pool
|
5
|
+
from sqlalchemy.engine import Connection
|
6
|
+
from sqlalchemy.ext.asyncio import async_engine_from_config
|
7
|
+
|
8
|
+
from alembic import context
|
9
|
+
|
10
|
+
# this is the Alembic Config object, which provides
|
11
|
+
# access to the values within the .ini file in use.
|
12
|
+
config = context.config
|
13
|
+
|
14
|
+
# Interpret the config file for Python logging.
|
15
|
+
# This line sets up loggers basically.
|
16
|
+
if config.config_file_name is not None:
|
17
|
+
fileConfig(config.config_file_name)
|
18
|
+
|
19
|
+
# add your model's MetaData object here
|
20
|
+
# for 'autogenerate' support
|
21
|
+
# from myapp import mymodel
|
22
|
+
# target_metadata = mymodel.Base.metadata
|
23
|
+
target_metadata = None
|
24
|
+
|
25
|
+
# other values from the config, defined by the needs of env.py,
|
26
|
+
# can be acquired:
|
27
|
+
# my_important_option = config.get_main_option("my_important_option")
|
28
|
+
# ... etc.
|
29
|
+
|
30
|
+
|
31
|
+
def run_migrations_offline() -> None:
|
32
|
+
"""Run migrations in 'offline' mode.
|
33
|
+
|
34
|
+
This configures the context with just a URL
|
35
|
+
and not an Engine, though an Engine is acceptable
|
36
|
+
here as well. By skipping the Engine creation
|
37
|
+
we don't even need a DBAPI to be available.
|
38
|
+
|
39
|
+
Calls to context.execute() here emit the given string to the
|
40
|
+
script output.
|
41
|
+
|
42
|
+
"""
|
43
|
+
url = config.get_main_option("sqlalchemy.url")
|
44
|
+
context.configure(
|
45
|
+
url=url,
|
46
|
+
target_metadata=target_metadata,
|
47
|
+
literal_binds=True,
|
48
|
+
dialect_opts={"paramstyle": "named"},
|
49
|
+
)
|
50
|
+
|
51
|
+
with context.begin_transaction():
|
52
|
+
context.run_migrations()
|
53
|
+
|
54
|
+
|
55
|
+
def do_run_migrations(connection: Connection) -> None:
|
56
|
+
context.configure(connection=connection, target_metadata=target_metadata)
|
57
|
+
|
58
|
+
with context.begin_transaction():
|
59
|
+
context.run_migrations()
|
60
|
+
|
61
|
+
|
62
|
+
async def run_async_migrations() -> None:
|
63
|
+
"""In this scenario we need to create an Engine
|
64
|
+
and associate a connection with the context.
|
65
|
+
|
66
|
+
"""
|
67
|
+
|
68
|
+
connectable = async_engine_from_config(
|
69
|
+
config.get_section(config.config_ini_section, {}),
|
70
|
+
prefix="sqlalchemy.",
|
71
|
+
poolclass=pool.NullPool,
|
72
|
+
)
|
73
|
+
|
74
|
+
async with connectable.connect() as connection:
|
75
|
+
await connection.run_sync(do_run_migrations)
|
76
|
+
|
77
|
+
await connectable.dispose()
|
78
|
+
|
79
|
+
|
80
|
+
def run_migrations_online() -> None:
|
81
|
+
"""Run migrations in 'online' mode."""
|
82
|
+
|
83
|
+
asyncio.run(run_async_migrations())
|
84
|
+
|
85
|
+
|
86
|
+
if context.is_offline_mode():
|
87
|
+
run_migrations_offline()
|
88
|
+
else:
|
89
|
+
run_migrations_online()
|