In next release ...
-
Added "end" event which was removed in v1.8.0.
-
The
endmethod now correctly throws an error if a network error occurred during the resulting protocol traffic.
-
Fix issue where larger results would sometimes have duplicates (#122).
-
Fixed an issue where the result row array type would use the record generic as the value type instead of
anywhich was incorrect. -
The
DatabaseError,ErrorLevel, andTransactionStatussymbols are no longer exported usingtype(which was incorrect given that you want to be able to useinstanceofand extract information).
- Fix SSL configuration issue where the
sslconfiguration option was not correctly processed for the prefer and require settings.
-
Type declarations are now optimized and rolled up into a single file.
-
The PostgreSQL error code table has been removed. Consult the documentation to map error codes to the string identifiers used in the PostgreSQL codebase.
-
Parse additional fields into
DatabaseErrorandClientNotice. Note that adetailfield has been added (previously it was added to the message) as part of this change.
-
The
connectfunction is now used to create a client, already connected when the promise returns. TheClientsymbol is now a type instead of a value. -
Add
[Symbol.asyncDispose]method to support Explicit Resource Management. This works on the client object as well as prepared statements. -
Add
offmethod to disable event listening. -
Remove dependency on ts-typed-events, which has been supplanted by updated typings for the built-in
EventEmitterclass that's now generic.
-
Add support for ESM modules.
-
The database host, port and connection timeout options can now be specified directly for
connect(taking priority over the provided configuration). -
Fix issue handling connection error during secure startup.
-
Reduce buffer allocation and intelligently scale initial allocation when creating a new buffer.
-
Both the
Queryobject and client configuration now provide an optionalbigintssetting which decides whether to use bigints or the number type for the INT8 data type. The setting is enabled by default. -
Add support for the INT2 and INT8 array types.
-
The
ConnectandEndevents have been removed, in addition to theParameterevent; theconnectmethod now returns an object with information about the established connection, namely whether the connection is encrypted and the connection parameters sent by the server. -
Fixed a regression where some symbols were not correctly exposed for importing.
-
The
executemethod has been removed. -
The querying options now include an optional
transformproperty which must be a function which takes a column name input, allowing the transformation of column names into for example camel-case. -
The
querymethod now accepts aQueryobject as the first argument in addition to a string argument, but no longer accepts any additional arguments aftervalues. The query options must now be provided using the query argument instead.The same change has been made to
prepare.
-
The iterator methods now return reified representations of the query result (i.e. objects), carrying the generic type parameter specified for the query (#83).
-
The result rows now extend the array type, providing
getandreifymethods. This separates the query results interface into an iterator interface (providing objects) and a result interface (providing rows and column names).
-
The
Valuetype has been replaced withany, motivated by the new generic result type as well as the possibility to implement custom value readers which could return objects of any type. -
Query results are now generic with typing support for the
getmethod on each row.In addition, a new
reifymethod now produces records which conform to the specified type. This method is available on all of the result objects. -
Use lookup table to optimize
getmethod. -
The
connectmethod now returns a boolean status of whether the connection is encrypted. -
The "verify-ca" SSL mode has been removed, favoring "require"; in addition, both "prefer" and "require" imply certificate verification. To use a self-signed certificate, use for example the
NODE_EXTRA_CA_CERTSenvironment variable to provide the public key to the runtime as a trusted certificate. -
Database name now implicitly defaults to the user name.
-
Add additional client connection configuration options.
-
Result rows are now themselves iterable.
-
Use
biginteverywhere as a type instead ofBigInt.
-
A statement error during the processing of a prepared statement is now handled correctly (#73).
-
An internal error now cancels all queries.
-
The ts-typed-events dependency was updated to version 3.0.0.
- Added details of database error to thrown error message (#64).
- Fix prepare statement with no return data (#56).
-
Fix range error that could occur when parsing an incomplete data row after one or more previous messages had already been processed.
-
The stack trace of a query error now originates in calling code, rather than an async listening thread.
-
Fix error handling for queries that return no data.
-
Fix error handling during connection attempts such that promise returned by
connect()is rejected in case of an error. -
Add support for SCRAM-SHA-256 authentication.
-
Fix issue where a query with multiple columns would yield incomplete rows when protocol data spans multiple receive buffers.
-
The "execute" method is now public and must be used now when passing a query object rather than individual arguments when querying.
-
Add support for streaming binary column data.
-
Add SSL support.
-
Fix buffer race condition that could lead to data corruption.
-
Fix issue with
BYTEAwhere a returned buffer would incorrectly be a slice into an internal buffer. -
The environment variables
PGHOSTandPGPORTcan now be set to override the static defaults "localhost" and 5432. -
Fixed an issue where a connection error would not reject the connect promise.
-
Added optional
connectionTimeoutconfiguration setting (in milliseconds). -
Updated dependency on "ts-typed-events".
- Added support for
BigInt.
- Fixed handling of null values in arrays. [matthieusieben]
-
Fixed
ECONNRESETdeprecation. -
Enable parsing of
jsonbanduuidarrays. [matthieusieben] -
Fixed error when parsing null arrays. [matthieusieben]
-
Encoding argument now uses
BufferEncodingtype.
-
The rejection value is now a
DatabaseErrorobject which inherits fromError. Previously, this value was a plain string. -
Add command status string to result object.
-
Fix password authentication.
-
Add support for MD5 authentication.
-
Handle
JSONBand null values.
-
Connection state variable 'closed' is now public. This should be checked before using the connection to make sure that an unexpected error has not occurred which would close the connection.
-
Handle protocol errors gracefully, passing error to open data handlers and marking the connection as 'closed'.
-
Parse JSON data only on non-null value.
-
Fixed an issue where getting a column would result in an infinite loop.
-
Fixed an issue with
Result.one()andResult.first()methods where a rejection would be uncaught.
- Initial release.