#include "stdafx.h"
|
#include "SaveSQL.h"
|
|
|
SaveSQL::SaveSQL()
|
{
|
}
|
|
|
SaveSQL::~SaveSQL()
|
{
|
}
|
|
int SaveSQL::get_file_ID(std::string filename)
|
{
|
// Õâ¸öÓï¾äÓÐsql×¢ÈëÎÊÌ⣬Êý¾Ý¿â²»Ó¦¸ÃÌṩ½Ó¿Ú°ïÎÒÃDzåÈëÂð£¿
|
std::string sql = "select file_id from files where name=\'" + filename + "\'";
|
int file_id = 0; // µ÷ÓÃÊý¾Ý¿âº¯Êý£»
|
return file_id;
|
}
|
|
int SaveSQL::create_InsFiles(SQLFiles fileInfo)
|
{
|
std::string sql = "INSERT INTO `files` (`name`, `current_version`) VALUES ('"
|
+ fileInfo.filename + "','"
|
+ fileInfo.current_ver + "')";
|
return 0;
|
}
|
|
int SaveSQL::create_InsVersions(SQLVersions versionInfo)
|
{
|
std::string sql = "INSERT INTO `versions` (`file_id`, `change_description`) VALUES ('"
|
+ versionInfo.file_id + "','"
|
+ versionInfo.desc + "')";
|
|
return 0;
|
}
|