Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

key_properties.inl 1.1 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #pragma once
  2. #include "key_properties.h"
  3. namespace cpphibernate {
  4. namespace mariadb {
  5. /* key_properties */
  6. template<>
  7. struct key_properties<uuid, void>
  8. {
  9. using key_type = uuid;
  10. static bool is_default(const key_type& key)
  11. { return key == key_type(); }
  12. static constexpr bool is_auto_generated()
  13. { return false; }
  14. static constexpr const char * create_table_argument()
  15. { return nullptr; }
  16. static constexpr const char * create_key_query()
  17. { return "SELECT Uuid()"; }
  18. };
  19. template<typename T_key>
  20. struct key_properties<
  21. T_key,
  22. mp::enable_if_t<mp::is_integral_v<mp::decay_t<T_key>>>>
  23. {
  24. using key_type = mp::decay_t<T_key>;
  25. static bool is_default(const key_type& key)
  26. { return key == key_type(); }
  27. static constexpr bool is_auto_generated()
  28. { return true; }
  29. static constexpr const char * create_table_argument()
  30. { return "AUTO_INCREMENT"; }
  31. static constexpr const char * create_key_query()
  32. { return nullptr; }
  33. };
  34. } }