Closed spiritEcosse closed 2 weeks ago
getFastDbClient() should run in IO loop or main loop.
Use like this in test:
drogon::app().getLoop()->runInLoop([TEST_CTX](){
auto dbClient = drogon::app().getFastDbClient("default");
REQUIRE(dbClient != nullptr); // Ensure the dbClient is not null
// Add your test logic here
});
Thanks a lot, @hwc0919. It works.
Hello there!
Here is my code where i try to access db from DROGON_TEST but in the test in a line
i get an error
How can i fix it ?
Thanks in advance.