In next release ...
-
Added "end" event which was removed in v1.8.0.
-
The
end
method 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
any
which was incorrect. -
The
DatabaseError
,ErrorLevel
, andTransactionStatus
symbols are no longer exported usingtype
(which was incorrect given that you want to be able to useinstanceof
and extract information).
- Fix SSL configuration issue where the
ssl
configuration 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
DatabaseError
andClientNotice
. Note that adetail
field has been added (previously it was added to the message) as part of this change.
-
The
connect
function is now used to create a client, already connected when the promise returns. TheClient
symbol 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
off
method to disable event listening. -
Remove dependency on ts-typed-events, which has been supplanted by updated typings for the built-in
EventEmitter
class 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
Query
object and client configuration now provide an optionalbigints
setting 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
Connect
andEnd
events have been removed, in addition to theParameter
event; theconnect
method 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
execute
method has been removed. -
The querying options now include an optional
transform
property which must be a function which takes a column name input, allowing the transformation of column names into for example camel-case. -
The
query
method now accepts aQuery
object 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
get
andreify
methods. This separates the query results interface into an iterator interface (providing objects) and a result interface (providing rows and column names).
-
The
Value
type 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
get
method on each row.In addition, a new
reify
method now produces records which conform to the specified type. This method is available on all of the result objects. -
Use lookup table to optimize
get
method. -
The
connect
method 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_CERTS
environment 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
bigint
everywhere 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
BYTEA
where a returned buffer would incorrectly be a slice into an internal buffer. -
The environment variables
PGHOST
andPGPORT
can 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
connectionTimeout
configuration setting (in milliseconds). -
Updated dependency on "ts-typed-events".
- Added support for
BigInt
.
- Fixed handling of null values in arrays. [matthieusieben]
-
Fixed
ECONNRESET
deprecation. -
Enable parsing of
jsonb
anduuid
arrays. [matthieusieben] -
Fixed error when parsing null arrays. [matthieusieben]
-
Encoding argument now uses
BufferEncoding
type.
-
The rejection value is now a
DatabaseError
object 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
JSONB
and 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.