0

It's my first time in reactive programming and using the spring-data-r2dbc with MySQL and it seems that entities (tables) are not auto-creating as spring-data-JPA does is this the default nature of spring-data-r2dbc or is there something Iam missing in my code?

pom dependencies:-

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-r2dbc</artifactId>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>
        <dependency>
            <groupId>dev.miku</groupId>
            <artifactId>r2dbc-mysql</artifactId>
            <version>0.8.2.RELEASE</version>
        </dependency>

my properties.yml:-

spring:
  r2dbc:
    url: r2dbc:mysql://localhost:3306/productsDB
    username: root
    password: password
    pool:
      validation-query: SELECT 1

main application:

@SpringBootApplication
@EnableR2dbcRepositories
public class SpringbootReactiveApplication {

    public static void main(String[] args) {
        SpringApplication.run(SpringbootReactiveApplication.class, args);
    }

}
Ahmed Hosny
  • 370
  • 4
  • 16
  • 3
    JPA does this, not R2DBC. You will need flyway to manage your schema (which is also adviced for JPA and don't let your provider manage the schema). – M. Deinum Sep 08 '22 at 09:12

0 Answers0