Sharc is a high-performance, pure managed C# library that reads and writes SQLite database files from disk and in-memory buffers. Zero native dependencies. 2-609x faster than Microsoft.Data.Sqlite.
It includes strict typed 128-bit column support for GUID/UUID and FIX128 (decimal, 28-29 significant digits).
using Sharc;
// Open a database
using var db = SharcDatabase.Open("mydata.db");
// Read data
using var reader = db.CreateReader("users");
while (reader.Read())
{
long id = reader.GetInt64(0);
string name = reader.GetString(1);
}| Page | Description |
|---|---|
| Opening Databases | SharcDatabase.Open, OpenMemory, Create, options |
| Reading Data | SharcDataReader, typed accessors, seek, projection |
| Querying Data | SQL queries, JOINs, UNION, GROUP BY, CTEs, prepared queries |
| Writing Data | SharcWriter, insert/update/delete/upsert, PreparedWriter, transactions |
| Schema Inspection | SharcSchema, TableInfo, ColumnInfo, IndexInfo |
| Graph Traversal | SharcContextGraph, BFS, Cypher, GraphWriter, algorithms |
| Encryption | AES-256-GCM, Argon2id KDF, encrypted databases |
| Trust Layer | Agent registry, ledger, ECDSA attestation, entitlements |
| Views | Programmatic views, SubViews, SQLite view auto-promotion, SQL integration |
| JitSQL & Prepared | JitQuery, PreparedReader, execution hints, FilterStar |
| Vector Search | HnswIndex, VectorQuery, HybridQuery, SIMD distance |
| Performance Guide | Zero-allocation patterns, benchmarks, best practices |
| AI Agent Reference | Complete copy-paste patterns for LLM coding assistants |
| Release History | NuGet versions, changelogs (1.0.0-beta → 1.2.80) |
dotnet add package Sharc # Core: read + write + query
dotnet add package Sharc.Crypto # AES-256-GCM encryption
dotnet add package Sharc.Graph # Graph traversal engine
dotnet add package Sharc.Vector # HNSW similarity searchSharcDatabase → SharcDataReader (read path)
SharcWriter → SharcWriteTransaction (write path)
SharcContextGraph → Traverse/Cursor (graph path)
AgentRegistry + LedgerManager (trust path)
All operations go through the B-tree layer, which reads SQLite pages directly from IPageSource (file, memory, or encrypted). No native SQLite bindings are involved.
| Guide | Description |
|---|---|
| JitSQL Cross-Language | JitSQL patterns for JS/TS/Python/Go developers |
| Graph DB Comparison | Sharc vs SurrealDB, ArangoDB, Neo4j |
| Vector Search Guide | Embedding storage, RAG, semantic cache patterns |
| Alternatives | Honest comparison vs SQLite, LiteDB, DuckDB |
| Samples | 13 runnable sample projects including GUID/FIX128 typed value usage |