Equivalent of NSManagedObjectContext.existingObject in SwiftData?

CoreData contexts expose a very convenient existingObject API that allows to fallback to retrieve from the persistent store in case the object is not registered in the context yet.

I don't see any equivalent in SwiftData. Does that mean we should fallback to fetch methods instead? Is there any rationale behind the lack of this API other than that it's still in development.

For more details about what I'm trying to do. I have a read-only context (the main context) and a read-write context. After inserting a model in the read-write context (and saving), I'd like to retrieve the equivalent object from the read-only context.

Equivalent of NSManagedObjectContext.existingObject in SwiftData?
 
 
Q