27 lines
636 B
C++
27 lines
636 B
C++
#ifndef MATADOR_SCHEMA_HPP
|
|
#define MATADOR_SCHEMA_HPP
|
|
|
|
#include "matador/object/repository.hpp"
|
|
|
|
namespace matador::orm {
|
|
|
|
class schema {
|
|
public:
|
|
explicit schema(const std::string &name);
|
|
|
|
template<typename Type>
|
|
[[nodiscard]] utils::result<void, utils::error> attach(const std::string &name, const std::string &parent = "") {
|
|
return repo_.attach<Type>(name, parent);
|
|
}
|
|
|
|
template<typename Type, typename SuperType>
|
|
[[nodiscard]] utils::result<void, utils::error> attach(const std::string &name) {
|
|
return repo_.attach<Type, SuperType>(name);
|
|
}
|
|
|
|
private:
|
|
object::repository repo_;
|
|
};
|
|
|
|
}
|
|
#endif //MATADOR_SCHEMA_HPP
|