postSql
Execute SQL statements (SELECT, INSERT, UPDATE, DELETE, MERGE) with parameter binding and output in JSON, CSV, GeoJSON, or spatial formats.
Instructions
Execute SQL statements.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | No | SQL statement to run. Allowed: SELECT, INSERT, UPDATE, DELETE, MERGE. Not allowed: DDL, transaction control. | |
| params | No | Parameters for the statement. For SELECT, only one parameter set is allowed. | |
| type_hints | No | Type hints for JSON-encoded parameters that are not JSON/JSONB in the database. | |
| type_formats | No | Formatting rules for typed parameters, e.g. date formats. | |
| output_format | No | Output format. Supported: json, geojson, csv, ccsv, ndjson, excel, or ogr/<format> (e.g. ogr/ESRI Shape). ccsv and ndjson are streamed. | json |
| srs | No | EPSG code for the spatial reference system used for PostGIS geometry output. |