save_query
Save SQL queries to a versioned library with parameters, tags, and optional overwrite, including DDL scripts for reuse and version tracking.
Instructions
Save a query to the library as .sql (id may contain folders: 'purchasing/open-pos-by-vendor'). sql is the body only -- do not DECLARE the parameters in it; describe them in params: [{"name": "@Start", "type": "date", "default": "'2026-01-01'", "description": "first order date"}] Updating an existing query needs overwrite=true; header fields left empty keep their current value. kind='script' stores DDL text from build_create_table / build_procedure / build_view (e.g. id 'ddl/usp_open_pos'): kept and versioned with the queries, but never linted as a query and never executed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| sql | Yes | ||
| kind | No | ||
| name | No | ||
| tags | No | ||
| params | No | ||
| dry_run | No | ||
| overwrite | No | ||
| connection | No | ||
| description | No |