coalesceWrites: NeonConfig["coalesceWrites"]
disableSNI: NeonConfig["disableSNI"]
disableWarningInBrowsers: NeonConfig["disableWarningInBrowsers"]
forceDisablePgSSL: NeonConfig["forceDisablePgSSL"]
pipelineConnect: NeonConfig["pipelineConnect"]
pipelineTLS: NeonConfig["pipelineTLS"]
rootCerts: NeonConfig["rootCerts"]
subtls: NeonConfig["subtls"]
useSecureWebSocket: NeonConfig["useSecureWebSocket"]
webSocketConstructor: NeonConfig["webSocketConstructor"]
webSocketConstructor: NeonConfig["webSocketConstructor"]
wsProxy: NeonConfig["wsProxy"]
coalesceWrites: NeonConfig["coalesceWrites"]
disableSNI: NeonConfig["disableSNI"]
disableWarningInBrowsers: NeonConfig["disableWarningInBrowsers"]
forceDisablePgSSL: NeonConfig["forceDisablePgSSL"]
pipelineConnect: NeonConfig["pipelineConnect"]
pipelineTLS: NeonConfig["pipelineTLS"]
rootCerts: NeonConfig["rootCerts"]
subtls: NeonConfig["subtls"]
useSecureWebSocket: NeonConfig["useSecureWebSocket"]
wsProxy: NeonConfig["wsProxy"]
destroy(): this
rawWrite(data: Uint8Array): void
ref(): this
setKeepAlive(): this
setNoDelay(): this
tlsReadLoop(): Promise<void>
unref(): this
coalesceWrites: NeonConfig["coalesceWrites"]
disableSNI: NeonConfig["disableSNI"]
disableWarningInBrowsers: NeonConfig["disableWarningInBrowsers"]
fetchConnectionCache: NeonConfig["fetchConnectionCache"]
fetchEndpoint: NeonConfig["fetchEndpoint"]
fetchFunction: NeonConfig["fetchFunction"]
forceDisablePgSSL: NeonConfig["forceDisablePgSSL"]
opts: Partial<NeonConfig>
pipelineConnect: NeonConfig["pipelineConnect"]
pipelineTLS: NeonConfig["pipelineTLS"]
poolQueryViaFetch: NeonConfig["poolQueryViaFetch"]
rootCerts: NeonConfig["rootCerts"]
subtls: NeonConfig["subtls"]
useSecureWebSocket: NeonConfig["useSecureWebSocket"]
webSocketConstructor: NeonConfig["webSocketConstructor"]
wsProxy: NeonConfig["wsProxy"]
coalesceWrites: NeonConfig["coalesceWrites"]
Batch multiple network writes per run-loop into a single outgoing WebSocket message.
Default: true
.
disableSNI: NeonConfig["disableSNI"]
When using subtls with forceDisablePgSSL = false
and Postgres connection
parameters that specify TLS, setting disableSNI = true
means that no SNI
data in included in the Postgres TLS handshake.
On Neon, disabling SNI and including the Neon project name in the password avoids CPU-intensive SCRAM authentication, but this is only relevant for earlier iterations of Neon's WebSocket support.
Default: false
.
disableWarningInBrowsers: NeonConfig["disableWarningInBrowsers"]
When disableWarningInBrowsers
is set to true
, it disables the warning about
running this driver in the browser.
Default: false
.
fetchConnectionCache: NeonConfig["fetchConnectionCache"]
DEPRECATED. Previously, only when fetchConnectionCache
was true
did queries carried via HTTP fetch make use of a connection pool/cache
on the server. All queries now use the connection pool/cache: this setting
is ignored.
Default: true
.
fetchEndpoint: NeonConfig["fetchEndpoint"]
Set fetchEndpoint
to set the server endpoint to be sent queries via http
fetch. May be useful in local development (e.g. to set a port that's not
the default 443).
Provide either the full endpoint URL, or a function that takes the database host address, port and options, and returns the full endpoint URL (including protocol).
Default: custom logic to connect to Neon endpoints.
fetchFunction: NeonConfig["fetchFunction"]
The fetchFunction
option allows you to supply an alternative function
for making http requests. The function must accept the same arguments as
native fetch
.
Default: undefined
.
forceDisablePgSSL: NeonConfig["forceDisablePgSSL"]
Disable TLS encryption in the Postgres protocol (as set via e.g.
?sslmode=require
in the connection string). Connection remains secure
as long as useSecureWebSocket
is true
, which is the default.
Default: true
pipelineConnect: NeonConfig["pipelineConnect"]
Pipelines the startup message, cleartext password message and first query
when set to "password"
. This works only for cleartext password auth.
Default: "password"
.
pipelineTLS: NeonConfig["pipelineTLS"]
Pipeline the pg SSL request and TLS handshake when forceDisablePgSSL
is
false
and the Postgres connection parameters specify TLS. Currently
compatible only with Neon hosts.
Default: false
.
poolQueryViaFetch: NeonConfig["poolQueryViaFetch"]
Experimentally, when poolQueryViaFetch
is true
, and no listeners
for the "connect"
, "acquire"
, "release"
or "remove"
events are set
on the Pool
, queries via Pool.query()
will be sent by low-latency HTTP
fetch request.
Default: false
.
rootCerts: NeonConfig["rootCerts"]
Set rootCerts
to a string comprising one or more PEM files. These are
the trusted root certificates for a TLS connection to Postgres when
forceDisablePgSSL
is false
and the Postgres connection parameters
specify TLS.
Default: ""
.
subtls: NeonConfig["subtls"]
If forceDisablePgSSL
is false
and the Postgres connection parameters
specify TLS, you must supply the subtls TLS library to this option:
import { neonConfig } from '@neondatabase/serverless'; import * as subtls from 'subtls'; neonConfig.subtls = subtls;
Default: undefined
.
useSecureWebSocket: NeonConfig["useSecureWebSocket"]
Use a secure (wss:
) connection to the WebSocket proxy.
Default: true
.
webSocketConstructor: NeonConfig["webSocketConstructor"]
Only if no global WebSocket
object is available, such as in older
versions of Node, set webSocketConstructor
to the constructor for a
custom WebSocket implementation, such as those provided by ws
or
undici
.
Default: undefined
.
wsProxy: NeonConfig["wsProxy"]
Set wsProxy
to use your own WebSocket proxy server.
Provide either the proxy server’s domain name, or a function that takes the database host and port and returns the proxy server address (without protocol).
Example: (host, port) => "myproxy.example.net?address=" + host + ":" + port
Default: host => host + '/v2'