From

public struct From<O> where O : DynamicObject
extension From: CustomDebugStringConvertible, CoreStoreDebugStringConvertible

A From clause specifies the source entity and source persistent store for fetch and query methods. A common usage is to just indicate the entity:

let person = transaction.fetchOne(From<Person>())

For cases where multiple NSPersistentStores contain the same entity, the source configuration’s name needs to be specified as well:

let person = transaction.fetchOne(From<Person>("Configuration1"))
  • The associated NSManagedObject or CoreStoreObject entity class

    Declaration

    Swift

    public let entityClass: O.Type
  • The NSPersistentStore configuration names to associate objects from. May contain Strings to pertain to named configurations, or nil to pertain to the default configuration

    Declaration

    Swift

    public let configurations: [ModelConfiguration]?
  • Initializes a From clause.

    let people = transaction.fetchAll(From<MyPersonEntity>())
    

    Declaration

    Swift

    public init()
  • Initializes a From clause with the specified entity type.

    let people = transaction.fetchAll(From<MyPersonEntity>())
    

    Declaration

    Swift

    public init(_ entity: O.Type)

    Parameters

    entity

    the associated NSManagedObject or CoreStoreObject type

  • Initializes a From clause with the specified configurations.

    let people = transaction.fetchAll(From<MyPersonEntity>(nil, "Configuration1"))
    

    Declaration

    Swift

    public init(_ configuration: ModelConfiguration, _ otherConfigurations: ModelConfiguration...)

    Parameters

    configuration

    the NSPersistentStore configuration name to associate objects from. This parameter is required if multiple configurations contain the created NSManagedObject or CoreStoreObject‘s entity type. Set to nil to use the default configuration.

    otherConfigurations

    an optional list of other configuration names to associate objects from (see configuration parameter)

  • Initializes a From clause with the specified configurations.

    let people = transaction.fetchAll(From<MyPersonEntity>(["Configuration1", "Configuration2"]))
    

    Declaration

    Swift

    public init(_ configurations: [ModelConfiguration])

    Parameters

    configurations

    a list of NSPersistentStore configuration names to associate objects from. This parameter is required if multiple configurations contain the created NSManagedObject or CoreStoreObject‘s entity type. Set to nil to use the default configuration.

  • Initializes a From clause with the specified configurations.

    let people = transaction.fetchAll(From(MyPersonEntity.self, nil, "Configuration1"))
    

    Declaration

    Swift

    public init(_ entity: O.Type, _ configuration: ModelConfiguration, _ otherConfigurations: ModelConfiguration...)

    Parameters

    entity

    the associated NSManagedObject or CoreStoreObject type

    configuration

    the NSPersistentStore configuration name to associate objects from. This parameter is required if multiple configurations contain the created NSManagedObject or CoreStoreObject‘s entity type. Set to nil to use the default configuration.

    otherConfigurations

    an optional list of other configuration names to associate objects from (see configuration parameter)

  • Initializes a From clause with the specified configurations.

    let people = transaction.fetchAll(From(MyPersonEntity.self, ["Configuration1", "Configuration1"]))
    

    Declaration

    Swift

    public init(_ entity: O.Type, _ configurations: [ModelConfiguration])

    Parameters

    entity

    the associated NSManagedObject or CoreStoreObject type

    configurations

    a list of NSPersistentStore configuration names to associate objects from. This parameter is required if multiple configurations contain the created NSManagedObject or CoreStoreObject‘s entity type. Set to nil to use the default configuration.

CustomDebugStringConvertible

  • Declaration

    Swift

    public var debugDescription: String { get }

From

Available where O: NSManagedObject

Available where O: CoreStoreObject