io.vertx.reactivex.sqlclient.Row Java Examples

The following examples show how to use io.vertx.reactivex.sqlclient.Row. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PgHealthIndicator.java    From micronaut-sql with Apache License 2.0 5 votes vote down vote up
@Override
public Publisher<HealthResult> getResult() {
    return client.query(QUERY).rxExecute().map(rows -> {
        HealthResult.Builder status = HealthResult.builder(NAME, HealthStatus.UP);
        Row row = rows.iterator().next();
        status.details(Collections.singletonMap("version", row.getString(0)));
        return status.build();
    }).onErrorReturn(this::buildErrorResult).toFlowable();
}
 
Example #2
Source File: MySQLHealthIndicator.java    From micronaut-sql with Apache License 2.0 5 votes vote down vote up
@Override
public Publisher<HealthResult> getResult() {
    return client.query(QUERY).rxExecute().map(rows -> {
        HealthResult.Builder status = HealthResult.builder(NAME, HealthStatus.UP);
        Row row = rows.iterator().next();
        status.details(Collections.singletonMap("version", row.getString(0)));
        return status.build();
    }).onErrorReturn(this::buildErrorResult).toFlowable();
}
 
Example #3
Source File: ActivityApiVerticle.java    From vertx-in-action with MIT License 5 votes vote down vote up
private void sendCount(RoutingContext ctx, Row row) {
  Integer count = row.getInteger(0);
  if (count != null) {
    JsonObject payload = new JsonObject()
      .put("count", count);
    ctx.response()
      .putHeader("Content-Type", "application/json")
      .end(payload.encode());
  } else {
    send404(ctx);
  }
}
 
Example #4
Source File: ActivityApiVerticle.java    From vertx-in-action with MIT License 5 votes vote down vote up
private void sendRanking(RoutingContext ctx, RowSet<Row> rows) {
  JsonArray data = new JsonArray();
  for (Row row : rows) {
    data.add(new JsonObject()
      .put("deviceId", row.getValue("device_id"))
      .put("stepsCount", row.getValue("steps")));
  }
  ctx.response()
    .putHeader("Content-Type", "application/json")
    .end(data.encode());
}
 
Example #5
Source File: RxReactiveQueryResult.java    From vertx-jooq with MIT License 4 votes vote down vote up
public RxReactiveQueryResult(RowSet<Row> result) {
    super(result);
}
 
Example #6
Source File: RxReactiveQueryResult.java    From vertx-jooq with MIT License 4 votes vote down vote up
RxReactiveQueryResult(Row row) {
    super(row);
}
 
Example #7
Source File: RxReactiveQueryResult.java    From vertx-jooq with MIT License 4 votes vote down vote up
@Override
protected RxReactiveQueryResult newInstance(Row result) {
    return new RxReactiveQueryResult(result);
}