auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps) => {
}
const { Client } = require('pg')
// The client will use environment variables to connect.
// See https://node-postgres.com/features/connecting.
//
// You'll need to add Pipedream environment variables
// for PGUSER, PGHOST, and PGPASSWORD at the very least.
// See https://docs.pipedream.com/environment-variables/
const client = new Client()
await client.connect()
// I run a mock query below, but you can replace that
// with any query you'd like
const { rows } = await client.query('SELECT NOW()')
for (row of rows) {
console.log(row)
}
await client.end()