diff --git a/support/include/utils/db/sqlite/db_delete.hpp b/support/include/utils/db/sqlite/db_delete.hpp index 91c7ee79..4b92fad3 100644 --- a/support/include/utils/db/sqlite/db_delete.hpp +++ b/support/include/utils/db/sqlite/db_delete.hpp @@ -45,8 +45,8 @@ public: using w_t = db_where_t; std::optional where; + std::map> where_actions; std::vector where_values; - std::map> actions; void clear(); }; diff --git a/support/include/utils/db/sqlite/db_select.hpp b/support/include/utils/db/sqlite/db_select.hpp index 3854ab8d..b764b2ab 100644 --- a/support/include/utils/db/sqlite/db_select.hpp +++ b/support/include/utils/db/sqlite/db_select.hpp @@ -58,8 +58,8 @@ public: std::optional limit; std::optional> order_by; std::optional where; + std::map> where_actions; std::vector where_values; - std::map> actions; void clear(); }; diff --git a/support/include/utils/db/sqlite/db_update.hpp b/support/include/utils/db/sqlite/db_update.hpp index 3de36774..acdc9fa0 100644 --- a/support/include/utils/db/sqlite/db_update.hpp +++ b/support/include/utils/db/sqlite/db_update.hpp @@ -53,8 +53,8 @@ public: std::optional limit; std::optional> order_by; std::optional where; + std::map> where_actions; std::vector where_values; - std::map> actions; void clear(); }; diff --git a/support/include/utils/db/sqlite/db_where_t.hpp b/support/include/utils/db/sqlite/db_where_t.hpp index 759a84fb..ee9468d3 100644 --- a/support/include/utils/db/sqlite/db_where_t.hpp +++ b/support/include/utils/db/sqlite/db_where_t.hpp @@ -72,7 +72,7 @@ struct db_where_next_t final { "AND", }; - ctx->actions[action_idx].emplace_back(next); + ctx->where_actions[action_idx].emplace_back(next); return next; } @@ -97,7 +97,7 @@ struct db_where_next_t final { "OR", }; - ctx->actions[action_idx].emplace_back(next); + ctx->where_actions[action_idx].emplace_back(next); return next; } }; @@ -111,7 +111,7 @@ struct db_comp_next_t final { using wn_t = db_where_next_t; [[nodiscard]] auto create(std::string operation, db_types_t value) { - ctx->actions[action_idx].emplace_back(db_comp_data_t{ + ctx->where_actions[action_idx].emplace_back(db_comp_data_t{ column_name, operation, }); @@ -177,24 +177,24 @@ template struct db_where_t final { [[nodiscard]] auto dump() const -> std::string { return op_t{ctx}.dump(); } [[nodiscard]] auto dump(std::int32_t &idx) const -> std::string { - return dump(idx, ctx->actions[action_idx]); + return dump(idx, ctx->where_actions[action_idx]); } [[nodiscard]] auto get_actions() -> auto & { - return ctx->actions[action_idx]; + return ctx->where_actions[action_idx]; } [[nodiscard]] auto get_actions() const -> const auto & { - return ctx->actions[action_idx]; + return ctx->where_actions[action_idx]; } [[nodiscard]] auto group(group_func_t func) -> wn_t { - ctx->actions[action_idx]; + ctx->where_actions[action_idx]; - db_where_t where{ctx->actions.size(), ctx}; + db_where_t where{ctx->where_actions.size(), ctx}; func(where); - ctx->actions[action_idx].emplace_back(where); + ctx->where_actions[action_idx].emplace_back(where); return wn_t{ action_idx, @@ -203,7 +203,7 @@ template struct db_where_t final { } [[nodiscard]] auto where(std::string column_name) -> cn_t { - ctx->actions[action_idx]; + ctx->where_actions[action_idx]; return cn_t{ action_idx,