org.springframework.r2dbc.connection.init

## Interface DatabasePopulator

- All Known Implementing Classes:
    CompositeDatabasePopulator, ResourceDatabasePopulator
  Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

      @FunctionalInterface
      public interface DatabasePopulator

  Strategy used to populate, initialize, or clean up a database.
  Since:
    5.3
  Author:
    Mark Paluch, Keith Donald, Sam Brannen
  See Also:
    `ResourceDatabasePopulator`, `ConnectionFactoryInitializer`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `reactor.core.publisher.Mono<Void>` | `populate(io.r2dbc.spi.Connection connection)` Populate, initialize, or clean up the database using the provided R2DBC `Connection`.
    `default reactor.core.publisher.Mono<Void>` | `populate(io.r2dbc.spi.ConnectionFactory connectionFactory)` Execute the given `DatabasePopulator` against the given `ConnectionFactory`.

- - ### Method Detail

    - #### populate

          reactor.core.publisher.Mono<Void> populate(io.r2dbc.spi.Connection connection)

      Populate, initialize, or clean up the database using the provided R2DBC `Connection`.
      Parameters:
        `connection` - the R2DBC connection to use to populate the db; already configured and ready to use, must not be `null`
      Returns:
        `Mono` that initiates script execution and is notified upon completion
      Throws:
        `ScriptException` - in case of any errors

    - #### populate

          default reactor.core.publisher.Mono<Void> populate(io.r2dbc.spi.ConnectionFactory connectionFactory)

      Execute the given `DatabasePopulator` against the given `ConnectionFactory`.
      Parameters:
        `connectionFactory` - the `ConnectionFactory` to execute against
      Returns:
        `Mono` that initiates `populate(Connection)` and is notified upon completion
      Throws:
        `ScriptException` - in case of any errors