Connects to a PostgreSQL instance and perform two operations:
- Insert a new row into the "invocations" table with an invocation ID
- Query the "invocations" table for all the invocation IDs
- Export your Heroku Postgres configuration
Make sure you have the DATABASE_URL
connection string in the .env
file of this folder. For using this recipe on a Compute Environment please refer to the Heroku Data in Functions documentation.
heroku config -a <app_name> --shell > .env
- Install dependencies with
npm install
- Run tests with
npm test
- Start your function locally
sf run function start --verbose
- Invoke your function locally
sf run function --function-url=http://localhost:8080 --payload='{}'