Dali.EntityFrameworkCore
0.0.7.1-alpha
dotnet add package Dali.EntityFrameworkCore --version 0.0.7.1-alpha
NuGet\Install-Package Dali.EntityFrameworkCore -Version 0.0.7.1-alpha
<PackageReference Include="Dali.EntityFrameworkCore" Version="0.0.7.1-alpha" />
<PackageVersion Include="Dali.EntityFrameworkCore" Version="0.0.7.1-alpha" />
<PackageReference Include="Dali.EntityFrameworkCore" />
paket add Dali.EntityFrameworkCore --version 0.0.7.1-alpha
#r "nuget: Dali.EntityFrameworkCore, 0.0.7.1-alpha"
#:package Dali.EntityFrameworkCore@0.0.7.1-alpha
#addin nuget:?package=Dali.EntityFrameworkCore&version=0.0.7.1-alpha&prerelease
#tool nuget:?package=Dali.EntityFrameworkCore&version=0.0.7.1-alpha&prerelease
Dali — SurrealDB Document Store
A .NET document store for SurrealDB with a Marten-compatible fluent API — idiomatic .NET sessions, schema management, indexing, and LINQ querying over SurrealDB's multi-model engine.
Goal
Be the MartenDB for SurrealDB. Bring the ergonomic document-session pattern, fluent schema configuration, and LINQ query pipeline that the .NET ecosystem loves to SurrealDB's document, graph, and search capabilities. If you've used Marten with PostgreSQL, Dali should feel like home.
Quick Start
// Configure
var store = Documents.For(opts =>
{
opts.Namespace = "myapp";
opts.Database = "production";
// Schema & indexes
opts.Schema.For<User>()
.Identity(u => u.Id)
.Index(u => u.Email, c => c.IsUnique())
.Index(u => new { u.FirstName, u.LastName })
.FullTextIndex(u => u.Bio, "english");
});
await store.InitializeAsync();
// Write
await using var session = store.LightweightSession();
session.Store(new User { Name = "Alice", Email = "alice@example.com" });
await session.SaveChangesAsync();
// Read
await using var query = store.QuerySession();
var alice = await query.Query<User>()
.FirstOrDefaultAsync(u => u.Email == "alice@example.com");
API Surface
Document Sessions
| Method | Purpose |
|---|---|
store.LightweightSession() |
Read/write, no change tracking |
store.QuerySession() |
Read-only |
session.Store(entity) |
Insert or update |
session.Delete(entity) |
Remove |
session.Query<T>() |
LINQ query entry point |
session.SaveChangesAsync() |
Commit unit of work |
Schema & Indexing
opts.Schema.For<T>()
.Identity(x => x.Id) // designate primary key
.Index(x => x.Prop) // single-column btree
.Index(x => x.Prop, c => { c.IsUnique(); c.WithName("…"); }) // with options
.Index(x => new { x.FirstName, x.LastName }) // multi-column composite via anonymous type
.UniqueIndex(x => x.Prop) // shortcut unique
.FullTextIndex(x => x.Body, "english") // full-text search
.HnswIndex(x => x.Embedding, 1536) // vector (HNSW)
.MtreeIndex(x => x.Embedding, 768) // vector (MTREE)
.DiskannIndex(x => x.Embedding, 1536, vectorType: "F16") // vector (DiskANN)
.SpatialIndex(x => x.Location) // geo-spatial marker
.MultiTenanted() // tenant-id filtered
.SetSchemaMode(SchemaMode.Strict) // SCHEMAFULL / Flexible
.Schema("analytics_db"); // route to a SurrealDB database
Schema vs Database: Dali's
.Schema("name")is named for Marten API parity, where it maps to a PostgreSQL schema. In SurrealDB, the hierarchy is Namespace → Database → Table (no RDBMS schemas). Under the hood,.Schema("name")switches to a different SurrealDB database within the same namespace viaUSE NS x DB name. This lets you logically partition tables (e.g., separatesalesandanalyticsdatabases in a single store).
LINQ Querying
var results = await session.Query<User>()
.Where(u => u.Age >= 18 && u.Name.Contains("A"))
.OrderBy(u => u.Name)
.Skip(20).Take(10)
.ToListAsync();
Marten Parity
| Feature | Marten (PostgreSQL) | Dali (SurrealDB) |
|---|---|---|
| Document sessions | IDocumentSession |
IDocumentSession |
| Fluent schema | Schema.For<T>().Index() |
Schema.For<T>().Index() |
| Anonymous-type multi-column index | Index(x => new { ... }) |
Index(x => new { ... }) |
| LINQ querying | session.Query<T>() |
session.Query<T>() |
| Full-text search | PostgreSQL tsvector | SurrealDB FTS |
| Vector search | pgvector extension | HNSW / MTREE / DiskANN |
| Multi-tenancy | Conjoined / separate | Native tenant filtering |
| Event sourcing | Marten Events | Dali Events (WolverineFx integration) |
Credits
Dali was solely and greatly inspired by Jeremy D. Miller and the genius developers over at JasperFx and their brilliant library MartenDB for PostgreSQL, which we have used for years. They just released Polecat for MSSQL, which is awesome. We recently had a need to use SurrealDB in a project and decided to follow the MartenDB patterns. Dali depends on SurrealDB.net, another awesome OSS library from the SurrealDB team.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Dali (>= 0.0.7.1-alpha)
- Microsoft.EntityFrameworkCore (>= 10.0.9)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.0.7.1-alpha | 0 | 7/3/2026 |
| 0.0.7-alpha | 53 | 6/26/2026 |
| 0.0.6-alpha | 57 | 6/24/2026 |