Skip to content

Commit 11c79dd

Browse files
Updated Identifiable instance accessors to be disfavored in cases where their IDs were similarly shaped
1 parent 720b897 commit 11c79dd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/CodableDatastore/Datastore/Datastore.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,25 +1010,29 @@ extension Datastore where AccessMode == ReadWrite {
10101010
public var readOnly: Datastore<Version, CodedType, IdentifierType, ReadOnly> { self as Any as! Datastore<Version, CodedType, IdentifierType, ReadOnly> }
10111011
}
10121012

1013-
// MARK: Idetifiable CodedType
1013+
// MARK: Identifiable CodedType
10141014

10151015
extension Datastore where CodedType: Identifiable, IdentifierType == CodedType.ID {
10161016
/// Persist an instance to the data store.
10171017
///
10181018
/// If an instance does not already exist for the specified identifier, it will be created. If an instance already exists, it will be updated.
10191019
/// - Parameter instance: The instance to persist.
1020+
@_disfavoredOverload
10201021
public func persist(_ instance: CodedType) async throws where AccessMode == ReadWrite {
10211022
try await self.persist(instance, to: instance.id)
10221023
}
10231024

1025+
@_disfavoredOverload
10241026
public func delete(_ instance: CodedType) async throws where AccessMode == ReadWrite {
10251027
try await self.delete(instance.id)
10261028
}
10271029

1030+
@_disfavoredOverload
10281031
public func load(_ instance: CodedType) async throws -> CodedType? {
10291032
try await self.load(instance.id)
10301033
}
10311034

1035+
@_disfavoredOverload
10321036
public func observe(_ instance: CodedType) async throws -> some TypedAsyncSequence<ObservedEvent<IdentifierType, CodedType>> {
10331037
try await observe(instance.id)
10341038
}

0 commit comments

Comments
 (0)