MongoDB: add missing name accessor to get database name. (#4020)

This commit is contained in:
Matej Kenda
2023-05-05 15:33:21 +02:00
committed by GitHub
parent dd21b48d05
commit 9a2c16f55a

View File

@@ -45,6 +45,9 @@ public:
virtual ~Database(); virtual ~Database();
/// Destroys the Database. /// Destroys the Database.
const std::string& name() const;
/// Database name
bool authenticate(Connection& connection, const std::string& username, const std::string& password, const std::string& method = AUTH_SCRAM_SHA1); bool authenticate(Connection& connection, const std::string& username, const std::string& password, const std::string& method = AUTH_SCRAM_SHA1);
/// Authenticates against the database using the given connection, /// Authenticates against the database using the given connection,
/// username and password, as well as authentication method. /// username and password, as well as authentication method.
@@ -160,6 +163,12 @@ private:
// //
// inlines // inlines
// //
inline const std::string& Database::name() const
{
return _dbname;
}
inline Poco::SharedPtr<Poco::MongoDB::QueryRequest> Database::createCommand() const inline Poco::SharedPtr<Poco::MongoDB::QueryRequest> Database::createCommand() const
{ {
Poco::SharedPtr<Poco::MongoDB::QueryRequest> cmd = createQueryRequest("$cmd"); Poco::SharedPtr<Poco::MongoDB::QueryRequest> cmd = createQueryRequest("$cmd");