Tools & Ecosystem

CSharpDB provides 10+ ways to interact with your database — from embedded APIs to remote services, AI integrations, and visual tools.

Data Access Layers

Engine API (In-Process)

The Database class is the primary entry point for embedded use. It provides direct, high-performance, in-process access to the SQL engine and Collection API.

using CSharpDB.Engine;

public record User(string Name, string Email);

await using var db = await Database.OpenAsync("myapp.db");
await using var result = await db.ExecuteAsync("SELECT Name, Email FROM Users");
var users = await db.GetCollectionAsync<User>("users");

ADO.NET Provider

Standard DbConnection, DbCommand, DbDataReader, and DbTransaction implementations. Compatible with ORMs and data access libraries that use ADO.NET.

using CSharpDB.Data;

await using var conn = new CSharpDbConnection("Data Source=myapp.db");
await conn.OpenAsync();

await using var tx = await conn.BeginTransactionAsync();
await using var cmd = conn.CreateCommand();
cmd.Transaction = tx;
cmd.CommandText = "INSERT INTO Users VALUES (@id, @name)";
cmd.Parameters.Add(new CSharpDbParameter("@id", 1));
cmd.Parameters.Add(new CSharpDbParameter("@name", "Alice"));
await cmd.ExecuteNonQueryAsync();
await tx.CommitAsync();

Features: parameter binding, connection pooling, transaction support, type mapping.

Client SDK

A unified C# client with pluggable transports. Use the same ICSharpDbClient interface whether connecting locally, over HTTP, or via gRPC.

await using var client = CSharpDbClient.Create(new CSharpDbClientOptions
{
    Transport = CSharpDbTransport.Direct,
    DataSource = "myapp.db"
});

// Swap the transport to talk to a host instead:
// Transport = CSharpDbTransport.Http, Endpoint = "http://localhost:5000"
// Transport = CSharpDbTransport.Grpc, Endpoint = "https://localhost:5001"

var tables = await client.GetTableNamesAsync();
var result = await client.ExecuteSqlAsync("SELECT * FROM Users");
await client.ExecuteProcedureAsync(
    "GetUser",
    new Dictionary<string, object?> { ["id"] = 1 });

Hosting & Services

REST API

An ASP.NET Core Minimal API exposing 33+ endpoints across 13 groups. Includes OpenAPI/Swagger documentation with Scalar UI for interactive exploration.

Endpoint GroupDescription
/api/tablesTable CRUD and schema inspection
/api/rowsRow-level insert, update, delete
/api/sqlExecute SQL statements
/api/indexesIndex management
/api/viewsView management
/api/triggersTrigger management
/api/proceduresStored procedure CRUD and execution
/api/collectionsCollection API endpoints
/api/pipelinesPipeline management and execution
/api/transactionsExplicit transaction control
/api/schemaFull schema export
/api/inspectStorage diagnostics
/api/maintenanceVacuum, analyze, checkpoint, backup

gRPC Daemon

A standalone gRPC service host (CSharpDB.Daemon) for remote client access. Enables multi-machine architectures with the same Client SDK interface used locally.

Developer Tools

CLI REPL

An interactive shell for executing SQL and inspecting databases from the terminal.

$ csharpdb myapp.db
CSharpDB CLI v2.3.0

csharpdb> SELECT * FROM Users;
┌────┬───────┬───────────────────┐
│ Id │ Name  │ Email             │
├────┼───────┼───────────────────┤
│  1 │ Alice │ alice@example.com │
│  2 │ Bob   │ bob@example.com   │
└────┴───────┴───────────────────┘

csharpdb> .tables
Users, Products, Orders

csharpdb> .schema Users
CREATE TABLE Users (Id INTEGER PRIMARY KEY, Name TEXT, Email TEXT)

csharpdb> .indexes
idx_users_email ON Users (Email)

csharpdb> .quit

Meta-commands: .tables, .schema, .indexes, .views, .triggers, .procedures, .read <file>, .snapshot, .quit

Admin UI (Blazor Server)

A full-featured web dashboard for database management and exploration.

TabDescription
DataBrowse tables with search, sort, filter, and inline CRUD
QuerySQL editor with syntax highlighting and results grid
Query DesignerVisual SQL builder with draggable table nodes, join lines, and live SQL preview
ProceduresCreate, edit, and execute stored procedures
Pipeline DesignerVisual ETL editor with nodes, connections, properties panel, and execution controls
StorageDisk inspection, page layout, and integrity analysis
ReportsVisual report designer with banded layouts, grouping, aggregates, and printable preview

VS Code Extension

A NativeAOT-backed extension for Visual Studio Code with deep CSharpDB integration.

  • Auto-connect to workspace .db files
  • Schema explorer — tables, columns, views, indexes, triggers, procedures
  • .csql syntax highlighting, completion, and hover help
  • Query results panel with export
  • Data browser with CRUD for tables
  • Table designer for schema editing
  • Storage diagnostics viewer

AI Integration

MCP Server (Model Context Protocol)

A Model Context Protocol server exposing 15+ tools for AI assistants. Works with Claude Desktop, Cursor, VS Code Copilot, LM Studio, and other MCP-compatible clients.

Tool CategoryTools
SchemaInspect tables, columns, indexes, views
SQLExecute queries and statements
DataBrowse rows, filter, iterate
MutationsInsert, update, delete rows

Cross-Platform

Native FFI (NativeAOT)

A C library compiled with NativeAOT for cross-language interop. Enables CSharpDB usage from Python, Node.js, Go, Rust, Swift, Kotlin, Dart, and other languages via FFI.

Node.js Package

A TypeScript/JavaScript wrapper around the native library using koffi for FFI binding. Brings CSharpDB to the Node.js ecosystem.