Skip to main content
runQuery opens a fresh database connection, executes one statement, returns the result, and closes the connection whether the query succeeds or fails.

Example

automations/query-postgres.automation.ts

Inputs

Use parameters for untrusted values. Placeholders cannot represent table or column names; do not concatenate untrusted identifiers into SQL.

Output

Returns a signal containing: Each field contains name, columnId, tableId, dataTypeId, dataTypeSize, dataTypeModifier, and format. A new connection per action is appropriate for independent statements; use getPostgresClient in a custom action when you need a transaction, cursor, or session-level state.