write-script-postgresql

Write PostgreSQL scripts with parameterized queries and S3 integration for Windmill workflows.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing and testing PostgreSQL scripts in Windmill requires knowing the correct parameter syntax, CLI commands, and deployment workflow, which is easy to get wrong without guidance. ## Core Features & Use Cases - Parameterized SQL Scripts: Write PostgreSQL queries using $1::{type} placeholders with named parameter comments and default values. - S3 Integration: Receive S3Object parameters decoded as jsonb recordsets, or stream large query results directly to S3 in JSON, Parquet, or CSV format. - CLI Workflow Guidance: Choose correctly between wmill script preview for local iteration, wmill script run for deployed scripts, and wmill sync push for deployment. - Use Case: You need a script that exports all users to a Parquet file in S3. Write the SQL with the -- s3 prefix=exports/users format=parquet directive, then preview it locally before deploying. ## Quick Start Write a Windmill PostgreSQL script that queries the users table by name and preview it locally with sample arguments.

Frequently Asked Questions about write-script-postgresql

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

FAQPage Schema
How do I write a parameterized PostgreSQL script in Windmill?

Use $1::{type}, $2::{type} placeholders directly in the SQL statement and name parameters with comments at the top like `-- $1 name1`. You can set defaults with `-- $2 name2 = default_value`.

How do I test a Windmill script locally without deploying?

Run `wmill script preview <script_path>` to execute the local file without deploying it. Use `wmill script run` only when you want to test the version already deployed in the workspace.

Can a PostgreSQL script read files from S3 in Windmill?

Yes, declare a parameter with type (s3object) and Windmill binds the file as a jsonb parameter. Parquet and CSV files are decoded into JSON records, which you consume with jsonb_to_recordset.

How do I export large PostgreSQL query results to S3?

Add a `-- s3` directive at the top of the script with optional prefix, storage, and format keys. Windmill streams rows directly to S3 and returns an S3Object instead of buffering the result set.

When should I use wmill sync push versus script preview?

Use `wmill sync push` only when you explicitly want to deploy changes to the workspace. Use `wmill script preview` for iterating and testing, since pushing untested changes overwrites the deployed version.