- Home
- Integrations
- PostgreSQL
PostgreSQL integration: insert, find and update data from a scheme
The PostgreSQL integration in nana800 runs an SQL query against your database on every scheme run: it saves a lead, finds an order or changes a status. You only need the connection string, and values from other blocks are sent as separate parameters, so a quote in a name cannot break the query. Each query costs $0.002, and your balance is topped up to $3.50 for free every month.
Build it in the builder- Block run: $0.002
- Free every month: $3.50
- No card needed
What you can do
- Save website leads, orders and bot messages as rows in your tables
- Look up data on request, such as an order by number or a customer by phone or email, and pass it further down the scheme
- Update and delete rows: mark an order as paid, move it to a new status, clean up old records
- Write any SQL: JOINs, aggregates, your own functions and RETURNING to get the inserted row right away
- Put values from other blocks into the query with no SQL injection risk: they are sent to the database as parameters
- Connect to cloud databases on Supabase, Neon, AWS RDS and Render or to your own server, with or without SSL
Blocks in the builder
PostgreSQL query
Action · $0.002 per run
Runs an SQL query against your PostgreSQL database: SELECT, INSERT, UPDATE, DELETE or any other command. Returns the rows found, the number of affected rows and an error text if the query fails.
How to set it up
- 1
Get access to the database
Copy the connection string from your hosting panel, like postgresql://user:password@host:5432/dbname, or note the host, port, database name, user and password. The database must accept connections from the internet: the block refuses localhost and private network addresses like 192.168.x.x.
- 2
Create a scheme and add a trigger
Create a scheme in the builder and add the trigger that brings the data: a webhook for website leads, a message to a Telegram bot or a schedule. For the first test the button trigger is enough, it starts the scheme by hand.
- 3
Connect the PostgreSQL block
Add the Postgres external database operation block. Paste the whole connection string or fill in the host, port, database name, user and password. Keep the SSL mode at require, which fits Supabase, Neon, AWS RDS and most cloud databases. If your server has no SSL, choose disable.
- 4
Write the SQL query
In the SQL query field write the command, for example an insert into your leads table, and put fields from the trigger where the values go. Wrap text values in single quotes, numbers can go without quotes. Add RETURNING * at the end and the block returns the inserted row.
- 5
Turn the scheme on and test it
Turn the scheme on, press the button trigger and open the block result: result holds the rows, row_count their number, and error_text the database answer if something went wrong. When it works, keep the scheme on. While it is on, it costs $0.0042 per hour.
Popular connections
- Webhook + PostgreSQL
Build your own PostgreSQL API without a backend: a webhook takes the data, an SQL query writes or reads rows and sends the result back. Free balance every month.
Frequently asked questions
Build your first scheme for free
Sign-up is free and needs no card. Every month the balance is topped up to $3.50 for free, enough for about 3,500 runs of basic blocks.
Build it in the builder