Class SqlClientHelper


  • public class SqlClientHelper
    extends Object
    Utilities for generating Multi and Uni with a SqlClient.
    • Method Detail

      • inTransactionMulti

        public static <T> io.smallrye.mutiny.Multi<T> inTransactionMulti​(Pool pool,
                                                                         Function<SqlClient,​io.smallrye.mutiny.Multi<T>> sourceSupplier)
        Generates a Multi from operations executed inside a Transaction.
        Type Parameters:
        T - the type of the items emitted by the Multi
        Parameters:
        pool - the Pool
        sourceSupplier - a user-provided function returning a Multi generated by interacting with the given SqlClient
        Returns:
        a Multi generated from operations executed inside a Transaction
      • inTransactionUni

        public static <T> io.smallrye.mutiny.Uni<T> inTransactionUni​(Pool pool,
                                                                     Function<SqlClient,​io.smallrye.mutiny.Uni<T>> sourceSupplier)
        Generates a Uni from operations executed inside a Transaction.
        Type Parameters:
        T - the type of the items emitted by the Uni
        Parameters:
        pool - the Pool
        sourceSupplier - a user-provided function returning a Uni generated by interacting with the given SqlClient
        Returns:
        a Uni generated from operations executed inside a Transaction
      • usingConnectionMulti

        public static <T> io.smallrye.mutiny.Multi<T> usingConnectionMulti​(Pool pool,
                                                                           Function<SqlConnection,​io.smallrye.mutiny.Multi<T>> sourceSupplier)
        Generates a Multi from SqlConnection operations.
        Type Parameters:
        T - the type of the items emitted by the Multi
        Parameters:
        pool - the Pool
        sourceSupplier - a user-provided function returning a Multi generated by interacting with the given SqlConnection
        Returns:
        a Multi generated from SqlConnection operations
      • usingConnectionUni

        public static <T> io.smallrye.mutiny.Uni<T> usingConnectionUni​(Pool pool,
                                                                       Function<SqlConnection,​io.smallrye.mutiny.Uni<T>> sourceSupplier)
        Generates a Uni from SqlConnection operations.
        Type Parameters:
        T - the type of the item emitted by the Uni
        Parameters:
        pool - the Pool
        sourceSupplier - a user-provided function returning a Uni generated by interacting with the given SqlConnection
        Returns:
        a Uni generated from SqlConnection operations