EfTurso 0.0.1-alpha
dotnet add package EfTurso --version 0.0.1-alpha
NuGet\Install-Package EfTurso -Version 0.0.1-alpha
<PackageReference Include="EfTurso" Version="0.0.1-alpha" />
<PackageVersion Include="EfTurso" Version="0.0.1-alpha" />
<PackageReference Include="EfTurso" />
paket add EfTurso --version 0.0.1-alpha
#r "nuget: EfTurso, 0.0.1-alpha"
#:package EfTurso@0.0.1-alpha
#addin nuget:?package=EfTurso&version=0.0.1-alpha&prerelease
#tool nuget:?package=EfTurso&version=0.0.1-alpha&prerelease
<div align="center">
<img src="assets/icon.png" alt="EfTurso" width="96" />
EfTurso
Entity Framework Core 10 provider for Turso / libSQL. Write LINQ, not HTTP.
Keep using DbContext, Include, Where and migrations exactly as you know them.
Under the hood, the provider talks to Turso Cloud over the Hrana protocol.
Alpha: this is an early alpha release (
0.0.1-alpha). The API may change and it is not recommended for production yet. Feedback and bug reports are very welcome.Disclaimer: community project, not officially affiliated with Turso. Built independently on the public Hrana protocol spec and the libSQL ecosystem.
</div>
Why this provider
- Familiar. Your existing EF Core code, LINQ queries and migrations work as they do with any other provider.
- Light. No native binaries to ship for the connection: everything goes over HTTPS to your Turso database.
- Reliable by construction. LINQ translation, type mapping and migration SQL are inherited from the Sqlite provider, so they are the same battle-tested code paths. Only the connection layer is new.
- Honest. When a construct can't be translated for Turso, you get a clear exception, not silently wrong SQL.
Contents
- Installation
- Quick Start
- Requirements
- Architecture
- Project Structure
- Branch Flow
- Resources
- Contributing
Installation
dotnet add package EfTurso
Quick Start
using Microsoft.EntityFrameworkCore;
using EfTurso;
var optionsBuilder = new DbContextOptionsBuilder<BlogDbContext>();
optionsBuilder.UseTurso("Server=https://<database>-<organization>.turso.io;Token=<auth-token>");
using var db = new BlogDbContext(optionsBuilder.Options);
await db.Database.EnsureCreatedAsync();
var user = await db.Users
.Include(u => u.UserDetail)
.FirstOrDefaultAsync(u => u.Id == 1);
Console.WriteLine(user?.Name ?? "Not found");
public class BlogDbContext : DbContext
{
public BlogDbContext(DbContextOptions<BlogDbContext> options) : base(options) { }
public DbSet<User> Users => Set<User>();
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<User>(entity =>
{
entity.HasKey(e => e.Id);
entity.HasOne(e => e.UserDetail)
.WithOne(e => e.User)
.HasForeignKey<UserDetail>(e => e.UserId);
});
}
}
Requirements
- .NET 10
- Entity Framework Core 10 (
10.0.x). This is the only supported EF Core major version for now; the provider relies on a few EF Core internals that can change between major versions. - A Turso Cloud database and its auth token
Environment: this project targets Turso Cloud only. A local
sqld/Docker workflow is not available yet (tracked in #2). The functional and conformance tests run against a real Turso Cloud database viatest/protocol/run-cloud-tests.ps1, which reads credentials fromtest/protocol/.envand never leaves them set in your shell.
Architecture
This provider takes advantage of the ~99% SQL compatibility between libSQL and SQLite. Instead of reinventing LINQ translation, type mapping and migrations SQL generation, it inherits those layers from Microsoft.EntityFrameworkCore.Sqlite and replaces only the connection/protocol layer via the Hrana protocol over HTTP.
| Layer | Source |
|---|---|
| LINQ → SQL translation | Inherited from Sqlite |
| Type mapping | Inherited from Sqlite |
| SQL generation & migrations | Inherited from Sqlite |
| Connection / protocol | EfTurso.Data (Hrana over HTTP) |
| EF Core integration | EfTurso |
Project Structure
/src
EfTurso.Data/ # ADO.NET layer (System.Data.Common)
EfTurso/ # EF Core provider
/test
EfTurso.Data.Tests/
EfTurso.Tests/
EfTurso.FunctionalTests/
Branch Flow
master: production/stable, the default branch.rc/alpha: release candidate (alpha line).dev: integration and development. New work lands here first.
Flow: dev → rc/alpha → master.
Resources
Contributing
Issues and pull requests are welcome. Please read CONTRIBUTING.md first: it covers the technical scope and the contribution workflow.
License
MIT. See LICENSE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- EfTurso.Data (>= 0.0.1-alpha)
- Microsoft.EntityFrameworkCore.Sqlite (>= 10.0.10)
- SQLitePCLRaw.lib.e_sqlite3 (>= 3.53.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.0.1-alpha | 45 | 10/15/2026 |