public abstract class SqlClientBase<C extends SqlClient> extends Object implements SqlClientInternal, CommandScheduler
| Modifier and Type | Field and Description |
|---|---|
protected ClientMetrics |
metrics |
protected QueryTracer |
tracer |
| Constructor and Description |
|---|
SqlClientBase(QueryTracer tracer,
ClientMetrics metrics) |
| Modifier and Type | Method and Description |
|---|---|
int |
appendQueryPlaceholder(StringBuilder queryBuilder,
int index,
int current)
Append a parameter placeholder in the
query. |
PreparedQuery<RowSet<Row>> |
preparedQuery(String sql)
Create a prepared query, one of the
PreparedQuery.execute(io.vertx.sqlclient.Tuple, io.vertx.core.Handler<io.vertx.core.AsyncResult<T>>) or PreparedQuery.executeBatch(java.util.List<io.vertx.sqlclient.Tuple>, io.vertx.core.Handler<io.vertx.core.AsyncResult<T>>)
methods must be called to execute the query. |
protected abstract <T> PromiseInternal<T> |
promise() |
protected abstract <T> PromiseInternal<T> |
promise(Handler<AsyncResult<T>> handler) |
Query<RowSet<Row>> |
query(String sql)
Create a query, the
Query.execute(io.vertx.core.Handler<io.vertx.core.AsyncResult<T>>) method must be called to execute the query. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitscheduleprotected final QueryTracer tracer
protected final ClientMetrics metrics
public SqlClientBase(QueryTracer tracer, ClientMetrics metrics)
public int appendQueryPlaceholder(StringBuilder queryBuilder, int index, int current)
SqlClientInternalquery.
The index starts at 0.
index == current indicates it is a new parameter and therefore the same
* value should be returned.index < current indicates the builder wants to reuse a parameter.
The implementation can either return the same value to indicate the parameter can be reused or
return the next index to use (which is shall be the current valueappendQueryPlaceholder in interface SqlClientInternalqueryBuilder - the builder to append toindex - the parameter placeholder indexprotected abstract <T> PromiseInternal<T> promise()
protected abstract <T> PromiseInternal<T> promise(Handler<AsyncResult<T>> handler)
public Query<RowSet<Row>> query(String sql)
SqlClientQuery.execute(io.vertx.core.Handler<io.vertx.core.AsyncResult<T>>) method must be called to execute the query.public PreparedQuery<RowSet<Row>> preparedQuery(String sql)
SqlClientPreparedQuery.execute(io.vertx.sqlclient.Tuple, io.vertx.core.Handler<io.vertx.core.AsyncResult<T>>) or PreparedQuery.executeBatch(java.util.List<io.vertx.sqlclient.Tuple>, io.vertx.core.Handler<io.vertx.core.AsyncResult<T>>)
methods must be called to execute the query.preparedQuery in interface SqlClientCopyright © 2021. All rights reserved.