make some test cases validate specific error codes from thrown errors

This commit is contained in:
John Estropia
2019-01-23 10:55:58 +09:00
parent 78954b9d78
commit 57ddbbd515
8 changed files with 181 additions and 230 deletions

View File

@@ -81,6 +81,33 @@ class BaseTestCase: XCTestCase {
CoreStore.logger = TestLogger(expectations)
}
@nonobjc
func expectError<T>(code: CoreStoreErrorCode, closure: () throws -> T) {
CoreStore.logger = TestLogger(self.prepareLoggerExpectations([.logError]))
defer {
self.checkExpectationsImmediately()
CoreStore.logger = TestLogger([:])
}
do {
_ = try closure()
}
catch let error as CoreStoreError {
if error.errorCode == code.rawValue {
return
}
XCTFail("Expected error code \(code) different from actual error: \((error as NSError).coreStoreDumpString)")
}
catch {
XCTFail("Error not wrapped as \(cs_typeName(CoreStoreError.self)): \((error as NSError).coreStoreDumpString)")
}
}
@nonobjc
func prepareLoggerExpectations(_ expectations: [TestLogger.Expectation]) -> [TestLogger.Expectation: XCTestExpectation] {

View File

@@ -376,17 +376,14 @@ final class FetchTests: BaseTestDataTestCase {
Where<TestEntity1>("%K > %@", #keyPath(TestEntity1.testNumber), 1),
OrderBy<TestEntity1>(.ascending(#keyPath(TestEntity1.testEntityID)))
]
let object = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try stack.fetchOne(from, fetchClauses)
}
XCTAssertNil(object as Any?)
let objectID = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try stack.fetchObjectID(from, fetchClauses)
}
XCTAssertNil(objectID as Any?)
}
do {
@@ -394,17 +391,14 @@ final class FetchTests: BaseTestDataTestCase {
Where<TestEntity1>("%K < %@", #keyPath(TestEntity1.testNumber), 4),
OrderBy<TestEntity1>(.descending(#keyPath(TestEntity1.testEntityID)))
]
let object = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try stack.fetchOne(from, fetchClauses)
}
XCTAssertNil(object as Any?)
let objectID = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try stack.fetchObjectID(from, fetchClauses)
}
XCTAssertNil(objectID as Any?)
}
}
}
@@ -559,17 +553,14 @@ final class FetchTests: BaseTestDataTestCase {
Where<TestEntity1>("%K > %@", #keyPath(TestEntity1.testNumber), 1),
OrderBy<TestEntity1>(.ascending(#keyPath(TestEntity1.testEntityID)))
]
let object = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try stack.fetchOne(from, fetchClauses)
}
XCTAssertNil(object as Any?)
let objectID = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try stack.fetchObjectID(from, fetchClauses)
}
XCTAssertNil(objectID as Any?)
}
do {
@@ -577,17 +568,14 @@ final class FetchTests: BaseTestDataTestCase {
Where<TestEntity1>("%K < %@", #keyPath(TestEntity1.testNumber), 4),
OrderBy<TestEntity1>(.descending(#keyPath(TestEntity1.testEntityID)))
]
let object = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try stack.fetchOne(from, fetchClauses)
}
XCTAssertNil(object as Any?)
let objectID = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try stack.fetchObjectID(from, fetchClauses)
}
XCTAssertNil(objectID as Any?)
}
}
}
@@ -881,17 +869,14 @@ final class FetchTests: BaseTestDataTestCase {
Where<TestEntity1>("%K < %@", #keyPath(TestEntity1.testNumber), 4),
OrderBy<TestEntity1>(.ascending(#keyPath(TestEntity1.testEntityID)))
]
let objects = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try stack.fetchAll(from, fetchClauses)
}
XCTAssertNil(objects)
let objectIDs = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try stack.fetchObjectIDs(from, fetchClauses)
}
XCTAssertNil(objectIDs)
}
do {
@@ -899,17 +884,14 @@ final class FetchTests: BaseTestDataTestCase {
Where<TestEntity1>(#keyPath(TestEntity1.testNumber), isEqualTo: 0),
OrderBy<TestEntity1>(.descending(#keyPath(TestEntity1.testEntityID)))
]
let objects = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try stack.fetchAll(from, fetchClauses)
}
XCTAssertNil(objects)
let objectIDs = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try stack.fetchObjectIDs(from, fetchClauses)
}
XCTAssertNil(objectIDs)
}
do {
@@ -917,17 +899,14 @@ final class FetchTests: BaseTestDataTestCase {
Where<TestEntity1>(#keyPath(TestEntity1.testNumber), isEqualTo: nil),
OrderBy<TestEntity1>(.descending(#keyPath(TestEntity1.testEntityID)))
]
let objects = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try stack.fetchAll(from, fetchClauses)
}
XCTAssertNil(objects)
let objectIDs = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try stack.fetchObjectIDs(from, fetchClauses)
}
XCTAssertNil(objectIDs)
}
}
}
@@ -1119,34 +1098,28 @@ final class FetchTests: BaseTestDataTestCase {
let fetchClauses: [FetchClause] = [
OrderBy<TestEntity1>(.ascending(#keyPath(TestEntity1.testEntityID)))
]
let objects = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try stack.fetchAll(from, fetchClauses)
}
XCTAssertNil(objects)
let objectIDs = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try stack.fetchObjectIDs(from, fetchClauses)
}
XCTAssertNil(objectIDs)
}
do {
let fetchClauses: [FetchClause] = [
OrderBy<TestEntity1>(.descending(#keyPath(TestEntity1.testEntityID)))
]
let objects = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try stack.fetchAll(from, fetchClauses)
}
XCTAssertNil(objects)
let objectIDs = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try stack.fetchObjectIDs(from, fetchClauses)
}
XCTAssertNil(objectIDs)
}
}
}
@@ -1411,8 +1384,8 @@ final class FetchTests: BaseTestDataTestCase {
let from = From<TestEntity1>("Config1")
do {
let count = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try stack.fetchCount(
from,
@@ -1420,11 +1393,10 @@ final class FetchTests: BaseTestDataTestCase {
OrderBy<TestEntity1>(.ascending(#keyPath(TestEntity1.testEntityID)))
)
}
XCTAssertNil(count)
}
do {
let count = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try stack.fetchCount(
from,
@@ -1432,11 +1404,10 @@ final class FetchTests: BaseTestDataTestCase {
OrderBy<TestEntity1>(.descending(#keyPath(TestEntity1.testEntityID)))
)
}
XCTAssertNil(count)
}
do {
let count = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try stack.fetchCount(
from,
@@ -1444,7 +1415,6 @@ final class FetchTests: BaseTestDataTestCase {
OrderBy<TestEntity1>(.descending(#keyPath(TestEntity1.testEntityID)))
)
}
XCTAssertNil(count)
}
}
}
@@ -1561,8 +1531,8 @@ final class FetchTests: BaseTestDataTestCase {
let from = From<TestEntity1>("Config2")
do {
let count = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try stack.fetchCount(
from,
@@ -1570,11 +1540,10 @@ final class FetchTests: BaseTestDataTestCase {
OrderBy<TestEntity1>(.ascending(#keyPath(TestEntity1.testEntityID)))
)
}
XCTAssertNil(count)
}
do {
let count = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try stack.fetchCount(
from,
@@ -1582,11 +1551,10 @@ final class FetchTests: BaseTestDataTestCase {
OrderBy<TestEntity1>(.descending(#keyPath(TestEntity1.testEntityID)))
)
}
XCTAssertNil(count)
}
do {
let count = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try stack.fetchCount(
from,
@@ -1594,7 +1562,6 @@ final class FetchTests: BaseTestDataTestCase {
OrderBy<TestEntity1>(.descending(#keyPath(TestEntity1.testEntityID)))
)
}
XCTAssertNil(count)
}
}
}
@@ -1821,17 +1788,14 @@ final class FetchTests: BaseTestDataTestCase {
Where<TestEntity1>("%K > %@", #keyPath(TestEntity1.testNumber), 1),
OrderBy<TestEntity1>(.ascending(#keyPath(TestEntity1.testEntityID)))
]
let object = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try transaction.fetchOne(from, fetchClauses)
}
XCTAssertNil(object as Any?)
let objectID = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try transaction.fetchObjectID(from, fetchClauses)
}
XCTAssertNil(objectID as Any?)
}
do {
@@ -1839,17 +1803,14 @@ final class FetchTests: BaseTestDataTestCase {
Where<TestEntity1>("%K < %@", #keyPath(TestEntity1.testNumber), 4),
OrderBy<TestEntity1>(.descending(#keyPath(TestEntity1.testEntityID)))
]
let object = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try transaction.fetchOne(from, fetchClauses)
}
XCTAssertNil(object as Any?)
let objectID = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try transaction.fetchObjectID(from, fetchClauses)
}
XCTAssertNil(objectID as Any?)
}
try transaction.cancel()
}
@@ -2015,17 +1976,14 @@ final class FetchTests: BaseTestDataTestCase {
Where<TestEntity1>("%K > %@", #keyPath(TestEntity1.testNumber), 1),
OrderBy<TestEntity1>(.ascending(#keyPath(TestEntity1.testEntityID)))
]
let object = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try transaction.fetchOne(from, fetchClauses)
}
XCTAssertNil(object as Any?)
let objectID = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try transaction.fetchObjectID(from, fetchClauses)
}
XCTAssertNil(objectID as Any?)
}
do {
@@ -2033,17 +1991,14 @@ final class FetchTests: BaseTestDataTestCase {
Where<TestEntity1>("%K < %@", #keyPath(TestEntity1.testNumber), 4),
OrderBy<TestEntity1>(.descending(#keyPath(TestEntity1.testEntityID)))
]
let object = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try transaction.fetchOne(from, fetchClauses)
}
XCTAssertNil(object as Any?)
let objectID = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try transaction.fetchObjectID(from, fetchClauses)
}
XCTAssertNil(objectID as Any?)
}
try transaction.cancel()
}
@@ -2353,17 +2308,14 @@ final class FetchTests: BaseTestDataTestCase {
Where<TestEntity1>("%K < %@", #keyPath(TestEntity1.testNumber), 4),
OrderBy<TestEntity1>(.ascending(#keyPath(TestEntity1.testEntityID)))
]
let objects = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try transaction.fetchAll(from, fetchClauses)
}
XCTAssertNil(objects)
let objectIDs = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try transaction.fetchObjectIDs(from, fetchClauses)
}
XCTAssertNil(objectIDs)
}
do {
@@ -2371,17 +2323,14 @@ final class FetchTests: BaseTestDataTestCase {
Where<TestEntity1>(#keyPath(TestEntity1.testNumber), isEqualTo: 0),
OrderBy<TestEntity1>(.descending(#keyPath(TestEntity1.testEntityID)))
]
let objects = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try transaction.fetchAll(from, fetchClauses)
}
XCTAssertNil(objects)
let objectIDs = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try transaction.fetchObjectIDs(from, fetchClauses)
}
XCTAssertNil(objectIDs)
}
do {
@@ -2389,17 +2338,14 @@ final class FetchTests: BaseTestDataTestCase {
Where<TestEntity1>(#keyPath(TestEntity1.testNumber), isEqualTo: nil),
OrderBy<TestEntity1>(.descending(#keyPath(TestEntity1.testEntityID)))
]
let objects = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try transaction.fetchAll(from, fetchClauses)
}
XCTAssertNil(objects)
let objectIDs = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try transaction.fetchObjectIDs(from, fetchClauses)
}
XCTAssertNil(objectIDs)
}
try transaction.cancel()
}
@@ -2614,34 +2560,28 @@ final class FetchTests: BaseTestDataTestCase {
let fetchClauses: [FetchClause] = [
OrderBy<TestEntity1>(.ascending(#keyPath(TestEntity1.testEntityID)))
]
let objects = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try transaction.fetchAll(from, fetchClauses)
}
XCTAssertNil(objects)
let objectIDs = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try transaction.fetchObjectIDs(from, fetchClauses)
}
XCTAssertNil(objectIDs)
}
do {
let fetchClauses: [FetchClause] = [
OrderBy<TestEntity1>(.descending(#keyPath(TestEntity1.testEntityID)))
]
let objects = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try transaction.fetchAll(from, fetchClauses)
}
XCTAssertNil(objects)
let objectIDs = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try transaction.fetchObjectIDs(from, fetchClauses)
}
XCTAssertNil(objectIDs)
}
try transaction.cancel()
}
@@ -2940,8 +2880,8 @@ final class FetchTests: BaseTestDataTestCase {
let from = From<TestEntity1>("Config1")
do {
let count = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try transaction.fetchCount(
from,
@@ -2949,11 +2889,10 @@ final class FetchTests: BaseTestDataTestCase {
OrderBy<TestEntity1>(.ascending(#keyPath(TestEntity1.testEntityID)))
)
}
XCTAssertNil(count)
}
do {
let count = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try transaction.fetchCount(
from,
@@ -2961,11 +2900,10 @@ final class FetchTests: BaseTestDataTestCase {
OrderBy<TestEntity1>(.descending(#keyPath(TestEntity1.testEntityID)))
)
}
XCTAssertNil(count)
}
do {
let count = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try transaction.fetchCount(
from,
@@ -2973,7 +2911,6 @@ final class FetchTests: BaseTestDataTestCase {
OrderBy<TestEntity1>(.descending(#keyPath(TestEntity1.testEntityID)))
)
}
XCTAssertNil(count)
}
try transaction.cancel()
}
@@ -3101,8 +3038,8 @@ final class FetchTests: BaseTestDataTestCase {
let from = From<TestEntity1>("Config2")
do {
let count = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try transaction.fetchCount(
from,
@@ -3110,11 +3047,10 @@ final class FetchTests: BaseTestDataTestCase {
OrderBy<TestEntity1>(.ascending(#keyPath(TestEntity1.testEntityID)))
)
}
XCTAssertNil(count)
}
do {
let count = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try transaction.fetchCount(
from,
@@ -3122,11 +3058,10 @@ final class FetchTests: BaseTestDataTestCase {
OrderBy<TestEntity1>(.descending(#keyPath(TestEntity1.testEntityID)))
)
}
XCTAssertNil(count)
}
do {
let count = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try transaction.fetchCount(
from,
@@ -3134,7 +3069,6 @@ final class FetchTests: BaseTestDataTestCase {
OrderBy<TestEntity1>(.descending(#keyPath(TestEntity1.testEntityID)))
)
}
XCTAssertNil(count)
}
try transaction.cancel()
}

View File

@@ -89,11 +89,10 @@ final class FromTests: BaseTestCase {
let from = From<TestEntity1>("Config1")
let request = CoreStoreFetchRequest()
let storesFound: Void? = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try from.applyToFetchRequest(request, context: dataStack.mainContext)
}
XCTAssertNil(storesFound)
XCTAssertNotNil(request.entity)
XCTAssertNotNil(request.safeAffectedStores)
@@ -145,11 +144,10 @@ final class FromTests: BaseTestCase {
let from = From<TestEntity1>("Config2")
let request = CoreStoreFetchRequest()
let storesFound: Void? = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try from.applyToFetchRequest(request, context: dataStack.mainContext)
}
XCTAssertNil(storesFound)
XCTAssertNotNil(request.entity)
XCTAssertNotNil(request.safeAffectedStores)
@@ -163,11 +161,10 @@ final class FromTests: BaseTestCase {
let from = From<TestEntity2>()
let request = CoreStoreFetchRequest()
let storesFound: Void? = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try from.applyToFetchRequest(request, context: dataStack.mainContext)
}
XCTAssertNil(storesFound)
XCTAssertNotNil(request.entity)
XCTAssertNotNil(request.safeAffectedStores)
@@ -181,11 +178,10 @@ final class FromTests: BaseTestCase {
let from = From<TestEntity2>("Config1")
let request = CoreStoreFetchRequest()
let storesFound: Void? = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try from.applyToFetchRequest(request, context: dataStack.mainContext)
}
XCTAssertNil(storesFound)
XCTAssertNotNil(request.entity)
XCTAssertNotNil(request.safeAffectedStores)
@@ -199,11 +195,10 @@ final class FromTests: BaseTestCase {
let from = From<TestEntity2>("Config2")
let request = CoreStoreFetchRequest()
let storesFound: Void? = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try from.applyToFetchRequest(request, context: dataStack.mainContext)
}
XCTAssertNil(storesFound)
XCTAssertNotNil(request.entity)
XCTAssertNotNil(request.safeAffectedStores)
@@ -255,11 +250,10 @@ final class FromTests: BaseTestCase {
let from = From<TestEntity1>("Config2")
let request = CoreStoreFetchRequest()
let storesFound: Void? = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try from.applyToFetchRequest(request, context: dataStack.mainContext)
}
XCTAssertNil(storesFound)
XCTAssertNotNil(request.entity)
XCTAssertNotNil(request.safeAffectedStores)
@@ -288,11 +282,10 @@ final class FromTests: BaseTestCase {
let from = From<TestEntity2>("Config1")
let request = CoreStoreFetchRequest()
let storesFound: Void? = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try from.applyToFetchRequest(request, context: dataStack.mainContext)
}
XCTAssertNil(storesFound)
XCTAssertNotNil(request.entity)
XCTAssertNotNil(request.safeAffectedStores)
@@ -306,11 +299,10 @@ final class FromTests: BaseTestCase {
let from = From<TestEntity2>("Config2")
let request = CoreStoreFetchRequest()
let storesFound: Void? = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try from.applyToFetchRequest(request, context: dataStack.mainContext)
}
XCTAssertNil(storesFound)
XCTAssertNotNil(request.entity)
XCTAssertNotNil(request.safeAffectedStores)
@@ -362,11 +354,10 @@ final class FromTests: BaseTestCase {
let from = From<TestEntity1>("Config2")
let request = CoreStoreFetchRequest()
let storesFound: Void? = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try from.applyToFetchRequest(request, context: dataStack.mainContext)
}
XCTAssertNil(storesFound)
XCTAssertNotNil(request.entity)
XCTAssertNotNil(request.safeAffectedStores)
@@ -395,11 +386,10 @@ final class FromTests: BaseTestCase {
let from = From<TestEntity2>("Config1")
let request = CoreStoreFetchRequest()
let storesFound: Void? = try? self.expectLogger([.logError]) {
self.expectError(code: .persistentStoreNotFound) {
try from.applyToFetchRequest(request, context: dataStack.mainContext)
}
XCTAssertNil(storesFound)
XCTAssertNotNil(request.entity)
XCTAssertNotNil(request.safeAffectedStores)

View File

@@ -137,7 +137,7 @@ extension BaseDataTransaction: FetchableSource, QueryableSource {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: the first `DynamicObject` instance that satisfies the specified `FetchClause`s, or `nil` if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func fetchOne<D>(_ from: From<D>, _ fetchClauses: FetchClause...) throws -> D? {
@@ -154,7 +154,7 @@ extension BaseDataTransaction: FetchableSource, QueryableSource {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: the first `DynamicObject` instance that satisfies the specified `FetchClause`s, or `nil` if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func fetchOne<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) throws -> D? {
@@ -176,7 +176,7 @@ extension BaseDataTransaction: FetchableSource, QueryableSource {
```
- parameter clauseChain: a `FetchChainableBuilderType` built from a chain of clauses
- returns: the first `DynamicObject` instance that satisfies the specified `FetchChainableBuilderType`, or `nil` if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func fetchOne<B: FetchChainableBuilderType>(_ clauseChain: B) throws -> B.ObjectType? {
@@ -193,7 +193,7 @@ extension BaseDataTransaction: FetchableSource, QueryableSource {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: all `DynamicObject` instances that satisfy the specified `FetchClause`s, or an empty array if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func fetchAll<D>(_ from: From<D>, _ fetchClauses: FetchClause...) throws -> [D] {
@@ -210,7 +210,7 @@ extension BaseDataTransaction: FetchableSource, QueryableSource {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: all `DynamicObject` instances that satisfy the specified `FetchClause`s, or an empty array if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func fetchAll<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) throws -> [D] {
@@ -232,7 +232,7 @@ extension BaseDataTransaction: FetchableSource, QueryableSource {
```
- parameter clauseChain: a `FetchChainableBuilderType` built from a chain of clauses
- returns: all `DynamicObject` instances that satisfy the specified `FetchChainableBuilderType`, or an empty array if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func fetchAll<B: FetchChainableBuilderType>(_ clauseChain: B) throws -> [B.ObjectType] {
@@ -249,7 +249,7 @@ extension BaseDataTransaction: FetchableSource, QueryableSource {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: the number of `DynamicObject`s that satisfy the specified `FetchClause`s
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func fetchCount<D>(_ from: From<D>, _ fetchClauses: FetchClause...) throws -> Int {
@@ -266,7 +266,7 @@ extension BaseDataTransaction: FetchableSource, QueryableSource {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: the number of `DynamicObject`s that satisfy the specified `FetchClause`s
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func fetchCount<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) throws -> Int {
@@ -288,7 +288,7 @@ extension BaseDataTransaction: FetchableSource, QueryableSource {
```
- parameter clauseChain: a `FetchChainableBuilderType` built from a chain of clauses
- returns: the number of `DynamicObject`s that satisfy the specified `FetchChainableBuilderType`
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func fetchCount<B: FetchChainableBuilderType>(_ clauseChain: B) throws -> Int {
@@ -305,7 +305,7 @@ extension BaseDataTransaction: FetchableSource, QueryableSource {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: the `NSManagedObjectID` for the first `DynamicObject` that satisfies the specified `FetchClause`s, or `nil` if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func fetchObjectID<D>(_ from: From<D>, _ fetchClauses: FetchClause...) throws -> NSManagedObjectID? {
@@ -322,7 +322,7 @@ extension BaseDataTransaction: FetchableSource, QueryableSource {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: the `NSManagedObjectID` for the first `DynamicObject` that satisfies the specified `FetchClause`s, or `nil` if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func fetchObjectID<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) throws -> NSManagedObjectID? {
@@ -344,7 +344,7 @@ extension BaseDataTransaction: FetchableSource, QueryableSource {
```
- parameter clauseChain: a `FetchChainableBuilderType` built from a chain of clauses
- returns: the `NSManagedObjectID` for the first `DynamicObject` that satisfies the specified `FetchChainableBuilderType`, or `nil` if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func fetchObjectID<B: FetchChainableBuilderType>(_ clauseChain: B) throws -> NSManagedObjectID? {
@@ -361,7 +361,7 @@ extension BaseDataTransaction: FetchableSource, QueryableSource {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: the `NSManagedObjectID` for all `DynamicObject`s that satisfy the specified `FetchClause`s, or an empty array if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func fetchObjectIDs<D>(_ from: From<D>, _ fetchClauses: FetchClause...) throws -> [NSManagedObjectID] {
@@ -378,7 +378,7 @@ extension BaseDataTransaction: FetchableSource, QueryableSource {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: the `NSManagedObjectID` for all `DynamicObject`s that satisfy the specified `FetchClause`s, or an empty array if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func fetchObjectIDs<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) throws -> [NSManagedObjectID] {
@@ -400,7 +400,7 @@ extension BaseDataTransaction: FetchableSource, QueryableSource {
```
- parameter clauseChain: a `FetchChainableBuilderType` built from a chain of clauses
- returns: the `NSManagedObjectID` for all `DynamicObject`s that satisfy the specified `FetchChainableBuilderType`, or an empty array if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func fetchObjectIDs<B: FetchChainableBuilderType>(_ clauseChain: B) throws -> [NSManagedObjectID] {
@@ -423,7 +423,7 @@ extension BaseDataTransaction: FetchableSource, QueryableSource {
- parameter selectClause: a `Select<U>` clause indicating the properties to fetch, and with the generic type indicating the return type.
- parameter queryClauses: a series of `QueryClause` instances for the query request. Accepts `Where`, `OrderBy`, `GroupBy`, and `Tweak` clauses.
- returns: the result of the the query, or `nil` if no match was found. The type of the return value is specified by the generic type of the `Select<U>` parameter.
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func queryValue<D, U: QueryableAttributeType>(_ from: From<D>, _ selectClause: Select<D, U>, _ queryClauses: QueryClause...) throws -> U? {
@@ -443,7 +443,7 @@ extension BaseDataTransaction: FetchableSource, QueryableSource {
- parameter selectClause: a `Select<U>` clause indicating the properties to fetch, and with the generic type indicating the return type.
- parameter queryClauses: a series of `QueryClause` instances for the query request. Accepts `Where`, `OrderBy`, `GroupBy`, and `Tweak` clauses.
- returns: the result of the the query, or `nil` if no match was found. The type of the return value is specified by the generic type of the `Select<U>` parameter.
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func queryValue<D, U: QueryableAttributeType>(_ from: From<D>, _ selectClause: Select<D, U>, _ queryClauses: [QueryClause]) throws -> U? {
@@ -467,7 +467,7 @@ extension BaseDataTransaction: FetchableSource, QueryableSource {
```
- parameter clauseChain: a `QueryChainableBuilderType` indicating the property/aggregate to fetch and the series of queries for the request.
- returns: the result of the the query as specified by the `QueryChainableBuilderType`, or `nil` if no match was found.
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func queryValue<B: QueryChainableBuilderType>(_ clauseChain: B) throws -> B.ResultType? where B.ResultType: QueryableAttributeType {
@@ -487,7 +487,7 @@ extension BaseDataTransaction: FetchableSource, QueryableSource {
- parameter selectClause: a `Select<U>` clause indicating the properties to fetch, and with the generic type indicating the return type.
- parameter queryClauses: a series of `QueryClause` instances for the query request. Accepts `Where`, `OrderBy`, `GroupBy`, and `Tweak` clauses.
- returns: the result of the the query. The type of the return value is specified by the generic type of the `Select<U>` parameter.
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func queryAttributes<D>(_ from: From<D>, _ selectClause: Select<D, NSDictionary>, _ queryClauses: QueryClause...) throws -> [[String: Any]] {
@@ -507,7 +507,7 @@ extension BaseDataTransaction: FetchableSource, QueryableSource {
- parameter selectClause: a `Select<U>` clause indicating the properties to fetch, and with the generic type indicating the return type.
- parameter queryClauses: a series of `QueryClause` instances for the query request. Accepts `Where`, `OrderBy`, `GroupBy`, and `Tweak` clauses.
- returns: the result of the the query. The type of the return value is specified by the generic type of the `Select<U>` parameter.
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func queryAttributes<D>(_ from: From<D>, _ selectClause: Select<D, NSDictionary>, _ queryClauses: [QueryClause]) throws -> [[String: Any]] {
@@ -540,7 +540,7 @@ extension BaseDataTransaction: FetchableSource, QueryableSource {
```
- parameter clauseChain: a `QueryChainableBuilderType` indicating the properties to fetch and the series of queries for the request.
- returns: the result of the the query as specified by the `QueryChainableBuilderType`
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func queryAttributes<B: QueryChainableBuilderType>(_ clauseChain: B) throws -> [[String: Any]] where B.ResultType == NSDictionary {

View File

@@ -81,7 +81,7 @@ public extension CoreStore {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: the first `DynamicObject` instance that satisfies the specified `FetchClause`s, or `nil` if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public static func fetchOne<D>(_ from: From<D>, _ fetchClauses: FetchClause...) throws -> D? {
@@ -94,7 +94,7 @@ public extension CoreStore {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: the first `DynamicObject` instance that satisfies the specified `FetchClause`s, or `nil` if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public static func fetchOne<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) throws -> D? {
@@ -112,7 +112,7 @@ public extension CoreStore {
```
- parameter clauseChain: a `FetchChainableBuilderType` built from a chain of clauses
- returns: the first `DynamicObject` instance that satisfies the specified `FetchChainableBuilderType`, or `nil` if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public static func fetchOne<B: FetchChainableBuilderType>(_ clauseChain: B) throws -> B.ObjectType? {
@@ -125,7 +125,7 @@ public extension CoreStore {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: all `DynamicObject` instances that satisfy the specified `FetchClause`s, or an empty array if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public static func fetchAll<D>(_ from: From<D>, _ fetchClauses: FetchClause...) throws -> [D] {
@@ -138,7 +138,7 @@ public extension CoreStore {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: all `DynamicObject` instances that satisfy the specified `FetchClause`s, or an empty array if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public static func fetchAll<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) throws -> [D] {
@@ -156,7 +156,7 @@ public extension CoreStore {
```
- parameter clauseChain: a `FetchChainableBuilderType` built from a chain of clauses
- returns: all `DynamicObject` instances that satisfy the specified `FetchChainableBuilderType`, or an empty array if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public static func fetchAll<B: FetchChainableBuilderType>(_ clauseChain: B) throws -> [B.ObjectType] {
@@ -169,7 +169,7 @@ public extension CoreStore {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: the number of `DynamicObject`s that satisfy the specified `FetchClause`s
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public static func fetchCount<D>(_ from: From<D>, _ fetchClauses: FetchClause...) throws -> Int {
@@ -182,7 +182,7 @@ public extension CoreStore {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: the number of `DynamicObject`s that satisfy the specified `FetchClause`s
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public static func fetchCount<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) throws -> Int {
@@ -200,7 +200,7 @@ public extension CoreStore {
```
- parameter clauseChain: a `FetchChainableBuilderType` built from a chain of clauses
- returns: the number of `DynamicObject`s that satisfy the specified `FetchChainableBuilderType`
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public static func fetchCount<B: FetchChainableBuilderType>(_ clauseChain: B) throws -> Int {
@@ -213,7 +213,7 @@ public extension CoreStore {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: the `NSManagedObjectID` for the first `DynamicObject` that satisfies the specified `FetchClause`s, or `nil` if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public static func fetchObjectID<D>(_ from: From<D>, _ fetchClauses: FetchClause...) throws -> NSManagedObjectID? {
@@ -226,7 +226,7 @@ public extension CoreStore {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: the `NSManagedObjectID` for the first `DynamicObject` that satisfies the specified `FetchClause`s, or `nil` if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public static func fetchObjectID<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) throws -> NSManagedObjectID? {
@@ -244,7 +244,7 @@ public extension CoreStore {
```
- parameter clauseChain: a `FetchChainableBuilderType` built from a chain of clauses
- returns: the `NSManagedObjectID` for the first `DynamicObject` that satisfies the specified `FetchChainableBuilderType`, or `nil` if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public static func fetchObjectID<B: FetchChainableBuilderType>(_ clauseChain: B) throws -> NSManagedObjectID? {
@@ -257,7 +257,7 @@ public extension CoreStore {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: the `NSManagedObjectID` for all `DynamicObject`s that satisfy the specified `FetchClause`s, or an empty array if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public static func fetchObjectIDs<D>(_ from: From<D>, _ fetchClauses: FetchClause...) throws -> [NSManagedObjectID] {
@@ -270,7 +270,7 @@ public extension CoreStore {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: the `NSManagedObjectID` for all `DynamicObject`s that satisfy the specified `FetchClause`s, or an empty array if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public static func fetchObjectIDs<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) throws -> [NSManagedObjectID] {
@@ -288,7 +288,7 @@ public extension CoreStore {
```
- parameter clauseChain: a `FetchChainableBuilderType` built from a chain of clauses
- returns: the `NSManagedObjectID` for all `DynamicObject`s that satisfy the specified `FetchChainableBuilderType`, or an empty array if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public static func fetchObjectIDs<B: FetchChainableBuilderType>(_ clauseChain: B) throws -> [NSManagedObjectID] {
@@ -304,7 +304,7 @@ public extension CoreStore {
- parameter selectClause: a `Select<U>` clause indicating the properties to fetch, and with the generic type indicating the return type.
- parameter queryClauses: a series of `QueryClause` instances for the query request. Accepts `Where`, `OrderBy`, `GroupBy`, and `Tweak` clauses.
- returns: the result of the the query, or `nil` if no match was found. The type of the return value is specified by the generic type of the `Select<U>` parameter.
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public static func queryValue<D, U: QueryableAttributeType>(_ from: From<D>, _ selectClause: Select<D, U>, _ queryClauses: QueryClause...) throws -> U? {
@@ -320,7 +320,7 @@ public extension CoreStore {
- parameter selectClause: a `Select<U>` clause indicating the properties to fetch, and with the generic type indicating the return type.
- parameter queryClauses: a series of `QueryClause` instances for the query request. Accepts `Where`, `OrderBy`, `GroupBy`, and `Tweak` clauses.
- returns: the result of the the query, or `nil` if no match was found. The type of the return value is specified by the generic type of the `Select<U>` parameter.
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public static func queryValue<D, U: QueryableAttributeType>(_ from: From<D>, _ selectClause: Select<D, U>, _ queryClauses: [QueryClause]) throws -> U? {
@@ -340,7 +340,7 @@ public extension CoreStore {
```
- parameter clauseChain: a `QueryChainableBuilderType` indicating the property/aggregate to fetch and the series of queries for the request.
- returns: the result of the the query as specified by the `QueryChainableBuilderType`, or `nil` if no match was found.
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public static func queryValue<B: QueryChainableBuilderType>(_ clauseChain: B) throws -> B.ResultType? where B.ResultType: QueryableAttributeType {
@@ -356,7 +356,7 @@ public extension CoreStore {
- parameter selectClause: a `Select<U>` clause indicating the properties to fetch, and with the generic type indicating the return type.
- parameter queryClauses: a series of `QueryClause` instances for the query request. Accepts `Where`, `OrderBy`, `GroupBy`, and `Tweak` clauses.
- returns: the result of the the query. The type of the return value is specified by the generic type of the `Select<U>` parameter.
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public static func queryAttributes<D>(_ from: From<D>, _ selectClause: Select<D, NSDictionary>, _ queryClauses: QueryClause...) throws -> [[String: Any]] {
@@ -372,7 +372,7 @@ public extension CoreStore {
- parameter selectClause: a `Select<U>` clause indicating the properties to fetch, and with the generic type indicating the return type.
- parameter queryClauses: a series of `QueryClause` instances for the query request. Accepts `Where`, `OrderBy`, `GroupBy`, and `Tweak` clauses.
- returns: the result of the the query. The type of the return value is specified by the generic type of the `Select<U>` parameter.
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public static func queryAttributes<D>(_ from: From<D>, _ selectClause: Select<D, NSDictionary>, _ queryClauses: [QueryClause]) throws -> [[String: Any]] {
@@ -401,7 +401,7 @@ public extension CoreStore {
```
- parameter clauseChain: a `QueryChainableBuilderType` indicating the properties to fetch and the series of queries for the request.
- returns: the result of the the query as specified by the `QueryChainableBuilderType`
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public static func queryAttributes<B: QueryChainableBuilderType>(_ clauseChain: B) throws -> [[String: Any]] where B.ResultType == NSDictionary {

View File

@@ -83,7 +83,7 @@ extension DataStack: FetchableSource, QueryableSource {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: the first `DynamicObject` instance that satisfies the specified `FetchClause`s, or `nil` if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func fetchOne<D>(_ from: From<D>, _ fetchClauses: FetchClause...) throws -> D? {
@@ -100,7 +100,7 @@ extension DataStack: FetchableSource, QueryableSource {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: the first `DynamicObject` instance that satisfies the specified `FetchClause`s, or `nil` if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func fetchOne<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) throws -> D? {
@@ -122,7 +122,7 @@ extension DataStack: FetchableSource, QueryableSource {
```
- parameter clauseChain: a `FetchChainableBuilderType` built from a chain of clauses
- returns: the first `DynamicObject` instance that satisfies the specified `FetchChainableBuilderType`, or `nil` if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func fetchOne<B: FetchChainableBuilderType>(_ clauseChain: B) throws -> B.ObjectType? {
@@ -139,7 +139,7 @@ extension DataStack: FetchableSource, QueryableSource {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: all `DynamicObject` instances that satisfy the specified `FetchClause`s, or an empty array if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func fetchAll<D>(_ from: From<D>, _ fetchClauses: FetchClause...) throws -> [D] {
@@ -156,7 +156,7 @@ extension DataStack: FetchableSource, QueryableSource {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: all `DynamicObject` instances that satisfy the specified `FetchClause`s, or an empty array if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func fetchAll<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) throws -> [D] {
@@ -178,7 +178,7 @@ extension DataStack: FetchableSource, QueryableSource {
```
- parameter clauseChain: a `FetchChainableBuilderType` built from a chain of clauses
- returns: all `DynamicObject` instances that satisfy the specified `FetchChainableBuilderType`, or an empty array if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func fetchAll<B: FetchChainableBuilderType>(_ clauseChain: B) throws -> [B.ObjectType] {
@@ -195,7 +195,7 @@ extension DataStack: FetchableSource, QueryableSource {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: the number of `DynamicObject`s that satisfy the specified `FetchClause`s
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func fetchCount<D>(_ from: From<D>, _ fetchClauses: FetchClause...) throws -> Int {
@@ -212,7 +212,7 @@ extension DataStack: FetchableSource, QueryableSource {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: the number of `DynamicObject`s that satisfy the specified `FetchClause`s
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func fetchCount<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) throws -> Int {
@@ -234,7 +234,7 @@ extension DataStack: FetchableSource, QueryableSource {
```
- parameter clauseChain: a `FetchChainableBuilderType` built from a chain of clauses
- returns: the number of `DynamicObject`s that satisfy the specified `FetchChainableBuilderType`
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func fetchCount<B: FetchChainableBuilderType>(_ clauseChain: B) throws -> Int {
@@ -251,7 +251,7 @@ extension DataStack: FetchableSource, QueryableSource {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: the `NSManagedObjectID` for the first `DynamicObject` that satisfies the specified `FetchClause`s, or `nil` if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func fetchObjectID<D>(_ from: From<D>, _ fetchClauses: FetchClause...) throws -> NSManagedObjectID? {
@@ -268,7 +268,7 @@ extension DataStack: FetchableSource, QueryableSource {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: the `NSManagedObjectID` for the first `DynamicObject` that satisfies the specified `FetchClause`s, or `nil` if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func fetchObjectID<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) throws -> NSManagedObjectID? {
@@ -290,7 +290,7 @@ extension DataStack: FetchableSource, QueryableSource {
```
- parameter clauseChain: a `FetchChainableBuilderType` built from a chain of clauses
- returns: the `NSManagedObjectID` for the first `DynamicObject` that satisfies the specified `FetchChainableBuilderType`, or `nil` if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func fetchObjectID<B: FetchChainableBuilderType>(_ clauseChain: B) throws -> NSManagedObjectID? {
@@ -307,7 +307,7 @@ extension DataStack: FetchableSource, QueryableSource {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: the `NSManagedObjectID` for all `DynamicObject`s that satisfy the specified `FetchClause`s, or an empty array if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func fetchObjectIDs<D>(_ from: From<D>, _ fetchClauses: FetchClause...) throws -> [NSManagedObjectID] {
@@ -324,7 +324,7 @@ extension DataStack: FetchableSource, QueryableSource {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: the `NSManagedObjectID` for all `DynamicObject`s that satisfy the specified `FetchClause`s, or an empty array if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func fetchObjectIDs<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) throws -> [NSManagedObjectID] {
@@ -346,7 +346,7 @@ extension DataStack: FetchableSource, QueryableSource {
```
- parameter clauseChain: a `FetchChainableBuilderType` built from a chain of clauses
- returns: the `NSManagedObjectID` for all `DynamicObject`s that satisfy the specified `FetchChainableBuilderType`, or an empty array if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func fetchObjectIDs<B: FetchChainableBuilderType>(_ clauseChain: B) throws -> [NSManagedObjectID] {
@@ -369,7 +369,7 @@ extension DataStack: FetchableSource, QueryableSource {
- parameter selectClause: a `Select<U>` clause indicating the properties to fetch, and with the generic type indicating the return type.
- parameter queryClauses: a series of `QueryClause` instances for the query request. Accepts `Where`, `OrderBy`, `GroupBy`, and `Tweak` clauses.
- returns: the result of the the query, or `nil` if no match was found. The type of the return value is specified by the generic type of the `Select<U>` parameter.
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func queryValue<D, U: QueryableAttributeType>(_ from: From<D>, _ selectClause: Select<D, U>, _ queryClauses: QueryClause...) throws -> U? {
@@ -389,7 +389,7 @@ extension DataStack: FetchableSource, QueryableSource {
- parameter selectClause: a `Select<U>` clause indicating the properties to fetch, and with the generic type indicating the return type.
- parameter queryClauses: a series of `QueryClause` instances for the query request. Accepts `Where`, `OrderBy`, `GroupBy`, and `Tweak` clauses.
- returns: the result of the the query, or `nil` if no match was found. The type of the return value is specified by the generic type of the `Select<U>` parameter.
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func queryValue<D, U: QueryableAttributeType>(_ from: From<D>, _ selectClause: Select<D, U>, _ queryClauses: [QueryClause]) throws -> U? {
@@ -413,7 +413,7 @@ extension DataStack: FetchableSource, QueryableSource {
```
- parameter clauseChain: a `QueryChainableBuilderType` indicating the property/aggregate to fetch and the series of queries for the request.
- returns: the result of the the query as specified by the `QueryChainableBuilderType`, or `nil` if no match was found.
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func queryValue<B: QueryChainableBuilderType>(_ clauseChain: B) throws -> B.ResultType? where B.ResultType: QueryableAttributeType {
@@ -433,7 +433,7 @@ extension DataStack: FetchableSource, QueryableSource {
- parameter selectClause: a `Select<U>` clause indicating the properties to fetch, and with the generic type indicating the return type.
- parameter queryClauses: a series of `QueryClause` instances for the query request. Accepts `Where`, `OrderBy`, `GroupBy`, and `Tweak` clauses.
- returns: the result of the the query. The type of the return value is specified by the generic type of the `Select<U>` parameter.
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func queryAttributes<D>(_ from: From<D>, _ selectClause: Select<D, NSDictionary>, _ queryClauses: QueryClause...) throws -> [[String: Any]] {
@@ -453,7 +453,7 @@ extension DataStack: FetchableSource, QueryableSource {
- parameter selectClause: a `Select<U>` clause indicating the properties to fetch, and with the generic type indicating the return type.
- parameter queryClauses: a series of `QueryClause` instances for the query request. Accepts `Where`, `OrderBy`, `GroupBy`, and `Tweak` clauses.
- returns: the result of the the query. The type of the return value is specified by the generic type of the `Select<U>` parameter.
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func queryAttributes<D>(_ from: From<D>, _ selectClause: Select<D, NSDictionary>, _ queryClauses: [QueryClause]) throws -> [[String: Any]] {
@@ -486,7 +486,7 @@ extension DataStack: FetchableSource, QueryableSource {
```
- parameter clauseChain: a `QueryChainableBuilderType` indicating the properties to fetch and the series of queries for the request.
- returns: the result of the the query as specified by the `QueryChainableBuilderType`
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
public func queryAttributes<B: QueryChainableBuilderType>(_ clauseChain: B) throws -> [[String: Any]] where B.ResultType == NSDictionary {

View File

@@ -72,7 +72,7 @@ public protocol FetchableSource: class {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: the first `DynamicObject` instance that satisfies the specified `FetchClause`s, or `nil` if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
func fetchOne<D>(_ from: From<D>, _ fetchClauses: FetchClause...) throws -> D?
@@ -82,7 +82,7 @@ public protocol FetchableSource: class {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: the first `DynamicObject` instance that satisfies the specified `FetchClause`s, or `nil` if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
func fetchOne<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) throws -> D?
@@ -97,7 +97,7 @@ public protocol FetchableSource: class {
```
- parameter clauseChain: a `FetchChainableBuilderType` built from a chain of clauses
- returns: the first `DynamicObject` instance that satisfies the specified `FetchChainableBuilderType`, or `nil` if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
func fetchOne<B: FetchChainableBuilderType>(_ clauseChain: B) throws -> B.ObjectType?
@@ -107,7 +107,7 @@ public protocol FetchableSource: class {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: all `DynamicObject` instances that satisfy the specified `FetchClause`s, or an empty array if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
func fetchAll<D>(_ from: From<D>, _ fetchClauses: FetchClause...) throws -> [D]
@@ -117,7 +117,7 @@ public protocol FetchableSource: class {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: all `DynamicObject` instances that satisfy the specified `FetchClause`s, or an empty array if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
func fetchAll<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) throws -> [D]
@@ -132,7 +132,7 @@ public protocol FetchableSource: class {
```
- parameter clauseChain: a `FetchChainableBuilderType` built from a chain of clauses
- returns: all `DynamicObject` instances that satisfy the specified `FetchChainableBuilderType`, or an empty array if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
func fetchAll<B: FetchChainableBuilderType>(_ clauseChain: B) throws -> [B.ObjectType]
@@ -142,7 +142,7 @@ public protocol FetchableSource: class {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: the number of `DynamicObject`s that satisfy the specified `FetchClause`s
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
func fetchCount<D>(_ from: From<D>, _ fetchClauses: FetchClause...) throws -> Int
@@ -152,7 +152,7 @@ public protocol FetchableSource: class {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: the number of `DynamicObject`s that satisfy the specified `FetchClause`s
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
func fetchCount<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) throws -> Int
@@ -167,7 +167,7 @@ public protocol FetchableSource: class {
```
- parameter clauseChain: a `FetchChainableBuilderType` built from a chain of clauses
- returns: the number of `DynamicObject`s that satisfy the specified `FetchChainableBuilderType`
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
func fetchCount<B: FetchChainableBuilderType>(_ clauseChain: B) throws -> Int
@@ -177,7 +177,7 @@ public protocol FetchableSource: class {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: the `NSManagedObjectID` for the first `DynamicObject` that satisfies the specified `FetchClause`s, or `nil` if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
func fetchObjectID<D>(_ from: From<D>, _ fetchClauses: FetchClause...) throws -> NSManagedObjectID?
@@ -187,7 +187,7 @@ public protocol FetchableSource: class {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: the `NSManagedObjectID` for the first `DynamicObject` that satisfies the specified `FetchClause`s, or `nil` if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
func fetchObjectID<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) throws -> NSManagedObjectID?
@@ -202,7 +202,7 @@ public protocol FetchableSource: class {
```
- parameter clauseChain: a `FetchChainableBuilderType` built from a chain of clauses
- returns: the `NSManagedObjectID` for the first `DynamicObject` that satisfies the specified `FetchChainableBuilderType`, or `nil` if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
func fetchObjectID<B: FetchChainableBuilderType>(_ clauseChain: B) throws -> NSManagedObjectID?
@@ -212,7 +212,7 @@ public protocol FetchableSource: class {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: the `NSManagedObjectID` for all `DynamicObject`s that satisfy the specified `FetchClause`s, or an empty array if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
func fetchObjectIDs<D>(_ from: From<D>, _ fetchClauses: FetchClause...) throws -> [NSManagedObjectID]
@@ -222,7 +222,7 @@ public protocol FetchableSource: class {
- parameter from: a `From` clause indicating the entity type
- parameter fetchClauses: a series of `FetchClause` instances for the fetch request. Accepts `Where`, `OrderBy`, and `Tweak` clauses.
- returns: the `NSManagedObjectID` for all `DynamicObject`s that satisfy the specified `FetchClause`s, or an empty array if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
func fetchObjectIDs<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) throws -> [NSManagedObjectID]
@@ -237,7 +237,7 @@ public protocol FetchableSource: class {
```
- parameter clauseChain: a `FetchChainableBuilderType` built from a chain of clauses
- returns: the `NSManagedObjectID` for all `DynamicObject`s that satisfy the specified `FetchChainableBuilderType`, or an empty array if no match was found
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
func fetchObjectIDs<B: FetchChainableBuilderType>(_ clauseChain: B) throws -> [NSManagedObjectID]

View File

@@ -43,7 +43,7 @@ public protocol QueryableSource: class {
- parameter selectClause: a `Select<U>` clause indicating the properties to fetch, and with the generic type indicating the return type.
- parameter queryClauses: a series of `QueryClause` instances for the query request. Accepts `Where`, `OrderBy`, `GroupBy`, and `Tweak` clauses.
- returns: the result of the the query, or `nil` if no match was found. The type of the return value is specified by the generic type of the `Select<U>` parameter.
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
func queryValue<D, U: QueryableAttributeType>(_ from: From<D>, _ selectClause: Select<D, U>, _ queryClauses: QueryClause...) throws -> U?
@@ -56,7 +56,7 @@ public protocol QueryableSource: class {
- parameter selectClause: a `Select<U>` clause indicating the properties to fetch, and with the generic type indicating the return type.
- parameter queryClauses: a series of `QueryClause` instances for the query request. Accepts `Where`, `OrderBy`, `GroupBy`, and `Tweak` clauses.
- returns: the result of the the query, or `nil` if no match was found. The type of the return value is specified by the generic type of the `Select<U>` parameter.
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
func queryValue<D, U: QueryableAttributeType>(_ from: From<D>, _ selectClause: Select<D, U>, _ queryClauses: [QueryClause]) throws -> U?
@@ -73,7 +73,7 @@ public protocol QueryableSource: class {
```
- parameter clauseChain: a `QueryChainableBuilderType` indicating the property/aggregate to fetch and the series of queries for the request.
- returns: the result of the the query as specified by the `QueryChainableBuilderType`, or `nil` if no match was found.
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
func queryValue<B: QueryChainableBuilderType>(_ clauseChain: B) throws -> B.ResultType? where B.ResultType: QueryableAttributeType
@@ -86,7 +86,7 @@ public protocol QueryableSource: class {
- parameter selectClause: a `Select<U>` clause indicating the properties to fetch, and with the generic type indicating the return type.
- parameter queryClauses: a series of `QueryClause` instances for the query request. Accepts `Where`, `OrderBy`, `GroupBy`, and `Tweak` clauses.
- returns: the result of the the query. The type of the return value is specified by the generic type of the `Select<U>` parameter.
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
func queryAttributes<D>(_ from: From<D>, _ selectClause: Select<D, NSDictionary>, _ queryClauses: QueryClause...) throws -> [[String: Any]]
@@ -99,7 +99,7 @@ public protocol QueryableSource: class {
- parameter selectClause: a `Select<U>` clause indicating the properties to fetch, and with the generic type indicating the return type.
- parameter queryClauses: a series of `QueryClause` instances for the query request. Accepts `Where`, `OrderBy`, `GroupBy`, and `Tweak` clauses.
- returns: the result of the the query. The type of the return value is specified by the generic type of the `Select<U>` parameter.
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
func queryAttributes<D>(_ from: From<D>, _ selectClause: Select<D, NSDictionary>, _ queryClauses: [QueryClause]) throws -> [[String: Any]]
@@ -125,7 +125,7 @@ public protocol QueryableSource: class {
```
- parameter clauseChain: a `QueryChainableBuilderType` indicating the properties to fetch and the series of queries for the request.
- returns: the result of the the query as specified by the `QueryChainableBuilderType`
- throws: a `CoreStoreError` value indicating the failure if the specified entity could not be found in any store's schema.
- throws: `CoreStoreError.persistentStoreNotFound` if the specified entity could not be found in any store's schema.
*/
func queryAttributes<B: QueryChainableBuilderType>(_ clauseChain: B) throws -> [[String: Any]] where B.ResultType == NSDictionary