refactoring and minor changes

This commit is contained in:
2020-05-15 21:39:23 +02:00
parent 726d990d20
commit 9f7dbd6cf7
5 changed files with 65 additions and 4 deletions

View File

@@ -37,3 +37,18 @@ std::list<std::string> msql_acces::get_pinfo(){
delete res;
return ret;
}
void msql_acces::write_install(std::string package, std::string user){
sql::PreparedStatement *pstmt =
con->prepareStatement("insert into packages(name,user) values(?,(select id from users where username=?))");
pstmt->setString(1,package);
pstmt->setString(2,user);
pstmt->executeUpdate();
}
void msql_acces::write_remove(std::string package){
sql::PreparedStatement *pstmt =
con->prepareStatement("delete from packages where name=?");
pstmt->setString(1,package);
pstmt->executeUpdate();
}