Open
Description
Looks like SwiftData flattens Codable structure into own table columns vs storing them as JSON.
Presumably to be able to run queries against such.
E.g.
@Model class Person {
struct Address: Codable {
var street: String
var city: String
}
var privateAddress : Address
}
Even though the property is just one in the model, I think it ends up in separate columns in SQLite. Presumably to allow this:
#Predicate {
$0.privateAddress.street = "XYZ"
}
Which seems valuable?
Not sure how we would hook that up in Core Data yet, I'd guess the Entity would need to get attributes for those.
Metadata
Metadata
Assignees
Labels
No labels