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.
Loading...
Searching...
No Matches
duckdb::CatalogEntryRetriever Class Reference
Collaboration diagram for duckdb::CatalogEntryRetriever:

Public Member Functions

 CatalogEntryRetriever (ClientContext &context)
 
 CatalogEntryRetriever (const CatalogEntryRetriever &other)
 
void Inherit (const CatalogEntryRetriever &parent)
 
ClientContextGetContext ()
 
optional_ptr< CatalogEntryGetEntry (const string &catalog, const string &schema, const EntryLookupInfo &lookup_info, OnEntryNotFound on_entry_not_found=OnEntryNotFound::THROW_EXCEPTION)
 
optional_ptr< CatalogEntryGetEntry (Catalog &catalog, const string &schema, const EntryLookupInfo &lookup_info, OnEntryNotFound on_entry_not_found=OnEntryNotFound::THROW_EXCEPTION)
 
LogicalType GetType (const string &catalog, const string &schema, const string &name, OnEntryNotFound on_entry_not_found=OnEntryNotFound::RETURN_NULL)
 
LogicalType GetType (Catalog &catalog, const string &schema, const string &name, OnEntryNotFound on_entry_not_found=OnEntryNotFound::RETURN_NULL)
 
optional_ptr< SchemaCatalogEntryGetSchema (const string &catalog, const EntryLookupInfo &schema_lookup, OnEntryNotFound on_entry_not_found=OnEntryNotFound::THROW_EXCEPTION)
 
const CatalogSearchPathGetSearchPath () const
 
void SetSearchPath (vector< CatalogSearchEntry > entries)
 
void SetCallback (catalog_entry_callback_t callback)
 
catalog_entry_callback_t GetCallback ()
 
optional_ptr< BoundAtClauseGetAtClause () const
 
void SetAtClause (optional_ptr< BoundAtClause > at_clause)
 

Private Member Functions

optional_ptr< CatalogEntryReturnAndCallback (optional_ptr< CatalogEntry > result)
 

Private Attributes

catalog_entry_callback_t callback = nullptr
 (optional) callback, called on every successful entry retrieval
 
ClientContextcontext
 
shared_ptr< CatalogSearchPathsearch_path
 
optional_ptr< BoundAtClauseat_clause
 

Constructor & Destructor Documentation

◆ CatalogEntryRetriever() [1/2]

duckdb::CatalogEntryRetriever::CatalogEntryRetriever ( ClientContext context)
inlineexplicit
932 : context(context) {
933 }

◆ CatalogEntryRetriever() [2/2]

duckdb::CatalogEntryRetriever::CatalogEntryRetriever ( const CatalogEntryRetriever other)
inline
934 : callback(other.callback), context(other.context) {
935 }
catalog_entry_callback_t callback
(optional) callback, called on every successful entry retrieval
Definition duckdb.cpp:971

Member Function Documentation

◆ Inherit()

void duckdb::CatalogEntryRetriever::Inherit ( const CatalogEntryRetriever parent)
22221 {
22222 this->callback = parent.callback;
22223 this->search_path = parent.search_path;
22224 this->at_clause = parent.at_clause;
22225}

◆ GetContext()

ClientContext & duckdb::CatalogEntryRetriever::GetContext ( )
inline
939 {
940 return context;
941 }

◆ GetEntry() [1/2]

optional_ptr< CatalogEntry > duckdb::CatalogEntryRetriever::GetEntry ( const string &  catalog,
const string &  schema,
const EntryLookupInfo lookup_info,
OnEntryNotFound  on_entry_not_found = OnEntryNotFound::THROW_EXCEPTION 
)
22185 {
22186 return ReturnAndCallback(Catalog::GetEntry(*this, catalog, schema, lookup_info, on_entry_not_found));
22187}
DUCKDB_API optional_ptr< CatalogEntry > GetEntry(ClientContext &context, const string &schema, const EntryLookupInfo &lookup_info, OnEntryNotFound if_not_found)
Gets the "schema.name" entry of the specified type, if entry does not exist behavior depends on OnEnt...
Definition duckdb.cpp:8156

◆ GetEntry() [2/2]

optional_ptr< CatalogEntry > duckdb::CatalogEntryRetriever::GetEntry ( Catalog catalog,
const string &  schema,
const EntryLookupInfo lookup_info,
OnEntryNotFound  on_entry_not_found = OnEntryNotFound::THROW_EXCEPTION 
)
22206 {
22207 return ReturnAndCallback(catalog.GetEntry(*this, schema, lookup_info, on_entry_not_found));
22208}

◆ GetType() [1/2]

LogicalType duckdb::CatalogEntryRetriever::GetType ( const string &  catalog,
const string &  schema,
const string &  name,
OnEntryNotFound  on_entry_not_found = OnEntryNotFound::RETURN_NULL 
)
22173 {
22174 EntryLookupInfo lookup_info(CatalogType::TYPE_ENTRY, name);
22175 auto result = GetEntry(catalog, schema, lookup_info, on_entry_not_found);
22176 if (!result) {
22177 return LogicalType::INVALID;
22178 }
22179 auto &type_entry = result->Cast<TypeCatalogEntry>();
22180 return type_entry.user_type;
22181}

◆ GetType() [2/2]

LogicalType duckdb::CatalogEntryRetriever::GetType ( Catalog catalog,
const string &  schema,
const string &  name,
OnEntryNotFound  on_entry_not_found = OnEntryNotFound::RETURN_NULL 
)
22162 {
22163 EntryLookupInfo lookup_info(CatalogType::TYPE_ENTRY, name);
22164 auto result = GetEntry(catalog, schema, lookup_info, on_entry_not_found);
22165 if (!result) {
22166 return LogicalType::INVALID;
22167 }
22168 auto &type_entry = result->Cast<TypeCatalogEntry>();
22169 return type_entry.user_type;
22170}

◆ GetSchema()

optional_ptr< SchemaCatalogEntry > duckdb::CatalogEntryRetriever::GetSchema ( const string &  catalog,
const EntryLookupInfo schema_lookup,
OnEntryNotFound  on_entry_not_found = OnEntryNotFound::THROW_EXCEPTION 
)
22191 {
22192 EntryLookupInfo schema_lookup(schema_lookup_p, at_clause);
22193 auto result = Catalog::GetSchema(*this, catalog, schema_lookup, on_entry_not_found);
22194 if (!result) {
22195 return result;
22196 }
22197 if (callback) {
22198 // Call the callback if it's set
22199 callback(*result);
22200 }
22201 return result;
22202}
DUCKDB_API SchemaCatalogEntry & GetSchema(ClientContext &context, const EntryLookupInfo &schema_lookup)
Returns the schema object with the specified name, or throws an exception if it does not exist.
Definition duckdb.cpp:7493

◆ GetSearchPath()

const CatalogSearchPath & duckdb::CatalogEntryRetriever::GetSearchPath ( ) const
22227 {
22228 if (search_path) {
22229 return *search_path;
22230 }
22231 return *ClientData::Get(context).catalog_search_path;
22232}

◆ SetSearchPath()

void duckdb::CatalogEntryRetriever::SetSearchPath ( vector< CatalogSearchEntry entries)
22234 {
22235 vector<CatalogSearchEntry> new_path;
22236 for (auto &entry : entries) {
22237 if (IsInvalidCatalog(entry.catalog) || entry.catalog == SYSTEM_CATALOG || entry.catalog == TEMP_CATALOG) {
22238 continue;
22239 }
22240 new_path.push_back(std::move(entry));
22241 }
22242 if (new_path.empty()) {
22243 return;
22244 }
22245
22246 // push the set paths from the ClientContext behind the provided paths
22247 auto &client_search_path = *ClientData::Get(context).catalog_search_path;
22248 auto &set_paths = client_search_path.GetSetPaths();
22249 for (auto path : set_paths) {
22250 if (IsInvalidCatalog(path.catalog)) {
22251 path.catalog = DatabaseManager::GetDefaultDatabase(context);
22252 }
22253 new_path.push_back(std::move(path));
22254 }
22255
22256 this->search_path = make_shared_ptr<CatalogSearchPath>(context, std::move(new_path));
22257}

◆ SetCallback()

void duckdb::CatalogEntryRetriever::SetCallback ( catalog_entry_callback_t  callback)
22267 {
22268 this->callback = std::move(callback);
22269}

◆ GetCallback()

catalog_entry_callback_t duckdb::CatalogEntryRetriever::GetCallback ( )
22271 {
22272 return callback;
22273}

◆ GetAtClause()

optional_ptr< BoundAtClause > duckdb::CatalogEntryRetriever::GetAtClause ( ) const
22259 {
22260 return at_clause;
22261}

◆ SetAtClause()

void duckdb::CatalogEntryRetriever::SetAtClause ( optional_ptr< BoundAtClause at_clause)
22263 {
22264 at_clause = at_clause_p;
22265}

◆ ReturnAndCallback()

optional_ptr< CatalogEntry > duckdb::CatalogEntryRetriever::ReturnAndCallback ( optional_ptr< CatalogEntry result)
private
22210 {
22211 if (!result) {
22212 return result;
22213 }
22214 if (callback) {
22215 // Call the callback if it's set
22216 callback(*result);
22217 }
22218 return result;
22219}

The documentation for this class was generated from the following file: