Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Spring Data R2DBC basics

This projects shows some sample usage of the work-in-progress R2DBC support for Spring Data.

Requirements

If neither is provided all tests will get ignored, essentially disabling the examples. If you want to fail the build instead add -DignoreMissingInfrastructure=true

Interesting bits to look at

  • InfrastructureConfiguration - sets up a R2DBC ConnectionFactory based on the R2DBC Postgres driver (r2dbc-postgresql), a DatabaseClient and a R2dbcRepositoryFactory to eventually create a CustomerRepository.

  • CustomerRepository - a standard Spring Data reactive CRUD repository exposing query methods using manually defined queries

  • CustomerRepositoryIntegrationTests - to initialize the database with some setup SQL and the inserting and reading Customer instances.