This commit is contained in:
2024-10-08 14:15:53 -05:00
parent 37d393c1f9
commit 8cc6868480
7 changed files with 97 additions and 85 deletions

View File

@ -240,7 +240,7 @@ struct db_next_t final {
[[nodiscard]] auto dump() const -> std::string { return op_t{ctx}.dump(); }
[[nodiscard]] auto dump(std::int64_t &idx) const -> std::string {
[[nodiscard]] auto dump(std::int32_t &idx) const -> std::string {
return ctx->where->dump(idx);
}
@ -267,7 +267,7 @@ struct db_next_limit_t final {
[[nodiscard]] auto dump() const -> std::string { return op_t{ctx}.dump(); }
[[nodiscard]] auto dump(std::int64_t &idx) const -> std::string {
[[nodiscard]] auto dump(std::int32_t &idx) const -> std::string {
return ctx->where->dump(idx);
}
@ -304,7 +304,7 @@ struct db_where_next_t final {
[[nodiscard]] auto dump() const -> std::string { return op_t{ctx}.dump(); }
[[nodiscard]] auto dump(std::int64_t &idx) const -> std::string {
[[nodiscard]] auto dump(std::int32_t &idx) const -> std::string {
return ctx->where->dump(idx);
}
@ -338,7 +338,7 @@ struct db_where_next_limit_t final {
[[nodiscard]] auto dump() const -> std::string { return op_t{ctx}.dump(); }
[[nodiscard]] auto dump(std::int64_t &idx) const -> std::string {
[[nodiscard]] auto dump(std::int32_t &idx) const -> std::string {
return ctx->where->dump(idx);
}
@ -377,6 +377,8 @@ struct db_comp_next_t final {
value,
});
ctx->where_values.push_back(&value);
return wn_t{
ctx,
owner,
@ -413,6 +415,8 @@ struct db_comp_next_limit_t final {
value,
});
ctx->where_values.push_back(&value);
return wn_t{
ctx,
owner,
@ -447,7 +451,7 @@ template <typename ctx_t, typename op_t> struct db_where_t final {
std::vector<action_t> actions{};
[[nodiscard]] static auto dump(std::int64_t &idx,
[[nodiscard]] static auto dump(std::int32_t &idx,
auto &&data) -> std::string {
std::stringstream stream;
@ -473,7 +477,7 @@ template <typename ctx_t, typename op_t> struct db_where_t final {
[[nodiscard]] auto dump() const -> std::string { return op_t{ctx}.dump(); }
[[nodiscard]] auto dump(std::int64_t &idx) const -> std::string {
[[nodiscard]] auto dump(std::int32_t &idx) const -> std::string {
return dump(idx, *this);
}
@ -510,7 +514,7 @@ template <typename ctx_t, typename op_t> struct db_where_with_limit_t final {
std::vector<action_t> actions{};
[[nodiscard]] static auto dump(std::int64_t &idx,
[[nodiscard]] static auto dump(std::int32_t &idx,
auto &&data) -> std::string {
std::stringstream stream;
@ -536,7 +540,7 @@ template <typename ctx_t, typename op_t> struct db_where_with_limit_t final {
[[nodiscard]] auto dump() const -> std::string { return op_t{ctx}.dump(); }
[[nodiscard]] auto dump(std::int64_t &idx) const -> std::string {
[[nodiscard]] auto dump(std::int32_t &idx) const -> std::string {
return dump(idx, *this);
}

View File

@ -36,6 +36,8 @@ public:
std::string table_name;
std::optional<db_where_t<context, db_delete>> where;
std::vector<db_types_t *> where_values;
db3_stmt_t stmt{nullptr};
};

View File

@ -41,6 +41,8 @@ public:
std::optional<std::int32_t> limit;
std::optional<std::pair<std::string, bool>> order_by;
std::optional<db_where_with_limit_t<context, db_select>> where;
std::vector<db_types_t *> where_values;
db3_stmt_t stmt{nullptr};
};

View File

@ -34,10 +34,12 @@ public:
sqlite3 &db3;
std::string table_name;
std::optional<db_where_with_limit_t<context, db_update>> where;
std::map<std::string, db_types_t> values{};
std::map<std::string, db_types_t> column_values{};
std::optional<std::int32_t> limit;
std::optional<std::pair<std::string, bool>> order_by;
std::optional<db_where_with_limit_t<context, db_update>> where;
std::vector<db_types_t *> where_values;
db3_stmt_t stmt{nullptr};
};