Skip to main content

alembic-autogenerate-enums

This package implements an Alembic hook that causes alembic revision --autogenerate to output PostgreSQL ALTER TYPE .. ADD VALUE SQL statements as part of new migrations.

Usage

Add the line:

import alembic_autogenerate_enums

To the top of your env.py.

Notes

Since ALTER TYPE .. ADD VALUE cannot run transactionally, each op.sync_enum_values() call creates its own temporary private DB connection. See https://bitbucket.org/zzzeek/alembic/issues/123/a-way-to-run-non-transactional-ddl

Tests

We have incredibly basic tests in a sample project.

mkvirtualenv alembic-autogenerate

Install the main autogenerate package and then the test harness:

pip install -e .
pip install -e test-harness
createuser alembic-autogenerate
createdb -O alembic-autogenerate alembic-autogenerate_db
cd test-harness && pytest

Release files for alembic-autogenerate-enums 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for alembic-autogenerate-enums 0.1.2
File Size Uploaded
alembic-autogenerate-enums-0.1.2.tar.gz 4.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for alembic-autogenerate-enums 0.1.2
File Interpreter ABI Platform
alembic_autogenerate_enums-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 10.1 kB

Release files / alembic-autogenerate-enums-0.1.2.tar.gz

Download URL alembic-autogenerate-enums-0.1.2.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
467adc76f1ef32576e514ef55c400c28900547800b676dec349293519751c128
BLAKE2b-256 checksum
How to use checksums
1533e395de48fcc4d9ac0b3c0d934d3eb128031da0888d2f32edd6a28d0a4c7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.1 CPython/3.10.4 Darwin/22.5.0

Release files / alembic_autogenerate_enums-0.1.2-py3-none-any.whl

Download URL alembic_autogenerate_enums-0.1.2-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
07b8fa63b2fca107effc61d3dc86d7ff848dd73b0e6cc9c292e904edcaeb8278
BLAKE2b-256 checksum
How to use checksums
e9115b63dac59e3761ca021359141ab0fab50e4cbca3ba6da90a7c7d2847328c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.1 CPython/3.10.4 Darwin/22.5.0

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page