ColumnMapping
public struct ColumnMapping : RowAdapter
ColumnMapping is a row adapter that maps column names.
let adapter = ColumnMapping(["foo": "bar"])
let sql = "SELECT 'foo' AS foo, 'bar' AS bar, 'baz' AS baz"
// <Row foo:"bar">
try Row.fetchOne(db, sql, adapter: adapter)
-
Creates a ColumnMapping with a dictionary from mapped column names to column names in a base row.
Declaration
Swift
public init(_ mapping: [String: String])
-
Declaration
Swift
public func layoutedAdapter(from layout: RowLayout) throws -> LayoutedRowAdapter