This commit is contained in:
@ -30,13 +30,15 @@ namespace repertory::db {
|
||||
class db_delete final {
|
||||
public:
|
||||
struct context final {
|
||||
using w_t = db_where_t<context, db_delete>;
|
||||
|
||||
context(sqlite3 &db3_, std::string table_name_)
|
||||
: db3(db3_), table_name(std::move(table_name_)) {}
|
||||
|
||||
sqlite3 &db3;
|
||||
std::string table_name;
|
||||
|
||||
std::optional<db_where_t<context, db_delete>> where;
|
||||
std::optional<w_t> where;
|
||||
std::vector<db_types_t *> where_values;
|
||||
|
||||
db3_stmt_t stmt{nullptr};
|
||||
@ -58,11 +60,10 @@ public:
|
||||
|
||||
[[nodiscard]] auto go() const -> db_result<context>;
|
||||
|
||||
[[nodiscard]] auto group(db_where_t<context, db_delete>::group_func_t func)
|
||||
-> db_where_t<context, db_delete>::wn_t;
|
||||
|
||||
[[nodiscard]] auto
|
||||
where(std::string column_name) const -> db_where_t<context, db_delete>::cn_t;
|
||||
group(context::w_t::group_func_t func) -> context::w_t::wn_t;
|
||||
|
||||
[[nodiscard]] auto where(std::string column_name) const -> context::w_t::cn_t;
|
||||
};
|
||||
} // namespace repertory::db
|
||||
|
||||
|
@ -33,6 +33,8 @@ public:
|
||||
context(sqlite3 &db3_, std::string table_name_)
|
||||
: db3(db3_), table_name(std::move(table_name_)) {}
|
||||
|
||||
using w_t = db_where_with_limit_t<context, db_select>;
|
||||
|
||||
sqlite3 &db3;
|
||||
std::string table_name;
|
||||
|
||||
@ -40,7 +42,7 @@ public:
|
||||
std::map<std::string, std::string> count_columns{};
|
||||
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::optional<w_t> where;
|
||||
std::vector<db_types_t *> where_values;
|
||||
|
||||
db3_stmt_t stmt{nullptr};
|
||||
@ -68,16 +70,14 @@ public:
|
||||
[[nodiscard]] auto go() const -> db_result<context>;
|
||||
|
||||
[[nodiscard]] auto
|
||||
group(db_where_with_limit_t<context, db_select>::group_func_t func)
|
||||
-> db_where_with_limit_t<context, db_select>::wn_t;
|
||||
group(context::w_t::group_func_t func) -> context::w_t::wn_t;
|
||||
|
||||
[[nodiscard]] auto limit(std::int32_t value) -> db_select &;
|
||||
|
||||
[[nodiscard]] auto order_by(std::string column_name,
|
||||
bool ascending) -> db_select &;
|
||||
|
||||
[[nodiscard]] auto where(std::string column_name) const
|
||||
-> db_where_with_limit_t<context, db_select>::cn_t;
|
||||
[[nodiscard]] auto where(std::string column_name) const -> context::w_t::cn_t;
|
||||
};
|
||||
} // namespace repertory::db
|
||||
|
||||
|
@ -32,6 +32,7 @@ public:
|
||||
struct context final {
|
||||
context(sqlite3 &db3_, std::string table_name_)
|
||||
: db3(db3_), table_name(std::move(table_name_)) {}
|
||||
using w_t = db_where_with_limit_t<context, db_update>;
|
||||
|
||||
sqlite3 &db3;
|
||||
std::string table_name;
|
||||
@ -39,7 +40,7 @@ public:
|
||||
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::optional<w_t> where;
|
||||
std::vector<db_types_t *> where_values;
|
||||
|
||||
db3_stmt_t stmt{nullptr};
|
||||
@ -65,16 +66,14 @@ public:
|
||||
[[nodiscard]] auto go() const -> db_result<context>;
|
||||
|
||||
[[nodiscard]] auto
|
||||
group(db_where_with_limit_t<context, db_update>::group_func_t func)
|
||||
-> db_where_with_limit_t<context, db_update>::wn_t;
|
||||
group(context::w_t::group_func_t func) -> context::w_t::wn_t;
|
||||
|
||||
[[nodiscard]] auto limit(std::int32_t value) -> db_update &;
|
||||
|
||||
[[nodiscard]] auto order_by(std::string column_name,
|
||||
bool ascending) -> db_update &;
|
||||
|
||||
[[nodiscard]] auto where(std::string column_name) const
|
||||
-> db_where_with_limit_t<context, db_update>::cn_t;
|
||||
[[nodiscard]] auto where(std::string column_name) const -> context::w_t::cn_t;
|
||||
};
|
||||
} // namespace repertory::db
|
||||
|
||||
|
Reference in New Issue
Block a user