LocalData/Sources/LocalData/Protocols/TransformingMigration.swift

10 lines
321 B
Swift

import Foundation
/// Migration protocol that supports data transformation during migration.
public protocol TransformingMigration: StorageMigration {
associatedtype SourceValue: Codable & Sendable
var sourceKey: StorageKey<SourceValue> { get }
func transform(_ source: SourceValue) async throws -> Value
}