Turso (libSQL) is a cheap way to get a cloud-hosted database wired into a
.NET app, but there's no actively maintained way to actually connect to it
from .NET. The closest attempt,
BMDRM.LibSql.Core, hasn't seen a
commit in over a year, so this project builds the connectivity directly
rather than depending on it.
This implements .NET database connectivity to Turso directly against
the Hrana v2 HTTP pipeline protocol — Turso's /v2/pipeline API
reference for the practical
request/response shape (it doesn't use the name "Hrana"), and libSQL's own
spec
("Hrana over HTTP") for where that name actually comes from — with no
dependency on any third-party libSQL client library — see
docs/architecture-decisions.md for why.
Current status, milestone plan, and known limitations are tracked in
roadmap.md and docs/tech-debt.md rather
than duplicated here. Contributor/agent-facing guidance (build commands,
architecture, conventions) is in CLAUDE.md. Issue/PR
conventions for contributors are in CONTRIBUTING.md.
src/Turso.Data/
├── TursoConnection.cs # DbConnection
├── TursoCommand.cs # DbCommand
├── TursoDataReader.cs # DbDataReader (materialized, not streamed)
├── TursoTransaction.cs # BEGIN/COMMIT/ROLLBACK over the same stream
├── TursoConnectionStringBuilder.cs
├── TursoException.cs
├── Parameters/ # DbParameter + DbParameterCollection
└── Hrana/ # internal Hrana v2 wire protocol + transport
samples/Turso.Data.Demo/ # Manual smoke test: SELECT 1 against a real DB
tests/Turso.Data.Tests/ # xUnit
You'll need the .NET 10 SDK and a real Turso database (the free tier is enough):
cd samples/Turso.Data.Demo
TURSO_URL="libsql://your-db-your-org.turso.io" \
TURSO_TOKEN="your-token-from-turso-cli" \
dotnet runExpect friction on the first run — this is the point where the "docs vs.
reality" gaps in the Hrana response shape will surface. Start there before
touching the EF Core integration layer (see roadmap.md Milestone 2).