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:
  • Method Details

    • populate

      reactor.core.publisher.Mono<Void> populate(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(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