[#wallet-WalletDatabase] = xref:wallet.adoc[wallet]::WalletDatabase :relfileprefix: ../ :mrdocs: An instance of this class represents one database. == Synopsis Declared in `<wallet/db.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class WalletDatabase; ---- == Member Functions [cols="1,4"] |=== | Name| Description | xref:wallet/WalletDatabase/2constructor.adoc[`WalletDatabase`] [.small]#[constructor]# | Create dummy DB handle | xref:wallet/WalletDatabase/2destructor.adoc[`~WalletDatabase`] [.small]#[destructor]# [.small]#[virtual]# | Destroys the database handle. | xref:wallet/WalletDatabase/Backup.adoc[`Backup`] [.small]#[virtual]# | Back up the entire database to a file. | xref:wallet/WalletDatabase/Close.adoc[`Close`] [.small]#[virtual]# | Flush to the database file and close the database. Also close the environment if no other databases are open in it. | xref:wallet/WalletDatabase/Filename.adoc[`Filename`] [.small]#[virtual]# | Return path to main database file for logs and error messages. | xref:wallet/WalletDatabase/Files.adoc[`Files`] [.small]#[virtual]# | Return paths to all database created files | xref:wallet/WalletDatabase/Format.adoc[`Format`] [.small]#[virtual]# | Returns the name of the database format. | xref:wallet/WalletDatabase/MakeBatch.adoc[`MakeBatch`] [.small]#[virtual]# | Make a DatabaseBatch connected to this database | xref:wallet/WalletDatabase/Open.adoc[`Open`] [.small]#[virtual]# | Open the database if it is not already opened. | xref:wallet/WalletDatabase/Rewrite.adoc[`Rewrite`] [.small]#[virtual]# | Rewrite the entire database on disk |=== == Data Members [cols="1,4"] |=== | Name| Description | xref:wallet/WalletDatabase/m_refcount.adoc[`m_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/MakeDatabase.adoc[`MakeDatabase`] | Creates or opens a wallet database at the given path. | xref:wallet/MakeInMemoryWalletDatabase.adoc[`MakeInMemoryWalletDatabase`] | Create a new in‐memory wallet database. | xref:wallet/MakeWalletDatabase.adoc[`MakeWalletDatabase`] | Open the database backend for a wallet. | xref:wallet/RunWithinTxn.adoc[`RunWithinTxn`] | Executes the provided function 'func' within a database transaction context. |=== == Derived Classes [cols="1,4"] |=== | Name| Description | xref:wallet/BerkeleyRODatabase.adoc[`BerkeleyRODatabase`] | A class representing a BerkeleyDB file from which we can only read records. This is used only for migration of legacy to descriptor wallets | xref:wallet/SQLiteDatabase.adoc[`SQLiteDatabase`] | An instance of this class represents one SQLite3 database. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#