PlistDirectoryRelation

public class PlistDirectoryRelation : PlistRelation, RelationDefaultChangeObserverImplementation

Undocumented

  • Declaration

    Swift

    public let scheme: Scheme
  • Undocumented

    Declaration

    Swift

    public let primaryKey: Attribute
  • url

    Undocumented

    Declaration

    Swift

    public internal(set) var url: URL?
  • Undocumented

    Declaration

    Swift

    public var changeObserverData: RelationDefaultChangeObserverImplementationData
  • Declaration

    Swift

    public var debugName: String?
  • Undocumented

    Declaration

    Swift

    public let saveObservers: RemovableSet<(URL) -> Void>
  • Create a new relation with a given directory.

    Declaration

    Swift

    public static func withDirectory(_ url: URL?, scheme: Scheme, primaryKey: Attribute, create: Bool, codec: DataCodec? = nil) -> Result<PlistDirectoryRelation, RelationError>

    Parameters

    url

    The URL to the directory to use. If nil, the relation is held in memory and the url property must be set before calling save().

    scheme

    The relation scheme.

    primaryKey

    The primary key to use for the relation. A row’s value for the primary key is used to derive the filename it’s stored under. Joins/selects that use the primary key will avoid scanning the entire directory.

    create

    If false, then a URL must be provided and an accessible directory must exist in that location. If no URL is provided, that is a precondition failure. If the URL is provided but no directory exists there or isn’t accessible, an error is returned. If create is true, then the directory can be nonexistent and the url can be nil. If the directory does exist, then its contents will be returned as part of the relation’s contents. Existing data is not deleted just because create: true.

    codec

    A DataCodec used to encode and decode individual Row plists on disk.

    Return Value

    The newly created directory relation, or an error if creation failed.

  • Declaration

    Swift

    public var contentProvider: RelationContentProvider { get }
  • Declaration

    Swift

    public func contains(_ row: Row) -> Result<Bool, RelationError>
  • Declaration

    Swift

    public func update(_ query: SelectExpression, newValues: Row) -> Result<Void, RelationError>
  • Undocumented

    Declaration

    Swift

    public func add(_ row: Row) -> Result<Int64, RelationError>
  • Undocumented

    Declaration

    Swift

    public func delete(_ query: SelectExpression) -> Result<Void, RelationError>
  • Undocumented

    Declaration

    Swift

    public func save() -> Result<Void, RelationError>
  • Undocumented

    See more

    Declaration

    Swift

    public enum Error : Swift.Error