io.vertx.reactivex.ext.sql

## Class SQLClientHelper

- java.lang.Object
- - io.vertx.reactivex.ext.sql.SQLClientHelper

-     public class SQLClientHelper
      extends Object

  Utilities for generating observables with a `SQLClient`.
  Author:
    Thomas Segismont

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Completable` | `inTransactionCompletable(SQLClient client, java.util.function.Function<SQLConnection,Completable> sourceSupplier)` Generates a `Completable` from `SQLConnection` operations executed inside a transaction.
    `static <T> Flowable<T>` | `inTransactionFlowable(SQLClient client, java.util.function.Function<SQLConnection,Flowable<T>> sourceSupplier)` Generates a `Flowable` from `SQLConnection` operations executed inside a transaction.
    `static <T> Maybe<T>` | `inTransactionMaybe(SQLClient client, java.util.function.Function<SQLConnection,Maybe<T>> sourceSupplier)` Generates a `Maybe` from `SQLConnection` operations executed inside a transaction.
    `static <T> Observable<T>` | `inTransactionObservable(SQLClient client, java.util.function.Function<SQLConnection,Observable<T>> sourceSupplier)` Generates a `Observable` from `SQLConnection` operations executed inside a transaction.
    `static <T> Single<T>` | `inTransactionSingle(SQLClient client, java.util.function.Function<SQLConnection,Single<T>> sourceSupplier)` Generates a `Single` from `SQLConnection` operations executed inside a transaction.
    `static CompletableTransformer` | `txCompletableTransformer(SQLConnection sqlConnection)` Creates a `CompletableTransformer` decorating a `Completable` with transaction management for a given `SQLConnection`.
    `static <T> FlowableTransformer<T,T>` | `txFlowableTransformer(SQLConnection sqlConnection)` Creates a `FlowableTransformer` decorating a `Flowable` with transaction management for a given `SQLConnection`.
    `static <T> MaybeTransformer<T,T>` | `txMaybeTransformer(SQLConnection sqlConnection)` Creates a `MaybeTransformer` decorating a `Maybe` with transaction management for a given `SQLConnection`.
    `static <T> ObservableTransformer<T,T>` | `txObservableTransformer(SQLConnection sqlConnection)` Creates a `ObservableTransformer` decorating an `Observable` with transaction management for a given `SQLConnection`.
    `static <T> SingleTransformer<T,T>` | `txSingleTransformer(SQLConnection sqlConnection)` Creates a `SingleTransformer` decorating a `Single` with transaction management for a given `SQLConnection`.
    `static Completable` | `usingConnectionCompletable(SQLClient client, java.util.function.Function<SQLConnection,Completable> sourceSupplier)` Generates a `Completable` from `SQLConnection` operations.
    `static <T> Flowable<T>` | `usingConnectionFlowable(SQLClient client, java.util.function.Function<SQLConnection,Flowable<T>> sourceSupplier)` Generates a `Flowable` from `SQLConnection` operations.
    `static <T> Maybe<T>` | `usingConnectionMaybe(SQLClient client, java.util.function.Function<SQLConnection,Maybe<T>> sourceSupplier)` Generates a `Maybe` from `SQLConnection` operations.
    `static <T> Observable<T>` | `usingConnectionObservable(SQLClient client, java.util.function.Function<SQLConnection,Observable<T>> sourceSupplier)` Generates a `Observable` from `SQLConnection` operations.
    `static <T> Single<T>` | `usingConnectionSingle(SQLClient client, java.util.function.Function<SQLConnection,Single<T>> sourceSupplier)` Generates a `Single` from `SQLConnection` operations.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### txFlowableTransformer

          public static <T> FlowableTransformer<T,T> txFlowableTransformer(SQLConnection sqlConnection)

      Creates a `FlowableTransformer` decorating a `Flowable` with transaction management for a given `SQLConnection`.

      If the upstream `Flowable` completes (onComplete), the transaction is committed. If the upstream `Flowable` emits an error (onError), the transaction is rollbacked.

      Eventually, the given `SQLConnection` is put back in autocommit mode.

      Type Parameters:
        `T` - the type of the items emitted by the upstream `Flowable`
      Parameters:
        `sqlConnection` - the `SQLConnection` used for database operations and transaction management
      Returns:
        a `FlowableTransformer` decorating a `Flowable` with transaction management

    - #### inTransactionFlowable

          public static <T> Flowable<T> inTransactionFlowable(SQLClient client,
                                                              java.util.function.Function<SQLConnection,Flowable<T>> sourceSupplier)

      Generates a `Flowable` from `SQLConnection` operations executed inside a transaction.
      Type Parameters:
        `T` - the type of the items emitted by the `Flowable`
      Parameters:
        `client` - the `SQLClient`
        `sourceSupplier` - a user-provided function returning a `Flowable` generated by interacting with the given `SQLConnection`
      Returns:
        a `Flowable` generated from `SQLConnection` operations executed inside a transaction

    - #### txObservableTransformer

          public static <T> ObservableTransformer<T,T> txObservableTransformer(SQLConnection sqlConnection)

      Creates a `ObservableTransformer` decorating an `Observable` with transaction management for a given `SQLConnection`.

      If the upstream `Observable` completes (onComplete), the transaction is committed. If the upstream `Observable` emits an error (onError), the transaction is rollbacked.

      Eventually, the given `SQLConnection` is put back in autocommit mode.

      Type Parameters:
        `T` - the type of the items emitted by the upstream `Observable`
      Parameters:
        `sqlConnection` - the `SQLConnection` used for database operations and transaction management
      Returns:
        a `ObservableTransformer` decorating an `Observable` with transaction management

    - #### inTransactionObservable

          public static <T> Observable<T> inTransactionObservable(SQLClient client,
                                                                  java.util.function.Function<SQLConnection,Observable<T>> sourceSupplier)

      Generates a `Observable` from `SQLConnection` operations executed inside a transaction.
      Type Parameters:
        `T` - the type of the items emitted by the `Observable`
      Parameters:
        `client` - the `SQLClient`
        `sourceSupplier` - a user-provided function returning a `Observable` generated by interacting with the given `SQLConnection`
      Returns:
        an `Observable` generated from `SQLConnection` operations executed inside a transaction

    - #### txSingleTransformer

          public static <T> SingleTransformer<T,T> txSingleTransformer(SQLConnection sqlConnection)

      Creates a `SingleTransformer` decorating a `Single` with transaction management for a given `SQLConnection`.

      If the upstream `Single` emits a value (onSuccess), the transaction is committed. If the upstream `Single` emits an error (onError), the transaction is rollbacked.

      Eventually, the given `SQLConnection` is put back in autocommit mode.

      Type Parameters:
        `T` - the type of the item emitted by the upstream `Single`
      Parameters:
        `sqlConnection` - the `SQLConnection` used for database operations and transaction management
      Returns:
        a `SingleTransformer` decorating a `Single` with transaction management

    - #### inTransactionSingle

          public static <T> Single<T> inTransactionSingle(SQLClient client,
                                                          java.util.function.Function<SQLConnection,Single<T>> sourceSupplier)

      Generates a `Single` from `SQLConnection` operations executed inside a transaction.
      Type Parameters:
        `T` - the type of the item emitted by the `Single`
      Parameters:
        `client` - the `SQLClient`
        `sourceSupplier` - a user-provided function returning a `Single` generated by interacting with the given `SQLConnection`
      Returns:
        a `Single` generated from `SQLConnection` operations executed inside a transaction

    - #### txMaybeTransformer

          public static <T> MaybeTransformer<T,T> txMaybeTransformer(SQLConnection sqlConnection)

      Creates a `MaybeTransformer` decorating a `Maybe` with transaction management for a given `SQLConnection`.

      If the upstream `Maybe` emits a value (onSuccess) or completes (onComplete), the transaction is committed. If the upstream `Maybe` emits an error (onError), the transaction is rollbacked.

      Eventually, the given `SQLConnection` is put back in autocommit mode.

      Type Parameters:
        `T` - the type of the item emitted by the upstream `Maybe`
      Parameters:
        `sqlConnection` - the `SQLConnection` used for database operations and transaction management
      Returns:
        a `MaybeTransformer` decorating a `Maybe` with transaction management

    - #### inTransactionMaybe

          public static <T> Maybe<T> inTransactionMaybe(SQLClient client,
                                                        java.util.function.Function<SQLConnection,Maybe<T>> sourceSupplier)

      Generates a `Maybe` from `SQLConnection` operations executed inside a transaction.
      Type Parameters:
        `T` - the type of the item emitted by the `Maybe`
      Parameters:
        `client` - the `SQLClient`
        `sourceSupplier` - a user-provided function returning a `Maybe` generated by interacting with the given `SQLConnection`
      Returns:
        a `Maybe` generated from `SQLConnection` operations executed inside a transaction

    - #### txCompletableTransformer

          public static CompletableTransformer txCompletableTransformer(SQLConnection sqlConnection)

      Creates a `CompletableTransformer` decorating a `Completable` with transaction management for a given `SQLConnection`.

      If the upstream `Completable` completes (onComplete), the transaction is committed. If the upstream `Completable` emits an error (onError), the transaction is rollbacked.

      Eventually, the given `SQLConnection` is put back in autocommit mode.

      Parameters:
        `sqlConnection` - the `SQLConnection` used for database operations and transaction management
      Returns:
        a `CompletableTransformer` decorating a `Completable` with transaction management

    - #### inTransactionCompletable

          public static Completable inTransactionCompletable(SQLClient client,
                                                             java.util.function.Function<SQLConnection,Completable> sourceSupplier)

      Generates a `Completable` from `SQLConnection` operations executed inside a transaction.
      Parameters:
        `client` - the `SQLClient`
        `sourceSupplier` - a user-provided function returning a `Completable` generated by interacting with the given `SQLConnection`
      Returns:
        a `Completable` generated from `SQLConnection` operations executed inside a transaction

    - #### usingConnectionFlowable

          public static <T> Flowable<T> usingConnectionFlowable(SQLClient client,
                                                                java.util.function.Function<SQLConnection,Flowable<T>> sourceSupplier)

      Generates a `Flowable` from `SQLConnection` operations.
      Type Parameters:
        `T` - the type of the items emitted by the `Flowable`
      Parameters:
        `client` - the `SQLClient`
        `sourceSupplier` - a user-provided function returning a `Flowable` generated by interacting with the given `SQLConnection`
      Returns:
        a `Flowable` generated from `SQLConnection` operations

    - #### usingConnectionObservable

          public static <T> Observable<T> usingConnectionObservable(SQLClient client,
                                                                    java.util.function.Function<SQLConnection,Observable<T>> sourceSupplier)

      Generates a `Observable` from `SQLConnection` operations.
      Type Parameters:
        `T` - the type of the items emitted by the `Observable`
      Parameters:
        `client` - the `SQLClient`
        `sourceSupplier` - a user-provided function returning a `Observable` generated by interacting with the given `SQLConnection`
      Returns:
        an `Observable` generated from `SQLConnection` operations

    - #### usingConnectionSingle

          public static <T> Single<T> usingConnectionSingle(SQLClient client,
                                                            java.util.function.Function<SQLConnection,Single<T>> sourceSupplier)

      Generates a `Single` from `SQLConnection` operations.
      Type Parameters:
        `T` - the type of the item emitted by the `Single`
      Parameters:
        `client` - the `SQLClient`
        `sourceSupplier` - a user-provided function returning a `Single` generated by interacting with the given `SQLConnection`
      Returns:
        a `Single` generated from `SQLConnection` operations

    - #### usingConnectionMaybe

          public static <T> Maybe<T> usingConnectionMaybe(SQLClient client,
                                                          java.util.function.Function<SQLConnection,Maybe<T>> sourceSupplier)

      Generates a `Maybe` from `SQLConnection` operations.
      Type Parameters:
        `T` - the type of the item emitted by the `Maybe`
      Parameters:
        `client` - the `SQLClient`
        `sourceSupplier` - a user-provided function returning a `Maybe` generated by interacting with the given `SQLConnection`
      Returns:
        a `Maybe` generated from `SQLConnection` operations

    - #### usingConnectionCompletable

          public static Completable usingConnectionCompletable(SQLClient client,
                                                               java.util.function.Function<SQLConnection,Completable> sourceSupplier)

      Generates a `Completable` from `SQLConnection` operations.
      Parameters:
        `client` - the `SQLClient`
        `sourceSupplier` - a user-provided function returning a `Completable` generated by interacting with the given `SQLConnection`
      Returns:
        a `Completable` generated from `SQLConnection` operations

Copyright © 2021 Eclipse. All rights reserved.