This PR contains modifications to the dotnet driver API to standardize it with other drivers and changes related to feedback provided by the EdgeDB team.
Changes
State (config, aliases, module, globals)
The state API has changed to follow the other drivers (js/ts, python, go, rust) and is defined like so:
var baseClient = new EdgeDBClient();
var client = baseClient
.WithConfig(conf => conf.AllowDMLInFunctions = true)
.WithGlobals(new Dictionary<string, object?>
{
{ "current_user_id", Guid.NewGuid() }
});
There are now 4 methods exposed on EdgeDBClient called WithConfig, WithGlobals, WithModule, and WithAliases which will return a new EdgeDBClient that shares the same client pool as its parent (baseClient in this example)[^1].
Object Deserialization
The deserialization step has been optimized to remove the intermediate dynamic object in favor for a ObjectEnumerator type which acts like an IEnumerator. The new method is designed to be fast and play well with the current binary workflow.
Benchmarks
Deserializing the type Person
public class Person
{
public string? Name { get; set; }
public string? Email { get; set; }
}
Summary
This PR contains modifications to the dotnet driver API to standardize it with other drivers and changes related to feedback provided by the EdgeDB team.
Changes
State (config, aliases, module, globals)
The state API has changed to follow the other drivers (js/ts, python, go, rust) and is defined like so:
There are now 4 methods exposed on
EdgeDBClient
calledWithConfig
,WithGlobals
,WithModule
, andWithAliases
which will return a newEdgeDBClient
that shares the same client pool as its parent (baseClient
in this example)[^1].Object Deserialization
The deserialization step has been optimized to remove the intermediate dynamic object in favor for a
ObjectEnumerator
type which acts like anIEnumerator
. The new method is designed to be fast and play well with the current binary workflow.Benchmarks
Deserializing the type
Person
TODO's
Node The official release is just for the
EdgeDB.Net.Driver
package, the query builder is still in development[^1]: see the js implementation.