Java Code Examples for io.vertx.reactivex.sqlclient.Row

The following examples show how to use io.vertx.reactivex.sqlclient.Row. These examples are extracted from open source projects. 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 Project: micronaut-sql   Source File: PgHealthIndicator.java    License: 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 Project: micronaut-sql   Source File: MySQLHealthIndicator.java    License: 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 Project: vertx-in-action   Source File: ActivityApiVerticle.java    License: 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 Project: vertx-in-action   Source File: ActivityApiVerticle.java    License: 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 Project: vertx-jooq   Source File: RxReactiveQueryResult.java    License: MIT License 4 votes vote down vote up
public RxReactiveQueryResult(RowSet<Row> result) {
    super(result);
}
 
Example 6
Source Project: vertx-jooq   Source File: RxReactiveQueryResult.java    License: MIT License 4 votes vote down vote up
RxReactiveQueryResult(Row row) {
    super(row);
}
 
Example 7
Source Project: vertx-jooq   Source File: RxReactiveQueryResult.java    License: MIT License 4 votes vote down vote up
@Override
protected RxReactiveQueryResult newInstance(Row result) {
    return new RxReactiveQueryResult(result);
}