Hi,
in the session the following is mentioned:
If a trip already exists with that name, then the persistent back end will update to the latest values. This is called an upsert. An upsert starts as an insert. If the insert collides with existing data, it becomes an update and updates the properties of the existing data.
Nevertheless, if I have a unique constraint on an (String) attribute and try to insert the same again, I end up in the debugger in the generated getter of the attribute:
@Attribute(.unique) public var name: String
{
get {
_$observationRegistrar.access(self, keyPath: \.name)
return self.getValue(for: \.name) // <- here
}
EXC_BREAKPOINT (code=1, subcode=0x1a8d6b724)
Am I missing something? If this is expected behaviour, how should I prevent this crash (other than checking for uniqueness before every insert)?
Thank you!
Cheers, Michael