Skip to content

Commit

Permalink
Document the limits of the unnamed database
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerollmops committed Sep 15, 2022
1 parent c91c44a commit cbaefc2
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions heed/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,12 @@ impl Env {
/// Opens a typed database that already exists in this environment.
///
/// If the database was previously opened in this program run, types will be checked.
///
/// ## Important Information
///
/// LMDB have an important restriction on the unnamed database when named ones are opened,
/// the names of the named databases are stored as keys in the unnamed one and are immutable,
/// these keys can only be read and not written.
pub fn open_database<KC, DC>(
&self,
rtxn: &RoTxn,
Expand All @@ -303,6 +309,12 @@ impl Env {
/// Opens an untyped database that already exists in this environment.
///
/// If the database was previously opened as a typed one, an error will be returned.
///
/// ## Important Information
///
/// LMDB have an important restriction on the unnamed database when named ones are opened,
/// the names of the named databases are stored as keys in the unnamed one and are immutable,
/// these keys can only be read and not written.
pub fn open_poly_database(
&self,
rtxn: &RoTxn,
Expand All @@ -318,6 +330,12 @@ impl Env {
/// Creates a typed database that can already exist in this environment.
///
/// If the database was previously opened in this program run, types will be checked.
///
/// ## Important Information
///
/// LMDB have an important restriction on the unnamed database when named ones are opened,
/// the names of the named databases are stored as keys in the unnamed one and are immutable,
/// these keys can only be read and not written.
pub fn create_database<KC, DC>(
&self,
wtxn: &mut RwTxn,
Expand All @@ -337,6 +355,12 @@ impl Env {
/// Creates a typed database that can already exist in this environment.
///
/// If the database was previously opened as a typed one, an error will be returned.
///
/// ## Important Information
///
/// LMDB have an important restriction on the unnamed database when named ones are opened,
/// the names of the named databases are stored as keys in the unnamed one and are immutable,
/// these keys can only be read and not written.
pub fn create_poly_database(
&self,
wtxn: &mut RwTxn,
Expand Down

0 comments on commit cbaefc2

Please sign in to comment.