pg-durable-sql
Installation
SKILL.md
pg_durable SQL Generation
Generate correct, idiomatic pg_durable durable function SQL using the df.* schema functions and operators.
Critical Rules
- All DSL expressions are TEXT. Operators and functions return JSON-encoded TEXT strings representing a function graph. Only
df.start()actually executes anything. - SQL strings are auto-wrapped. Plain SQL strings like
'SELECT 1'are automatically converted to SQL nodes — you do NOT needdf.sql(). - Single-quote escaping. Each DSL node is itself a single-quoted SQL string, so any single quotes inside it must be doubled. To filter
status = 'pending', write the whole node as'SELECT * FROM orders WHERE status = ''pending'''(note the doubled quotes aroundpendingand the closing'''). - Operators are SQL-level custom operators. They work on
TEXToperands. Parentheses control grouping. df.setvar()must be called BEFOREdf.start(). Variables are captured at start time and are immutable during execution.- Two variable syntaxes:
{varname}for durable function variables (fromdf.setvar),$namefor result captures (from|=>). Do NOT mix them up.