Summary
Support std::optional<T> values at the ORM mapper boundary.
Empty optionals should map to SQL NULL, while populated optionals should use normal value conversion.
Current behavior
any_to_dbvalue_or_throw() supports direct scalar values and explicit NULL values.
A mapper returning std::optional<std::string> or std::optional<std::int64_t> is rejected as an unsupported std::any type.
Expected behavior
Common optional scalar types must convert predictably without requiring every mapper to unwrap them manually.
Scope
Suggested files
modules/orm/include/vix/orm/db_compat.hpp
modules/orm/tests/optional_conversion_test.cpp
modules/orm/docs/...
Acceptance criteria
Non-goals
This issue does not include:
- automatic row-to-optional conversion;
- nested optionals;
- nullable relationship loading;
- changing
DbValue.
Suggested labels
scope:orm
type:feature
tests
good first issue
status:accepted
Summary
Support
std::optional<T>values at the ORM mapper boundary.Empty optionals should map to SQL NULL, while populated optionals should use normal value conversion.
Current behavior
any_to_dbvalue_or_throw()supports direct scalar values and explicit NULL values.A mapper returning
std::optional<std::string>orstd::optional<std::int64_t>is rejected as an unsupportedstd::anytype.Expected behavior
Common optional scalar types must convert predictably without requiring every mapper to unwrap them manually.
Scope
Suggested files
modules/orm/include/vix/orm/db_compat.hppmodules/orm/tests/optional_conversion_test.cppmodules/orm/docs/...Acceptance criteria
vix::db::null().Non-goals
This issue does not include:
DbValue.Suggested labels
scope:ormtype:featuretestsgood first issuestatus:accepted