CamusDB.Client
0.3.0
See the version list below for details.
dotnet add package CamusDB.Client --version 0.3.0
NuGet\Install-Package CamusDB.Client -Version 0.3.0
<PackageReference Include="CamusDB.Client" Version="0.3.0" />
<PackageVersion Include="CamusDB.Client" Version="0.3.0" />
<PackageReference Include="CamusDB.Client" />
paket add CamusDB.Client --version 0.3.0
#r "nuget: CamusDB.Client, 0.3.0"
#:package CamusDB.Client@0.3.0
#addin nuget:?package=CamusDB.Client&version=0.3.0
#tool nuget:?package=CamusDB.Client&version=0.3.0
CamusDB Connector for .NET
.NET idiomatic client libraries for CamusDB
CamusDB.Client is the ADO.NET provider for CamusDB. It is the recommended package for regular CamusDB database access from .NET.
Installation
Install the CamusDB.Client package from NuGet. Add it to your project in the normal way (for example by right-clicking on the project in Visual Studio and choosing "Manage NuGet Packages...").
Using .NET CLI
dotnet add package CamusDB.Client --version 0.2.2-alpha
Using NuGet Package Manager
Search for CamusDB.Client and install it from the NuGet package manager UI, or use the Package Manager Console:
Install-Package CamusDB.Client -Version 0.2.2-alpha
Configuration
Create a CamusConnectionStringBuilder with a connection string:
using CamusDB.Client;
CamusConnectionStringBuilder builder = new("Endpoint=http://localhost:8082;Database=test");
await using CamusConnection connection = new(builder);
await connection.OpenAsync();
Supported connection string keys:
| Key | Required | Description |
|---|---|---|
Endpoint |
Yes | Base URL for the CamusDB HTTP endpoint. |
Database |
Yes | Database name sent with requests. |
Endpoint also supports a comma-separated pool. The client selects endpoints with round-robin routing:
CamusConnectionStringBuilder builder = new(
"Endpoint=http://localhost:8082,http://localhost:8084,http://localhost:8086;Database=test");
When a request fails because an endpoint is unreachable, that endpoint is marked unavailable and skipped by later requests made through the same CamusConnectionStringBuilder.
Usage
Ping
await using CamusCommand ping = connection.CreatePingCommand();
int result = await ping.ExecuteNonQueryAsync();
Execute DDL
await using CamusCommand command = connection.CreateCamusCommand("""
CREATE TABLE robots (
id ID,
name STRING,
type STRING,
year INTEGER64,
price FLOAT64,
enabled BOOL
)
""");
bool created = await command.ExecuteDDLAsync();
Insert Rows
using CamusDB.Core.Util.ObjectIds;
await using CamusCommand insert = connection.CreateInsertCommand("robots");
insert.Parameters.Add("id", ColumnType.Id, CamusObjectIdGenerator.Generate());
insert.Parameters.Add("name", ColumnType.String, "T-800");
insert.Parameters.Add("type", ColumnType.String, "cyborg");
insert.Parameters.Add("year", ColumnType.Integer64, 1984);
insert.Parameters.Add("price", ColumnType.Float64, 10.0);
insert.Parameters.Add("enabled", ColumnType.Bool, true);
int insertedRows = await insert.ExecuteNonQueryAsync();
You can also execute parameterized SQL:
const string sql = """
INSERT INTO robots (id, name, year, type, price, enabled)
VALUES (GEN_ID(), @name, @year, @type, @price, @enabled)
""";
await using CamusCommand insert = connection.CreateCamusCommand(sql);
insert.Parameters.Add("@name", ColumnType.String, "R2-D2");
insert.Parameters.Add("@year", ColumnType.Integer64, 1977);
insert.Parameters.Add("@type", ColumnType.String, "mechanical");
insert.Parameters.Add("@price", ColumnType.Float64, 25.5);
insert.Parameters.Add("@enabled", ColumnType.Bool, true);
int insertedRows = await insert.ExecuteNonQueryAsync();
Select Rows
await using CamusCommand select = connection.CreateSelectCommand(
"SELECT * FROM robots WHERE year = @year");
select.Parameters.Add("@year", ColumnType.Integer64, 1977);
CamusDataReader reader = await select.ExecuteReaderAsync();
while (await reader.ReadAsync())
{
string id = reader.GetString(0);
string name = reader.GetString(1);
string type = reader.GetString(2);
long year = reader.GetInt64(3);
}
Transactions
CamusTransaction transaction = await connection.BeginTransactionAsync();
await using CamusCommand insert = connection.CreateInsertCommand("robots");
insert.Transaction = transaction;
insert.Parameters.Add("id", ColumnType.Id, CamusObjectIdGenerator.Generate());
insert.Parameters.Add("name", ColumnType.String, "HAL 9000");
insert.Parameters.Add("type", ColumnType.String, "electronic");
insert.Parameters.Add("year", ColumnType.Integer64, 1968);
insert.Parameters.Add("price", ColumnType.Float64, 42.0);
insert.Parameters.Add("enabled", ColumnType.Bool, true);
await insert.ExecuteNonQueryAsync();
await transaction.CommitAsync();
Use await transaction.RollbackAsync() to roll back instead.
Run Tests
To run the unit tests, it is necessary to have an instance of CamusDB running on the local machine on the standard port 7141. After this, the tests can be run with the following command:
dotnet test -l "console;verbosity=normal" --filter "FullyQualifiedName~CamusDB.Client.Tests"
Contribution
CamusDB.Client is an open-source project, and contributions are heartily welcomed! Whether you are looking to fix bugs, add new features, or improve documentation, your efforts and contributions will be appreciated. Check out the CONTRIBUTING.md file for guidelines on how to get started with contributing to CamusDB.Client.
License
CamusDB.Client is released under the MIT License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Flurl (>= 4.0.0)
- Flurl.Http (>= 4.0.2)
- Polly (>= 8.5.2)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on CamusDB.Client:
| Package | Downloads |
|---|---|
|
CamusDB.EntityFrameworkCore
CamusDB.EntityFrameworkCore provides Entity Framework Core support for CamusDB. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.5.0 | 53 | 6/25/2026 |
| 0.4.6 | 114 | 6/21/2026 |
| 0.4.5 | 123 | 6/18/2026 |
| 0.4.2 | 111 | 6/15/2026 |
| 0.4.1 | 118 | 6/15/2026 |
| 0.4.0 | 97 | 6/15/2026 |
| 0.3.9 | 118 | 6/15/2026 |
| 0.3.7 | 122 | 6/7/2026 |
| 0.3.6 | 113 | 6/7/2026 |
| 0.3.5 | 123 | 6/7/2026 |
| 0.3.4 | 127 | 6/7/2026 |
| 0.3.3 | 126 | 6/7/2026 |
| 0.3.1 | 114 | 6/7/2026 |
| 0.3.0 | 120 | 6/7/2026 |
| 0.2.2-alpha | 106 | 6/4/2026 |
| 0.2.1-alpha | 107 | 6/1/2026 |
| 0.2.0-alpha | 96 | 5/29/2026 |
| 0.1.1-alpha | 9,719 | 7/31/2024 |
| 0.0.9-alpha | 17,515 | 2/7/2024 |
| 0.0.8-alpha | 188 | 2/5/2024 |