Interface DatabaseClient.GenericExecuteSpec

Enclosing interface:
DatabaseClient

public static interface DatabaseClient.GenericExecuteSpec
Contract for specifying an SQL call along with options leading to the execution.
  • Method Details

    • bind

      DatabaseClient.GenericExecuteSpec bind(int index, Object value)
      Bind a non-null value to a parameter identified by its index. value can be either a scalar value or Parameter.
      Parameters:
      index - zero based index to bind the parameter to
      value - either a scalar value or Parameter
    • bindNull

      DatabaseClient.GenericExecuteSpec bindNull(int index, Class<?> type)
      Bind a null value to a parameter identified by its index.
      Parameters:
      index - zero based index to bind the parameter to
      type - the parameter type
    • bind

      Bind a non-null value to a parameter identified by its name.
      Parameters:
      name - the name of the parameter
      value - the value to bind
    • bindNull

      Bind a null value to a parameter identified by its name.
      Parameters:
      name - the name of the parameter
      type - the parameter type
    • filter

      default DatabaseClient.GenericExecuteSpec filter(Function<? super Statement,? extends Statement> filterFunction)
      Add the given filter to the end of the filter chain.

      Filter functions are typically used to invoke methods on the Statement before it is executed. For example:

       DatabaseClient client = …;
       client.sql("SELECT book_id FROM book").filter(statement -> statement.fetchSize(100))
       
      Parameters:
      filterFunction - the filter to be added to the chain
    • filter

      Add the given filter to the end of the filter chain.

      Filter functions are typically used to invoke methods on the Statement before it is executed. For example:

       DatabaseClient client = …;
       client.sql("SELECT book_id FROM book").filter((statement, next) -> next.execute(statement.fetchSize(100)))
       
      Parameters:
      filter - the filter to be added to the chain
    • map

      <R> RowsFetchSpec<R> map(Function<? super Readable,R> mappingFunction)
      Configure a result mapping function and enter the execution stage.
      Type Parameters:
      R - the result type
      Parameters:
      mappingFunction - a function that maps from Readable to the result type
      Returns:
      a FetchSpec for configuration what to fetch
      Since:
      6.0
    • map

      <R> RowsFetchSpec<R> map(BiFunction<Row,RowMetadata,R> mappingFunction)
      Configure a result mapping function and enter the execution stage.
      Type Parameters:
      R - the result type
      Parameters:
      mappingFunction - a function that maps from Row and RowMetadata to the result type
      Returns:
      a FetchSpec for configuration what to fetch
    • flatMap

      <R> reactor.core.publisher.Flux<R> flatMap(Function<Result,Publisher<R>> mappingFunction)
      Perform the SQL call and apply function to the Result.
      Type Parameters:
      R - the result type
      Parameters:
      mappingFunction - a function that maps from Result into a result publisher
      Returns:
      a Flux that emits mapped elements
      Since:
      6.0
      See Also:
    • fetch

      Perform the SQL call and retrieve the result by entering the execution stage.
    • then

      reactor.core.publisher.Mono<Void> then()
      Perform the SQL call and return a Mono that completes without result on statement completion.
      Returns:
      a Mono ignoring its payload (actively dropping)