Skip to content

Commit 03447fb

Browse files
committed
Document the limits of the unnamed database
1 parent 629730e commit 03447fb

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

heed/src/env.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,12 @@ impl Env {
283283
/// Opens a typed database that already exists in this environment.
284284
///
285285
/// If the database was previously opened in this program run, types will be checked.
286+
///
287+
/// ## Important Information
288+
///
289+
/// LMDB have an important restriction on the unnamed database when named ones are opened,
290+
/// the names of the named databases are stored as keys in the unnamed one and are immutable,
291+
/// these keys can only be read and not written.
286292
pub fn open_database<KC, DC>(
287293
&self,
288294
rtxn: &RoTxn,
@@ -303,6 +309,12 @@ impl Env {
303309
/// Opens an untyped database that already exists in this environment.
304310
///
305311
/// If the database was previously opened as a typed one, an error will be returned.
312+
///
313+
/// ## Important Information
314+
///
315+
/// LMDB have an important restriction on the unnamed database when named ones are opened,
316+
/// the names of the named databases are stored as keys in the unnamed one and are immutable,
317+
/// these keys can only be read and not written.
306318
pub fn open_poly_database(
307319
&self,
308320
rtxn: &RoTxn,
@@ -318,6 +330,12 @@ impl Env {
318330
/// Creates a typed database that can already exist in this environment.
319331
///
320332
/// If the database was previously opened in this program run, types will be checked.
333+
///
334+
/// ## Important Information
335+
///
336+
/// LMDB have an important restriction on the unnamed database when named ones are opened,
337+
/// the names of the named databases are stored as keys in the unnamed one and are immutable,
338+
/// these keys can only be read and not written.
321339
pub fn create_database<KC, DC>(
322340
&self,
323341
wtxn: &mut RwTxn,
@@ -337,6 +355,12 @@ impl Env {
337355
/// Creates a typed database that can already exist in this environment.
338356
///
339357
/// If the database was previously opened as a typed one, an error will be returned.
358+
///
359+
/// ## Important Information
360+
///
361+
/// LMDB have an important restriction on the unnamed database when named ones are opened,
362+
/// the names of the named databases are stored as keys in the unnamed one and are immutable,
363+
/// these keys can only be read and not written.
340364
pub fn create_poly_database(
341365
&self,
342366
wtxn: &mut RwTxn,

0 commit comments

Comments
 (0)