Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Neon 4 min read Announcement mediumAdept

Better Postgres with Prisma Experience

Prisma users on Neon can now use a single pooled Postgres connection string for both serverless queries and schema migrations, replacing separate pooled, direct and shadow database URLs. PgBouncer 1.22.0 added support for prepared statements and DISCARD ALL/DEALLOCATE ALL, which fixes the "prepared statement already exists" errors `prisma migrate` used to hit through the pooler, and the `pgbouncer=true` parameter is no longer needed. Neon also enabled role and database management via SQL, and Prisma 5.10.0 added DROP DATABASE WITH (FORCE), so `prisma migrate dev` can create and drop its own shadow database without manual setup.

Assumes: Postgres connection poolingPrisma schema files

Related posts

  • Improving the developer experience for Prisma users

    Neon mediumAdept

    Neon shipped three changes to smooth Prisma integration: faster cold starts from scale-to-zero, simultaneous pooled (PgBouncer) and direct connection strings, and SQL-based role/database management that removes the need for a manual shadow database. Prisma 5 users in the same region as their database likely no longer need a raised connect_timeout to avoid P1001 errors. Prisma Migrate fails over PgBouncer with a "prepared statement already exists" error, so the pooled `-pooler` endpoint goes in `url` and the direct endpoint in `directUrl` in schema.prisma. The `shadowDatabaseUrl` workaround can now be dropped.

  • PgBouncer is now available in Supabase

    Supabase mediumAdept

    Supabase now bundles PgBouncer, co-located on the same server as each new project's Postgres, so serverless functions that open a connection per request don't overwhelm the database. The pooler keeps a fixed set of connections open, currently a pool size of 15, and queues clients when all are busy rather than raising Postgres's connection limit. Three pool modes are available: session (full feature support), transaction (recommended for serverless, but no session features like prepared statements) and statement (no multi-statement transactions, suited to autocommit). Pooling applies to new projects only.

  • Postgres 17 is Now Available on Neon

    Neon mediumAdept

    Postgres 17 is available on Neon for all plans, including Free, and can be provisioned in a few steps. The post walks through new PG17 features with runnable SQL: MERGE with RETURNING and merge_action(), random(min, max) for generating test data, JSON_TABLE for turning JSON into relational rows, the sslnegotiation=direct connection parameter, and EXPLAIN reporting planner memory usage. Neon's proxy supports direct SSL negotiation even for older server versions, which cut a sample psql connection from 0.87s to 0.75s. Major version upgrades on Neon still require manual steps and a check of extension compatibility.

  • Neon Twin: How to deploy a change tested in Neon to prod in RDS

    Neon mediumAdept

    Schema changes tested on Neon database branches can be promoted to an AWS RDS production Postgres database through GitHub Actions that run when a pull request merges. Neon's schema diff shows how a dev branch differs from main. From there, migrations are applied in one of two ways: hand-written dated .sql files that a workflow detects via git diff and runs with psql, or Prisma migrations applied with `prisma migrate deploy`. A follow-up pg_dump/pg_restore job then re-syncs the Neon Twin from production.

  • PgBouncer: The one with prepared statements

    Neon mediumAdept

    Neon now runs PgBouncer 1.22.0, which supports protocol-level prepared statements (added in 1.21.0) plus DEALLOCATE ALL and DISCARD ALL, and claims 15% to 250% higher query throughput. SQL-level PREPARE/EXECUTE still won't work through the pooler. Protocol-level prepared statements from client libraries such as psycopg2 and node-postgres do work. PgBouncer tracks each unique query string, gives it an internal name like PGBOUNCER_123, prepares it on the server connection if needed, and rewrites client commands to use that name.

The quest for software engineering knowledge.

Look:
Layout: