write-script-postgresql

Write and test PostgreSQL scripts for Windmill workflows with parameterized queries.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing PostgreSQL scripts for Windmill requires knowing the platform's parameter binding syntax, metadata regeneration workflow, and the correct CLI commands for previewing versus deploying — mistakes here cause stale locks, spurious git diffs, or accidental deploys of untested code. ## Core Features & Use Cases - Parameterized SQL scripts: Bind arguments with $1::{type} placeholders and named comment headers, including S3Object parameters decoded via jsonb_to_recordset. - Correct CLI workflow: Distinguishes wmill script preview (local iteration) from wmill script run (deployed version) and wmill generate-metadata (lock/schema sync), preventing accidental deploys. - Result streaming to S3: Streams large query result sets directly to S3 in JSON, Parquet, or CSV format using the -- s3 directive. - Use Case: You need a Windmill script that queries a users table by name and age. The Skill produces the correctly parameterized SQL, then previews it locally with sample arguments before any deploy. ## Quick Start Write a Windmill PostgreSQL script that selects users by name and age, then 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. Default values can be set inline, for example -- $2 name2 = default_value.

What is the difference between wmill script preview and wmill script run?▼

wmill script preview executes the local script file without deploying, making it the default for iterating on edits. wmill script run executes the version already deployed in the workspace and should only be used when testing the deployed version.

How do I pass an S3 file as a parameter to a Windmill PostgreSQL script?▼

Declare the argument with type (s3object) in the comment header. Windmill renders an S3 file picker, decodes Parquet or CSV into JSON records, and binds it as jsonb, which you consume with jsonb_to_recordset.

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

Editing script content, especially imports or main's arguments, invalidates the stored content hash and leaves the lock and input schema stale. Run wmill generate-metadata to regenerate locks, schemas, and hashes so git-sync and CI stay clean.

Can a Windmill PostgreSQL script stream large results to S3?▼

Yes, add a -- s3 directive at the top of the script to stream the result set to S3 instead of returning rows. Optional keys control prefix, storage, and format (json, parquet, or csv), and the script returns the S3Object.