Follow

The more I work with Core Data, the more I think I should never be just fetching objects directly; that, instead, I want to be fetching only the data I need and only in the structure I need.

For example, if I have an app that shows blog posts, and I want to look at a list of all blog posts, I should only fetch the things I need (title, date posted, number of comments, for example) as a dictionary result type, and never as an array of Post managed objects.

@pcperini the ORMs I’ve used on mobile have been not great. I keep thinking I should try my hand at creating my own, but that’s probably easier said than done.

@grantjbutler A lot of it is that state makes everything stupid complicated. Type-safe wrappers around queries? 👌

@pcperini more that none of the ones I’ve used have been very Swifty. I want to use value types to get a handle on immutability, with Codable as the primary way of integrating with the ORM.

@grantjbutler this sounds like the beginning of a GraphQL pitch…

@dzombak ah, but GraphQL isn’t a local ORM. I guess I want something kinda like that, though? Will have to spend some time experimenting.

Sign in to participate in the conversation
Mastodon

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!