Expand description
Deployment execution utilities.
This module contains the DeploymentExecutor for running SQL statements
during deployment, along with helper functions for collecting deployment
metadata and generating environment names.
§ApplyPlan Lifecycle
compile project → connect client → plan phases → execute
│
┌──────────────────┼───────────────────┐
▼ ▼ ▼
prepare_schemas add_phase(...) execute(&client)
(CREATE DB/SCHEMA) (dry-run SQL) (run all SQL)- Compile —
compile_apply_project_and_connectloads and validates the project. - Plan — Each apply subcommand calls
DeploymentExecutor::new_dry_run()to collect SQL without executing it, then packages results asApplyResultphases. - Execute —
ApplyPlan::execute()runs setup statements first, then per-phase object statements. Objects sharing atransaction_groupkey are wrapped in a singleBEGIN/COMMITblock with automaticROLLBACKon failure.
Structs§
- Apply
Plan - A complete apply plan: global setup + ordered phase results. Built incrementally by adding phases, then executed as a unit.
- Apply
Result - Result of applying one phase (e.g. clusters, connections, etc.).
- Deployment
Executor - Helper for executing database object deployments.
- Object
Result - Result of applying a single object (cluster, role, connection, etc.).
Enums§
- Object
Action - What happened when applying a single object.
Functions§
- collect_
deployment_ metadata - Collect deployment metadata (user and git commit).
- compile_
apply_ project_ and_ connect - Compile the project (without type checking) and connect a planning client for database-object apply commands.
- connect_
apply_ client - Connect a planning client for apply commands.
- generate_
random_ env_ name - Generate a unique 7-character hex identifier for deployments when no explicit environment name is provided.