SqlQuery

Runs one SQL statement against an external PostgreSQL or MySQL database.

Fields

FieldTypeRequiredWhat it does
connectionstringyesThe connection string: postgres://user:password@host:5432/database or mysql://…. Never write it here — keep it in a flow variable and reference it as {{variables.SHOP_DB}}.
querystringyesOne SQL statement with placeholders: $1, $2 for postgres, ? for mysql. {{expressions}} are refused here on purpose — values go through params.
paramsjsonataA JSONata expression giving the list of values for the placeholders, in order, for example [ input.body.customer, input.body.total ]. At most 100 values, each a single value.
maxRowsnumberHow many rows to carry into the flow, up to 1000. Above that the answer is cut and truncated says so.

Output

ok, engine, database, rows, rowCount, fields, truncated

Notes

The database has to be reachable from the internet: a private or local address is refused. TLS is on unless sslmode=disable, and Cloudflare always checks the certificate — a database with a certificate of its own making cannot be reached this way. The password never appears in an error. Each run opens its own connection.