schema progress
This commit is contained in:
parent
3ae2b003aa
commit
d7758e827d
|
|
@ -0,0 +1,27 @@
|
||||||
|
#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
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
add_library(matador-orm STATIC
|
add_library(matador-orm STATIC
|
||||||
../../include/matador/orm/error_code.hpp
|
../../include/matador/orm/error_code.hpp
|
||||||
|
../../include/matador/orm/schema.hpp
|
||||||
../../include/matador/orm/session.hpp
|
../../include/matador/orm/session.hpp
|
||||||
../../include/matador/orm/session_insert_builder.hpp
|
../../include/matador/orm/session_insert_builder.hpp
|
||||||
../../include/matador/orm/session_query_builder.hpp
|
../../include/matador/orm/session_query_builder.hpp
|
||||||
|
|
@ -71,6 +72,7 @@ add_library(matador-orm STATIC
|
||||||
../../include/matador/sql/table.hpp
|
../../include/matador/sql/table.hpp
|
||||||
orm/error_code.cpp
|
orm/error_code.cpp
|
||||||
orm/query_builder_exception.cpp
|
orm/query_builder_exception.cpp
|
||||||
|
orm/schema.cpp
|
||||||
orm/session.cpp
|
orm/session.cpp
|
||||||
orm/session_insert_builder.cpp
|
orm/session_insert_builder.cpp
|
||||||
orm/session_query_builder.cpp
|
orm/session_query_builder.cpp
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
#include "matador/orm/schema.hpp"
|
||||||
|
|
||||||
|
namespace matador::orm {
|
||||||
|
schema::schema( const std::string& name )
|
||||||
|
: repo_(name){}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue