Skip to content

Releases: porsager/postgres

v3.0.3

04 Apr 11:00
Compare
Choose a tag to compare
  • Run tests with github actions b536d0d
  • Add custom socket option - fixes #284 5413f0c
  • Fix sql function overload type inference (#294) 3c4e90a
  • Update deno std to 0.132 and enable last tests 50762d4
  • Send proper client-encoding - Fixes #288 e5b8554

v3.0.2...v3.0.3

v3.0.2

31 Mar 12:08
Compare
Choose a tag to compare

v3.0.1...v3.0.2

v3.0.1

30 Mar 20:10
Compare
Choose a tag to compare
  • Improve connection queue handling + fix leak cee1a57
  • Use publications option - fixes #295 b5ceecc
  • Add types to debug signature dbb668c
  • Throw proper query error if destroyed e148a0a
  • Transaction rejects with rethrown error - fixes #289 f7c8ae6
  • Only create origin stacktrace for tagged and debug - fixes #290 a782edf
  • Include types and readme in deno release - fixes #287 9068820
  • Disable fetch_types for Subscribe options 72e0cdb
  • Update TypeScript types with v3 changes (#293) db05836

v3.0.0...v3.0.1

v3.0.0

25 Mar 08:35
Compare
Choose a tag to compare

This is a complete rewrite to better support all the features that I was trying to get into v2. There are a few breaking changes from v2 beta, which some (myself included) was using in production, so I'm skipping a stable v2 release and going straight to v3.

Here are some of the new things available, but check the updated docs.

  • Dynamic query builder based on raw sql
  • Realtime subscribe to db changes through logical replication
  • Multi-host support for High Availability setups
  • Postgres input parameter types from ParameterDescription
  • Deno support
  • Cursors as async iterators
  • .describe() to only get query input types and column definitions
  • Support for Large Objects
  • max_lifetime for connections
  • Cancellation of requests
  • Converted to ESM (with CJS support)
  • Typescript support (Credit @Minigugus)

Breaking changes from v2 -> v3

  • Cursors are always called with Result arrays (previously cursor 1 would return a row object, where > 1 would return an array of rows)
  • .writable() and .readable() is now async (returns a Promise that resolves to the stream)
  • Queries now returns a lazy promise instead of being executed immediately. This means the query won't be sent until awaited (.then, .catch, .finally is called) or until .execute() is manually called.
  • .stream() is renamed to .forEach
  • Returned results are now it's own Result class extending Array instead of an Array with extra properties (actually shouldn't be breaking unless you're doing something funny)
  • Parameters are now cast using the types returned from Postgres ParameterDescription with a fallback to the previously inferred types
  • Only tested with node v12 and up
  • Implicit array value to multiple parameter expansion removed (use sql([...]) instead)

Breaking changes from v1 -> v2 (v2 never moved on from beta)

  • All identifiers from sql() in queries are now always quoted
  • Undefined parameters are no longer allowed
  • Rename timeout option to idle_timeout
  • Default to 10 connections instead of number of CPUs
  • Numbers that cannot be safely cast to JS Number are returned as string. This happens for eg, select count(*) because count() returns a 64 bit integer (int8), so if you know your count() won't be too big for a js number just cast in your query to int4 like select count(*)::int

v1.0.2...v3.0.0

v3.0.0-rc.3

24 Mar 18:41
Compare
Choose a tag to compare
v3.0.0-rc.3 Pre-release
Pre-release

v3.0.0-rc.2

23 Mar 21:31
Compare
Choose a tag to compare
v3.0.0-rc.2 Pre-release
Pre-release
  • Fix race condition with transactions on end 315407e

v3.0.0-rc.1...v3.0.0-rc.2

v3.0.0-rc.1

20 Mar 22:21
Compare
Choose a tag to compare
v3.0.0-rc.1 Pre-release
Pre-release

This is a complete rewrite to better support all the features that I was trying to get into v2. There are a few breaking changes from v2 beta , which some (myself included) are using in production, so I'm skipping a stable v2 release and going to v3.

Here are some of the new things available..

  • Converted to ESM with CJS support
  • Deno support
  • Dynamic query builder based on raw sql
  • Realtime subscribe to db changes through logical replication
  • Cursors as async iterators
  • Multi-host support for High Availability setups
  • Postgres input parameter types from ParameterDescription
  • .describe() to only get query input types and column definitions
  • Support for Large Objects
  • max_lifetime for connections
  • Cancellation of requests

Breaking changes from v2 -> v3

  • Cursors are always called with Result arrays (previously cursor 1 would return a row object, where > 1 would return an array of rows)
  • .writable() and .readable() is now async (returns a Promise that resolves to the stream)
  • Queries now returns a lazy promise instead of being executed immediately. This means the query won't be sent until awaited (.then, .catch, .finally is called) or until .execute() is manually called.
  • .stream() is renamed to .forEach
  • Returned results are now it's own Result class extending Array instead of an Array with extra properties (actually shouldn't be breaking unless you're doing something funny)
  • Parameters are now cast using the types returned from Postgres ParameterDescription with a fallback to the previously inferred types
  • Only tested with node v12 and up
  • Implicit array value to multiple parameter expansion removed (use sql([...]) instead)

Breaking changes from v1 -> v2 (v2 never moved on from beta)

  • All identifiers from sql() in queries are now always quoted
  • Undefined parameters are no longer allowed
  • Numbers that cannot be safely cast to JS Number are returned as string. This happens for eg, select count(*) because count() returns a 64 bit integer (int8), so if you know your count() won't be too big for a js number just cast in your query to int4 like select count(*)::int

v2.0.0-beta.11...v3.0.0-rc.1

v2.0.0-beta.11

17 Nov 13:37
Compare
Choose a tag to compare
v2.0.0-beta.11 Pre-release
Pre-release
  • Fix listen reconnect on connection errors + simple backoff 09592ea

v2.0.0-beta.10...v2.0.0-beta.11

v2.0.0-beta.10

29 Sep 11:43
Compare
Choose a tag to compare
v2.0.0-beta.10 Pre-release
Pre-release
  • Remove unnecessary portal and flush 06cc8e4

v2.0.0-beta.9...v2.0.0-beta.10

v2.0.0-beta.9

19 Sep 20:29
Compare
Choose a tag to compare
v2.0.0-beta.9 Pre-release
Pre-release

v2.0.0-beta.8...v2.0.0-beta.9