47constexpr std::string_view to_string(
RelationError error)
noexcept
52 return "NotConfigured";
78 std::runtime_error(std::format(
"Could not load the data record: {} ({})", columnType, to_string(error))),
97struct std::formatter<Lightweight::
RelationError>: std::formatter<std::string_view>
102 return std::formatter<std::string_view>::format(Lightweight::to_string(error), ctx);
Raised by the relation shortcuts that cannot return a RelationResult - operator->,...
SqlRequireLoadedError(std::string_view columnType, RelationError error=RelationError::NotConfigured)
RelationError Error() const noexcept
std::expected< T, RelationError > RelationResult
The outcome of a relation access: the requested value, or why it is unavailable.
RelationError
Why a relation could not provide its record(s).
@ NotFound
There is nothing to load: the foreign key is NULL, or the referenced row does not exist.