write-script-duckdb

Write DuckDB SQL scripts for Windmill with preview, metadata sync, and S3 integration.

1|Updated Aug 3, 2026
One-click install
npx skills add https://github.com/vpzed-dev/smithy --skill write-script-duckdb-vpzed-dev
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: write-script-duckdb
Source: https://github.com/vpzed-dev/smithy/tree/main/windmill/local-dev/.agents/skills/write-script-duckdb
Command: npx skills add https://github.com/vpzed-dev/smithy --skill write-script-duckdb-vpzed-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing DuckDB scripts for Windmill involves more than SQL: you must declare typed arguments, choose the right run command (preview vs. deployed run vs. deploy), keep lock files and input schemas in sync, and wire up S3 or external database access. This Skill encodes those rules so scripts are written and tested correctly the first time. ## Core Features & Use Cases - Correct CLI workflow: Distinguishes wmill script preview (local iteration) from wmill script run (deployed version) and wmill sync push (deploy), preventing accidental overwrites of workspace scripts. - Metadata synchronization: Runs wmill generate-metadata after edits that change imports or main arguments so .lock, .script.yaml, and wmill-lock.yaml hashes stay consistent. - DuckDB-specific patterns: Covers $name argument syntax, Ducklake attachment, external database connections via resources, and S3 reads/writes including s3object parameters and COPY ... TO exports. - Use Case: You need a Windmill script that reads a Parquet file from S3, joins it against a Postgres table, and exports results back to S3 — this Skill produces the script with correct argument declarations and previews it with sample args. ## Quick Start Write a DuckDB Windmill script that reads a CSV from S3 and filters rows by a name argument, then preview it with sample data.

Frequently Asked Questions about write-script-duckdb

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test a Windmill script locally without deploying?▼

Use `wmill script preview <script_path>` to run the local file without deploying it to the workspace. Only use `wmill script run` when you explicitly want to execute the version already deployed on the server, and reserve `wmill sync push` for actual deploys.

How do I declare arguments in a Windmill DuckDB script?▼

Declare arguments as SQL comments using the syntax `-- $name (text) = default`, then reference them in the query as `$name`. Windmill parses these comments to build the input form and passes values into the query at runtime.

Can DuckDB scripts in Windmill read files from S3?▼

Yes, DuckDB reads S3 files directly with functions like `read_csv('s3:///path/file.csv')`, `read_parquet`, and `read_json`. You can also declare an argument as `(s3object)` to get an S3 file picker whose URI feeds straight into these reader functions.

Why does wmill-lock.yaml show diffs after editing a script?▼

Editing a script's content, especially adding imports or changing `main` arguments, invalidates its recorded content hash. Run `wmill generate-metadata` to regenerate the lock file, input schema, and hashes so git-sync and CI stop showing spurious diffs.

How do I write DuckDB query results to S3 in Windmill?▼

Use DuckDB's native `COPY (SELECT ...) TO 's3:///path/output.parquet' (FORMAT PARQUET)` statement. The `-- s3` streaming directive available in other Windmill SQL dialects is not supported in DuckDB.