Originally created by @a13xb on GitHub (Sep 9, 2016).
It would be nice to be able to do a query through managed object's context, so you can filter and search object's relationships without having to pass a data stack explicitly or using the default global data stack.
But right now all querying methods on NSManagedObjectContext are marked as internal. Would you be open to making them public?
Originally created by @a13xb on GitHub (Sep 9, 2016).
It would be nice to be able to do a query through managed object's context, so you can filter and search object's relationships without having to pass a data stack explicitly or using the default global data stack.
For example:
``` swift
class Post : NSManagedObject {
@NSmanaged var comments: Set<Comment>
var commentsByDate {
managedObjectContext.fetchAll(...)
}
var commentsByVotes {
managedObjectContext.fetchAll(...)
}
}
```
But right now all querying methods on `NSManagedObjectContext` are marked as internal. Would you be open to making them public?
It was a conscious decision to not expose NSManagedObjectContext to ensure transaction integrity. I'll see if there's a way to take advantage of Swift 3's new private behavior so only transaction and datastack extensions can access NSManagedObjectContext's fetch methods
@JohnEstropia commented on GitHub (Sep 10, 2016):
It was a conscious decision to not expose NSManagedObjectContext to ensure transaction integrity. I'll see if there's a way to take advantage of Swift 3's new `private` behavior so only transaction and datastack extensions can access NSManagedObjectContext's fetch methods
See the new FetchableSource and QueryableSource protocols
@JohnEstropia commented on GitHub (Nov 21, 2016):
This has been implemented in https://github.com/JohnEstropia/CoreStore/commit/b230ed6400b2ca38533d597b9f514e0f0bfc7871
See the new `FetchableSource` and `QueryableSource` protocols
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @a13xb on GitHub (Sep 9, 2016).
It would be nice to be able to do a query through managed object's context, so you can filter and search object's relationships without having to pass a data stack explicitly or using the default global data stack.
For example:
But right now all querying methods on
NSManagedObjectContextare marked as internal. Would you be open to making them public?@JohnEstropia commented on GitHub (Sep 10, 2016):
It was a conscious decision to not expose NSManagedObjectContext to ensure transaction integrity. I'll see if there's a way to take advantage of Swift 3's new
privatebehavior so only transaction and datastack extensions can access NSManagedObjectContext's fetch methods@JohnEstropia commented on GitHub (Nov 21, 2016):
This has been implemented in https://github.com/JohnEstropia/CoreStore/commit/b230ed6400b2ca38533d597b9f514e0f0bfc7871
See the new
FetchableSourceandQueryableSourceprotocols