Opt-in destructive flags for the cleanup phase. Without these, cleanup runs only the demo's teardown SQL; with them it also drops the created schema or zone.
--drop-schema | --drop-zone
## Overview `--drop-schema` and `--drop-zone` are opt-in destructive flags that tell the cleanup phase to retain schema-level and zone-level DROP statements that would otherwise be filtered out. The default cleanup path drops only the tables and other objects the demo created; removing the enclosing schema or zone requires explicit opt-in because demos are commonly rerun against shared zones. ## Behavior - The flags are independent booleans and can be combined. - Filtering is a line-level match on `cleanup.sql` (case-insensitive) against `DROP SCHEMA IF EXISTS ...` and `DROP ZONE IF EXISTS ...`. A matching line is removed from the SQL that actually gets sent to the compute node. - Only the `IF EXISTS` forms are filtered. A bare `DROP SCHEMA foo;` or `DROP ZONE bar;` in `cleanup.sql` is executed regardless of these flags. `DROP SCHEMA COLUMNS` is also preserved because it is a safe, table-scoped operation. - After filtering, trailing comment-only or blank lines are stripped so the compute node does not receive orphaned section headers as empty statements. - The flags are consulted only when the cleanup phase runs. With `--phase setup` or `--phase queries`, the flags are parsed but have no effect on the run. - With `--phase all` (the default), cleanup always runs, so the flags always take effect. ## Compatibility - The filtering logic matches the GUI's `filterCleanupSql`, so a run from the CLI with both flags set is equivalent to the GUI's 'full teardown' toggle. - Stderr prints `Skipping DROP SCHEMA (use --drop-schema to include)` and `Skipping DROP ZONE (use --drop-zone to include)` when the flags are off and cleanup runs, so it is obvious from the log what was suppressed.
| Name | Type | Description |
|---|---|---|
--drop-schema | When the cleanup phase runs, retain any `DROP SCHEMA IF EXISTS ...` statements present in `cleanup.sql`. Without this flag, those statements are filtered out before execution. | |
--drop-zone | When the cleanup phase runs, retain any `DROP ZONE IF EXISTS ...` statements present in `cleanup.sql`. Without this flag, those statements are filtered out before execution. |
# Default cleanup: drop the demo's tables but keep the schema and zone
delta-forge-cli demo-test node zone path --phase cleanup
# Full teardown: drop tables, schema, and zone
delta-forge-cli demo-test node zone path --phase cleanup --drop-schema --drop-zone
# --drop-* are no-ops unless cleanup runs
delta-forge-cli demo-test node zone path --phase queries --drop-schema # has no effect