优化结构
This commit is contained in:
@@ -93,7 +93,7 @@ void sqlManager::initialization(appConfig* _appConfig,std::string dataBasePath,
|
||||
std::cout << "SQL runing Init..." << std::endl;
|
||||
dbPtr = new sqliteModule(dataBasePath);//初始化
|
||||
dbPtr->backup(dataBasePath + getCurrentDate() + ".db");//备份
|
||||
std::vector<std::string>tables = getFutureDates(180);
|
||||
std::vector<std::string>tables = getFutureDates(30);
|
||||
|
||||
//整合所需要的数据名
|
||||
std::vector<std::string>dataStr;
|
||||
@@ -160,7 +160,10 @@ bool sqlManager::addData(std::string SN,std::vector<sqlData> data)
|
||||
if (res.customType == sqlFalse)
|
||||
{
|
||||
for (auto keyName : data)
|
||||
{
|
||||
dbPtr->addColumn(currentTableName, keyName.key, "text");
|
||||
std::cout << "new col insert" << keyName.key << std::endl;
|
||||
}
|
||||
dbPtr->Insert(currentTableName, SN, data);
|
||||
}
|
||||
mutex.unlock();
|
||||
|
||||
Reference in New Issue
Block a user