Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wissance/edgedb.net.configurator
Single line EdgeDb.Net configurator
https://github.com/wissance/edgedb.net.configurator
edgedb edgedb-extension edgedb-net
Last synced: 18 days ago
JSON representation
Single line EdgeDb.Net configurator
- Host: GitHub
- URL: https://github.com/wissance/edgedb.net.configurator
- Owner: Wissance
- License: apache-2.0
- Created: 2023-01-24T06:02:12.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-10-29T16:57:24.000Z (about 1 year ago)
- Last Synced: 2024-04-26T17:08:34.942Z (8 months ago)
- Topics: edgedb, edgedb-extension, edgedb-net
- Language: C#
- Homepage: https://wissance.github.io/EdgeDb.Net.Configurator/
- Size: 27.3 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## EdgeDb.Net.Configurator
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:```csharp
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`:
```csharp
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);
}
```### LIMITATIONS
1. works if your `edgedb` server on the same machine as application.
2. supports only `Windows` and `Linux`, if required more `OS`, please add `PR` and/or issue.Advantage of this - you just need **only EdgeDb Project name**.
### NuGet
[Configurator Nuget package](https://www.nuget.org/packages/Wissance.EdgeDb.Configurator/)