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.
Strategy used to populate, initialize, or clean up a database.
- Since:
- 5.3
- Author:
- Mark Paluch, Keith Donald, Sam Brannen
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<Void>
populate
(Connection connection) Populate, initialize, or clean up the database using the provided R2DBCConnection
.default reactor.core.publisher.Mono<Void>
populate
(ConnectionFactory connectionFactory) Execute the givenDatabasePopulator
against the givenConnectionFactory
.
-
Method Details
-
populate
Populate, initialize, or clean up the database using the provided R2DBCConnection
.- Parameters:
connection
- the R2DBC connection to use to populate the db; already configured and ready to use, must not benull
- Returns:
Mono
that initiates script execution and is notified upon completion- Throws:
ScriptException
- in all other error cases
-
populate
default reactor.core.publisher.Mono<Void> populate(ConnectionFactory connectionFactory) throws DataAccessException Execute the givenDatabasePopulator
against the givenConnectionFactory
.- Parameters:
connectionFactory
- theConnectionFactory
to execute against- Returns:
Mono
that initiatespopulate(Connection)
and is notified upon completion- Throws:
DataAccessException
-