MDB_RDONLY top-level constant
int
const MDB_RDONLY
Opens the environment in read-only mode.
When used:
- All write operations will be prohibited
- Multiple processes can access database simultaneously
- Perfect for read-only scenarios like dictionaries or lookups
Common usage scenarios:
- Deployment of read-only databases
- Concurrent access by multiple processes
- When using smaller mapsize than actual database size
Example:
await db.init(path,
flags: LMDBFlagSet()..add(MDB_RDONLY));
Related flags:
- Often used with MDB_NOLOCK for better read performance
- Compatible with MDB_NOTLS for multi-threaded access
Implementation
const MDB_RDONLY = bindings.MDB_RDONLY;