mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-11 20:00:30 +01:00
Upgrade to 2.1.3 - OrderBy failure #97
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @netbe on GitHub (Nov 14, 2016).
Hi,
I am upgrading our project to 2.1.3, and seeing some failures like:
Most of the time, I see it because the fetchClauses contains OrderBy() only without any argument. Specifying the order then works fine, but not leaving it out
Failed
[Where()][Where(), OrderBy()]Worked
[Where(), OrderBy(.Descending(ManagedPhysician.Keys.fullName.rawValue))]I am just wondering why the init on OrderBy is then public if it cannot be used or in which case it can be used at all.
Thanks
@JohnEstropia commented on GitHub (Nov 15, 2016):
@netbe For ListMonitor, the OrderBy is required to have at least one sort key. Few reasons I left the default initializers public:
fetchAll(),deleteAll()also acceptsOrderByclauses, and are perfectly fine with empty sortingNSFetchRequest.predicateandNSFetchRequest.sortDescriptorsboth acceptniland empty predicate/array. The effect of either is undocumented so I left a way to set bothniland theirWhere()andOrderBy()empty counterpartsWhere()andOrderBy()can be used to explicitly express that the predicate and sort order are intentionally set to empty (as opposed to having forgot to set them)@netbe commented on GitHub (Nov 17, 2016):
@JohnEstropia thx for the explanation