Typescript wrapper around node-postgres
Typescript wrapper around node-postgres
breaking change
new feature
bug fix
chore
docs
queryOneOrNone
was executed with SQL that selected insufficient columns to fullyNone
. Fixed now to return the expectedPgRowValidationError
type.context
param has been added to connection.query
and queryX
named
function to set the name of a given SQL
-templated query.public readonly _T = "<class name>"
public readonly _<class name>: void
.makeConnectionPool
now returns an error unionPgPoolCreationError | PgTypeParserSetupError
instead of PgPoolCreationError
. Other errorsConnection
) under a Symbol
key. This will never conflict with otherE
, so we can now remove ConnectionE
and related subsequent design decisions.QueryAnyError
union included PgRowCountError
. This is incorrect (obvs).Either
ish functions no longer return a simple Error
type in their Left
s. Instead, we nowErrorPredicate
functions, e.g,isRowCountError
. Application-defined error types are propagated through the pg-ts
stack.ConnectionError<L>
, TransactionError<L>
.withConnectionE
to widenToConnectionE
for clarity and to differentiate from thewithConnectionE
function defined on Connection
.withTransaction
has been replaced by three similar functions that assist you depending on
whether you want to go from:
| Outer Context | Inner Context | Function to use |
|—————————|—————————|——————————-|
| Connection
| Connection
| withTransactionC
|
| ConnectionE<E>
| ConnectionE<E>
| withTransactionE
|
| ConnectionE<E>
| Connection
| withTransactionEC
|
Fixed the types
setting in package.json, so imports should now default to from "pg-ts"
instead of from "pg-ts/dist"
.
DATABASE_URL
environment variable must be present. The test