Skip to main content

Module snapshot

Module snapshot 

Source
Expand description

The prod-snapshot preflights: restore the dumps of a directory and its tenants into fresh local databases, run cli admin check-forms or check-references on them and drop what it created.

Tenants are restored under a prefixed name and the restored directory is rewritten to point at it, so no existing database is ever reused. The check saves every transaction, which is why it only runs on these copies.

StructsΒ§

Restored πŸ”’
The databases created so far; dropped when the run ends, however it ends.

ConstantsΒ§

DIRECTORY_DUMP πŸ”’
DUMP_EXTENSION πŸ”’
NIL_USER πŸ”’
The CLI demands a user id the admin command does not use.

FunctionsΒ§

check_forms
Restores the dumps in dir under server and checks the forms on them.
check_references
Restores the dumps in dir under server and lists the ambiguous and bare references of the templates and of the sources in sources.
database_url πŸ”’
references_args πŸ”’
The cli admin arguments of the reference check.
repoint πŸ”’
SQL pointing the restored directory at the restored copy of a tenant.
run πŸ”’
run_admin πŸ”’
tenant_copy_name πŸ”’
tenant_names πŸ”’
Tenant database names: every dump of dir except the directory’s own.