mapRow
Extension function for Flow
Return
A Flow
Example usage:
val connection: Connection = // Obtain a connection from your R2DBC connection factory
val sql = "SELECT * FROM users"
connection
.query(sql)
.asRows()
.mapRow { row -> User(id = row["id"], name = row["name"], age = row["age"]) }
.collect { user -> println("User: ${user.name}, Age: ${user.age}") }
Content copied to clipboard
Parameters
f
A suspend function that takes a Row as input and returns an instance of type T.