Releases: CoreyKaylor/Lightning.NET
v0.21.0
Breaking Changes
API Signature Changes (nullable annotations and overload refactoring):
- LightningEnvironment.BeginTransaction() - The parent parameter is no longer a nullable default. Use:
- BeginTransaction() or BeginTransaction(TransactionBeginFlags) for top-level transactions
- BeginTransaction(LightningTransaction parent, ...) for nested transactions
- LightningTransaction.OpenDatabase() - Refactored from single method with nullable defaults to explicit overloads:
- OpenDatabase() - default unnamed database
- OpenDatabase(DatabaseConfiguration) - unnamed with config
- OpenDatabase(string name) - named database
- OpenDatabase(string name, DatabaseConfiguration) - named with config
- LightningEnvironment constructor - Now requires explicit overload:
- LightningEnvironment(string path) - default config
- LightningEnvironment(string path, EnvironmentConfiguration) - custom config (no longer nullable)
- ParentTransaction property is now explicitly nullable (LightningTransaction?)
- TryGet extension now returns string? for the out parameter
MDBValue is now a readonly struct - This improves performance but may affect code that mutated the struct.
New Features
Built-in Comparers (LightningDB.Comparers namespace):
- BitwiseComparer / ReverseBitwiseComparer - Lexicographic byte comparison
- SignedIntegerComparer / ReverseSignedIntegerComparer - 4/8-byte signed integers
- UnsignedIntegerComparer / ReverseUnsignedIntegerComparer - 4/8-byte unsigned integers
- Utf8StringComparer / ReverseUtf8StringComparer - Ordinal UTF-8 strings
- LengthComparer / ReverseLengthComparer - Sort by length first, then content
- LengthOnlyComparer - Sort by length only
- GuidComparer / ReverseGuidComparer - Optimized 16-byte GUID comparison
- HashCodeComparer - Hash-based comparison for large values
MDBValue Enhancements (thanks @sebastienros ):
- Read() - Read unmanaged type directly from buffer
- Cast() - Cast buffer to ReadOnlySpan
- CopyTo(Span) - Copy buffer contents
- AsWritableSpan() - Get writable span
Performance Improvements
- MDBValue optimized with [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [SkipLocalsInit] attribute on .NET 5+ for reduced initialization overhead
- Optimized span creation using MemoryMarshal.CreateReadOnlySpan
Infrastructure
- Added GitHub Actions benchmark workflows for performance regression tracking
v0.20.0
What's New
- Added support for .NET 10.0, thx @sebastienros for the pointers as always
- Migrated solution to modern .slnx format
v0.19.1
v0.19.0
v0.18.1
This release includes a minor improvement on the finalizer path for LightningDatabase that could cause a system crash even when close on dispose is set to false.
More native lib additions, better comments, more tests
This release largely ensured there is better coverage with the native methods available in the LMDB available in this library.
- Added overloads for Copy that include FileStream (file descriptor in the native lib)
- Ability to set environment flags and get existing flags
- A LOT more test coverage providing much better examples of different use-cases
- Improved many of the XML doc comments throughout
Minor binaries fixes and stats addition
- Database stats addition from @DecoyFish
- Recompile native binaries to fix duplicate binaries issue in linux/arm targets
- Updating target framework versions to remove netcoreapp3.1
LMDB 0.9.33 and remove event delegates π―
- Remove some debug code from compiled native binaries
- Update LMDB native binaries to 0.9.33
- Return key/value pairs in several missing cursor methods (related to older design modifications)
- No longer support Windows auto-resize DLL. You can compile it yourself or grab the older binaries, but has been unsupported for a long time in the native project
- Updated to net9.0 and language v13
- BREAKING: Sorry, but I have done away with the convoluted internals using .NET event delegates to handle event, tx, child tx scenarios for you. If you were relying previously for this library to handle those for you, it will not require you to manage the correct order of things
Mobile binaries and fixes
Adds native binaries for Android and iOS targets.
Adds mdb_cursor_count from @adamfur
Fixes CopyTo swallowed error from @DecoyFish
Fixes string marshalling for paths in .NET 6 from @Sonix
net7.0 & C# 11 & LMDB 0.9.29
- Updated all LMDB native binaries to 0.9.29 or equivalent commit from master for auto-grow on Windows
- Added binary for osx-arm64
- Fixed Windows x86 native binary when auto-grow is enabled
- All binaries are produced deterministically with repository script now
- Fixed spelling errors on TransactionState (breaking but simple)
- Simplified targets file for .NET framework references
- Added target for net7.0
- Use LibraryImport over DllImport for net7.0
- Fixed bug that closed cursor when it was already closed for us @4deeptech @sebastienros @AlgorithmsAreCool @pepelev
- Fixed for net7.0 environment path now marshalling as UTF8
- CI build simplified and now uses binaries in repo for all OS's for better coverage on binary script
- Updated code-style for C# 11 and fixed many inconsistencies in code