EdgeDB.Net is the official .NET driver for the EdgeDB database.
Documentation for the dotnet driver can be found here.
EdgeDB.Net is distributed through the NuGet package manager.
We recommend using the dotnet
command or NuGet package manager in Visual
Studio:
$ dotnet add package EdgeDB.Net.Driver
Clients are what allow your code to talk and interface with EdgeDB. The
EdgeDBClient
class contains a pool of connections and numerous abstractions for executing
queries with ease:
using EdgeDB;
var client = new EdgeDBClient();
EdgeDBClient
will automatically determine how to connect to your EdgeDB
instance by resolving EdgeDB Projects.
For specifying custom connection arguments, considering checking out the
EdgeDBConnection
class. Here's an example of using the .Parse()
method:
using EdgeDB;
var connection = EdgeDBConnection.Parse("edgedb://user:password@localhost:5656/mydb");
var client = new EdgeDBClient(connection);
Note: EdgeDB.Net is a fully asynchronous driver, and as such, all I/O operations are performed asynchronously.
Queries are executed through the EdgeDBClient
by using different helper
methods. Your choice of method is dependent on the kind of query you're making,
better known as cardinality.
Query helper methods will expect a generic T
type which is the .NET version of an EdgeDB type:
var result = await client.QueryAsync<long>("select 2 + 2"); // returns 4
We openly welcome and accept contributions to EdgeDB.Net! Before writing a GitHub Issue or Pull Request, please see our contribution requirements.
This repository contains a list of working examples, check them out to see EdgeDB.Net in action!
If you're building EdgeDB.Net from source, you will need to download the .NET 6 SDK.
Once you have the SDK installed, you can then run dotnet build
in the root
directory of the project:
$ dotnet build
You can run the test suite by using dotnet test
like so:
$ dotnet test