write-script-duckdb

Write DuckDB SQL scripts for Windmill with S3, Ducklake, and external database integration.

Updated May 28, 2026
One-click install
npx skills add https://github.com/kma-core/windmill --skill write-script-duckdb-kma-core
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: write-script-duckdb
Source: https://github.com/kma-core/windmill/tree/main/system_prompts/auto-generated/skills/write-script-duckdb
Command: npx skills add https://github.com/kma-core/windmill --skill write-script-duckdb-kma-core

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing DuckDB scripts on Windmill requires knowing its specific argument syntax, resource attachment patterns, and S3 access conventions, which differ from other SQL dialects and are easy to get wrong. ## Core Features & Use Cases - DuckDB Argument Syntax: Declares script parameters with -- $name (type) comments and binds them via $name in queries. - Ducklake and External Databases: Attaches Ducklake instances and external databases like PostgreSQL through Windmill resources using ATTACH '$res:path/to/resource'. - S3 File Operations: Reads CSV, Parquet, and JSON from S3 storage, accepts s3object script parameters, and writes query results back to S3 with COPY ... TO. - Use Case: A data engineer needs a Windmill script that reads a Parquet file from S3, joins it with a PostgreSQL table, and exports the result as Parquet back to S3. ## Quick Start Write a Windmill DuckDB script that reads a Parquet file from S3 and filters rows by a parameter, then preview it with wmill script preview.

Frequently Asked Questions about write-script-duckdb

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

FAQPage Schema
How do I write a DuckDB script in Windmill?

Declare arguments with comments like `-- $name (text) = default` and reference them in queries as `$name`. Place the script in a folder and test it locally with `wmill script preview <script_path>` before deploying.

How do I read S3 files with DuckDB in Windmill?

Use DuckDB reader functions with S3 URIs, such as `read_parquet('s3:///path/to/file.parquet')` or `read_csv` and `read_json`. For named storage, prefix the path with the storage name like `s3://storage_name/path`.

Can DuckDB connect to PostgreSQL from a Windmill script?

Yes, attach an external database through a Windmill resource using `ATTACH '$res:path/to/resource' AS db (TYPE postgres)`, then query it with `SELECT * FROM db.schema.table`.

How do I pass an S3 file as a script parameter in DuckDB?

Declare the argument with type `(s3object)`, for example `-- $file (s3object)`. Windmill renders an S3 file picker and binds the argument as an `s3://storage/key` URI that reader functions like `read_parquet($file)` consume directly.

How do I export DuckDB query results to S3?

Use `COPY (SELECT ...) TO 's3:///path/output.parquet' (FORMAT PARQUET)` to write results directly to S3. The `-- s3` streaming directive used by other Windmill SQL dialects is not available in DuckDB.