Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mark Postgres aggregate return types as nullable (#498)
### What As discussed internally, a particular quirk of SQL (or Postgres, at the very least) is that, with the exception of `COUNT`, an aggregate of an empty row set returns `NULL`[^1] (rather than, for example, returning `0` for `SUM`). This means that all aggregate functions over scalar types exposed by the Postgres connector should be labelled as nullable. This PR addresses [APG-131](https://hasurahq.atlassian.net/browse/APG-131). NB: this will be a breaking change for anyone generating (for example) types from our /schema output. ### How This PR updates the `/schema` endpoint to mark these types as nullable. [^1]: The entire work effort of this PR was trying to verify this statement. [APG-131]: https://hasurahq.atlassian.net/browse/APG-131?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
- Loading branch information