- switch from "unknown" parameter in text format to a "json" parameter in
binary format (no dependency update required)
- use a lazy bytestring "json" encoder (via updated hasql)
* Adds error body when Prefer: count=exact is used and offset is out of bounds
* Adds details to differentiate between negative limits, lower boundaries greater than upper boundaries and out of bound ranges
The configuration option db-pool-acquisition-timeout
specifies the time in seconds to wait for the pool to
free up a connection slot. Otherwise, a 504 error is
returned. By default, there is no timeout.
- hasql-pool-0.8
* 'release' now flushes the pool, and no longer destroys it;
'PoolIsReleasedUsageError' is gone compared to our fork
* now supports an acquisition timeout, which we don't use
yet
* lower bound on 0.8.0.2 to fix a Windows build issue
- hasql-1.6
introduces a position parameter to ServerError, which we
ignore
This version of hasql-pool is a simplified rewrite that doesn't use
the resource-pool package. The major API changes are that idle
connections are no longer timed out (and the corresponding setting
is gone), and that `release` makes the pool unusable, where it used
to remain usable and only flushed idle connections.
We depend on a PostgREST fork of 0.7.2 that gives us reliable
flushing, compare https://github.com/PostgREST/hasql-pool/pull/1
- hasql-pool 0.7 removes timing out of idle connections, so
this change removes the db-pool-timeout option.
Given that we were typically running with very high
timeout settings, I don't anticipate the lack of timeout
to introduce new issues, though we might want to consider
introducing some retry-logic down the line when we
encounter connection failures.
- See https://github.com/PostgREST/postgrest/issues/2422 for a
discussion on depending on a forked dependency. Besides adding
the dependency to the nix overlay, we're also adding it to
stack.yaml and a new cabal.project to allow stack/cabal users
to build the project.
The original test no longer makes sense once we drop pool timeouts
with the hasql-pool upgrade.
To somehow test that new connections have the settings, convert it
to flush the pool instead.
The idea is that this ensures
1. that it's easy for contributers to hack on PostgREST without
getting nix set up
2. we see things break more easily outside the very controlled nix
environment (e.g. it would be easy to add a GHC 9.4.2 build here)
BREAKING CHANGE: For the cases where one to one relationships are
detected, json objects will be returned instead of json arrays of length
1.
If you wish to override this behavior, you can use computed
relationships to return arrays again.
- Revert patch #2311
- Keep the refactor done to qsFiltersRoot
- Keep the refactor done to the items tables
- Add tests that now work with pg-safeupdate as a result
This changes behaviour somewhat in that:
- We now consistently release the pool on shutdown, even on non-Unix
platforms, and including for CmdDumpConfig.
- We release the pool *after* interrupting `App.run`, which will
rather cause more than fewer connection to be closed properly.
(Previously any in-use connections would not have been caught by
`releasePool`, though *maybe* the `UserInterrupt` handling in
the web handler ends up closing the connections properly already
anyway).
(The main aim of the change is to make it clearer when and why the
pool is released.)