Files
spring-data-examples/r2dbc/example
Mark Paluch b38ade2298 #438 - Adapt to refactored R2DBC configuration.
AbstractR2dbcConfiguration was moved from org.springframework.data.r2dbc.repository.config.AbstractR2dbcConfiguration to org.springframework.data.r2dbc.config.AbstractR2dbcConfiguration.
2018-12-10 08:39:37 +01:00
..
2018-10-19 11:36:27 +02:00

== Spring Data R2DBC basics

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

=== Requirements

- A PostgreSQL database server running on port 5432, a database instance named `postgres` with a user `postgres` and an empty password.

=== Interesting bits to look at

- `InfrastructureConfiguration` - sets up a R2DBC `ConnectionFactory` based on the R2DBC Postgres driver (https://github.com/r2dbc/r2dbc-postgresql[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.