loom.core.repository.sqlalchemy.rls.guard_manifest¶
The guard revisions this release of loom ships, each pinned by its SHA-256 and its catalogue.
A released revision is never edited; a change is a new revision. The file
digest is checked before a revision runs and against what the database
recorded; the catalogue digests identify which revision a database holds from
what any role can read, so startup accepts every revision at or above
MIN_COMPATIBLE_GUARD_REVISION. Upgrade the application first, then
bootstrap.
Functions
|
|
|
Digest catalogue lines independently of their order. |
|
Return the hexadecimal SHA-256 of |
|
Return the revisions still to apply after checking the ones already applied. |
Return the static statement that defines the guard-creating temporary function. |
Classes
|
One static guard revision: its number, its file, its digest and its catalogue digests. |
- class loom.core.repository.sqlalchemy.rls.guard_manifest.GuardRevision(number, filename, sha256, catalog)[source]¶
Bases:
objectOne static guard revision: its number, its file, its digest and its catalogue digests.
- sql()[source]¶
Return the revision’s text after checking it is the released text.
- Raises:
ConfigError – When the packaged file differs from the released digest.
- Return type:
- loom.core.repository.sqlalchemy.rls.guard_manifest.digest(text)[source]¶
Return the hexadecimal SHA-256 of
textencoded as UTF-8.
- loom.core.repository.sqlalchemy.rls.guard_manifest.catalog_digest(lines)[source]¶
Digest catalogue lines independently of their order.
- loom.core.repository.sqlalchemy.rls.guard_manifest.preflight_sql()[source]¶
Return the static statement that defines the guard-creating temporary function.
- Raises:
ConfigError – When the packaged file differs from the released digest.
- Return type:
- loom.core.repository.sqlalchemy.rls.guard_manifest.pending_revisions(applied)[source]¶
Return the revisions still to apply after checking the ones already applied.
- Raises:
ConfigError – When the database holds a revision this release does not know, or one whose recorded digest differs from the released one.
- Parameters:
- Return type:
tuple[GuardRevision, …]