Skip to content

Neon — Integrations

Neon is serverless Postgres with branching and scale-to-zero. It’s standard Postgres over the wire, so Axel connects with a normal connection URL and runs the usual axel diff / axel up flow.

In the Neon console, open Dashboard → Connection Details and copy the connection string. Neon offers two endpoint styles:

  • Direct (ep-<id>.<region>.aws.neon.tech) — use this for Axel migrations.
  • Pooled (ep-<id>-pooler.<region>.aws.neon.tech) — PgBouncer in transaction mode, for high-concurrency app runtime. Not for migrations.

Neon requires TLS, so the URL includes sslmode=require:

Terminal window
export DATABASE_URL='postgresql://<user>:<password>@ep-<id>.<region>.aws.neon.tech/<db>?sslmode=require'
axel.yaml
schema-path: ./schema.asl
migrations-dir: ./migrations
database-url: $env.DATABASE_URL
Terminal window
axel validate # parse + type-check, no DB needed
axel diff -n init # write a migration from the schema diff
axel up # apply pending migrations

Neon’s database branches pair well with Axel’s file-based migrations: create a branch, point DATABASE_URL at its direct endpoint, and run axel up to bring that branch’s schema up to date. Because migrations are tracked in _axel_migrations, each branch converges to the same schema independently.

Terminal window
# preview branch
export DATABASE_URL='postgresql://<user>:<password>@ep-preview-....aws.neon.tech/<db>?sslmode=require'
axel up