Repository navigation
@databases/pg@3.0.0
Breaking Changes
-
Renamed the following options (#118)
- The
bigIntAsStringoption has been replaced with thebigIntModeoption. It still defaults to'number'but a future major version may change the default to'bigint'. I recommend you set it explicitly to the value you want. - The
application_nameoption has been renamed toapplicationName - The
fallback_application_nameoption has been renamed tofallbackApplicationName - The
idleTimeoutMillisoption has been renamed toidleTimeoutMilliseconds - The
statement_timeoutoption has been renamed tostatementTimeoutMilliseconds - The
query_timeoutoption has been renamed toqueryTimeoutMilliseconds - The
errorcallback has been renamed toonErrorand no longer includes theclient
- The
-
Removed the following options (#118)
- The
noLockingoption has been removed. - The
noDuplicateDatabaseObjectsWarningoption has been removed (along with the associated warning) - The
pgFormattingoption has been removed (we always use prepared statements now) - The
pgNativeoption has been removed (it was incompatible with some features, and if you need that kind of extreme performance, you may be better off without@databases) - The
promiseLiboption has been removed (we didn't always honour it, and everyone should be using the builtin promise implementation anyway) - The
capSQLoption has been removed (we don't generate any SQL for you) - The
noWarningsoption has been removed (we don't have many warnings) - The
binaryoption has been removed (many internal features of @databases would not function when this is enabled) - The
client_encodingoption has been removed (the underlying parser assumes "utf8" no matter what you passed anyway) - The
encodingoption has been removed (this is for the same reason as client_encoding) - The
isDomainSocketoption has been removed (it is unclear if this ever worked. Open an issue if you need this.) - The
parseInputDatesAsUTCoption has been removed (the underlying library does not suport specifying this on a per-connection basis) - The
rowoption has been removed (it never made sense to specify this here)
- The
-
Removed event handlers (previously passed via options) (#118)
- The
connectevent has been removed - The
disconnectevent has been removed - The
queryevent has been removed - The
receiveevent has been removed - The
taskevent has been removed - The
transactevent has been removed - The
extendevent has been removed - The
errorcallback has been renamed toonErrorand no longer includes theclient
- The
-
New options (#118)
connectionTimeoutMillisecondsdefaults to 10 secondsmaxUsesdefaults toInfinity, this is the maximum number of times a connection can be retrieved from the pool before being recycled.keepAliveInitialDelayMillisecondsspecifies the TCP keepalive interval (when enabled via thekeepAliveoption)idleInTransactionSessionTimeoutMillisecondsnumber of milliseconds before terminating any session with an open idle transaction, default is no timeouttypesallows you to specify custom type parsers when creating a connection (See pg/src/TypeOverrides.ts for details)
-
createConectionPoolnow takes a single parameter containing all options (#118)To pass both a connection string, and other options, you can use
createConnectionPool({connectionString: '...', ...otherOptions})This replaces the arbitrary split between connection details and "options" -
Replace the old
Connectiontype with the newQueryable(#118)We now have 4 clear types:
Transaction- a database transactionConnection- a single connection to the databaseConnectionPool- a pool of connections to the databaseQueryable- an interface representing the common methods that are available to all 3 other types.
-
The default
sslmodeis now "prefer" (#118)Previously, the default was to always attempt to connect without ssl, and fail if the server required SSL. This resulted in errors that were difficult to debug in many environments. The new default is "prefer", which always attempts to connect with SSL, and then disables SSL if the connection fails.
-
Update compile target to node 12.19.0 (#115)
-
Updated
@databases/sqlto3.0.0(#114)This means:
- queries are no longer minified before being sent to Postgres
- queries no longer have
.compile()or.compileMySQL()methods - queries no longer have
.textor.valuesproperties SQLQueryis only a type, not a class.
If you were previously using
instanceof SQLQueryto check if a value is anSQLQuery, you can swap to usingisSqlQuery.If you were relying on the properties or methods to get the actual query text, please open an issue.