updated build system
This commit is contained in:
parent
6645b322bd
commit
52a2df2576
@ -34,7 +34,7 @@ public:
|
|||||||
context(sqlite3 &db3_, std::string table_name_)
|
context(sqlite3 &db3_, std::string table_name_)
|
||||||
: db_context_t(db3_, table_name_) {}
|
: db_context_t(db3_, table_name_) {}
|
||||||
|
|
||||||
using w_t = db_where_with_limit_t<context, db_select>;
|
using w_t = db_where_limit_t<context, db_select>;
|
||||||
|
|
||||||
std::vector<std::string> columns;
|
std::vector<std::string> columns;
|
||||||
std::map<std::string, std::string> count_columns;
|
std::map<std::string, std::string> count_columns;
|
||||||
|
@ -33,7 +33,8 @@ public:
|
|||||||
struct context final : db_context_t {
|
struct context final : db_context_t {
|
||||||
context(sqlite3 &db3_, std::string table_name_)
|
context(sqlite3 &db3_, std::string table_name_)
|
||||||
: db_context_t(db3_, table_name_) {}
|
: db_context_t(db3_, table_name_) {}
|
||||||
using w_t = db_where_with_limit_t<context, db_update>;
|
|
||||||
|
using w_t = db_where_limit_t<context, db_update>;
|
||||||
|
|
||||||
std::map<std::string, db_types_t> column_values;
|
std::map<std::string, db_types_t> column_values;
|
||||||
std::optional<std::int32_t> limit;
|
std::optional<std::int32_t> limit;
|
||||||
|
@ -158,16 +158,16 @@ struct db_comp_next_limit_t final {
|
|||||||
auto not_equals(db_types_t value) -> wn_t { return create("!=", value); };
|
auto not_equals(db_types_t value) -> wn_t { return create("!=", value); };
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename ctx_t, typename op_t> struct db_where_with_limit_t final {
|
template <typename ctx_t, typename op_t> struct db_where_limit_t final {
|
||||||
std::shared_ptr<ctx_t> ctx;
|
std::shared_ptr<ctx_t> ctx;
|
||||||
|
|
||||||
using cn_t = db_comp_next_limit_t<ctx_t, op_t, db_where_with_limit_t>;
|
using cn_t = db_comp_next_limit_t<ctx_t, op_t, db_where_limit_t>;
|
||||||
using wn_t = db_where_next_limit_t<cn_t, ctx_t, op_t, db_where_with_limit_t>;
|
using wn_t = db_where_next_limit_t<cn_t, ctx_t, op_t, db_where_limit_t>;
|
||||||
using n_t = db_next_limit_t<cn_t, ctx_t, op_t, db_where_with_limit_t, wn_t>;
|
using n_t = db_next_limit_t<cn_t, ctx_t, op_t, db_where_limit_t, wn_t>;
|
||||||
|
|
||||||
using group_func_t = std::function<void(db_where_with_limit_t &)>;
|
using group_func_t = std::function<void(db_where_limit_t &)>;
|
||||||
|
|
||||||
using action_t = std::variant<db_comp_data_t, n_t, db_where_with_limit_t>;
|
using action_t = std::variant<db_comp_data_t, n_t, db_where_limit_t>;
|
||||||
|
|
||||||
std::vector<action_t> actions{};
|
std::vector<action_t> actions{};
|
||||||
std::vector<db_where_limit_t> sub_actions{};
|
std::vector<db_where_limit_t> sub_actions{};
|
||||||
@ -186,7 +186,7 @@ template <typename ctx_t, typename op_t> struct db_where_with_limit_t final {
|
|||||||
stream << ' ' << next.action << ' '
|
stream << ' ' << next.action << ' '
|
||||||
<< dump(idx, next.get_next());
|
<< dump(idx, next.get_next());
|
||||||
},
|
},
|
||||||
[&idx, &stream](const db_where_with_limit_t &where) {
|
[&idx, &stream](const db_where_limit_t &where) {
|
||||||
stream << '(' << dump(idx, where) << ')';
|
stream << '(' << dump(idx, where) << ')';
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -203,7 +203,7 @@ template <typename ctx_t, typename op_t> struct db_where_with_limit_t final {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] auto group(group_func_t func) -> wn_t {
|
[[nodiscard]] auto group(group_func_t func) -> wn_t {
|
||||||
db_where_with_limit_t where{ctx};
|
db_where_limit_t where{ctx};
|
||||||
func(where);
|
func(where);
|
||||||
|
|
||||||
actions.emplace_back(std::move(where));
|
actions.emplace_back(std::move(where));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user