简体   繁体   English

如何在 postgresql r2dbc 中获取 select 查询的结果?

[英]How to get results of select query in postgresql r2dbc?

I can execute this query just fine but I don't know how to extract the information returned by the select statement.我可以很好地执行这个查询,但我不知道如何提取 select 语句返回的信息。

Flux<PostgresqlResult> checkTableQuery = connectionMono.flatMapMany(connection -> connection
    .createStatement("select exists(\n" +
                " select table_name from information_schema.tables\n" +
                " where table_name='sequence1'\n" +
                ");")
        .execute());
checkTableQuery.subscribe();
Flux<PostgresqlResult> checkTableQuery = connectionMono.flatMapMany(connection -> connection
.createStatement("select exists(\n" +
            " select table_name from information_schema.tables\n" +
            " where table_name='sequence1'\n" +
            ");")
    .execute()).flatmap(result->result.map(Row,RowMetadata)->Row.get("exists",Boolean.class)));
checkTableQuery.subscribe();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM