Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dorssel/dotnet-ef-sqlite-timestamp
Extension for Entity Framework (EF) Core 8.0 that adds support for SQLite row versioning ([Timestamp] attribute).
https://github.com/dorssel/dotnet-ef-sqlite-timestamp
dotnet entity-framework-core sqlite
Last synced: 10 days ago
JSON representation
Extension for Entity Framework (EF) Core 8.0 that adds support for SQLite row versioning ([Timestamp] attribute).
- Host: GitHub
- URL: https://github.com/dorssel/dotnet-ef-sqlite-timestamp
- Owner: dorssel
- License: mit
- Created: 2024-02-28T19:53:33.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-04-11T23:32:24.000Z (7 months ago)
- Last Synced: 2024-05-01T18:01:59.439Z (7 months ago)
- Topics: dotnet, entity-framework-core, sqlite
- Language: C#
- Homepage:
- Size: 68.4 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# dotnet-ef-sqlite-timestamp
[![Build](https://github.com/dorssel/dotnet-ef-sqlite-timestamp/actions/workflows/dotnet.yml/badge.svg?branch=main)](https://github.com/dorssel/dotnet-ef-sqlite-timestamp/actions?query=workflow%3ABuild+branch%3Amain)
[![CodeQL](https://github.com/dorssel/dotnet-ef-sqlite-timestamp/actions/workflows/codeql.yml/badge.svg?branch=main)](https://github.com/dorssel/dotnet-ef-sqlite-timestamp/actions?query=workflow%3ACodeQL+branch%3Amain)
[![MegaLinter](https://github.com/dorssel/dotnet-ef-sqlite-timestamp/actions/workflows/lint.yml/badge.svg?branch=main)](https://github.com/dorssel/dotnet-ef-sqlite-timestamp/actions?query=workflow%3ALint+branch%3Amain)
[![codecov](https://codecov.io/gh/dorssel/dotnet-ef-sqlite-timestamp/branch/main/graph/badge.svg?token=zsbTiXoisQ)](https://codecov.io/gh/dorssel/dotnet-ef-sqlite-timestamp)
[![REUSE status](https://api.reuse.software/badge/github.com/dorssel/dotnet-ef-sqlite-timestamp)](https://api.reuse.software/info/github.com/dorssel/dotnet-ef-sqlite-timestamp)
[![NuGet](https://img.shields.io/nuget/v/Dorssel.EntityFrameworkCore.Sqlite.Timestamp?logo=nuget)](https://www.nuget.org/packages/Dorssel.EntityFrameworkCore.Sqlite.Timestamp)Extension for Entity Framework (EF) Core 8.0 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`](https://www.nuget.org/packages/Dorssel.EntityFrameworkCore.Sqlite.Timestamp).
In your `DbContext` derived class modify the following:
```diff
+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](https://learn.microsoft.com/en-us/ef/core/saving/concurrency?tabs=data-annotations#native-database-generated-concurrency-tokens);
except now you can ignore the part that says it isn't supported with SQLite!The released binary NuGet packages and the .NET assemblies contained therein have the following properties:
- [Strong Naming](https://learn.microsoft.com/en-us/dotnet/standard/library-guidance/strong-naming)
- [SourceLink](https://learn.microsoft.com/en-us/dotnet/standard/library-guidance/sourcelink)
- [IntelliSense](https://learn.microsoft.com/en-us/visualstudio/ide/using-intellisense)
- [Authenticode](https://learn.microsoft.com/en-us/windows/win32/seccrypto/time-stamping-authenticode-signatures#a-brief-introduction-to-authenticode)