* Run CI only on pull requests, push to main and push
to tags matching v*. This avoids running the CI more than
once for a single user action
* Change pre-releases, which are now identified by a version
number with 4 components (e.g., 1.1.1.1)
* Change how release artifacts are packaged, ensuring they
are executable and compressed with xz
Update the hasql-transaction library to version 1.0.1
Add hints and kill thread at configuration read when using incompatible pooling modes: statement pooling and transaction pooling with prepared statements enabled.
* openapi-mode="follow-acl"(default): follows access control for the
JWT role.
* openapi-mode="ignore-acl": ignores access control for the JWT role.
* openapi-mode="disabled": disables OpenAPI output, the root endpoint
replies with 404 Not Found.
Now that PgVersion is not part of DbStructure, Config is a more apt
module for it.
Also rename getDbStructure to queryDbStructure. AppState also had a
getDbStructure function for a record field.
* Use ExceptT to avoid 'staircasing' case analysis in App.hs
* Split large function in App.hs into individual handler functions
* Adapt API of Auth.hs, OpenApi.hs etc. to simplify the use of those modules in App.hs
* Split optional rollback functionality into Middleware
* Unify SimpleError and ApiRequestError into one Error type, so it can be used across modules
Change callProc/createWriteStatement to H.Snippet.
Parametrize the inputs on the same SQLFragments by taking advantage
of hasql-dynamic-statements. It's not necessary to parametrize
every input, inlining with pgFmtLit can still be used for queries
that can't be parametrized(like SET LOCALs).
Also adds hasql-dynamic-statements to Nix and stack.
Specifically, allow point-updates to hasql-notifications, and
give a reasonable lower bound for network (the version that comess
with GHC 8.0 on stackage).
* remove configQuiet from Config
configQuiet was not an end user setting.
The logging setup is now an internal parameter.
* move proxy uri validation to Private dir
Fixes https://github.com/PostgREST/postgrest/issues/1512
Helps on environments where you can't send unix signals(Windows, managed
containers). Also provides better UX for schema reloads - NOTIFY
can be sent from pg clients(psql, pgadmin).
`NOTIFY pgrst` - with no payload - should be done to reload the schema cache.
Notifications with a payload will be ignored.
The channel can be enabled with `db-channel-enabled`(false by default)
and its name can be configured with `db-channel`.
The LISTEN thread uses a dedicated pg connection.
This connection is recovered if it fails.
A debounce of 1ms is done in case too many NOTIFYs arrive.
When doing:
```
cabal upload dist-newstyle/sdist/postgrest-7.0.1.tar.gz
```
The following error is shown:
```
Error: Invalid package
'ghc-options: -Wall -Werror' makes the package very easy to break with
future GHC versions because new GHC versions often add new warnings.
Use just 'ghc-options: -Wall' instead. Alternatively, if you want to
use this, make it conditional based on a Cabal configuration flag
(with 'manual: True' and 'default: False') and enable that flag
during development.
```
Put -Werror in a cabal flag to work around this restriction.
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.
This allows lens-4.19, network-uri-2.7 and time-0.10. According to
the respective changelogs, none of these should cause trouble.
lens-4.19 is required to build with GHC 8.10.
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.
Specifically, allow base 4.13 which ships with GHC 8.8, as well
as several dependency updates including hasql-transaction 1.0,
swagger 2.5 and warp 3.3.