PlistDirectoryRelation
public class PlistDirectoryRelation : PlistRelation, RelationDefaultChangeObserverImplementation
Undocumented
-
Declaration
Swift
public let scheme: Scheme -
Undocumented
Declaration
Swift
public let primaryKey: Attribute -
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
Parameters
urlThe URL to the directory to use. If nil, the relation is held in memory and the
urlproperty must be set before calling save().schemeThe relation scheme.
primaryKeyThe 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.
createIf 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
createis 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 becausecreate: true.codecA 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 update(_ query: SelectExpression, newValues: Row) -> Result<Void, RelationError> -
Undocumented
Declaration
Swift
public func delete(_ query: SelectExpression) -> Result<Void, RelationError> -
Undocumented
Declaration
Swift
public func save() -> Result<Void, RelationError>
PlistDirectoryRelation Class Reference