Skip to content

Find the best way to integrate CoreData or Realm as a cache #2

@fmo91

Description

@fmo91

Right now, the only persistent cache that Pigeon provides is UserDefaultsQueryCache, which is very convenient but it's not CoreData.

On the other hand, Pigeon provides QueryCacheType as a way to extend cache functionality. By implementing these properties, users can extend Pigeon cache functionality

public protocol QueryCacheType {
    func save<T: Codable>(_ value: T, for key: QueryKey, andTimestamp timestamp: Date)
    func invalidate(for key: QueryKey)
    func isValueValid(
        forKey key: QueryKey,
        timestamp: Date,
        andInvalidationPolicy invalidationPolicy: QueryCacheConfig.InvalidationPolicy
    ) -> Bool
    func get<T: Codable>(for key: QueryKey) -> T?
}

How can we improve CoreData integration in Pigeon? Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions