pub struct Transaction<'env, K, E> where
    K: TransactionKind,
    E: EnvironmentKind
{ /* private fields */ }
Expand description

An MDBX transaction.

All database operations require a transaction.

Implementations

Returns a raw pointer to the MDBX environment.

Returns the transaction id.

Gets an item from a database.

This function retrieves the data associated with the given key in the database. If the database supports duplicate keys (DatabaseFlags::DUP_SORT) then the first data item for the key will be returned. Retrieval of other items requires the use of Cursor. If the item is not in the database, then None will be returned.

Commits the transaction.

Any pending operations will be saved.

Commits the transaction and returns table handles permanently open for the lifetime of Environment.

Opens a handle to an MDBX database.

If name is None, then the returned handle will be for the default database.

If name is not None, then the returned handle will be for a named database. In this case the environment must be configured to allow named databases through EnvironmentBuilder::set_max_dbs().

The returned database handle may be shared among any transaction in the environment.

The database name may not contain the null character.

Gets the option flags for the given database in the transaction.

Retrieves database statistics.

Open a new cursor on the given database.

Opens a handle to an MDBX database, creating the database if necessary.

If the database is already created, the given option flags will be added to it.

If name is None, then the returned handle will be for the default database.

If name is not None, then the returned handle will be for a named database. In this case the environment must be configured to allow named databases through EnvironmentBuilder::set_max_dbs().

This function will fail with Error::BadRslot if called by a thread with an open transaction.

Stores an item into a database.

This function stores key/data pairs in the database. The default behavior is to enter the new key/data pair, replacing any previously existing key if duplicates are disallowed, or adding a duplicate data item if duplicates are allowed (DatabaseFlags::DUP_SORT).

Returns a buffer which can be used to write a value into the item at the given key and with the given length. The buffer must be completely filled by the caller.

Delete items from a database. This function removes key/data pairs from the database.

The data parameter is NOT ignored regardless the database does support sorted duplicate data items or not. If the data parameter is Some only the matching data item will be deleted. Otherwise, if data parameter is None, any/all value(s) for specified key will be deleted.

Returns true if the key/value pair was present.

Empties the given database. All items will be removed.

Drops the database from the environment.

Safety

Caller must close ALL other Database and Cursor instances pointing to the same dbi BEFORE calling this function.

Closes the database handle.

Safety

Caller must close ALL other Database and Cursor instances pointing to the same dbi BEFORE calling this function.

Begins a new nested transaction inside of this transaction.

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.