Class MySQLConnection


  • public class MySQLConnection
    extends SqlConnection
    An interface which represents a connection to MySQL server.

    The connection object supports all the operations defined in the 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 using Vert.x codegen.

    • Constructor Detail

      • MySQLConnection

        public MySQLConnection​(io.vertx.mysqlclient.MySQLConnection delegate)
      • MySQLConnection

        public MySQLConnection​(Object delegate)
    • Method Detail

      • getDelegate

        public io.vertx.mysqlclient.MySQLConnection getDelegate()
        Overrides:
        getDelegate in class SqlConnection
      • 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 given connectOptions.

        Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

        Parameters:
        vertx - the vertx instance
        connectOptions - the options for the connection
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • connectAndAwait

        public static MySQLConnection connectAndAwait​(Vertx vertx,
                                                      io.vertx.mysqlclient.MySQLConnectOptions connectOptions)
        Blocking variant of connect(io.vertx.mutiny.core.Vertx,MySQLConnectOptions).

        This method waits 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 a RuntimeException).

        Parameters:
        vertx - the vertx instance
        connectOptions - the options for the connection
        Returns:
        the MySQLConnection instance produced by the operation.
      • connectAndAwait

        public static MySQLConnection connectAndAwait​(Vertx vertx,
                                                      String connectionUri)
        Blocking variant of connect(io.vertx.mutiny.core.Vertx,String).

        This method waits 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 a RuntimeException).

        Parameters:
        vertx -
        connectionUri -
        Returns:
        the MySQLConnection instance produced by the operation.
      • prepare

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<PreparedStatement> prepare​(String sql)

        Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

        Overrides:
        prepare in class SqlConnection
        Parameters:
        sql -
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • prepareAndAwait

        public PreparedStatement prepareAndAwait​(String sql)
        Blocking variant of prepare(String).

        This method waits 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 a RuntimeException).

        Overrides:
        prepareAndAwait in class SqlConnection
        Parameters:
        sql -
        Returns:
        the PreparedStatement instance produced by the operation.
      • prepareAndForget

        public MySQLConnection prepareAndForget​(String sql)
        Variant of prepare(String) that ignores the result of the operation.

        This method subscribes on the result of prepare(String), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from prepare(String) but you don't need to compose it with other operations.

        Overrides:
        prepareAndForget in class SqlConnection
        Parameters:
        sql -
        Returns:
        the instance of MySQLConnection to chain method calls.
      • ping

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<Void> ping()
        Send a PING command to check if the server is alive.

        Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • pingAndAwait

        public Void pingAndAwait()
        Blocking variant of ping().

        This method waits 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 a RuntimeException).

        Returns:
        the Void instance produced by the operation.
      • pingAndForget

        public MySQLConnection pingAndForget()
        Variant of ping() that ignores the result of the operation.

        This method subscribes on the result of ping(), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from ping() but you don't need to compose it with other operations.

        Returns:
        the instance of MySQLConnection to chain method calls.
      • specifySchema

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<Void> specifySchema​(String schemaName)
        Send a INIT_DB command to change the default schema of the connection.

        Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

        Parameters:
        schemaName - name of the schema to change to
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • specifySchemaAndAwait

        public Void specifySchemaAndAwait​(String schemaName)
        Blocking variant of specifySchema(String).

        This method waits 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 a RuntimeException).

        Parameters:
        schemaName - name of the schema to change to
        Returns:
        the Void instance produced by the operation.
      • specifySchemaAndForget

        public MySQLConnection specifySchemaAndForget​(String schemaName)
        Variant of specifySchema(String) that ignores the result of the operation.

        This method subscribes on the result of specifySchema(String), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from specifySchema(String) but you don't need to compose it with other operations.

        Parameters:
        schemaName - name of the schema to change to
        Returns:
        the instance of MySQLConnection to chain method calls.
      • getInternalStatistics

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<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. Don't forget to subscribe on it to trigger the operation.

        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • getInternalStatisticsAndAwait

        public String getInternalStatisticsAndAwait()
        Blocking variant of getInternalStatistics().

        This method waits 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 a RuntimeException).

        Returns:
        the String instance produced by the operation.
      • getInternalStatisticsAndForget

        public MySQLConnection getInternalStatisticsAndForget()
        Variant of getInternalStatistics() that ignores the result of the operation.

        This method subscribes on the result of getInternalStatistics(), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from getInternalStatistics() but you don't need to compose it with other operations.

        Returns:
        the instance of MySQLConnection to chain method calls.
      • 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. Don't forget to subscribe on it to trigger the operation.

        Parameters:
        option - the options to set
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • setOptionAndAwait

        public Void setOptionAndAwait​(io.vertx.mysqlclient.MySQLSetOption option)
        Blocking variant of setOption(MySQLSetOption).

        This method waits 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 a RuntimeException).

        Parameters:
        option - the options to set
        Returns:
        the Void instance produced by the operation.
      • setOptionAndForget

        public MySQLConnection setOptionAndForget​(io.vertx.mysqlclient.MySQLSetOption option)
        Variant of setOption(MySQLSetOption) that ignores the result of the operation.

        This method subscribes on the result of setOption(MySQLSetOption), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from setOption(MySQLSetOption) but you don't need to compose it with other operations.

        Parameters:
        option - the options to set
        Returns:
        the instance of MySQLConnection to chain method calls.
      • resetConnection

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<Void> resetConnection()
        Send a RESET_CONNECTION command to reset the session state.

        Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • resetConnectionAndAwait

        public Void resetConnectionAndAwait()
        Blocking variant of resetConnection().

        This method waits 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 a RuntimeException).

        Returns:
        the Void instance produced by the operation.
      • resetConnectionAndForget

        public MySQLConnection resetConnectionAndForget()
        Variant of resetConnection() that ignores the result of the operation.

        This method subscribes on the result of resetConnection(), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from resetConnection() but you don't need to compose it with other operations.

        Returns:
        the instance of MySQLConnection to chain method calls.
      • debug

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<Void> 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. Don't forget to subscribe on it to trigger the operation.

        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • debugAndAwait

        public Void debugAndAwait()
        Blocking variant of debug().

        This method waits 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 a RuntimeException).

        Returns:
        the Void instance produced by the operation.
      • debugAndForget

        public MySQLConnection debugAndForget()
        Variant of debug() that ignores the result of the operation.

        This method subscribes on the result of debug(), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from debug() but you don't need to compose it with other operations.

        Returns:
        the instance of MySQLConnection to chain method calls.
      • 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. Don't forget to subscribe on it to trigger the operation.

        Parameters:
        options - authentication options
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • changeUserAndAwait

        public Void changeUserAndAwait​(io.vertx.mysqlclient.MySQLAuthOptions options)
        Blocking variant of changeUser(MySQLAuthOptions).

        This method waits 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 a RuntimeException).

        Parameters:
        options - authentication options
        Returns:
        the Void instance produced by the operation.
      • changeUserAndForget

        public MySQLConnection changeUserAndForget​(io.vertx.mysqlclient.MySQLAuthOptions options)
        Variant of changeUser(MySQLAuthOptions) that ignores the result of the operation.

        This method subscribes on the result of changeUser(MySQLAuthOptions), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from changeUser(MySQLAuthOptions) but you don't need to compose it with other operations.

        Parameters:
        options - authentication options
        Returns:
        the instance of MySQLConnection to chain method calls.
      • newInstance

        public static MySQLConnection newInstance​(io.vertx.mysqlclient.MySQLConnection arg)