spring-attic / spring-boot-r2dbc

Experimental Spring Boot support for R2DBC
82 stars 13 forks source link

Add embeded H2 for @DataR2dbcTest #68

Closed hantsy closed 4 years ago

hantsy commented 4 years ago

Like the H2 support for @DataJpaTest , configure an embedded H2 for @DataR2dbcTest to replace the runtime driver if r2dbc-h2 is existed in the dependencies.

        <dependency>
            <groupId>org.springframework.boot.experimental</groupId>
            <artifactId>spring-boot-test-autoconfigure-r2dbc</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.r2dbc</groupId>
            <artifactId>r2dbc-h2</artifactId>
            <scope>test</scope>
        </dependency>

Currently it ignore h2 at all.

mp911de commented 4 years ago

That’s currently not possible because the embedded test database API isn’t usable from R2DBC.

Spring Boot configures a DataSource bean that does not allow introspection. Likely, if the R2DBC support gets merged into Spring Boot proper, we will be able to revisit this feature in.

snicoll commented 4 years ago

This experimental project has run its course and the features have moved to Spring Boot 2.3 proper. This part isn't implemented though. We brainstormed on how this feature can be improved for the plain jdbc use case and I think it could be applicable to r2dbc as well.

Please watch https://github.com/spring-projects/spring-boot/issues/19038, I've just added a comment.