Top Description Methods
org.springframework.r2dbc.connection.init

public Interface DatabasePopulator

Known Direct Implementers
org.springframework.r2dbc.connection.init.ResourceDatabasePopulator, org.springframework.r2dbc.connection.init.CompositeDatabasePopulator
Annotations
@FunctionalInterface
Imports
io.r2dbc.spi.Connection, .ConnectionFactory, reactor.core.publisher.Mono, org.springframework.r2dbc.connection.ConnectionFactoryUtils, org.springframework.util.Assert

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

Method Summary

Modifier and TypeMethod and Description
public Mono<Void>

Returns:

Mono that initiates script execution and is notified upon completion
populate
(Connection
the R2DBC connection to use to populate the db; already configured and ready to use, must not be null
connection
)

Populate, initialize, or clean up the database using the provided R2DBC Connection.

public default Mono<Void>

Returns:

Mono that initiates DatabasePopulator#populate(Connection) and is notified upon completion
populate
(ConnectionFactory
the ConnectionFactory to execute against
connectionFactory
)

Execute the given DatabasePopulator against the given ConnectionFactory.

Method Detail

populateback to summary
public Mono<Void> populate(Connection connection)

Populate, initialize, or clean up the database using the provided R2DBC Connection.

Parameters
connection:Connection

the R2DBC connection to use to populate the db; already configured and ready to use, must not be null

Returns:Mono<Void>

Mono that initiates script execution and is notified upon completion

Exceptions
ScriptException:
in case of any errors
populateback to summary
public default Mono<Void> populate(ConnectionFactory connectionFactory)

Execute the given DatabasePopulator against the given ConnectionFactory.

Parameters
connectionFactory:ConnectionFactory

the ConnectionFactory to execute against

Returns:Mono<Void>

Mono that initiates DatabasePopulator#populate(Connection) and is notified upon completion

Exceptions
ScriptException:
in case of any errors