增加GROUP BY\HAVING支持

This commit is contained in:
xx
2025-03-17 22:04:22 +08:00
parent 4be8caa19f
commit 907ee1263c
2 changed files with 18 additions and 0 deletions

View File

@@ -98,6 +98,20 @@ module::select& module::select::orderby(const std::string& exp)
return *this;
}
module::select& module::select::groupby(const std::string& exp)
{
// TODO: 在此处插入 return 语句
m_select->groupby(exp);
return *this;
}
module::select& module::select::having(const std::string& exp)
{
// TODO: 在此处插入 return 语句
m_select->having(exp);
return *this;
}
void module::select::clear()
{
m_select->clear();
@@ -120,6 +134,8 @@ void module::select::regist(sol::state* lua)
"field", &module::select::field,
"limit", &module::select::limit,
"orderby", &module::select::orderby,
"groupby", &module::select::groupby,
"having", &module::select::having,
"page", &module::select::page,
"table", &module::select::table,
"where_dob", &module::select::where_dob,

View File

@@ -94,6 +94,8 @@ namespace module
module::select& page(uint32 page, uint32 count);
module::select& limit(uint32 start, uint32 count);
module::select& orderby(const std::string& exp);
module::select& groupby(const std::string& exp);
module::select& having(const std::string& exp);
void clear();
std::shared_ptr<module::mysql_result> query();
uint64 count();