Scripts

Manage reusable SQL scripts that can be included in pipelines or run standalone.

Category: workflow

Description

## Overview The Scripts page provides a management interface for reusable SQL scripts that serve as building blocks for pipelines or standalone execution. Data engineers use this page to create, edit, version, and organize SQL scripts that encapsulate common transformation logic, utility operations, or shared business rules. Scripts support the INCLUDE SCRIPT directive, which allows one script to reference another. This composition mechanism promotes code reuse and reduces duplication across pipelines. The expansion preview feature renders the fully resolved SQL after all INCLUDE SCRIPT directives have been expanded, giving engineers a clear view of the complete statement sequence before execution. ## Key Features - **Script CRUD operations.** Create new scripts, edit existing ones, and delete scripts that are no longer needed. Each script is stored as a named SQL file and can be referenced by pipelines or other scripts. - **Dependency tracking (INCLUDE SCRIPT).** The page automatically detects INCLUDE SCRIPT directives within a script and displays a dependency tree showing which other scripts are referenced. This tracking helps engineers understand the inclusion chain and avoid circular dependencies. - **Script expansion preview.** Preview the fully expanded SQL that results from resolving all INCLUDE SCRIPT directives. The expanded view shows the complete, executable SQL in the order it would run, making it straightforward to verify correctness before triggering a pipeline or manual execution. ## Workflow 1. Navigate to the Scripts page from the Workflow sidebar. 2. Click the add script button to create a new SQL script. 3. Write or paste the SQL content, using INCLUDE SCRIPT directives to reference shared logic. 4. Review the dependency tree to confirm that all referenced scripts exist and the chain is acyclic. 5. Use the expansion preview to verify the fully resolved SQL. 6. Save the script. It is now available for inclusion in pipelines or direct execution from a workspace. 7. Update scripts as business logic evolves and verify that dependent pipelines remain correct.

See Also

Open in interactive docs →   DeltaForge home →