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:
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
, orSerializable
. -
readOnly
Ensures that a
READ ONLY
transaction is used to execute queries. The default value isfalse
. -
deferrable
Ensures that a
DEFERRABLE
transaction is used to execute queries. The default value isfalse
.
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.