CodableDatastore icon indicating copy to clipboard operation
CodableDatastore copied to clipboard

Support static properties for default disk stores

Open dimitribouniol opened this issue 2 years ago • 0 comments

It would be much nicer to get a single common instance when getting the default store:

extension DiskPersistence where AccessMode == ReadWrite {
    /// The default persistence for the read-write store of an app.
    public static var `default`: DiskPersistence<AccessMode> = ...
}

extension DiskPersistence where AccessMode == ReadOnly {
    /// The default persistence for the read-only store of an app.
    public static var readOnlyDefault: DiskPersistence<AccessMode> = self.default.readOnly
}

However, the default URL helper cannot through in that case, specifically on Linux, and we must have a way from converting from a read-write store to a read-only one.

Depends on:

  • #15
  • #16

dimitribouniol avatar Jun 08 '23 00:06 dimitribouniol