Neon
This walkthrough connects a Hosted Sink to a Neon serverless Postgres database.
1. Create a Neon Project
Sign in to console.neon.tech and click New project.
Choose a name, Postgres version, and a region close to StreamingFast's infrastructure.
Neon creates a default database (
neondb) and branch (main) automatically.
2. Get Connection Credentials
In your project, go to the Dashboard and open the Connection Details panel. Select:
Branch:
mainDatabase: your target database (default:
neondb)Role:
neondb_owneror a role you create
The connection string looks like:
postgres://<user>:<password>@<endpoint-host>.neon.tech/neondb?sslmode=requirePull the individual fields from it:
Host
ep-quiet-forest-a1b2c3d4.us-east-2.aws.neon.tech
Port
5432
Database
neondb
User
neondb_owner
Password
shown once — copy it now
3. Create a Dedicated Role and Schema (Recommended)
Open the Neon SQL Editor and run:
Replace substreams with your intended schema name.
4. Configure the Hosted Sink
In The Graph Market, create a new sink and fill in the Output section:
Host
ep-<name>.<region>.aws.neon.tech
Port
5432
Database
neondb (or your database name)
Schema
substreams (or the schema you created above)
User
substreams_sink
Password
Password for that role
SSL Mode
require
Neon endpoints suspend after a period of inactivity on the free tier. A Hosted Sink running continuously will keep the endpoint active, but if the sink is stopped for an extended period the first reconnect may be slow. Consider upgrading to a paid Neon plan for production workloads.
5. Deploy
Complete the remaining sink configuration (package, execution settings) and click Deploy sink. The sink will connect to your Neon database and begin writing data.
Troubleshooting
Endpoint suspended on first connect — Neon free-tier endpoints auto-suspend. The sink will retry on reconnect but may log an initial connection error. This is transient; the endpoint wakes within a few seconds.
SSL required — Neon requires SSL. Set SSL Mode to require; disable will be rejected.
Permission denied on new tables — Run ALTER DEFAULT PRIVILEGES IN SCHEMA substreams GRANT ALL ON TABLES TO substreams_sink; so that tables created by the sink are automatically accessible to the role.
Last updated
Was this helpful?

