Ligare.database.migrations.alembic.env_setup

Ligare.database environment modification for Alembic migration.

Classes

AlembicEnvSetup(config)

type_metadata(include_schemas, ...)

final class Ligare.database.migrations.alembic.env_setup.AlembicEnvSetup(config)[source]
__init__(config)[source]
get_config()[source]
get_metadata(bases)[source]
run_migrations_offline(bases)[source]

Run migrations in ‘offline’ mode.

This configures the context with just a URL and not an Engine, though an Engine is acceptable here as well. By skipping the Engine creation we don’t even need a DBAPI to be available.

Calls to context.execute() here emit the given string to the script output.

run_migrations_online(bases)[source]

Run migrations in ‘online’ mode.

In this scenario we need to create an Engine and associate a connection with the context.

protocol Ligare.database.migrations.alembic.env_setup.type_include_object[source]

typing.Protocol.

Classes that implement this protocol must have the following methods / attributes:

__call__(object, name, type_, reflected, compare_to)[source]

Call self as a function.

Return type:

bool

protocol Ligare.database.migrations.alembic.env_setup.type_include_schemas[source]

typing.Protocol.

Classes that implement this protocol must have the following methods / attributes:

__call__(names)[source]

Call self as a function.

Return type:

type_include_object

class Ligare.database.migrations.alembic.env_setup.type_metadata(include_schemas, target_metadata, schemas)[source]
__init__(include_schemas, target_metadata, schemas)
include_schemas: type_include_schemas
schemas: List[str]
target_metadata: List[MetaData]