7#include <unordered_map> 
    8#include <unordered_set> 
   10#include <userver/storages/postgres/exceptions.hpp> 
   11#include <userver/storages/postgres/io/pg_types.hpp> 
   12#include <userver/storages/postgres/io/type_mapping.hpp> 
   14USERVER_NAMESPACE_BEGIN
 
   22  CompositeTypeDescription(CompositeFieldDefs::const_iterator begin,
 
   23                           CompositeFieldDefs::const_iterator end)
 
   24      : attributes_{begin, end} {}
 
   25  std::size_t Size() 
const { 
return attributes_.size(); }
 
   26  bool Empty() 
const { 
return attributes_.empty(); }
 
   28    if (index >= Size()) {
 
   31    return attributes_[index];
 
   35  CompositeFieldDefs attributes_;
 
   43  UserTypes() = 
default;
 
   45  UserTypes(
UserTypes&&) 
noexcept = 
default;
 
   69  bool HasParser(Oid) 
const;
 
   71  const io::TypeBufferCategory& GetTypeBufferCategories() 
const;
 
   74  void AddCompositeFields(CompositeFieldDefs&& defs);
 
   93  DescriptionSet types_;
 
   96  io::TypeBufferCategory buffer_categories_;
 
   97  CompositeTypes composite_types_;
 
  100namespace io::detail {
 
  103inline constexpr DBTypeName kPgUserTypeName = CppToUserPg<T>::postgres_name;
 
  106struct CppToUserPgImpl {
 
  107  static_assert(
io::
traits::CheckParser<T>());
 
  110  using Mapping = CppToUserPg<T>;
 
  111  static constexpr DBTypeName postgres_name = kPgUserTypeName<T>;
 
  112  static const detail::RegisterUserTypeParser init_;
 
  113  static Oid GetOid(
const UserTypes& user_types) {
 
  115    return user_types.FindOid(init_.postgres_name);
 
  117  static Oid GetArrayOid(
const UserTypes& user_types) {
 
  119    return user_types.FindArrayOid(init_.postgres_name);
 
  124const RegisterUserTypeParser CppToUserPgImpl<T>::init_ =
 
  125    RegisterUserTypeParser::Register(kPgUserTypeName<T>,
 
  129void LogRegisteredTypesOnce();