Expand description
Compile-time configuration.
ekv
has some configuration settings that are set at compile time.
They can be set in two ways:
- Via Cargo features: enable a feature like
<name>-<value>
.name
must be in lowercase and use dashes instead of underscores. For example.max-page-count-1024
. Only a selection of values is available, checkCargo.toml
for the list. - Via environment variables at build time: set the variable named
EKV_<value>
. For exampleEKV_MAX_PAGE_COUNT=1024 cargo build
. You can also set them in the[env]
section of.cargo/config.toml
. Any value can be set, unlike with Cargo features.
Environment variables take precedence over Cargo features. If two Cargo features are enabled for the same setting with different values, compilation fails.
§Compatibility warning
Changing ANY of these configuration settings changes the on-disk format of the database. If you change them, you won’t be able to read databases written with a different configuration.
Currently, mounting doesn’t check the on-disk database uses the same configuration. Mounting a database with a different configuration might succeed and then cause fun errors later, perhaps very rarely. Always remember to format your flash device every time you change them.
Constants§
- Flash alignment for reads and writes.
- Branching factor of the file tree.
- Protect integrity of the data in flash with CRCs.
- Value of flash memory bytes after erasing.
- Maximum chunk size supported.
- Maximum supported key size.
- Maximum flash page count supported.
- Maximum supported value size.
- Flash page size
- Amount of scratch pages reserved for compaction.
Functions§
- Dump the compile-time configuration to
log
ordefmt
.