TupleResultSet
public struct TupleResultSet : Equatable
This type describes the results of a reading a range of keys from the database.
-
Undocumented
Declaration
Swift
public init(_ resultSet: ResultSet)
-
This type provides errors that can be thrown when reading fields from a tuple in a result set.
These wrap around the errors in Tuple.ParsingError to replace the index with the database key, which is more useful when reading fields from a result set.
See moreDeclaration
Swift
public enum ParsingError : Error
-
This method reads a key from the result set.
This will automatically convert it into the requested return type. If it cannot be converted into the requested return type, it will rethrow the resulting error.
If the value is missing, this will throw
Tuple.ParsingError.MissingKey
.Throws
Tuple.ParsingError.Declaration
Swift
public func read<ReturnType>(_ key: Tuple) throws -> ReturnType where ReturnType : TupleConvertible
Parameters
key
The key to fetch.
Return Value
The converted value.
-
This method reads a key from the result set.
This will automatically convert it into the requested return type. If it cannot be converted into the requested return type, it will rethrow the resulting error.
If the value is missing, this will return nil.
Throws
Tuple.ParsingError.Declaration
Swift
public func read<ReturnType>(_ key: Tuple) throws -> ReturnType? where ReturnType : TupleConvertible
Parameters
key
The key to fetch.
Return Value
The converted value.