PlistFileRelation

public class PlistFileRelation : PlistRelation, RelationDefaultChangeObserverImplementation

Undocumented

  • Declaration

    Swift

    public let scheme: Scheme
  • 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>
  • 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

    See more

    Declaration

    Swift

    public enum Error : Swift.Error
  • Create a new relation with the given file.

    Declaration

    Swift

    public static func withFile(_ url: URL?, scheme: Scheme, primaryKeys: [Attribute], create: Bool, codec: DataCodec? = nil) -> Result<PlistFileRelation, RelationError>

    Parameters

    url

    The URL to the file to use. If nil, the relation starts out empty, and the url property must be set before calling save().

    scheme

    The relation scheme.

    primaryKeys

    The primary keys to use for the relation. Queries involving these keys can be resolved without scanning every row in the relation. Each primary key involves extra bookkeeping time and space, so it is not always desirable to put every key in the scheme in.

    create

    If false, then a URL must be provided and it must point to an existing file. If no URL is provided, this is a precondition failure. If an URL is provided but the file doesn’t exist or isn’t readable, this is an error. If true, then the file doesn’t have to exist. If it does exist, its contents are loaded into the relation.

    codec

    A DataCodec used to encode and decode the plist on disk.

    Return Value

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

  • Returns a new transient plist-backed relation (stored in memory only).

    Declaration

    Swift

    public static func transient(scheme: Scheme, primaryKeys: [Attribute], codec: DataCodec? = nil) -> PlistFileRelation
  • Undocumented

    Declaration

    Swift

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