Assuming you want a few paragraphs on what you can do with the PostgreSQL API:
The following examples demonstrate some of the things that can be done with the PostgreSQL API:
module.exports = defineComponent({
props: {
postgresql: {
type: "app",
app: "postgresql",
}
},
async run({steps, $}) {
const { Client } = require('pg')
const { host, user, password, port, database } = this.postgresql.$auth
const client = new Client({
host,
database,
user,
password,
port,
})
await client.connect()
this.results = (await client.query("SELECT NOW()")).rows
await client.end()
},
})
PostgreSQL uses API keys for authentication. When you connect your PostgreSQL account, Pipedream securely stores the keys so you can easily authenticate to PostgreSQL APIs in both code and no-code steps.
Before you connect to your PostgreSQL database from Pipedream, please make sure your database is either:
Accessible from the public internet (You may need to add a firewall rule on 0.0.0.0/0
on port 5432), or
Accessible from an SSH server that you route PostgreSQL requests through
After that, enter the following values:
5432
, unless you run PostgreSQL on a different port