pica/database/dbinterface.cpp

24 lines
503 B
C++
Raw Normal View History

2023-12-07 20:32:43 +00:00
#include "dbinterface.h"
#include "mysql/mysql.h"
DBInterface::DBInterface(Type type):
type(type),
state(State::disconnected)
{}
DBInterface::~DBInterface() {}
std::unique_ptr<DBInterface> DBInterface::create(Type type) {
switch (type) {
case Type::mysql:
return std::make_unique<MySQL>();
}
throw std::runtime_error("Unexpected database type: " + std::to_string((uint8_t)type));
}
DBInterface::State DBInterface::currentState() const {
return state;
}