Class MySQLConnection
- All Implemented Interfaces:
MutinyDelegate
The connection object supports all the operations defined in the SqlConnection interface,
in addition it provides MySQL utility command support:
- COM_PING
- COM_CHANGE_USER
- COM_RESET_CONNECTION
- COM_DEBUG
- COM_INIT_DB
- COM_STATISTICS
- COM_SET_OPTION
NOTE: This class has been automatically generated from the original non Mutiny-ified interface.
- See Also:
-
MySQLConnection
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMySQLConnection(io.vertx.mysqlclient.MySQLConnection delegate) Create a new instance ofMySQLConnectiondelegating to the given (non-null) instance ofMySQLConnection.MySQLConnection(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionio.smallrye.mutiny.Uni<Transaction>begin()Begin a transaction and returns aTransactionfor controlling and tracking this transaction.Begin a transaction and returns aTransactionfor controlling and tracking this transaction.Begin a transaction and returns aTransactionfor controlling and tracking this transaction.static MySQLConnectioncast(SqlConnection sqlConnection) Cast aSqlConnectiontoMySQLConnection.io.smallrye.mutiny.Uni<Void>changeUser(io.vertx.mysqlclient.MySQLAuthOptions options) Send a CHANGE_USER command to change the user of the current connection, this operation will also reset connection state.voidchangeUserAndAwait(io.vertx.mysqlclient.MySQLAuthOptions options) Send a CHANGE_USER command to change the user of the current connection, this operation will also reset connection state.changeUserAndForget(io.vertx.mysqlclient.MySQLAuthOptions options) Send a CHANGE_USER command to change the user of the current connection, this operation will also reset connection state.io.smallrye.mutiny.Uni<Void>close()Close the client and release the associated resources.voidClose the client and release the associated resources.Close the client and release the associated resources.closeHandler(Runnable handler) Set an handler called when the connection is closed.static io.smallrye.mutiny.Uni<MySQLConnection>Create a connection to MySQL server with the givenconnectOptions.static io.smallrye.mutiny.Uni<MySQLConnection>Likeconnect(Vertx, MySQLConnectOptions)with options built fromconnectionUri.static MySQLConnectionconnectAndAwait(Vertx vertx, io.vertx.mysqlclient.MySQLConnectOptions connectOptions) Create a connection to MySQL server with the givenconnectOptions.static MySQLConnectionconnectAndAwait(Vertx vertx, String connectionUri) Likeconnect(Vertx, MySQLConnectOptions)with options built fromconnectionUri.static voidconnectAndForget(Vertx vertx, io.vertx.mysqlclient.MySQLConnectOptions connectOptions) Create a connection to MySQL server with the givenconnectOptions.static voidconnectAndForget(Vertx vertx, String connectionUri) Likeconnect(Vertx, MySQLConnectOptions)with options built fromconnectionUri.io.smallrye.mutiny.Uni<Void>debug()Send a DEBUG command to dump debug information to the server's stdout.voidSend a DEBUG command to dump debug information to the server's stdout.Send a DEBUG command to dump debug information to the server's stdout.booleanexceptionHandler(Consumer<Throwable> handler) Set an handler called with connection errors.io.vertx.mysqlclient.MySQLConnectionGet the delegate instance.io.smallrye.mutiny.Uni<String>Send a STATISTICS command to get a human readable string of the server internal status.Send a STATISTICS command to get a human readable string of the server internal status.Send a STATISTICS command to get a human readable string of the server internal status.inthashCode()static MySQLConnectionnewInstance(io.vertx.mysqlclient.MySQLConnection delegate) Creates a new instance of theMySQLConnection.io.smallrye.mutiny.Uni<Void>ping()Send a PING command to check if the server is alive.voidSend a PING command to check if the server is alive.Send a PING command to check if the server is alive.io.smallrye.mutiny.Uni<PreparedStatement>Create a prepared statement using the givensqlstring.io.smallrye.mutiny.Uni<PreparedStatement>Create a prepared statement using the givensqlstring.prepareAndAwait(String sql) Create a prepared statement using the givensqlstring.prepareAndAwait(String sql, io.vertx.sqlclient.PrepareOptions options) Create a prepared statement using the givensqlstring.prepareAndForget(String sql) Create a prepared statement using the givensqlstring.prepareAndForget(String sql, io.vertx.sqlclient.PrepareOptions options) Create a prepared statement using the givensqlstring.io.smallrye.mutiny.Uni<Void>Send a RESET_CONNECTION command to reset the session state.voidSend a RESET_CONNECTION command to reset the session state.Send a RESET_CONNECTION command to reset the session state.io.smallrye.mutiny.Uni<Void>setOption(io.vertx.mysqlclient.MySQLSetOption option) Send a SET_OPTION command to set options for the current connection.voidsetOptionAndAwait(io.vertx.mysqlclient.MySQLSetOption option) Send a SET_OPTION command to set options for the current connection.setOptionAndForget(io.vertx.mysqlclient.MySQLSetOption option) Send a SET_OPTION command to set options for the current connection.io.smallrye.mutiny.Uni<Void>specifySchema(String schemaName) Send a INIT_DB command to change the default schema of the connection.voidspecifySchemaAndAwait(String schemaName) Send a INIT_DB command to change the default schema of the connection.specifySchemaAndForget(String schemaName) Send a INIT_DB command to change the default schema of the connection.toString()Methods inherited from class io.vertx.mutiny.sqlclient.SqlConnection
databaseMetadata, isSSL, newInstance, transactionMethods inherited from class io.vertx.mutiny.sqlclient.SqlClient
newInstance, preparedQuery, preparedQuery, query
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
MySQLConnection
public MySQLConnection(io.vertx.mysqlclient.MySQLConnection delegate) Create a new instance ofMySQLConnectiondelegating to the given (non-null) instance ofMySQLConnection. -
MySQLConnection
-
-
Method Details
-
getDelegate
public io.vertx.mysqlclient.MySQLConnection getDelegate()Get the delegate instance.This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.
- Specified by:
getDelegatein interfaceMutinyDelegate- Overrides:
getDelegatein classSqlConnection- Returns:
- the delegate instance
-
connect
@CheckReturnValue public static io.smallrye.mutiny.Uni<MySQLConnection> connect(Vertx vertx, io.vertx.mysqlclient.MySQLConnectOptions connectOptions) Create a connection to MySQL server with the givenconnectOptions.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
vertx- the vertx instanceconnectOptions- the options for the connection- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
io.vertx.mysqlclient.MySQLConnection#connect(Vertx, MySQLConnectOptions)
-
connectAndAwait
public static MySQLConnection connectAndAwait(Vertx vertx, io.vertx.mysqlclient.MySQLConnectOptions connectOptions) Create a connection to MySQL server with the givenconnectOptions.Unlike the bare Vert.x variant, this method returns a
MySQLConnection. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Parameters:
vertx- the vertx instanceconnectOptions- the options for the connection- Returns:
- The operation result
- See Also:
-
io.vertx.mysqlclient.MySQLConnection#connect(Vertx, MySQLConnectOptions)
-
connectAndForget
public static void connectAndForget(Vertx vertx, io.vertx.mysqlclient.MySQLConnectOptions connectOptions) Create a connection to MySQL server with the givenconnectOptions.Unlike the bare Vert.x variant, this method ignores the
MySQLConnectionresult or any failure.- Parameters:
vertx- the vertx instanceconnectOptions- the options for the connection- See Also:
-
io.vertx.mysqlclient.MySQLConnection#connect(Vertx, MySQLConnectOptions)
-
connect
@CheckReturnValue public static io.smallrye.mutiny.Uni<MySQLConnection> connect(Vertx vertx, String connectionUri) Likeconnect(Vertx, MySQLConnectOptions)with options built fromconnectionUri.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
io.vertx.mysqlclient.MySQLConnection#connect(Vertx, String)
-
connectAndAwait
Likeconnect(Vertx, MySQLConnectOptions)with options built fromconnectionUri.Unlike the bare Vert.x variant, this method returns a
MySQLConnection. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Returns:
- The operation result
- See Also:
-
io.vertx.mysqlclient.MySQLConnection#connect(Vertx, String)
-
connectAndForget
Likeconnect(Vertx, MySQLConnectOptions)with options built fromconnectionUri.Unlike the bare Vert.x variant, this method ignores the
MySQLConnectionresult or any failure.- See Also:
-
io.vertx.mysqlclient.MySQLConnection#connect(Vertx, String)
-
ping
Send a PING command to check if the server is alive.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
MySQLConnection.ping()
-
pingAndAwait
public void pingAndAwait()Send a PING command to check if the server is alive.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- See Also:
-
MySQLConnection.ping()
-
pingAndForget
Send a PING command to check if the server is alive.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
MySQLConnection.ping()
-
specifySchema
Send a INIT_DB command to change the default schema of the connection.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
schemaName- name of the schema to change to- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
MySQLConnection.specifySchema(String)
-
specifySchemaAndAwait
Send a INIT_DB command to change the default schema of the connection.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Parameters:
schemaName- name of the schema to change to- See Also:
-
MySQLConnection.specifySchema(String)
-
specifySchemaAndForget
Send a INIT_DB command to change the default schema of the connection.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
schemaName- name of the schema to change to- Returns:
- The current instance to chain operations if needed.
- See Also:
-
MySQLConnection.specifySchema(String)
-
getInternalStatistics
Send a STATISTICS command to get a human readable string of the server internal status.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
MySQLConnection.getInternalStatistics()
-
getInternalStatisticsAndAwait
Send a STATISTICS command to get a human readable string of the server internal status.Unlike the bare Vert.x variant, this method returns a
String. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Returns:
- The operation result
- See Also:
-
MySQLConnection.getInternalStatistics()
-
getInternalStatisticsAndForget
Send a STATISTICS command to get a human readable string of the server internal status.Unlike the bare Vert.x variant, this method ignores the
Stringresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
MySQLConnection.getInternalStatistics()
-
setOption
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> setOption(io.vertx.mysqlclient.MySQLSetOption option) Send a SET_OPTION command to set options for the current connection.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
option- the options to set- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
MySQLConnection.setOption(MySQLSetOption)
-
setOptionAndAwait
public void setOptionAndAwait(io.vertx.mysqlclient.MySQLSetOption option) Send a SET_OPTION command to set options for the current connection.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Parameters:
option- the options to set- See Also:
-
MySQLConnection.setOption(MySQLSetOption)
-
setOptionAndForget
Send a SET_OPTION command to set options for the current connection.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
option- the options to set- Returns:
- The current instance to chain operations if needed.
- See Also:
-
MySQLConnection.setOption(MySQLSetOption)
-
resetConnection
Send a RESET_CONNECTION command to reset the session state.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
MySQLConnection.resetConnection()
-
resetConnectionAndAwait
public void resetConnectionAndAwait()Send a RESET_CONNECTION command to reset the session state.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- See Also:
-
MySQLConnection.resetConnection()
-
resetConnectionAndForget
Send a RESET_CONNECTION command to reset the session state.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
MySQLConnection.resetConnection()
-
debug
Send a DEBUG command to dump debug information to the server's stdout.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
MySQLConnection.debug()
-
debugAndAwait
public void debugAndAwait()Send a DEBUG command to dump debug information to the server's stdout.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- See Also:
-
MySQLConnection.debug()
-
debugAndForget
Send a DEBUG command to dump debug information to the server's stdout.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
MySQLConnection.debug()
-
changeUser
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> changeUser(io.vertx.mysqlclient.MySQLAuthOptions options) Send a CHANGE_USER command to change the user of the current connection, this operation will also reset connection state.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
MySQLConnection.changeUser(MySQLAuthOptions)
-
changeUserAndAwait
public void changeUserAndAwait(io.vertx.mysqlclient.MySQLAuthOptions options) Send a CHANGE_USER command to change the user of the current connection, this operation will also reset connection state.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- See Also:
-
MySQLConnection.changeUser(MySQLAuthOptions)
-
changeUserAndForget
Send a CHANGE_USER command to change the user of the current connection, this operation will also reset connection state.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
MySQLConnection.changeUser(MySQLAuthOptions)
-
begin
Begin a transaction and returns aTransactionfor controlling and tracking this transaction. When the connection is explicitely closed, any inflight transaction is rollbacked.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Overrides:
beginin classSqlConnection- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
SqlConnection.begin()
-
beginAndAwait
Begin a transaction and returns aTransactionfor controlling and tracking this transaction. When the connection is explicitely closed, any inflight transaction is rollbacked.Unlike the bare Vert.x variant, this method returns a
Transaction. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Overrides:
beginAndAwaitin classSqlConnection- Returns:
- The operation result
- See Also:
-
SqlConnection.begin()
-
beginAndForget
Begin a transaction and returns aTransactionfor controlling and tracking this transaction. When the connection is explicitely closed, any inflight transaction is rollbacked.Unlike the bare Vert.x variant, this method ignores the
Transactionresult or any failure.- Overrides:
beginAndForgetin classSqlConnection- Returns:
- The current instance to chain operations if needed.
- See Also:
-
SqlConnection.begin()
-
prepare
@CheckReturnValue public io.smallrye.mutiny.Uni<PreparedStatement> prepare(String sql, io.vertx.sqlclient.PrepareOptions options) Create a prepared statement using the givensqlstring.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Overrides:
preparein classSqlConnection- Parameters:
sql- the sql- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
SqlConnection.prepare(String, PrepareOptions)
-
prepareAndAwait
Create a prepared statement using the givensqlstring.Unlike the bare Vert.x variant, this method returns a
PreparedStatement. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Overrides:
prepareAndAwaitin classSqlConnection- Parameters:
sql- the sql- Returns:
- The operation result
- See Also:
-
SqlConnection.prepare(String, PrepareOptions)
-
prepareAndForget
Create a prepared statement using the givensqlstring.Unlike the bare Vert.x variant, this method ignores the
PreparedStatementresult or any failure.- Overrides:
prepareAndForgetin classSqlConnection- Parameters:
sql- the sql- Returns:
- The current instance to chain operations if needed.
- See Also:
-
SqlConnection.prepare(String, PrepareOptions)
-
close
Close the client and release the associated resources.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Overrides:
closein classSqlConnection- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
SqlClient.close()
-
closeAndAwait
public void closeAndAwait()Close the client and release the associated resources.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Overrides:
closeAndAwaitin classSqlConnection- See Also:
-
SqlClient.close()
-
closeAndForget
Close the client and release the associated resources.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Overrides:
closeAndForgetin classSqlConnection- Returns:
- The current instance to chain operations if needed.
- See Also:
-
SqlClient.close()
-
prepare
Create a prepared statement using the givensqlstring.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Overrides:
preparein classSqlConnection- Parameters:
sql- the sql- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
SqlConnection.prepare(String)
-
prepareAndAwait
Create a prepared statement using the givensqlstring.Unlike the bare Vert.x variant, this method returns a
PreparedStatement. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Overrides:
prepareAndAwaitin classSqlConnection- Parameters:
sql- the sql- Returns:
- The operation result
- See Also:
-
SqlConnection.prepare(String)
-
prepareAndForget
Create a prepared statement using the givensqlstring.Unlike the bare Vert.x variant, this method ignores the
PreparedStatementresult or any failure.- Overrides:
prepareAndForgetin classSqlConnection- Parameters:
sql- the sql- Returns:
- The current instance to chain operations if needed.
- See Also:
-
SqlConnection.prepare(String)
-
exceptionHandler
Set an handler called with connection errors.- Overrides:
exceptionHandlerin classSqlConnection- Parameters:
handler- the handler- Returns:
- a reference to this, so the API can be used fluently
-
closeHandler
Set an handler called when the connection is closed.- Overrides:
closeHandlerin classSqlConnection- Parameters:
handler- the handler- Returns:
- a reference to this, so the API can be used fluently
-
cast
Cast aSqlConnectiontoMySQLConnection. This is mostly useful for Vert.x generated APIs like RxJava/Mutiny.- Parameters:
sqlConnection- the connection to cast- Returns:
- a
instance
-
newInstance
Creates a new instance of theMySQLConnection. -
hashCode
public int hashCode()- Overrides:
hashCodein classSqlConnection
-
equals
- Overrides:
equalsin classSqlConnection
-
toString
- Overrides:
toStringin classSqlConnection
-