template<enum_type ENUM>
struct pqxx::internal::enum_traits< ENUM >
Helper class for defining enum conversions.
The conversion will convert enum values to numeric strings, and vice versa.
- Warning
- These numeric strings do not actually help you with the database, where enum values are textual strings. Once we have reflection in C++26, it should become easier to provide real support.
To define a string conversion for an enum type, derive a string_traits specialisation for the enum from this struct.
There's usually an easier way though: the PQXX_DECLARE_ENUM_CONVERSION macro. Use enum_traits manually only if you need to customise your traits type in more detail.