Skip to content

Latest commit

 

History

History
54 lines (37 loc) · 2.96 KB

README.md

File metadata and controls

54 lines (37 loc) · 2.96 KB

dotnet-ef-sqlite-timestamp

Build CodeQL MegaLinter codecov REUSE status NuGet

Extension for Entity Framework (EF) Core 8.0 (or higher) that adds support for SQLite row versioning ([Timestamp] attribute).

The implementation is for AnyCPU, and works on all platforms.

Usage

Add a package reference to your project for Dorssel.EntityFrameworkCore.Sqlite.Timestamp.

In your DbContext derived class modify the following:

+using Dorssel.EntityFrameworkCore;

   protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
   {
     optionsBuilder
       .UseSqlite($"Data Source={DbPath}")
+      .UseSqliteTimestamp();
   }

This is all you need to support row versioning with SQLite, including support for migrations.

See Native database-generated concurrency tokens; except now you can ignore the part that says it isn't supported with SQLite!

Example

See the Example project for a demonstration using .NET 9 & EF Core 9.

NuGet package

The released NuGet package and the .NET assemblies contained therein have the following properties: