# CHANGELOG
> Refer to: https://keepachangelog.com/en/1.1.0/
>
> Sections: Added, Changed, Fixed, Deprecated, Removed, and Security

This project adheres to [Semantic Versioning (SemVer)](https://semver.org/).

## [Unreleased]

## [2.1.0] - 2025-11-30
### Added
- New Cargo feature toggle: `enable_lto`.
- New compression option: `zstd`.
- Support multiple environment variables to customize static values of LevelDB source code.
- Custom logger for LevelDB info logging.

## [2.0.1] - 2025-11-01
### Fixed
- Update the code snippets about usage of this crate in the document as the URL to this repo.

## [2.0.0] - 2025-10-31
### Added
- Set compression choice in `Options` struct when opening LevelDB instances
- Use `Slice` for exchanging bytes with LevelDB instances
- Get error info of Iterator with method `get_error`
- New `Policy` trait to control iterator behaviour. And `BoundedKeyPolicy` to maintain feature-compatibility.
- Iterable `iter_with_policy` method can create multiple type of iterators by inferring result type, with provided policy.
- New methods for `Compaction` trait: `compact_all`, `compact_from` and `compact_until`.

### Changed
- The generic parameter of `Database`, `Options`, etc. are removed.
- Methods `last`, `key`, `value`, `entry` of `Iterator` are marked as unsafe.
- Methods `last` of `Iterator` return error message if available.
- Iterator `last` method returns the same item type like iterator itself.
- Iterable `iter` method can create multiple type of iterators by inferring result type, with default policy.

### Removed
- Trait `Serializable` is removed.
- Iterator `reverse` method. Specify `Rev` suffix type of Iterator with factory methods of `Iterable` trait for iterators can advance reversely.
- Iterator `from`, `to` methods.
- Database `open_with_comparator` method.

## [1.1.0] - 2025-10-03
### Added
- Get properties of database
- Convenient methods to get database statistics
- New field `max_file_size` in `Options` struct
- New methods `get_approximate_sizes()` and `get_approximate_size_for_range()` in `Statistics` trait for efficient key ranges storage usage estimation

### Fixed
- Fixed warning in example `simple_app`

## [1.0.0] - 2025-09-16
### Added
- Add boundaries for iterator on start and end
- Options supports filter policies, including built-in bloom filter and customized ones
- Options supports comparator, including customized ones
- Add examples of this crate under folder `example`

### Fixed
- Fix Error: field message is publicly available
- Fix Iterator to hold ownership of `from` and `to` field

### Changed
- Bump Edition as 2024
- Bump leveldb to main branch commit ID: 4ee78d7
- Bump snappy to v1.2.2
- Compile C++ dependencies with C++17
- Renamed trait `Key` as `Serializable`, and removed function `as_slice`
- Original function `key`, `value` and `entry` of Iterator are renamed as `unsafe_key`, `unsafe_value` and `unsafe_entry` that return `T` directly. Now, function `key`, `value` and `entry` of Iterator return `Option<T>`.

### Deprecated
- Deprecate function `open_with_comparator` for opening database

## [0.8.8] - 2024-08-24
### Fixed
- Allow to customize the database key with trait `Key`

### Changed
- Bump Edition as 2021
- Use git submodules to manage dependencies: LevelDB and Snappy.
- Bump leveldb to main branch commit ID: 23e35d7
- Bump snappy to v1.2.1

### Removed
- Remove dependency `db-key`

