Neon
Last updated
Was this helpful?
This walkthrough connects a Hosted Sink to a Neon serverless Postgres database.
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.
In your project, go to the Dashboard and open the Connection Details panel. Select:
Branch: main
Database: your target database (default: neondb)
Role: neondb_owner or 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
Open the Neon SQL Editor and run:
Replace substreams with your intended schema name.
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.
Complete the remaining sink configuration (package, execution settings) and click Deploy sink. The sink will connect to your Neon database and begin writing data.
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?
Was this helpful?
CREATE ROLE substreams_sink WITH LOGIN PASSWORD 'a-strong-password';
CREATE SCHEMA IF NOT EXISTS substreams;
GRANT ALL PRIVILEGES ON SCHEMA substreams TO substreams_sink;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA substreams TO substreams_sink;
ALTER DEFAULT PRIVILEGES IN SCHEMA substreams GRANT ALL ON TABLES TO substreams_sink;
