Update hasql-notifications to include the fix on
https://github.com/diogob/hasql-notifications/issues/24.
Which now reveals the following error:
```
$ postgrest-with-postgresql-16 --replica -f test/spec/fixtures/load.sql postgrest-run
17/May/2024:18:35:38 -0500: Successfully connected to PostgreSQL 16.2 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 13.2.0, 64-bit
17/May/2024:18:35:38 -0500: Could not listen for notifications on the "pgrst" channel. ERROR: cannot execute LISTEN during recovery
17/May/2024:18:35:38 -0500: Retrying listening for notifications...
```
This is still not good because the LISTEN channel will be retried
forever without a backoff.
- new option db-pool-max-idletime limits the maximal idle time of a
postgresql connection, defaults to 30 seconds
- this essentially restores the db-pool-timeout option from versions
<=10, with more specific name
- db-pool-acquisition-timeout is no longer optional, defaults to 10s
- new option db-pool-max-lifetime limits the maximal lifetime of a
postgresql connection, defaults to 30m
- 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)
- 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 good part is that protolude 0.3.0 builds with GHC 8.10.
The bad part is that this change is a bit painful:
- the default `toS` has changed to no longer convert to and from ByteString
- similarly, `show` no longer outputs ByteString
The changes here are pretty much minimal to keep things compiling; I didn't
see a nice way to work with the new ConvertText class, even though `toUtf8`
seems like it might help if used besides `toS` at just the right spots.
The changes here are from fixing stack build with LTS 15.8 (GHC 8.8.3)
to be warning-free. Most if not all come from the newer protolude
version, which adds some things like `unwords`.
So to make sure that we don't get unused import warnings with newer
stackage, this both raises the protolude lower bound and removes
these imports.
* Don't indent first line of configuration parser error messages
configurator-pg returns multi-line errors now. Alternatively,
we could indent all the lines.
* Update resolver to lts-13.29 and add lock file to repository
* Upgrade stack version
* Save cache after building dependencies only to have faster feedback loop when tests fail
* Move private functions from QueryBuilder to a separate Private module
* Move more functions over to private trying to make compilation consume less memory
* Split private in 4 modules
* Remove unused LambdaCase pragma
* Add profile to memory-tests.sh so it can find postgrest executable
* Move save dependencies before building and running tests for faster feedback loop