Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions dev/statement_serializator.h
Original file line number Diff line number Diff line change
Expand Up @@ -1642,10 +1642,10 @@ namespace sqlite_orm {
std::stringstream ss;
ss << '(';
auto index = 0;
const auto tupleSize = int(std::tuple_size<statement_type>::value);
using TupleSize = std::tuple_size<statement_type>;
iterate_tuple(statement, [&context, &index, &ss](auto &value) {
ss << serialize(value, context);
if(index < tupleSize - 1) {
if(index < TupleSize::value - 1) {
ss << ", ";
}
++index;
Expand All @@ -1670,10 +1670,10 @@ namespace sqlite_orm {
auto index = 0;
auto &tuple = statement.tuple;
using tuple_type = typename std::decay<decltype(tuple)>::type;
const auto tupleSize = int(std::tuple_size<tuple_type>::value);
using TupleSize = std::tuple_size<tuple_type>;
iterate_tuple(tuple, [&context, &index, &ss](auto &value) {
ss << serialize(value, context);
if(index < tupleSize - 1) {
if(index < TupleSize::value - 1) {
ss << ", ";
}
++index;
Expand Down
12 changes: 8 additions & 4 deletions include/sqlite_orm/sqlite_orm.h
Original file line number Diff line number Diff line change
Expand Up @@ -5375,6 +5375,10 @@ namespace sqlite_orm {

}

/**
* Use this function to specify indexed column inside `make_index` function call.
* Example: make_index("index_name", indexed_column(&User::id).asc())
*/
template<class C>
internal::indexed_column_t<C> indexed_column(C column_or_expression) {
return {std::move(column_or_expression)};
Expand Down Expand Up @@ -11114,10 +11118,10 @@ namespace sqlite_orm {
std::stringstream ss;
ss << '(';
auto index = 0;
const auto tupleSize = int(std::tuple_size<statement_type>::value);
using TupleSize = std::tuple_size<statement_type>;
iterate_tuple(statement, [&context, &index, &ss](auto &value) {
ss << serialize(value, context);
if(index < tupleSize - 1) {
if(index < TupleSize::value - 1) {
ss << ", ";
}
++index;
Expand All @@ -11142,10 +11146,10 @@ namespace sqlite_orm {
auto index = 0;
auto &tuple = statement.tuple;
using tuple_type = typename std::decay<decltype(tuple)>::type;
const auto tupleSize = int(std::tuple_size<tuple_type>::value);
using TupleSize = std::tuple_size<tuple_type>;
iterate_tuple(tuple, [&context, &index, &ss](auto &value) {
ss << serialize(value, context);
if(index < tupleSize - 1) {
if(index < TupleSize::value - 1) {
ss << ", ";
}
++index;
Expand Down
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ else()
add_subdirectory(third_party/sqlite)
endif()

add_executable(unit_tests tests.cpp tests2.cpp tests3.cpp tests4.cpp tests5.cpp private_getters_tests.cpp pragma_tests.cpp explicit_columns.cpp core_functions_tests.cpp index_tests.cpp constraints/composite_key.cpp static_tests.cpp operators/arithmetic_operators.cpp operators/like.cpp operators/glob.cpp operators/in.cpp operators/cast.cpp operators/is_null.cpp operators/not_operator.cpp operators/bitwise.cpp dynamic_order_by.cpp prepared_statement_tests/select.cpp prepared_statement_tests/get_all.cpp prepared_statement_tests/get_all_pointer.cpp prepared_statement_tests/get_all_optional.cpp prepared_statement_tests/update_all.cpp prepared_statement_tests/remove_all.cpp prepared_statement_tests/get.cpp prepared_statement_tests/get_pointer.cpp prepared_statement_tests/get_optional.cpp prepared_statement_tests/update.cpp prepared_statement_tests/remove.cpp prepared_statement_tests/insert.cpp prepared_statement_tests/replace.cpp prepared_statement_tests/insert_range.cpp prepared_statement_tests/replace_range.cpp prepared_statement_tests/insert_explicit.cpp pragma_tests.cpp simple_query.cpp static_tests/is_bindable.cpp static_tests/arithmetic_operators_result_type.cpp static_tests/tuple_conc.cpp static_tests/node_tuple.cpp static_tests/bindable_filter.cpp static_tests/count_tuple.cpp static_tests/member_traits_tests.cpp static_tests/select_return_type.cpp constraints/default.cpp constraints/unique.cpp constraints/foreign_key.cpp constraints/check.cpp table_tests.cpp statement_serializator_tests/primary_key.cpp statement_serializator_tests/column_names.cpp statement_serializator_tests/autoincrement.cpp statement_serializator_tests/arithmetic_operators.cpp statement_serializator_tests/core_functions.cpp statement_serializator_tests/comparison_operators.cpp statement_serializator_tests/unique.cpp statement_serializator_tests/foreign_key.cpp statement_serializator_tests/collate.cpp statement_serializator_tests/check.cpp statement_serializator_tests/index.cpp statement_serializator_tests/indexed_column.cpp unique_cases/get_all_with_two_tables.cpp unique_cases/prepare_get_all_with_case.cpp unique_cases/index_named_table_with_fk.cpp unique_cases/issue525.cpp get_all_custom_containers.cpp select_asterisk.cpp backup_tests.cpp)
add_executable(unit_tests tests.cpp tests2.cpp tests3.cpp tests4.cpp tests5.cpp private_getters_tests.cpp pragma_tests.cpp explicit_columns.cpp core_functions_tests.cpp index_tests.cpp constraints/composite_key.cpp static_tests.cpp operators/arithmetic_operators.cpp operators/like.cpp operators/glob.cpp operators/in.cpp operators/cast.cpp operators/is_null.cpp operators/not_operator.cpp operators/bitwise.cpp dynamic_order_by.cpp prepared_statement_tests/select.cpp prepared_statement_tests/get_all.cpp prepared_statement_tests/get_all_pointer.cpp prepared_statement_tests/get_all_optional.cpp prepared_statement_tests/update_all.cpp prepared_statement_tests/remove_all.cpp prepared_statement_tests/get.cpp prepared_statement_tests/get_pointer.cpp prepared_statement_tests/get_optional.cpp prepared_statement_tests/update.cpp prepared_statement_tests/remove.cpp prepared_statement_tests/insert.cpp prepared_statement_tests/replace.cpp prepared_statement_tests/insert_range.cpp prepared_statement_tests/replace_range.cpp prepared_statement_tests/insert_explicit.cpp pragma_tests.cpp simple_query.cpp static_tests/is_bindable.cpp static_tests/arithmetic_operators_result_type.cpp static_tests/tuple_conc.cpp static_tests/node_tuple.cpp static_tests/bindable_filter.cpp static_tests/count_tuple.cpp static_tests/member_traits_tests.cpp static_tests/select_return_type.cpp constraints/default.cpp constraints/unique.cpp constraints/foreign_key.cpp constraints/check.cpp table_tests.cpp statement_serializator_tests/primary_key.cpp statement_serializator_tests/column_names.cpp statement_serializator_tests/autoincrement.cpp statement_serializator_tests/arithmetic_operators.cpp statement_serializator_tests/core_functions.cpp statement_serializator_tests/comparison_operators.cpp statement_serializator_tests/unique.cpp statement_serializator_tests/foreign_key.cpp statement_serializator_tests/collate.cpp statement_serializator_tests/check.cpp statement_serializator_tests/index.cpp statement_serializator_tests/indexed_column.cpp unique_cases/get_all_with_two_tables.cpp unique_cases/prepare_get_all_with_case.cpp unique_cases/index_named_table_with_fk.cpp unique_cases/issue525.cpp unique_cases/delete_with_two_fields.cpp get_all_custom_containers.cpp select_asterisk.cpp backup_tests.cpp)


if(SQLITE_ORM_OMITS_CODECVT)
Expand Down