Community EF Core 10 provider for
libSQL, backed by in-repo
Nj.LibSql.Data (architecture).
Status:
10.0.0-preview.2(prerelease on NuGet.org). APIs may change. Do not use in production until a stable10.0.xrelease. See releasing.
dotnet add package Nj.EntityFrameworkCore.LibSql --prerelease| Item | Value |
|---|---|
| NuGet package | Nj.EntityFrameworkCore.LibSql (also Nj.LibSql.Data, Nj.LibSql.Bindings) |
| Namespace / assembly | Nj.EntityFrameworkCore.LibSql |
| Version | 10.0.0-preview.2 |
| License | MIT |
| EF Core | 10.0.10 |
| ADO.NET | Nj.LibSql.Data + Nj.LibSql.Bindings (versions) |
Public API follows Microsoft’s Sqlite naming pattern (UseLibSql,
AddEntityFrameworkLibSql, …). Connection modes are selected only via the
connection string (or an existing LibSqlConnection) — no mode-specific Use*
helpers. Reference: connection-strings.md,
connection-modes.md.
| Mode | Preview | Notes |
|---|---|---|
| Local libSQL file | Yes | File create/delete like EF SQLite |
Remote self-hosted sqld / Turso |
Yes | Database must already exist; Turso via HTTPS/libsql:// (Cloud rejects WebSocket) |
| Embedded replica | Yes (vs sqld) |
Database.Sync / LibSqlConnection.Sync; Turso Cloud Sync hangs — C-019 |
dotnet run --project samples/LocalSampleOr in code:
optionsBuilder.UseLibSql("Data Source=/tmp/app.db");./eng/start-sqld.sh && ./eng/wait-for-sqld.sh # self-hosted
dotnet run --project samples/RemoteSample
# or: LIBSQL_SAMPLE_CONNECTION='Data Source=libsql://…;Auth Token=…' dotnet run --project samples/RemoteSampleoptionsBuilder.UseLibSql("Data Source=http://127.0.0.1:8080");
// Turso: Data Source=libsql://<db>-<org>.turso.io;Auth Token=<token>Requires a reachable primary (self-hosted sqld recommended; Turso Sync is
C-019):
./eng/start-sqld.sh && ./eng/wait-for-sqld.sh
dotnet run --project samples/EmbeddedReplicaSampleoptionsBuilder.UseLibSql(
"Data Source=/tmp/replica.db;Sync URL=http://127.0.0.1:8080;Read Your Writes=False");
// then: await context.Database.SyncAsync();dotnet run --project samples/DiPoolingSampleCovers AddDbContextPool, AddDbContextFactory, and UseLibSql(LibSqlConnection).
See samples/MigrationsSample (dotnet-ef
10.0.10, IDesignTimeDbContextFactory, migrate + scaffold). Overview:
docs/migrations.md.
dotnet restore Nj.EntityFrameworkCore.LibSql.slnx
dotnet build Nj.EntityFrameworkCore.LibSql.slnx -c Release
dotnet test test/Nj.EntityFrameworkCore.LibSql.UnitTests -c Release
dotnet run --project samples/LocalSample
./eng/start-sqld.sh && ./eng/wait-for-sqld.sh
dotnet run --project samples/RemoteSampleFull guide: CONTRIBUTING.md.
- Docs index
- Architecture
- Connection modes · Connection strings
- Migrate from EF SQLite
- Transactions · Deployment
- Compatibility · Limitations
- Releasing · Observability
- Contributing · Security
- GitHub: nareshjois/Nj.EntityFrameworkCore.LibSQL
- Attribution: NOTICE
- Changelog: CHANGELOG.md
MIT — see LICENSE. Imported EF Core SQLite provider source retains Microsoft’s MIT copyright headers; community modifications are attributed in NOTICE.