Embedded .NET Document Database

A lightweight database combining NoSQL flexibility with SQL reliability.
Built on SQLite. Powered by LINQ. Zero configuration.

Quick Start

dotnet add package SoloDB
using var db = new SoloDB("my_app.db");
var users = db.GetCollection<User>();

// Insert
users.Insert(new User { Name = "Alice", Email = "alice@example.com" });

// Query with LINQ
var found = users.FirstOrDefault(u => u.Email == "alice@example.com");

// Update
found.Name = "Alice Smith";
users.Update(found);

// Delete
users.Delete(found.Id);

Features

SQLite Foundation

Built on the world's most deployed database engine. Battle-tested reliability with JSONB support for document storage.

Full LINQ Support

Strongly-typed queries with full IntelliSense. Where, Select, GroupBy, OrderBy, and 40+ more LINQ operations.

ACID Transactions

Full transactional guarantees with automatic rollback on exceptions. Thread-safe with built-in connection pooling.

Integrated File Storage

Hierarchical file system API with metadata support. Upload, download, and manage files directly in your database.

Polymorphic Collections

Store different derived types in a single collection. Query by base type or filter with OfType<T>().

Zero Configuration

Embedded and serverless. No separate database server needed. Just reference the package and start coding.

Indexing Made Simple

public class Product
{
    public long Id { get; set; }

    [Indexed(unique: true)]
    public string SKU { get; set; }

    [Indexed]
    public string Category { get; set; }
}

Powerful Transactions

db.WithTransaction(tx =>
{
    var accounts = tx.GetCollection<Account>();
    var from = accounts.GetById(fromId);
    var to = accounts.GetById(toId);

    from.Balance -= amount;
    to.Balance += amount;

    accounts.Update(from);
    accounts.Update(to);
});

File Storage

var fs = db.FileSystem;

// Upload with metadata
fs.Upload("/reports/q4.pdf", stream);
fs.SetMetadata(
    "/reports/q4.pdf", "Author", "Finance");

// Download
fs.Download("/reports/q4.pdf", outputStream);

Custom ID Generation

public class GuidGenerator : IIdGenerator<Doc>
{
    public object GenerateId(
        ISoloDBCollection<Doc> col, Doc item)
        => Guid.NewGuid().ToString("N");

    public bool IsEmpty(object id)
        => string.IsNullOrEmpty(id as string);
}

Ready to Get Started?

SoloDB is open source under the LGPL-3.0 license with a special exception for single-file deployments.