PostgreSQL integration
PostgreSQL is a SQL-based relational database that is suited for more technical users.
For Supabase users, check out our Supabase-specific documentation.
Setup
When adding a PostgreSQL integration, you can either input the fully qualified connection string or:
- Host: The host for your database, like
my.postgresql.host.com
. - Port: The port for your database. This is usually 5432.
- Database name: The name of the database on the host.
- User: The user to log in to your database.
- Password: The password to log in to your database.
You can also specify some optional connection options to be used when connecting to your database.
Security
Your integration credentials will only be used on Plasmic servers and will never be exposed to clients. See the documentation on integration security for more details.
Data queries
Operation | Description | Result in $steps |
---|---|---|
Fetch rows | Fetches row on a table with an SELECT statement. Results can be filtered, sorted, and paginated. | ManyRowsResult |
Custom SQL | Use custom SQL to perform any select query on the database. You can use advanced features such as JOIN . | ManyRowsResult |
Backend operations
Operation | Description | Result in $steps |
---|---|---|
Create row | Creates a row on a table with an INSERT statement. | Number of rows created. |
Create rows | Creates rows on a table with INSERT statements in a TRANSACTION . | Number of rows created. |
Update rows | Updates rows on a table with an UPDATE statement`. A filter is required. | Number of rows updated. |
Delete rows | Updates rows on a table with a DELETE statement`. A filter is required. | Number of rows deleted. |
Custom SQL | Use custom SQL to perform any insert, update, or delete queries on the database. You can use advanced features such as ON CONFLICT . | Number of rows created/updated/deleted. |
Result types
ManyRowsResult
{"data": [{ "ID": 1, "Name": "User 1" },{ "ID": 2, "Name": "User 2" }],"schema": {"id": "Users","fields": [{ "id": "ID", "type": "number", "readOnly": false },{ "id": "Name", "type": "string", "readOnly": false }]},"paginate": {"pageSize": 20,"pageIndex": 0}}
The paginate
field is only set if the data query was paginated.
For users familiar with TypeScript, you can view the most up-to-date schema here.
Was this page helpful?
Have feedback on this page? Let us know on our forum.