|
- #pragma once
-
- #include "key_properties.h"
-
- namespace cpphibernate {
- namespace mariadb {
-
- /* key_properties */
-
- template<>
- struct key_properties<uuid, void>
- {
- using key_type = uuid;
-
- static bool is_default(const key_type& key)
- { return key == key_type(); }
-
- static constexpr bool is_auto_generated()
- { return false; }
-
- static constexpr const char * create_table_argument()
- { return nullptr; }
-
- static constexpr const char * create_key_query()
- { return "SELECT Uuid()"; }
- };
-
- template<typename T_key>
- struct key_properties<
- T_key,
- mp::enable_if_t<mp::is_integral_v<mp::decay_t<T_key>>>>
- {
- using key_type = mp::decay_t<T_key>;
-
- static bool is_default(const key_type& key)
- { return key == key_type(); }
-
- static constexpr bool is_auto_generated()
- { return true; }
-
- static constexpr const char * create_table_argument()
- { return "AUTO_INCREMENT"; }
-
- static constexpr const char * create_key_query()
- { return nullptr; }
- };
-
- } }
|