Interface DatabaseClient

All Superinterfaces:
ConnectionAccessor

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

Use one of the static factory methods 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