Configuration
The driver can be configured by passing an EdgeDBClientConfig
object
into the EdgeDBClient
constructor. The client config contains immutable
settings for client behavior. You can construct a new EdgeDBClientConfig
with the builder subclass like so:
var builder = EdgeDBClientConfig.builder();
..
var config = builder.build();
These are the following methods exposed on the configuration builder:
Name |
Parameters |
Description |
---|---|---|
|
|
The maximum number of concurrent clients to allow in the client pool. |
|
|
The connection retry mode for new clients. |
|
|
The maximum number of connection attempts to make before throwing. |
|
|
The amount of time to wait for a connection to be established. |
|
|
The amount of time to wait for an expected response from EdgeDB. |
|
|
Whether or not the |
|
|
Set an implicit result limit. |
|
|
Whether or not |
|
|
The naming strategy used to correlate field names to schema field names. |
|
|
Whether or not to try to use a setter method for a field being deserialized. |
|
|
The client type of the pool. |
|
|
The number of clients to keep instansiated within the pool, regardless of connection state. |
|
|
The max age of an inactive client within the client pool. |
This configuration object can then be passed into the constructor of
a EdgeDBClient
.
In addition to client-level configuration, the driver offers session-level
configuration. This type of configuration is controlled using methods prefixed
by with
. These methods return a new client instance which shares the same
connection, pool, and client configuration.
var client = new EdgeDBClient();
var appliedGlobalClient = client.withGlobals(new HashMap<>(){{
put("current_user_id", ...);
}});