OptionalautocreateOptionalbackoffOptionalconnect_Connect timeout in seconds
OptionalconnectionConnection parameters
OptionaldatabaseName of database to connect to
OptionaldbName of database to connect to (an alias for database)
OptionaldebugIs called with (connection; query; parameters)
Optionalfetch_Automatically fetches types on connect
OptionalhostOptionalhostnamePostgres ip address or domain name (an alias for host)
Optionalidle_Idle connection timeout in seconds
Optionalkeep_OptionalmaxMax number of connections
Optionalmax_Optionalno_Disable prepared mode
OptionaloncloseOptionalonnoticeCalled when a notice is received
Optionalonparameter(key; value) when a server param change
OptionalpassPassword of database user (an alias for password)
OptionalpasswordPassword of database user
OptionalpathOptionalportOptionalprepareEnables prepare mode.
OptionalpublicationsPublications to subscribe to (only relevant when calling sql.subscribe())
OptionalsslHow to deal with ssl (can be a tls.connect option object)
Optionaltarget_Use 'read-write' with multiple hosts to ensure only connecting to primary
OptionaltimeoutIdle connection timeout in seconds
OptionaltransformTransform hooks
Optionalcolumn?: Transforms incoming and outgoing column names
Optionalrow?: { from?: (row: Row) => any } | ((row: Row) => any)Transforms entire rows
Optionalundefined?: anyTransforms outcoming undefined values
Optionalvalue?: Transforms incoming and outgoing row values
OptionaltypesArray of custom types; see more in the README
OptionalurlURL to reach the database on.
OptionaluserUsername of database user
OptionalusernameUsername of database user (an alias for user)
Should the schema table be automatically created (the v0 schema effectively). Defaults to
true.