Merge branch '5.3.x'

This commit is contained in:
Stephane Nicoll 2021-11-22 10:31:27 +01:00
commit aa80c4873a
1 changed files with 3 additions and 3 deletions

View File

@ -6788,20 +6788,20 @@ You can take control over result mapping by supplying a `Function<Row, T>` that
called for each `Row` so it can can return arbitrary values (singular values, called for each `Row` so it can can return arbitrary values (singular values,
collections and maps, and objects). collections and maps, and objects).
The following example extracts the `id` column and emits its value: The following example extracts the `name` column and emits its value:
[source,java,indent=0,subs="verbatim,quotes",role="primary"] [source,java,indent=0,subs="verbatim,quotes",role="primary"]
.Java .Java
---- ----
Flux<String> names = client.sql("SELECT name FROM person") Flux<String> names = client.sql("SELECT name FROM person")
.map(row -> row.get("id", String.class)) .map(row -> row.get("name", String.class))
.all(); .all();
---- ----
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"] [source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin .Kotlin
---- ----
val names = client.sql("SELECT name FROM person") val names = client.sql("SELECT name FROM person")
.map{ row: Row -> row.get("id", String.class) } .map{ row: Row -> row.get("name", String.class) }
.flow() .flow()
---- ----