mirror of
https://github.com/Telecominfraproject/wlan-cloud-analytics.git
synced 2025-12-25 17:27:09 +00:00
Initial commit
This commit is contained in:
@@ -51,37 +51,6 @@ namespace OpenWifi {
|
||||
Pool_->shutdown();
|
||||
}
|
||||
|
||||
[[nodiscard]] inline std::string ComputeRange(uint64_t From, uint64_t HowMany) {
|
||||
if(dbType_==sqlite) {
|
||||
return " LIMIT " + std::to_string(From) + ", " + std::to_string(HowMany) + " ";
|
||||
} else if(dbType_==pgsql) {
|
||||
return " LIMIT " + std::to_string(HowMany) + " OFFSET " + std::to_string(From) + " ";
|
||||
} else if(dbType_==mysql) {
|
||||
return " LIMIT " + std::to_string(HowMany) + " OFFSET " + std::to_string(From) + " ";
|
||||
}
|
||||
return " LIMIT " + std::to_string(HowMany) + " OFFSET " + std::to_string(From) + " ";
|
||||
}
|
||||
|
||||
inline std::string ConvertParams(const std::string & S) const {
|
||||
std::string R;
|
||||
R.reserve(S.size()*2+1);
|
||||
if(dbType_==pgsql) {
|
||||
auto Idx=1;
|
||||
for(auto const & i:S)
|
||||
{
|
||||
if(i=='?') {
|
||||
R += '$';
|
||||
R.append(std::to_string(Idx++));
|
||||
} else {
|
||||
R += i;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
R = S;
|
||||
}
|
||||
return R;
|
||||
}
|
||||
|
||||
private:
|
||||
inline int Setup_SQLite();
|
||||
inline int Setup_MySQL();
|
||||
|
||||
Reference in New Issue
Block a user