vapor / fluent-kit

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

Allow pivot editing closures to be async and throwing. #585

Closed gwynne closed 1 year ago

gwynne commented 1 year ago

When using the attach(_:method:on:_:) and attach(_:on:_:) methods of SiblingsProperty, the optional closure provided to allow editing new pivots before they are saved can now optionally be both throws and async.

Closes #581.

Additional changes:

codecov-commenter commented 1 year ago

Codecov Report

Merging #585 (14d4697) into main (ccea982) will increase coverage by 0.35%. The diff coverage is 37.33%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #585 +/- ## ========================================== + Coverage 47.17% 47.52% +0.35% ========================================== Files 106 106 Lines 4689 4734 +45 ========================================== + Hits 2212 2250 +38 - Misses 2477 2484 +7 ``` | [Files Changed](https://app.codecov.io/gh/vapor/fluent-kit/pull/585?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor) | Coverage Δ | | |---|---|---| | [Sources/FluentKit/FluentError.swift](https://app.codecov.io/gh/vapor/fluent-kit/pull/585?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor#diff-U291cmNlcy9GbHVlbnRLaXQvRmx1ZW50RXJyb3Iuc3dpZnQ=) | `0.00% <0.00%> (ø)` | | | [Sources/FluentKit/Properties/Siblings.swift](https://app.codecov.io/gh/vapor/fluent-kit/pull/585?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor#diff-U291cmNlcy9GbHVlbnRLaXQvUHJvcGVydGllcy9TaWJsaW5ncy5zd2lmdA==) | `47.09% <11.11%> (+0.75%)` | :arrow_up: | | [...s/FluentKit/Concurrency/Siblings+Concurrency.swift](https://app.codecov.io/gh/vapor/fluent-kit/pull/585?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor#diff-U291cmNlcy9GbHVlbnRLaXQvQ29uY3VycmVuY3kvU2libGluZ3MrQ29uY3VycmVuY3kuc3dpZnQ=) | `55.55% <67.64%> (+55.55%)` | :arrow_up: | | [Sources/XCTFluent/DummyDatabase.swift](https://app.codecov.io/gh/vapor/fluent-kit/pull/585?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor#diff-U291cmNlcy9YQ1RGbHVlbnQvRHVtbXlEYXRhYmFzZS5zd2lmdA==) | `23.77% <100.00%> (+1.08%)` | :arrow_up: | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/vapor/fluent-kit/pull/585/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor)
penny-for-vapor[bot] commented 1 year ago

These changes are now available in 1.45.0