vapor / fluent-kit

Swift ORM (queries, models, and relations) for NoSQL and SQL databases
MIT License
211 stars 116 forks source link

Handle aggregate types a very tiny bit better #569

Closed gwynne closed 1 year ago

gwynne commented 1 year ago

This just adds explicit forwarding of the generic Result parameter of the two QueryBuilder.aggregate() variants which weren't doing so already. It was already being implicitly forwarded due to type inference, but better to do so explicitly.

Also adds notes to the sum() and average() sets of methods warning that the Field.Value return types are not always correct (usually only causes problems with Postgres) and giving the workaround. This is related to #379 and vapor/fluent-postgres-driver#166 but does NOT fix those issues; it only clarifies one of the ways to get around the problem.

codecov-commenter commented 1 year ago

Codecov Report

Merging #569 (8bafe01) into main (2d7dce5) will increase coverage by 0.03%. The diff coverage is 87.50%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #569 +/- ## ========================================== + Coverage 47.53% 47.56% +0.03% ========================================== Files 106 106 Lines 4706 4709 +3 ========================================== + Hits 2237 2240 +3 Misses 2469 2469 ``` | [Impacted Files](https://app.codecov.io/gh/vapor/fluent-kit/pull/569?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor) | Coverage Δ | | |---|---|---| | [...uentKit/Query/Builder/QueryBuilder+Aggregate.swift](https://app.codecov.io/gh/vapor/fluent-kit/pull/569?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor#diff-U291cmNlcy9GbHVlbnRLaXQvUXVlcnkvQnVpbGRlci9RdWVyeUJ1aWxkZXIrQWdncmVnYXRlLnN3aWZ0) | `49.36% <87.50%> (+1.99%)` | :arrow_up: |
penny-for-vapor[bot] commented 1 year ago

These changes are now available in 1.43.1