In Neon, you can provision Postgres databases in < 1s. Don't believe us? Check out this demo

Changelog

The latest product updates from Neon

Neon serverless driver enhancements

The Neon serverless driver is a low-latency Postgres driver for JavaScript and TypeScript that allows you to query data from serverless and edge environments over HTTP or WebSockets in place of TCP.

The driver now supports batched queries and a larger response size for queries over HTTP.

Batched queries

You can now issue multiple queries at once in a single, non-interactive transaction using the transaction() function, which is exposed as property of the query function. For example:

import { neon } from '@neondatabase/serverless';
const sql = neon(process.env.DATABASE_URL);
const showLatestN = 10;

const [posts, tags] = await sql.transaction([
  sql`SELECT * FROM posts ORDER BY posted_at DESC LIMIT ${showLatestN}`,
  sql`SELECT * FROM tags`,
]);

The transaction() function supports the same option keys the ordinary query function — arrayMode, fullResults, and fetchOptions — plus three additional keys for transaction configuration:

  • isolationMode

    Must be one of ReadUncommitted, ReadCommitted, RepeatableRead, or Serializable.

  • readOnly

    Ensures that a READ ONLY transaction is used to execute queries. The default value is false.

  • deferrable

    Ensures that a DEFERRABLE transaction is used to execute queries. The default value is false.

For more information, see transaction(...) function.

Larger response sizes

The maximum response size for queries over HTTP was raised from 1 MB to 10 MB.

Back to all changelog posts