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§
- ALIGN
- Flash alignment for reads and writes.
- BRANCHING_
FACTOR - Branching factor of the file tree.
- CRC
- Protect integrity of the data in flash with CRCs.
- ERASE_
VALUE - Value of flash memory bytes after erasing.
- MAX_
CHUNK_ SIZE - Maximum chunk size supported.
- MAX_
KEY_ SIZE - Maximum supported key size.
- MAX_
PAGE_ COUNT - Maximum flash page count supported.
- MAX_
VALUE_ SIZE - Maximum supported value size.
- PAGE_
SIZE - Flash page size
- SCRATCH_
PAGE_ COUNT - Amount of scratch pages reserved for compaction.
Functions§
- dump
- Dump the compile-time configuration to
log
ordefmt
.