Skip to content

geldata/gel-net

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f1e2554 · Mar 10, 2025
Feb 20, 2025
May 17, 2022
Jan 25, 2024
Feb 27, 2025
Feb 27, 2025
Feb 27, 2025
Feb 14, 2025
Feb 22, 2025
Aug 30, 2022
Feb 18, 2022
Oct 17, 2022
Feb 22, 2025
Feb 6, 2025
Feb 4, 2025
Feb 27, 2025
Sep 1, 2022
Mar 3, 2025
Feb 4, 2025

Repository files navigation

Gel.Net

Downloads NuGet Tests Discord

Gel.Net is the official .NET driver for the Gel database.

Installation

Gel.Net is distributed through the NuGet package manager. We recommend using the dotnet command or NuGet package manager in Visual Studio:

$ dotnet add package Gel.Net.Driver

Basic usage

Creating a client

Clients are what allow your code to talk and interface with Gel. The GelClientPool class contains a pool of connections and numerous abstractions for executing queries with ease:

using Gel;

var client = new GelClientPool();

Client configuration

GelClientPool will automatically determine how to connect to your Gel instance by resolving Gel Projects. For specifying custom connection arguments, considering checking out the GelConnection class. Here's an example of using the .Create() method:

using Gel;

var connection = GelConnection.Create(
  new GelConnection.Options(){dsn="gel://user:password@localhost:5656/mybranch"}
);
var client = new GelClientPool(connection);

Executing queries

Note: Gel.Net is a fully asynchronous driver, and as such, all I/O operations are performed asynchronously.

Queries are executed through the GelClientPool 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 Gel type:

var result = await client.QueryAsync<long>("select 2 + 2"); // returns 4

Contributing

We openly welcome and accept contributions to Gel.Net! Before writing a GitHub Issue or Pull Request, please see our contribution requirements.

Examples

This repository contains a list of working examples, check them out to see Gel.Net in action!

Compiling

If you're building Gel.Net from source, you will need to download the .NET 8 SDK.

Once you have the SDK installed, you can then run dotnet build in the root directory of the project:

$ dotnet build

Testing

You can run the test suite by using dotnet test like so:

$ dotnet test