PostgreSQL
Connect a Postgres database as a datasource, then write SQL queries (with prepared statements recommended for user input).
Connect
- Datasources → New → PostgreSQL
- Enter host, port, database, username, and password for the target environment.
- Test the connection, then Save.
Use separate configurations for staging and production when your workspace uses environments.
Query
Create a query on the datasource. Prefer prepared statements for dynamic values — see Prepared statements.
Bind results with {{QueryName.data}} on Tables and other widgets.