Skip to main content

Module contract

Module contract 

Source
Expand description

Bounded loading and validation for one app-owned logical database contract.

Structs§

AppDataContract
One backend-neutral app schema and its ordered additive migrations.
LegacyAdoption
Historical checksum sets prove populated-database adoption without naming a backend or selecting a physical migration file in an app contract.

Functions§

deserialize_legacy_ledgers 🔒
Reads checksum sets from current app contracts and older saved projects. Historical backend labels are discarded; adapters verify physical ledgers.
legacy_adoption_schema
Reconstructs the schema at the end of the historical migration prefix. Later logical migrations must not be required in an existing populated database.
load_contract
Reads one verified app-owned contract without following symlinks or oversized input.
migration_checksum
Computes the source checksum that every adapter must record in its ledger.
promote_identity 🔒
reidentify_contract
Reidentifies a source copy as a new app without selecting a database vendor. Historical adoption belongs to the original app’s populated database and must not authorize a different app’s fresh database.
rewrite_contract_strings 🔒
Visits bounded JSON values without rewriting field or entity map keys.
rewrite_source_contract_strings
Rewrites string values in a fresh source copy and regenerates its migration checksums. This is an authoring operation, never an applied-ledger update.
schema_from_entity_catalog
Builds a typed projection from the app’s compiled entity contract. Every requested field must declare its logical type; guesses from SQL storage or field names would let one backend interpret app data differently.
schema_through_migrations
Replays declaration changes through one migration boundary without exposing future fields.
validate_contract
Validates migration identity, source checksums, and entity creation coverage.
validate_json_record_copy
Validates historical JSON adoption without selecting a database vendor.
validate_migration
Validates one migration before an adapter writes its logical ledger.
verify_legacy_ledger
Checks historical migration evidence before a populated database can be adopted into the logical ledger. A legacy checksum records what actually ran; it is never inferred from the current physical table names.
widen_integer_to_decimal 🔒
Allows only a lossless integer-to-decimal change outside keys and relations.