mirror of
https://github.com/getml/sqlgen.git
synced 2026-01-04 08:30:30 -06:00
Adapted get_schema and get_tablename
This commit is contained in:
@@ -13,8 +13,7 @@ template <class T>
|
||||
std::optional<std::string> get_schema() noexcept {
|
||||
using Type = std::remove_cvref_t<T>;
|
||||
if constexpr (has_schema<Type>) {
|
||||
using LiteralType = typename Type::schema;
|
||||
return LiteralType().str();
|
||||
return std::string(Type::schema);
|
||||
} else {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
@@ -24,8 +24,7 @@ template <class T>
|
||||
std::string get_tablename() noexcept {
|
||||
using Type = std::remove_cvref_t<T>;
|
||||
if constexpr (has_tablename<Type>) {
|
||||
using LiteralType = typename Type::tablename;
|
||||
return LiteralType().str();
|
||||
return std::string(Type::tablename);
|
||||
} else {
|
||||
return internal::remove_namespaces(rfl::type_name_t<Type>().str());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user