drivers added/updated comment

This commit is contained in:
silverqx
2024-03-07 18:33:29 +01:00
parent dca9e9c20f
commit bad836352d
2 changed files with 6 additions and 2 deletions

View File

@@ -438,7 +438,7 @@ void SqlQuery::clear()
// Ownership of a weak_ptr()
const auto driver = driverWeakInternal();
// Get the SqlResult instance
// Get a new empty SqlResult instance
*this = SqlQuery(driver.lock()->createResult(driver));
}

View File

@@ -204,7 +204,11 @@ MySqlDriver::createResult(const std::weak_ptr<SqlDriver> &driver) const
/* We need to upcast here, there is no other way, it also has to be
std::weak_ptr(), it can't be done better. This upcast is kind of check,
we can't pass down the SqlDriver to the MySqlResult.
Even if it would be the shared_ptr<SqlDriver> we had to upcast the same way. */
Even if it would be the shared_ptr<SqlDriver> we had to upcast the same way.
Revisited, also, all driver data members like host, port, username, ..., and
also connectionName will be still the same, it only creates an empty result
set. I'm noting this because of SqlQuery::clear() as it was confusing that
all these data members stay unchanged, but it's correct. */
return std::make_unique<MySqlResult>(
std::dynamic_pointer_cast<MySqlDriver>(driverShared));