Skip to content
/ pg-ts Public
forked from musicglue/pg-ts

Typescript wrapper around node-postgres

License

Notifications You must be signed in to change notification settings

ivivona/pg-ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 Cannot retrieve latest commit at this time.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pg-ts

Typescript wrapper around node-postgres

πŸ’₯ breaking change πŸš€ new feature πŸ› bug fix πŸ”§ chore πŸ““ docs

v6.0.0

  • πŸ’₯ Simplified the API by always requiring an environment object in which pg-ts can store it's state (Connection) under a Symbol key. This will never conflict with other keys in the E, so we can now remove ConnectionE and related subsequent design decisions.

v5.0.1

  • πŸ› QueryAnyError union included PgRowCountError. This is incorrect (obvs).
  • πŸ”§ Compiled with TS3.0.1.

v5.0.0

  • Eitherish functions no longer return a simple Error type in their Lefts. Instead, we now provide a union of concrete error types that make it explicit what the failure conditions are. Clients can pattern match on error type using the provided ErrorPredicate functions, e.g, isRowCountError. Application-defined error types are propagated through the pg-ts stack.

  • Commonly-grouped errors are provided as unions, e.g. ConnectionError<L>, TransactionError<L>.

  • Renamed withConnectionE to widenToConnectionE for clarity and to differentiate from the withConnectionE 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".

  • Integration tests are provided. A DATABASE_URL environment variable must be present. The test suite will create the table it needs and will truncate before each test. Every query type is tested and transaction commit/rollback behaviour is also verified.

About

Typescript wrapper around node-postgres

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%