Is a lib that helps to easily configure and add EdgeDb.Net in a single line (services.ConfigureEdgeDbDatabase(Settings.Database.ProjectName, poolCfg)) using just only project name, see following full example that a bit larger then single line:
private void ConfigureDatabase(IServiceCollection services)
{
EdgeDBClientPoolConfig poolCfg = new EdgeDBClientPoolConfig()
{
ClientType = EdgeDBClientType.Tcp,
SchemaNamingStrategy = INamingStrategy.CamelCaseNamingStrategy,
DefaultPoolSize = 256,
ConnectionTimeout = 5000,
MessageTimeout = 10000
};
services.ConfigureEdgeDbDatabase("10.50.55.41", Settings.Database.ProjectName, poolCfg, null, true);
}or you could pass an array of directories where edgedb project credentials could be found, i.e. services.ConfigureEdgeDbDatabase("10.50.55.41", Settings.Database.ProjectName, poolCfg, new[] {"/usr/myapp/edgedb", "/usr/share"}, true);
or if you are running app && edgedb on the same machine use simplified method ConfigureLocalEdgeDbDatabase:
private void ConfigureDatabase(IServiceCollection services)
{
EdgeDBClientPoolConfig poolCfg = new EdgeDBClientPoolConfig()
{
ClientType = EdgeDBClientType.Tcp,
SchemaNamingStrategy = INamingStrategy.CamelCaseNamingStrategy,
DefaultPoolSize = 256,
ConnectionTimeout = 5000,
MessageTimeout = 10000
};
services.ConfigureLocalEdgeDbDatabase(Settings.Database.ProjectName, poolCfg);
}- works if your
edgedbserver on the same machine as application. - supports only
WindowsandLinux, if required moreOS, please addPRand/or issue.
Advantage of this - you just need only EdgeDb Project name.