![]() |
Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
|
The DatabaseManager is a class that sits at the root of all attached databases. More...

Public Member Functions | |
| DatabaseManager (DatabaseInstance &db) | |
| DatabaseInstance & | GetInstance () |
| void | InitializeSystemCatalog () |
| Initializes the system catalog of the attached SYSTEM_DATABASE. | |
| void | FinalizeStartup () |
| Finalize starting up the system. | |
| optional_ptr< AttachedDatabase > | GetDatabase (ClientContext &context, const string &name) |
| Get an attached database by its name. | |
| shared_ptr< AttachedDatabase > | GetDatabase (const string &name) |
| shared_ptr< AttachedDatabase > | AttachDatabase (ClientContext &context, AttachInfo &info, AttachOptions &options) |
| Attach a new database. | |
| void | DetachDatabase (ClientContext &context, const string &name, OnEntryNotFound if_not_found) |
| Detach an existing database. | |
| void | Alter (ClientContext &context, AlterInfo &info) |
| Alter operation dispatcher. | |
| shared_ptr< AttachedDatabase > | DetachInternal (const string &name) |
| Rollback the attach of a database. | |
| Catalog & | GetSystemCatalog () |
| Returns a reference to the system catalog. | |
| void | SetDefaultDatabase (ClientContext &context, const string &new_value) |
| InsertDatabasePathResult | InsertDatabasePath (const AttachInfo &info, AttachOptions &options) |
| Inserts a path to name mapping to the database paths map. | |
| void | GetDatabaseType (ClientContext &context, AttachInfo &info, const DBConfig &config, AttachOptions &options) |
| vector< shared_ptr< AttachedDatabase > > | GetDatabases (ClientContext &context, const optional_idx max_db_count=optional_idx()) |
| vector< shared_ptr< AttachedDatabase > > | GetDatabases () |
| Scans the catalog set and returns each committed database entry. | |
| idx_t | ApproxDatabaseCount () |
| Returns the approximate count of attached databases. | |
| void | ResetDatabases () |
| transaction_t | GetNewQueryNumber () |
| transaction_t | ActiveQueryNumber () const |
| transaction_t | GetNewTransactionNumber () |
| transaction_t | ActiveTransactionNumber () const |
| idx_t | NextOid () |
| bool | HasDefaultDatabase () |
| vector< string > | GetAttachedDatabasePaths () |
| Gets a list of all attached database paths. | |
| shared_ptr< AttachedDatabase > | GetDatabaseInternal (const lock_guard< mutex > &, const string &name) |
Static Public Member Functions | |
| static DatabaseManager & | Get (DatabaseInstance &db) |
| static DatabaseManager & | Get (ClientContext &db) |
| static DatabaseManager & | Get (AttachedDatabase &db) |
| static const string & | GetDefaultDatabase (ClientContext &context) |
Private Member Functions | |
| optional_ptr< AttachedDatabase > | FinalizeAttach (ClientContext &context, AttachInfo &info, shared_ptr< AttachedDatabase > database) |
| void | RenameDatabase (ClientContext &context, const string &old_name, const string &new_name, OnEntryNotFound if_not_found) |
| Rename an existing database. | |
Private Attributes | |
| DatabaseInstance & | db |
| shared_ptr< AttachedDatabase > | system |
| The system database is a special database that holds system entries (e.g. functions) | |
| mutex | databases_lock |
| Lock for databases. | |
| case_insensitive_map_t< shared_ptr< AttachedDatabase > > | databases |
| The set of attached databases. | |
| atomic< idx_t > | next_oid |
| The next object id handed out by the NextOid method. | |
| atomic< transaction_t > | current_query_number |
| The current query number. | |
| atomic< transaction_t > | current_transaction_id |
| The current transaction number. | |
| string | default_database |
| The current default database. | |
| shared_ptr< DatabaseFilePathManager > | path_manager |
| Manager for ensuring we never open the same database file twice in the same program. | |
Friends | |
| class | Catalog |
The DatabaseManager is a class that sits at the root of all attached databases.
|
inline |
| void duckdb::DatabaseManager::GetDatabaseType | ( | ClientContext & | context, |
| AttachInfo & | info, | ||
| const DBConfig & | config, | ||
| AttachOptions & | options | ||
| ) |
Returns the database type. This might require checking the header of the file, in which case the file handle is necessary. We can only grab the file handle, if it is not yet held, even for uncommitted changes. Thus, we have to lock for this operation.
| vector< shared_ptr< AttachedDatabase > > duckdb::DatabaseManager::GetDatabases | ( | ClientContext & | context, |
| const optional_idx | max_db_count = optional_idx() |
||
| ) |
Scans the catalog set and adds each committed database entry, and each database entry of the current transaction, to a vector holding AttachedDatabase references
| void duckdb::DatabaseManager::ResetDatabases | ( | ) |
Removes all databases from the catalog set. This is necessary for the database instance's destructor, as the database manager has to be alive when destroying the catalog set objects.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |