mirror of
https://github.com/rbock/sqlpp11.git
synced 2026-04-30 16:09:30 -05:00
We now have unique name representations per name
Before this, there could be multiple classes representing multiple id columns. Now there is one class representing ALL the name "id". Very important for analyzing potential name clashes.
This commit is contained in:
@@ -28,13 +28,15 @@
|
||||
#define SQLPP_ALIAS_PROVIDER_H
|
||||
|
||||
#include <type_traits>
|
||||
#include <sqlpp11/char_sequence.h>
|
||||
|
||||
#define SQLPP_ALIAS_PROVIDER(name) \
|
||||
struct name##_t\
|
||||
{\
|
||||
struct _name_t\
|
||||
struct _alias_t\
|
||||
{\
|
||||
static constexpr const char* _get_name() { return #name; }\
|
||||
static constexpr const char _literal[] = #name;\
|
||||
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;\
|
||||
template<typename T>\
|
||||
struct _member_t\
|
||||
{\
|
||||
@@ -55,7 +57,7 @@ namespace sqlpp
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct is_alias_provider_t<T, typename std::enable_if<std::is_class<typename T::_name_t::template _member_t<int>>::value, void>::type>
|
||||
struct is_alias_provider_t<T, typename std::enable_if<std::is_class<typename T::_alias_t::template _member_t<int>>::value, void>::type>
|
||||
{
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user