RenameColumnAdapter

public struct RenameColumnAdapter : RowAdapter

RenameColumnAdapter is a row adapter that renames columns.

For example:

let adapter = RenameColumnAdapter { $0 + "rrr" }
let sql = "SELECT 'foo' AS foo, 'bar' AS bar, 'baz' AS baz"

// [foorrr:"foo", barrrr:"bar", bazrrr:"baz"]
try Row.fetchOne(db, sql: sql, adapter: adapter)
  • Creates a RenameColumnAdapter adapter that renames columns according to the provided transform function.

    Declaration

    Swift

    public init(_ transform: @escaping (String) -> String)