Sharpify.Data
2.0.1
See the version list below for details.
dotnet add package Sharpify.Data --version 2.0.1
NuGet\Install-Package Sharpify.Data -Version 2.0.1
<PackageReference Include="Sharpify.Data" Version="2.0.1" />
paket add Sharpify.Data --version 2.0.1
#r "nuget: Sharpify.Data, 2.0.1"
// Install Sharpify.Data as a Cake Addin #addin nuget:?package=Sharpify.Data&version=2.0.1 // Install Sharpify.Data as a Cake Tool #tool nuget:?package=Sharpify.Data&version=2.0.1
CHANGELOG
v2.0.1
- Added
ContainsKey
andRemove
functions toDatabaseFilter{T}
to give it essentially the same functionality scope as theDatabase
itself. - Removed
Flags
attribute fromDataChangeType
as it wasn't really a flag type, it can only be one thing.
v2.0.0 - BREAKING CHANGE
The entire package has been reworked.
Database{T}
was removed, and so wasDatabaseOptions
Database
is now the only offer, and was tremendously optimized.- GC pressure massively reduced due to very heavy usage of pooling.
- The options that were previously part of
DatabaseOptions
enum are now simplebool
s inDatabaseConfiguration
string
value type upsert and get now usesMemoryPack
for improved efficiency.- the base value type is now a
ReadOnlyMemory<byte>
instead ofbyte[]
enabling internal use of better apis and more optimization, client usage shouldn't change much because of implicit converters. DatabaseFilter{T}
is areadonly struct
filter of theDatabase
based on a types that areIMemoryPackable
, the filter should provide an AOT-friendly way to use multiple types in the same file, while ensuring no unforeseendeserialization
issues occur because of key exists but with value of different type.DatabaseFilter{T}
is simple and AOT-friendly because it does no changes toDatabase
whatsoever, instead just wraps the key that it uses with a modification that includes the name of the type. It is only an abstraction. Nevertheless, this abstraction is very powerful as it takes no additional effort from the user, and allowing the user to create generic consumer classes, all of which use the same database, but injecting the filter instead of the database, making it virtually impossible that a generic class will try to use a value of a different type.- Using
DatabaseFilter{T}
without per key encryption should perform on par withDatabase{T}
, which allowed its removal due to deprecation. DatabaseFilter{T}
is a lightweight struct that won't have a big performance impact when it is copied by value, but it is possible to negate even that by using theref
andin
keywords in your own APIs- An internal abstraction of
DatabaseSerializer
, which has multiple implementations that vary by theDatabaseConfiguration
, is now created with the database initialization and reused, enabling both more efficient hot-paths for all serialization related functionality and usage of code that is specifically optimized per each variation ofDatabaseConfiguration
. - More optimizations were made to allow JIT to branch eliminate parts of the manual
Serialize
andSerializeAsync
based on theDatabaseConfiguration
. - Lower level APIs are now used internally to interact with the underlying data structure that should shave a few nanoseconds out of the CRUD operations.
The deletion of Database{T}
gave way to make Database
a much greater and more customizable database, all the previous functionality was improved, and the usage DatabaseFilter{T}
without per-key encryption, now offers a replacement to Database{T}
which is more extensible to allow usage for multiple {T}
types, where as Database{T}
allowed a single type.
The new changes mean that runtime deserialization exceptions are almost guaranteed if you try to use it on a pre-existing database. It is recommended to either start from fresh (Which is not a big issue if you used the database for caching), or perform some matching (the easiest of which will probably be to extract all the values using the GetKeys
and Get
functions, save them somewhere and delete the database, then upgrade, initialize a database with similar configuration and add all the values back)
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net7.0
- MemoryPack (>= 1.10.0)
- Sharpify (>= 1.7.1)
-
net8.0
- MemoryPack (>= 1.10.0)
- Sharpify (>= 1.7.1)
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 |
---|---|---|
2.6.0 | 85 | 11/13/2024 |
2.5.0 | 85 | 7/30/2024 |
2.4.1 | 86 | 6/3/2024 |
2.4.0 | 84 | 5/30/2024 |
2.3.0 | 127 | 4/17/2024 |
2.2.0 | 134 | 3/2/2024 |
2.1.3 | 116 | 1/25/2024 |
2.1.2 | 105 | 1/25/2024 |
2.1.1 | 109 | 1/25/2024 |
2.1.0 | 129 | 1/25/2024 |
2.0.2 | 105 | 1/23/2024 |
2.0.1 | 106 | 1/22/2024 |
2.0.0 | 101 | 1/20/2024 |
1.1.0 | 118 | 1/15/2024 |
1.0.3 | 127 | 1/8/2024 |
1.0.2 | 132 | 1/5/2024 |
1.0.1 | 126 | 1/4/2024 |
1.0.0 | 122 | 1/4/2024 |