mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-01-06 23:22:25 +01:00
Finish DatabaseLookupTable — well, except for testing and seeing if it actually works.
This commit is contained in:
parent
dccc44c920
commit
54cfaefd81
@ -75,6 +75,8 @@ public final class DatabaseLookupTable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MARK: - Private
|
||||||
|
|
||||||
private extension DatabaseLookupTable {
|
private extension DatabaseLookupTable {
|
||||||
|
|
||||||
// MARK: Removing
|
// MARK: Removing
|
||||||
@ -187,6 +189,10 @@ private extension DatabaseLookupTable {
|
|||||||
|
|
||||||
func saveLookups(for objectID: String, _ relatedObjectIDs: Set<String>, _ database: FMDatabase) {
|
func saveLookups(for objectID: String, _ relatedObjectIDs: Set<String>, _ database: FMDatabase) {
|
||||||
|
|
||||||
|
for relatedObjectID in relatedObjectIDs {
|
||||||
|
let d: [NSObject: Any] = [(objectIDKey as NSString): objectID, (relatedObjectIDKey as NSString): relatedObjectID]
|
||||||
|
let _ = database.rs_insertRow(with: d, insertType: .orIgnore, tableName: name)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: Attaching
|
// MARK: Attaching
|
||||||
@ -269,6 +275,8 @@ private extension DatabaseLookupTable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MARK: -
|
||||||
|
|
||||||
private struct LookupTable {
|
private struct LookupTable {
|
||||||
|
|
||||||
private let dictionary: [String: Set<String>] // objectID: Set<relatedObjectID>
|
private let dictionary: [String: Set<String>] // objectID: Set<relatedObjectID>
|
||||||
|
Loading…
Reference in New Issue
Block a user