Deprecation of enum CoreStore, reorganize global symbols

This commit is contained in:
John Estropia
2019-08-29 17:03:09 +09:00
parent 02d5bf85ae
commit 266b1a9913
95 changed files with 2232 additions and 1837 deletions

View File

@@ -87,9 +87,9 @@ extension DataStack: FetchableSource, QueryableSource {
*/
public func fetchOne<D>(_ from: From<D>, _ fetchClauses: FetchClause...) throws -> D? {
CoreStore.assert(
Internals.assert(
Thread.isMainThread,
"Attempted to fetch from a \(cs_typeName(self)) outside the main thread."
"Attempted to fetch from a \(Internals.typeName(self)) outside the main thread."
)
return try self.mainContext.fetchOne(from, fetchClauses)
}
@@ -104,9 +104,9 @@ extension DataStack: FetchableSource, QueryableSource {
*/
public func fetchOne<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) throws -> D? {
CoreStore.assert(
Internals.assert(
Thread.isMainThread,
"Attempted to fetch from a \(cs_typeName(self)) outside the main thread."
"Attempted to fetch from a \(Internals.typeName(self)) outside the main thread."
)
return try self.mainContext.fetchOne(from, fetchClauses)
}
@@ -126,9 +126,9 @@ extension DataStack: FetchableSource, QueryableSource {
*/
public func fetchOne<B: FetchChainableBuilderType>(_ clauseChain: B) throws -> B.ObjectType? {
CoreStore.assert(
Internals.assert(
Thread.isMainThread,
"Attempted to fetch from a \(cs_typeName(self)) outside the main thread."
"Attempted to fetch from a \(Internals.typeName(self)) outside the main thread."
)
return try self.mainContext.fetchOne(clauseChain)
}
@@ -143,9 +143,9 @@ extension DataStack: FetchableSource, QueryableSource {
*/
public func fetchAll<D>(_ from: From<D>, _ fetchClauses: FetchClause...) throws -> [D] {
CoreStore.assert(
Internals.assert(
Thread.isMainThread,
"Attempted to fetch from a \(cs_typeName(self)) outside the main thread."
"Attempted to fetch from a \(Internals.typeName(self)) outside the main thread."
)
return try self.mainContext.fetchAll(from, fetchClauses)
}
@@ -160,9 +160,9 @@ extension DataStack: FetchableSource, QueryableSource {
*/
public func fetchAll<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) throws -> [D] {
CoreStore.assert(
Internals.assert(
Thread.isMainThread,
"Attempted to fetch from a \(cs_typeName(self)) outside the main thread."
"Attempted to fetch from a \(Internals.typeName(self)) outside the main thread."
)
return try self.mainContext.fetchAll(from, fetchClauses)
}
@@ -182,9 +182,9 @@ extension DataStack: FetchableSource, QueryableSource {
*/
public func fetchAll<B: FetchChainableBuilderType>(_ clauseChain: B) throws -> [B.ObjectType] {
CoreStore.assert(
Internals.assert(
Thread.isMainThread,
"Attempted to fetch from a \(cs_typeName(self)) outside the main thread."
"Attempted to fetch from a \(Internals.typeName(self)) outside the main thread."
)
return try self.mainContext.fetchAll(clauseChain)
}
@@ -199,9 +199,9 @@ extension DataStack: FetchableSource, QueryableSource {
*/
public func fetchCount<D>(_ from: From<D>, _ fetchClauses: FetchClause...) throws -> Int {
CoreStore.assert(
Internals.assert(
Thread.isMainThread,
"Attempted to fetch from a \(cs_typeName(self)) outside the main thread."
"Attempted to fetch from a \(Internals.typeName(self)) outside the main thread."
)
return try self.mainContext.fetchCount(from, fetchClauses)
}
@@ -216,9 +216,9 @@ extension DataStack: FetchableSource, QueryableSource {
*/
public func fetchCount<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) throws -> Int {
CoreStore.assert(
Internals.assert(
Thread.isMainThread,
"Attempted to fetch from a \(cs_typeName(self)) outside the main thread."
"Attempted to fetch from a \(Internals.typeName(self)) outside the main thread."
)
return try self.mainContext.fetchCount(from, fetchClauses)
}
@@ -238,9 +238,9 @@ extension DataStack: FetchableSource, QueryableSource {
*/
public func fetchCount<B: FetchChainableBuilderType>(_ clauseChain: B) throws -> Int {
CoreStore.assert(
Internals.assert(
Thread.isMainThread,
"Attempted to fetch from a \(cs_typeName(self)) outside the main thread."
"Attempted to fetch from a \(Internals.typeName(self)) outside the main thread."
)
return try self.mainContext.fetchCount(clauseChain)
}
@@ -255,9 +255,9 @@ extension DataStack: FetchableSource, QueryableSource {
*/
public func fetchObjectID<D>(_ from: From<D>, _ fetchClauses: FetchClause...) throws -> NSManagedObjectID? {
CoreStore.assert(
Internals.assert(
Thread.isMainThread,
"Attempted to fetch from a \(cs_typeName(self)) outside the main thread."
"Attempted to fetch from a \(Internals.typeName(self)) outside the main thread."
)
return try self.mainContext.fetchObjectID(from, fetchClauses)
}
@@ -272,9 +272,9 @@ extension DataStack: FetchableSource, QueryableSource {
*/
public func fetchObjectID<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) throws -> NSManagedObjectID? {
CoreStore.assert(
Internals.assert(
Thread.isMainThread,
"Attempted to fetch from a \(cs_typeName(self)) outside the main thread."
"Attempted to fetch from a \(Internals.typeName(self)) outside the main thread."
)
return try self.mainContext.fetchObjectID(from, fetchClauses)
}
@@ -294,9 +294,9 @@ extension DataStack: FetchableSource, QueryableSource {
*/
public func fetchObjectID<B: FetchChainableBuilderType>(_ clauseChain: B) throws -> NSManagedObjectID? {
CoreStore.assert(
Internals.assert(
Thread.isMainThread,
"Attempted to fetch from a \(cs_typeName(self)) outside the main thread."
"Attempted to fetch from a \(Internals.typeName(self)) outside the main thread."
)
return try self.mainContext.fetchObjectID(clauseChain)
}
@@ -311,9 +311,9 @@ extension DataStack: FetchableSource, QueryableSource {
*/
public func fetchObjectIDs<D>(_ from: From<D>, _ fetchClauses: FetchClause...) throws -> [NSManagedObjectID] {
CoreStore.assert(
Internals.assert(
Thread.isMainThread,
"Attempted to fetch from a \(cs_typeName(self)) outside the main thread."
"Attempted to fetch from a \(Internals.typeName(self)) outside the main thread."
)
return try self.mainContext.fetchObjectIDs(from, fetchClauses)
}
@@ -328,9 +328,9 @@ extension DataStack: FetchableSource, QueryableSource {
*/
public func fetchObjectIDs<D>(_ from: From<D>, _ fetchClauses: [FetchClause]) throws -> [NSManagedObjectID] {
CoreStore.assert(
Internals.assert(
Thread.isMainThread,
"Attempted to fetch from a \(cs_typeName(self)) outside the main thread."
"Attempted to fetch from a \(Internals.typeName(self)) outside the main thread."
)
return try self.mainContext.fetchObjectIDs(from, fetchClauses)
}
@@ -350,9 +350,9 @@ extension DataStack: FetchableSource, QueryableSource {
*/
public func fetchObjectIDs<B: FetchChainableBuilderType>(_ clauseChain: B) throws -> [NSManagedObjectID] {
CoreStore.assert(
Internals.assert(
Thread.isMainThread,
"Attempted to fetch from a \(cs_typeName(self)) outside the main thread."
"Attempted to fetch from a \(Internals.typeName(self)) outside the main thread."
)
return try self.mainContext.fetchObjectIDs(clauseChain)
}
@@ -373,9 +373,9 @@ extension DataStack: FetchableSource, QueryableSource {
*/
public func queryValue<D, U: QueryableAttributeType>(_ from: From<D>, _ selectClause: Select<D, U>, _ queryClauses: QueryClause...) throws -> U? {
CoreStore.assert(
Internals.assert(
Thread.isMainThread,
"Attempted to query from a \(cs_typeName(self)) outside the main thread."
"Attempted to query from a \(Internals.typeName(self)) outside the main thread."
)
return try self.mainContext.queryValue(from, selectClause, queryClauses)
}
@@ -393,9 +393,9 @@ extension DataStack: FetchableSource, QueryableSource {
*/
public func queryValue<D, U: QueryableAttributeType>(_ from: From<D>, _ selectClause: Select<D, U>, _ queryClauses: [QueryClause]) throws -> U? {
CoreStore.assert(
Internals.assert(
Thread.isMainThread,
"Attempted to query from a \(cs_typeName(self)) outside the main thread."
"Attempted to query from a \(Internals.typeName(self)) outside the main thread."
)
return try self.mainContext.queryValue(from, selectClause, queryClauses)
}
@@ -417,9 +417,9 @@ extension DataStack: FetchableSource, QueryableSource {
*/
public func queryValue<B: QueryChainableBuilderType>(_ clauseChain: B) throws -> B.ResultType? where B.ResultType: QueryableAttributeType {
CoreStore.assert(
Internals.assert(
Thread.isMainThread,
"Attempted to query from a \(cs_typeName(self)) outside the main thread."
"Attempted to query from a \(Internals.typeName(self)) outside the main thread."
)
return try self.mainContext.queryValue(clauseChain.from, clauseChain.select, clauseChain.queryClauses)
}
@@ -437,9 +437,9 @@ extension DataStack: FetchableSource, QueryableSource {
*/
public func queryAttributes<D>(_ from: From<D>, _ selectClause: Select<D, NSDictionary>, _ queryClauses: QueryClause...) throws -> [[String: Any]] {
CoreStore.assert(
Internals.assert(
Thread.isMainThread,
"Attempted to query from a \(cs_typeName(self)) outside the main thread."
"Attempted to query from a \(Internals.typeName(self)) outside the main thread."
)
return try self.mainContext.queryAttributes(from, selectClause, queryClauses)
}
@@ -457,9 +457,9 @@ extension DataStack: FetchableSource, QueryableSource {
*/
public func queryAttributes<D>(_ from: From<D>, _ selectClause: Select<D, NSDictionary>, _ queryClauses: [QueryClause]) throws -> [[String: Any]] {
CoreStore.assert(
Internals.assert(
Thread.isMainThread,
"Attempted to query from a \(cs_typeName(self)) outside the main thread."
"Attempted to query from a \(Internals.typeName(self)) outside the main thread."
)
return try self.mainContext.queryAttributes(from, selectClause, queryClauses)
}
@@ -490,9 +490,9 @@ extension DataStack: FetchableSource, QueryableSource {
*/
public func queryAttributes<B: QueryChainableBuilderType>(_ clauseChain: B) throws -> [[String: Any]] where B.ResultType == NSDictionary {
CoreStore.assert(
Internals.assert(
Thread.isMainThread,
"Attempted to query from a \(cs_typeName(self)) outside the main thread."
"Attempted to query from a \(Internals.typeName(self)) outside the main thread."
)
return try self.mainContext.queryAttributes(clauseChain.from, clauseChain.select, clauseChain.queryClauses)
}