InferredSchemaMappingProvider
public final class InferredSchemaMappingProvider : Hashable, SchemaMappingProvider
A SchemaMappingProvider
that tries to infer model migration between two DynamicSchema
versions by searching all xcmappingmodel
s from Bundle.allBundles
or by relying on lightweight migration if possible. Throws an error if lightweight migration is impossible for the two DynamicSchema
. This mapping is automatically used as a fallback mapping provider, even if no mapping providers are explicitly declared in the StorageInterface
.
Note
For security reasons,InferredSchemaMappingProvider
will not search Bundle.allFrameworks
by default. If the xcmappingmodel
s are bundled within a framework, use XcodeSchemaMappingProvider
instead and provide Bundle(for: <a class in the framework>
to its initializer.
-
Declaration
Swift
public static func == (lhs: InferredSchemaMappingProvider, rhs: InferredSchemaMappingProvider) -> Bool
-
Declaration
Swift
public func hash(into hasher: inout Hasher)
-
Declaration
Swift
public func cs_createMappingModel(from sourceSchema: DynamicSchema, to destinationSchema: DynamicSchema, storage: LocalStorage) throws -> (mappingModel: NSMappingModel, migrationType: MigrationType)