lmdb library

Classes

CursorEntry
Represents an entry returned by cursor operations
DatabaseEfficiency
Represents database efficiency metrics for analyzing LMDB performance.
DatabaseStats
Represents statistical information about an LMDB database.
LMDB
A high-level Dart interface for LMDB (Lightning Memory-Mapped Database).
LMDBConfig
Configuration and utility functions for LMDB (Lightning Memory-Mapped Database)
LMDBFlagSet
A class for managing LMDB flag combinations in a type-safe way.
LMDBInitConfig
Configuration class for LMDB initialization.
MDB_txn
An opaque handle for a database transaction.

Enums

CursorOp
Public cursor operation modes for LMDB

Constants

MDB_CORRUPTED → const int
MDB_CORRUPTED: Located page was wrong type. Indicates database corruption or structural integrity issues. Database may need recovery or rebuilding.
MDB_CREATE → const int
/ Creates the named database if it doesn't exist.
MDB_DUPFIXED → const int
Specifies fixed-size duplicate data items.
MDB_DUPSORT → const int
Enables duplicate keys in the database.
MDB_FIXEDMAP → const int
Use fixed-size memory map.
MDB_INTEGERDUP → const int
MDB_INTEGERDUP: Used only with MDB_DUPFIXED databases. Indicates that duplicate data items are binary integers. This flag enables efficient storage and comparison of integer values similar to MDB_INTEGERKEY for keys.
MDB_INTEGERKEY → const int
Specifies that keys are binary integers in native byte order.
MDB_INVALID → const int
MDB_INVALID: File is not an LMDB file. Occurs when attempting to open a file that:
MDB_KEYEXIST → const int
MDB_KEYEXIST: Key/data pair already exists. Occurs during put operations when the key already exists and MDB_NOOVERWRITE was specified.
MDB_MAP_FULL → const int
MDB_MAP_FULL: Environment mapsize limit reached. Occurs when:
MDB_MAP_RESIZED → const int
MDB_MAP_RESIZED: Database was resized externally. Occurs when another process has increased the database size. Action required: Close and reopen the environment. Common scenario: Multi-process access with dynamic growth.
MDB_MAPASYNC → const int
Enables asynchronous flushes to disk when using MDB_WRITEMAP.
MDB_NOLOCK → const int
When used:
MDB_NOMEMINIT → const int
Skips initialization of malloc'd memory before writing.
MDB_NOMETASYNC → const int
Don't sync meta pages when committing transaction.
MDB_NOOVERWRITE → const int
Flag for put operations that prevents overwriting existing keys.
MDB_NORDAHEAD → const int
Disables read-ahead for random access patterns.
MDB_NOSUBDIR → const int
Opens a database file directly instead of using a directory.
MDB_NOSYNC → const int
Disable syncing of system buffers to disk on transaction commit.
MDB_NOTFOUND → const int
MDB_NOTFOUND: Key/data pair not found (EOF). Occurs when:
MDB_NOTLS → const int
Disables thread-local storage.
MDB_PAGE_NOTFOUND → const int
MDB_PAGE_NOTFOUND: Requested page not found. Internal error indicating database corruption or invalid page access.
MDB_PANIC → const int
MDB_PANIC: Update of meta page failed or environment had fatal error. Severe error condition requiring immediate attention. Database might be corrupted or system resources exhausted.
MDB_PREVSNAPSHOT → const int
Allows read-only access if write access is unavailable.
MDB_RDONLY → const int
Opens the environment in read-only mode.
MDB_REVERSEDUP → const int
Enables reverse string comparison for duplicate data items.
MDB_REVERSEKEY → const int
Stores key/data pairs in reverse byte order.
MDB_SUCCESS → const int
MDB_SUCCESS: Operation completed successfully. Return code: 0
MDB_VERSION_MISMATCH → const int
MDB_VERSION_MISMATCH: Environment version mismatch. Occurs when:
MDB_WRITEMAP → const int
Use a writeable memory map instead of malloc/msync for database operations.

Functions

fetchNativeLibraries({String? targetDir}) Future<void>
Downloads native libraries from GitHub releases with manifest support

Exceptions / Errors

LMDBException
Exception class for LMDB-specific errors.