Open jamesward opened 2 years ago
Friendly note to those who are looking for an alternative: use ResourceDatabasePopulator
@Profile("test")
@Configuration
open class TestContainerPopulationConfig(
private val connectionFactory: ConnectionFactory
) : InitializingBean {
override fun afterPropertiesSet() {
runBlocking {
val databasePopulator = ResourceDatabasePopulator()
databasePopulator.addScripts(
ClassPathResource("db/db-schema.sql"),
)
databasePopulator.populate(connectionFactory).awaitFirstOrNull()
}
}
}
although it would still be nice if TC_INITSCRIPT works for R2DBC anyways 😃
Please add a way to specify a
TC_INITSCRIPT
with the R2DBC automagic stuffr2dbc:tc
(like exists on thejdbc:tc
stuff). Thanks!