[#wallet-DatabaseBatch]
= xref:wallet.adoc[wallet]::DatabaseBatch
:relfileprefix: ../
:mrdocs:

RAII class that provides access to a WalletDatabase

== Synopsis

Declared in `&lt;wallet&sol;db&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class DatabaseBatch;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:wallet/DatabaseBatch/2constructor-02.adoc[`DatabaseBatch`]         [.small]#[constructor]#
| Constructors
| xref:wallet/DatabaseBatch/2destructor.adoc[`&#126;DatabaseBatch`] [.small]#[destructor]# [.small]#[virtual]#
| Destroys the batch&period;
| xref:wallet/DatabaseBatch/operator_assign.adoc[`operator&equals;`]  [.small]#[deleted]#
| Batches are non&hyphen;copyable&period;
| xref:wallet/DatabaseBatch/Close.adoc[`Close`]  [.small]#[virtual]#
| Closes the batch&period;
| xref:wallet/DatabaseBatch/Erase.adoc[`Erase`] 
| Erases the record stored under a key&period;
| xref:wallet/DatabaseBatch/ErasePrefix.adoc[`ErasePrefix`]  [.small]#[virtual]#
| Erases all records whose key begins with the given prefix&period;
| xref:wallet/DatabaseBatch/Exists.adoc[`Exists`] 
| Returns whether a record exists for a key&period;
| xref:wallet/DatabaseBatch/GetNewCursor.adoc[`GetNewCursor`]  [.small]#[virtual]#
| Returns a cursor over all records in the database&period;
| xref:wallet/DatabaseBatch/GetNewPrefixCursor.adoc[`GetNewPrefixCursor`]  [.small]#[virtual]#
| Returns a cursor over records whose key begins with the given prefix&period;
| xref:wallet/DatabaseBatch/HasActiveTxn.adoc[`HasActiveTxn`]  [.small]#[virtual]#
| Returns whether a database transaction is currently active&period;
| xref:wallet/DatabaseBatch/Read.adoc[`Read`] 
| Reads the value stored under a key&period;
| xref:wallet/DatabaseBatch/TxnAbort.adoc[`TxnAbort`]  [.small]#[virtual]#
| Aborts the current transaction&period;
| xref:wallet/DatabaseBatch/TxnBegin.adoc[`TxnBegin`]  [.small]#[virtual]#
| Begins a database transaction&period;
| xref:wallet/DatabaseBatch/TxnCommit.adoc[`TxnCommit`]  [.small]#[virtual]#
| Commits the current transaction&period;
| xref:wallet/DatabaseBatch/Write.adoc[`Write`] 
| Writes a value under a key&period;
|===


== Derived Classes

[cols="1,4"]
|===
| Name| Description
| xref:wallet/BerkeleyROBatch.adoc[`BerkeleyROBatch`] 
| RAII class that provides access to a BerkeleyRODatabase
| xref:wallet/SQLiteBatch.adoc[`SQLiteBatch`] 
| RAII class that provides access to a WalletDatabase
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
