Created an interface for the Db class

This commit is contained in:
emeric
2025-07-09 00:29:16 +02:00
parent ecdfa8d68d
commit 764c92698c
106 changed files with 315 additions and 284 deletions
+7 -2
View File
@@ -17,8 +17,6 @@
* along with LMS. If not, see <http://www.gnu.org/licenses/>.
*/
#include "database/Db.hpp"
#include <functional>
#include <memory>
@@ -31,6 +29,8 @@
#include "database/Session.hpp"
#include "database/User.hpp"
#include "Db.hpp"
namespace lms::db
{
namespace
@@ -134,6 +134,11 @@ namespace lms::db
}
} // namespace
std::unique_ptr<IDb> createDb(const std::filesystem::path& dbPath, std::size_t connectionCount)
{
return std::make_unique<Db>(dbPath, connectionCount);
}
// Session living class handling the database and the login
Db::Db(const std::filesystem::path& dbPath, std::size_t connectionCount)
{