@@ -12663,17 +12663,15 @@ namespace sqlite_orm {
12663
12663
constexpr decltype(auto) materialize_column_pointer(const DBOs&,
12664
12664
const column_pointer<Moniker, alias_holder<ColAlias>>&) {
12665
12665
using table_type = storage_pick_table_t<Moniker, DBOs>;
12666
- using cte_mapper_type = cte_mapper_type_t<table_type>;
12666
+ using cte_colrefs_tuple = typename cte_mapper_type_t<table_type>::final_colrefs_tuple;
12667
+ using cte_fields_type = typename cte_mapper_type_t<table_type>::fields_type;
12667
12668
12668
12669
// lookup ColAlias in the final column references
12669
- using colalias_index =
12670
- find_tuple_type<typename cte_mapper_type::final_colrefs_tuple, alias_holder<ColAlias>>;
12671
- static_assert(colalias_index::value < std::tuple_size_v<typename cte_mapper_type::final_colrefs_tuple>,
12670
+ using colalias_index = find_tuple_type<cte_colrefs_tuple, alias_holder<ColAlias>>;
12671
+ static_assert(colalias_index::value < std::tuple_size_v<cte_colrefs_tuple>,
12672
12672
"No such column mapped into the CTE.");
12673
12673
12674
- return &aliased_field<
12675
- ColAlias,
12676
- std::tuple_element_t<colalias_index::value, typename cte_mapper_type::fields_type>>::field;
12674
+ return &aliased_field<ColAlias, std::tuple_element_t<colalias_index::value, cte_fields_type>>::field;
12677
12675
}
12678
12676
#endif
12679
12677
@@ -12697,14 +12695,13 @@ namespace sqlite_orm {
12697
12695
constexpr decltype(auto) find_column_name(const DBOs& dboObjects,
12698
12696
const column_pointer<Moniker, alias_holder<ColAlias>>&) {
12699
12697
using table_type = storage_pick_table_t<Moniker, DBOs>;
12700
- using cte_mapper_type = cte_mapper_type_t<table_type>;
12698
+ using cte_colrefs_tuple = typename cte_mapper_type_t<table_type>::final_colrefs_tuple ;
12701
12699
using column_index_sequence = filter_tuple_sequence_t<elements_type_t<table_type>, is_column>;
12702
12700
12703
12701
// note: even though the columns contain the [`aliased_field<>::*`] we perform the lookup using the column references.
12704
12702
// lookup ColAlias in the final column references
12705
- using colalias_index =
12706
- find_tuple_type<typename cte_mapper_type::final_colrefs_tuple, alias_holder<ColAlias>>;
12707
- static_assert(colalias_index::value < std::tuple_size_v<typename cte_mapper_type::final_colrefs_tuple>,
12703
+ using colalias_index = find_tuple_type<cte_colrefs_tuple, alias_holder<ColAlias>>;
12704
+ static_assert(colalias_index::value < std::tuple_size_v<cte_colrefs_tuple>,
12708
12705
"No such column mapped into the CTE.");
12709
12706
12710
12707
// note: we could "materialize" the alias to an `aliased_field<>::*` and use the regular `table_t<>::find_column_name()` mechanism;
0 commit comments