Row
public struct Row : Hashable, Sequence
A single entry in a Relation. Conceptually, the same as Dictionary<Attribute, RelationValue>.
The implementation is more complex, and optimized for the use cases it sees in this code. In particular,
the underlying storage is implemented as an interned object, which makes hashing and equality
really quick to evaluate.
-
Initialize a new
Rowfrom a sequence ofAttribute/RelationValuepairs.Declaration
Swift
public init<S>(values: S) where S : Sequence, S.Element == (key: Attribute, value: RelationValue) -
A convenience for a row with no attributes or values.
Declaration
Swift
public static var empty: Row -
Declaration
Swift
public func hash(into hasher: inout Hasher) -
Retrieve the value for a given
Attribute. If theRowdoes not contain theAttribute, return.notFound.Declaration
Swift
public subscript(attribute: Attribute) -> RelationValue { get set } -
Create a new row containing only the values whose attributes are also in the attributes parameter.
Declaration
Swift
public func rowWithAttributes<Seq>(_ attributes: Seq) -> Row where Seq : Sequence, Seq.Element == Attribute -
Create a new row containing only the values whose attributes are also in the attributes parameter.
Declaration
Swift
public func rowWithAttributes(_ attributes: Set<Attribute>) -> Row -
Produce a new Row by applying updated values to this Row. Any attributes that exist in
newValuesbut notselfwill be added. Any attributes that exist in both will be set to the new value. Attributes only inselfare left alone.Declaration
Swift
public func rowWithUpdate(_ newValues: Row) -> Row -
Declaration
Swift
public struct Iterator : IteratorProtocol -
Declaration
Swift
public func makeIterator() -> Iterator -
The attributes in the
Row.Declaration
Swift
public var attributes: LazyMapSequence<Row, Attribute> { get } -
The
Row‘s scheme.Declaration
Swift
public var scheme: Scheme { get } -
The number of values in the
Row.Declaration
Swift
public var count: Int { get } -
Whether the
Rowis empty.Declaration
Swift
public var isEmpty: Bool { get }
-
Declaration
Swift
public init(dictionaryLiteral elements: (Attribute, RelationValueConvertible)...)
-
Declaration
Swift
public var description: String { get }
-
Undocumented
Declaration
Swift
public static func fromPlist(_ plist: Any) -> Result<Row, RelationError> -
Undocumented
Declaration
Swift
public func toPlist() -> Any
Row Structure Reference