Implemented deletion functionality, and lingering records are removed fixes #49

This commit is contained in:
kdeng00
2019-09-10 22:27:28 -04:00
parent 8c1c2340b2
commit a00a70029e
17 changed files with 489 additions and 17 deletions
+4 -1
View File
@@ -13,6 +13,7 @@ database::SongRepository::SongRepository(const std::string& path) : BaseReposito
database::SongRepository::SongRepository(const model::BinaryPath& bConf) : BaseRepository(bConf)
{ }
std::vector<model::Song> database::SongRepository::retrieveRecords()
{
auto conn = setupMysqlConnection();
@@ -134,7 +135,7 @@ bool database::SongRepository::doesSongExist(const model::Song& song, type::Song
return (rowCount > 0) ? true : false;
}
void database::SongRepository::deleteRecord(const model::Song& song)
bool database::SongRepository::deleteRecord(const model::Song& song)
{
auto conn = setupMysqlConnection();
auto status = 0;
@@ -144,6 +145,8 @@ void database::SongRepository::deleteRecord(const model::Song& song)
auto result = performMysqlQuery(conn, query);
mysql_close(conn);
return (result == 0) ? true : false;
}
void database::SongRepository::saveRecord(const model::Song& song)