/** * Execute a one shot SQL statement that returns a single SQL row. This method will reduce the boilerplate code by * getting a connection from the pool (this object) and return it back after the execution. Only the first result * from the result set is returned. * @param sql the statement to execute * @return self * @deprecated use {@link #rxQuerySingle} instead */ @Deprecated() public Observable<JsonArray> querySingleObservable(String sql) { io.vertx.rx.java.ObservableFuture<JsonArray> handler = io.vertx.rx.java.RxHelper.observableFuture(); querySingle(sql, handler.toHandler()); return handler; }
/** * Execute a one shot SQL statement that returns a single SQL row. This method will reduce the boilerplate code by * getting a connection from the pool (this object) and return it back after the execution. Only the first result * from the result set is returned. * @param sql the statement to execute * @return self */ public Single<JsonArray> rxQuerySingle(String sql) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { querySingle(sql, fut); })); }
/** * Execute a one shot SQL statement that returns a single SQL row. This method will reduce the boilerplate code by * getting a connection from the pool (this object) and return it back after the execution. Only the first result * from the result set is returned. * @param sql the statement to execute * @return self */ public Single<JsonArray> rxQuerySingle(String sql) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { querySingle(sql, fut); })); }