Embedded .NET Relational-Document Database

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

Version 1.1 Released! Relational API with DBRef, DBRefMany, delete policies, and nested transactions. See what's new →

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>().

Document-Relational DB

First-class document references with DBRef<T> and DBRefMany<T>. Automatic cascade insert, configurable delete policies, and LINQ-queryable joins.

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);

Document Relations

public class Order
{
    public long Id { get; set; }
    public DBRef<Customer> Customer { get; set; }
    public DBRefMany<OrderItem> Items { get; set; }
}

// Cascade-insert a new customer with the order
orders.Insert(new Order
{
    Customer = DBRef<Customer>.From(
        new Customer { Name = "Acme" }),
});

Ready to Get Started?

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