* 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
It was detected that Aeson encoding had high memory usage when
the json payload was large, around x60 the payload size.
With this change we get around x10 payload size memory usage.
The encodeUtf8(when doing a Text -> ByteString with `toS`) function
on a large payload also contributed to the high memory usage.
Main idea to reduce the memory usage was to let the ByteString coming
from the request body go to the database unchanged.
* Add support for and/or params in GET, POST, PATCH and DELETE
* Restrict usage of IN in and/or to be inside parens e.g. in.(1,2,3)
* Allow quoting operators for values that have ',)' chars
inside and/or e.g. eq."(entity,1)"
* 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
* WIP: remove non-openapi root spec
* Refactor ContentType
Different endpoints will favor one type over another
* Permit different Accept headers per endpoint
* Lint
* Add charset to Content-Type only when used as a header
Keep it out of error messages
* Accept: */* is last resort, not first
* Changelog
* makeMimeList consistently
* Remove schema description from OPTIONS response
* 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
* Make middleware use ApiRequest rather than Request
* Fix outdated comments
* Use read-only transaction mode for read requests
This allows API requests against read replicas