New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metadata should be read/write capable independently #56
Conversation
Yeah, that's all a fair point. The functional API got scaled back in a few places, including the |
So, I'll add |
Also, just to clarify, Also, it is not possible to have a func readMetadataByKey<
PersistableWithObjectMetadata where
PersistableWithObjectMetadata: Persistable,
PersistableWithObjectMetadata.MetadataType: NSCoding>(key: String) -> PersistableWithObjectMetadata.MetadataType? {
return readMetadataAtIndex(PersistableWithObjectMetadata.indexWithKey(key))
} trying to use it... let metadata: MyObject.MetadataType? = readMetadataByKey(aKey) will not compile. So, instead, you'd have to call let metadata: MyObject.MetadataType? = readMetadataAtIndex(MyObject.indexWithKey(aKey)) |
Current coverage is
|
Metadata should be read/write capable independently
Yap database doesn't have a Makes sense to have to use the full index to get the metadata separately as well, thanks for that! |
@aranasaurus well, may add a set of replace functions at some point in the future. |
Currently I can write my Item without writing its Metadata by setting the metadata property to nil, there's no way to conversely write the Metadata without also writing the Item.
There also doesn't appear to be a way to read either one without reading them both. This may seem odd, given that my original request was that I wanted to be able to read them together, which I now can, but I'd still like to be able to read them separately if needed.
Neither of these are really that big of a deal and may just be me prematurely optimizing, but as I'm refactoring my code to use the new API these have come up and I thought I'd run them by you.