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

A class representing a BerkeleyDB file from which we can only read records&period; This is used only for migration of legacy to descriptor wallets

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class BerkeleyRODatabase
    : public xref:wallet/WalletDatabase.adoc[WalletDatabase]
----

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `xref:wallet/WalletDatabase.adoc[WalletDatabase]`
| An instance of this class represents one database&period;
|===

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:wallet/BerkeleyRODatabase/2constructor.adoc[`BerkeleyRODatabase`]         [.small]#[constructor]#
| Create DB handle
| xref:wallet/BerkeleyRODatabase/2destructor.adoc[`&#126;BerkeleyRODatabase`] [.small]#[destructor]# [.small]#[virtual]#
| Destroy the database handle&period;
| xref:wallet/BerkeleyRODatabase/Backup.adoc[`Backup`]  [.small]#[virtual]#
| Back up the entire database to a file&period;
| xref:wallet/BerkeleyRODatabase/Close.adoc[`Close`]  [.small]#[virtual]#
| Flush to the database file and close the database&period; Also close the environment if no other databases are open in it&period;
| xref:wallet/BerkeleyRODatabase/Filename.adoc[`Filename`]  [.small]#[virtual]#
| Return path to main database file for logs and error messages&period;
| xref:wallet/BerkeleyRODatabase/Files.adoc[`Files`]  [.small]#[virtual]#
| Return the paths to all files that make up this database&period;
| xref:wallet/BerkeleyRODatabase/Format.adoc[`Format`]  [.small]#[virtual]#
| Return the name of this database&apos;s storage format&period;
| xref:wallet/BerkeleyRODatabase/MakeBatch.adoc[`MakeBatch`]  [.small]#[virtual]#
| Make a DatabaseBatch connected to this database
| xref:wallet/BerkeleyRODatabase/Open.adoc[`Open`]  [.small]#[virtual]#
| Open the database if it is not already opened&period;
| xref:wallet/BerkeleyRODatabase/Rewrite.adoc[`Rewrite`]  [.small]#[virtual]#
| Rewrite the entire database on disk
|===


== Data Members

[cols="1,4"]
|===
| Name| Description
| xref:wallet/BerkeleyRODatabase/m_records.adoc[`m&lowbar;records`] 
| The records read from the database file&period;
| xref:wallet/WalletDatabase/m_refcount.adoc[`m&lowbar;refcount`] 
| Counts the number of active database users to be sure that the database is not closed while someone is using it
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:wallet/MakeBerkeleyRODatabase.adoc[`MakeBerkeleyRODatabase`]
| Return object giving access to Berkeley Read Only database at specified path&period;
| xref:wallet/RunWithinTxn.adoc[`RunWithinTxn`]
| Executes the provided function &apos;func&apos; within a database transaction context&period;
|===


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