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

OperationDescriptionResult in $steps
Fetch rowsFetches row on a table with an SELECT statement. Results can be filtered, sorted, and paginated.ManyRowsResult
Custom SQLUse custom SQL to perform any select query on the database. You can use advanced features such as JOIN.ManyRowsResult

Backend operations

OperationDescriptionResult in $steps
Create rowCreates a row on a table with an INSERT statement.Number of rows created.
Create rowsCreates rows on a table with INSERT statements in a TRANSACTION.Number of rows created.
Update rowsUpdates rows on a table with an UPDATE statement`. A filter is required.Number of rows updated.
Delete rowsUpdates rows on a table with a DELETE statement`. A filter is required.Number of rows deleted.
Custom SQLUse 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

Copy
{
"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?

Join 3000+ Plasmic users on Slack