Interface DatabaseClient

All Superinterfaces:
ConnectionAccessor

public interface DatabaseClient extends ConnectionAccessor
A non-blocking, reactive client for performing database calls with Reactive Streams back pressure. Provides a higher level, common API over R2DBC client libraries. Propagates DataAccessException variants for errors.

Use the static factory method create(ConnectionFactory) or obtain a builder to create an instance.

Usage example:

ConnectionFactory factory = …

DatabaseClient client = DatabaseClient.create(factory);
Mono<Actor> actor = client.sql("select first_name, last_name from t_actor")
    .map(row -> new Actor(row.get("first_name", String.class),
         row.get("last_name", String.class)))
    .first();
Since:
5.3
Author:
Mark Paluch, Juergen Hoeller, Brian Clozel