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.
* add tests for POST, PATCH, DELETE when using ?select= with empty bodies or ret=min
* fix select with empty bodies and ret=min
* improved tests for default cases, fixed computed overloaded columns on empty-body?select= PATCH
PATCH/DELETE can now be done without adding Prefer return=minimal when
the user doesn't have SELECT privileges.
* Also fix PATCH wrong HTTP status code
* Update config default; Copy non-defaults
* Update .stylish-haskell config version to match pgrst
* Apply stylish haskell to all files
* CircleCI config
* Remove redundant import.
What is used from Network.HTTP.Types.Headers is also exported by Network.HTTP.Types.
* Grouped imports
* Show un-styled files on CircleCI failure
* Fix styling imports
* Apply adhoc standard correctly
* Add test for params=single-object on GET
* Add tests for procs with DEFAULT args
* Add tests for overloaded functions
* Add test for PATCHing with an empty json array, this previously
gave a "Something is wrong" error
also fix broken text env
After the last couple of commits the tests ran correctly only on a
fresh db, in addition, the roles within the db were not created/dropped
on each request and we need that since their privileges differ and we
need to to have an absolute clean db on each execution
* Bring packages up to date
* New LTS includes deps now
Use stack to select most versions
* Alphabetize packages
* Strip down packages
Switch tests to protolude
* Appease cabal check with base version constraint
* WIP: disable counting total table size by default
* Remove commented tests since PUT is no longer supported
* Fix tests for invalid range which require count
* Do not report count in PATCH response if not asked
* Return count of deleted items only if asked
* Return count for bulk insert when requested
* Changelog entry
* Allow a singular entity to be returned from an update
Since a `PATCH` will be an update that could affect many rows, there might be
more than one object returned. By allowing asking for a singular response,
the/an object will be returned instead of a list. This is useful in cases when
the `PATCH` is against single entity (i.e. `/items?pkey=eq.99`).
* Add tests for plurality=singular for `PATCH` requests
* Disallow updating more than one row if `plurality=singular`
As discussed in #634, we don't want to allow updating several rows with
a `PATCH` request when the `Prefer` header specifies
`return=representation;plurality=singular` as this would almost
certainly be a client error.
* Add test for patching multiple objects with singular response
Patching > 1 object with `return=representation;plurality=singular`
should return `400 Bad Request`.
* Only add singleton range for read API requests
* Disallow inserting more than one row if `plurality=singular`
Disallow inserting several rows with a `POST` request when the `Prefer`
header specifies `return=representation;plurality=singular` as this
would almost certainly be a client error.
* Only import `q` from `Text.InterpolatedString.Perl6`
* Update OpenAPI response for PATCH/POST to mention `plurality=singular`
The OpenAPI response for PATCH/POST requests now includes the `Prefer` value
`return=representation;plurality=singular`.
* Add entry in changelog
Possible after bug fix in a Hasql that we picked up with the new
dependency bounds in #606. Also includes test to ensure location header
is omitted on bulk insert.
The database returns an array of key-value strings like `"k1=eq.hello
world"`. Haskell URL-encodes the portion after the equal sign and joins
them with `&`.
Includes updates to tests in Feature.InsertSpec: The CompoundPK has been
modified to have one Int and one String. We attempt to add a key with a
String that has spaces and other special characters. This requires that
the returned Location header is properly URL-encoded.