25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 

51 satır
1.1 KiB

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