loom.core.repository.sqlalchemy.migrations.operations¶
Alembic operations for the guard, so generated revisions carry calls and never SQL.
A revision reads op.protect_scoped_table("notes", scopes, privileges); the
implementation executes a constant statement with bound parameters. The
schema is the one the runner configured as the version table schema.
Functions
|
|
|
|
|
|
|
Run one guard operation with the guard resolved before the application schema. |
Classes
|
The part of Alembic's |
|
Stop a downgrade where only the developer knows the scopes of the target revision. |
|
|
|
- class loom.core.repository.sqlalchemy.migrations.operations.OpenHatchOp(*args, **kwargs)¶
Bases:
MigrateOperationOpen the guard’s hatch for the rest of the revision’s transaction.
- Parameters:
args (Any)
kwargs (Any)
- Return type:
Any
- class loom.core.repository.sqlalchemy.migrations.operations.ProtectScopedTableOp(*args, **kwargs)¶
Bases:
MigrateOperationProtect a scoped table of the application schema.
- class loom.core.repository.sqlalchemy.migrations.operations.UnprotectScopedTableOp(*args, **kwargs)¶
Bases:
MigrateOperationUnprotect a scoped table of the application schema; needs the open hatch.
- class loom.core.repository.sqlalchemy.migrations.operations.GrantTableOp(*args, **kwargs)¶
Bases:
MigrateOperationGrant the declared privileges of an unscoped table to the schema’s groups.
- class loom.core.repository.sqlalchemy.migrations.operations.EnsureRangePartitionsOp(*args, **kwargs)¶
Bases:
MigrateOperationCreate the missing partitions of a range-partitioned scoped table covering
[start, end).The guard creates, registers and protects each partition in the revision’s transaction; one that already exists is left alone.
- class loom.core.repository.sqlalchemy.migrations.operations.DetachRangePartitionsOp(*args, **kwargs)¶
Bases:
MigrateOperationUnprotect and detach, and with
dropdrop, the partitions covering[start, end).
- class loom.core.repository.sqlalchemy.migrations.operations.DropPartitionsOp(*args, **kwargs)¶
Bases:
MigrateOperationUnprotect, detach and drop every partition of a table, before the table is dropped.
- Parameters:
table (str)
- class loom.core.repository.sqlalchemy.migrations.operations.HandWrittenProtectOp(*args, **kwargs)[source]¶
Bases:
MigrateOperationStop a downgrade where only the developer knows the scopes of the target revision.
- Parameters:
table (str)
- class loom.core.repository.sqlalchemy.migrations.operations.GuardOperations(*args, **kwargs)[source]¶
Bases:
ProtocolThe part of Alembic’s
Operationsa guard operation needs.
- loom.core.repository.sqlalchemy.migrations.operations.run_guard_operation(operations, op)[source]¶
Run one guard operation with the guard resolved before the application schema.
The guard name comes from
run_migrations; outside it the operation is refused, so a revision can never reach a routine the application schema shadows.- Parameters:
operations (GuardOperations)
op (alembic.operations.MigrateOperation)
- Return type:
None