|
- #pragma once
-
- #include "schema.h"
-
- #include <cpphibernate/types.inl>
- #include "../tables/tables.inl"
-
- namespace cpphibernate {
- namespace mariadb {
-
- /* schema_t */
-
- template<typename T_schema>
- schema_t::schema_t(const T_schema& p_schema)
- : name (p_schema.name)
- , tables(make_tables(*this, p_schema))
- { init(); }
-
- namespace __impl
- {
-
- /* schema_builder */
-
- template<typename T, typename>
- struct schema_builder
- {
- template<typename... T_args>
- static constexpr decltype(auto) apply(T_args&&... args)
- { static_assert(sizeof...(args) == -1, "Invalid parameters for mariadb::make_schema(...)!"); }
- };
-
- template<typename T_schema>
- struct schema_builder<
- mp::list<T_schema>,
- mp::enable_if_t<
- schema::is_schema_v<mp::decay_t<T_schema>>>>
- {
- static decltype(auto) apply(const T_schema& p_schema)
- { return std::make_unique<schema_t>(p_schema); }
- };
-
- }
-
- } }
|