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
+6
View File
@@ -1,6 +1,7 @@
#ifndef ARTISTREPOSITORY_H_
#define ARTISTREPOSITORY_H_
#include <utility>
#include <vector>
#include "database/BaseRepository.h"
@@ -16,14 +17,19 @@ namespace database
std::vector<model::Artist> retrieveRecords();
std::pair<model::Artist, int> retrieveRecordWithSongCount(model::Artist&, type::ArtistFilter);
model::Artist retrieveRecord(model::Artist&, type::ArtistFilter);
bool doesArtistExist(const model::Artist&, type::ArtistFilter);
void saveRecord(const model::Artist&);
void deleteArtist(const model::Artist&, type::ArtistFilter);
private:
std::vector<model::Artist> parseRecords(MYSQL_STMT*);
std::pair<model::Artist, int> parseRecordWithSongCount(MYSQL_STMT*);
// TODO: After parseRecord(MYSQL_STMT*) is implemented
// remove parseRecord(MYSQL_RES*)
model::Artist parseRecord(MYSQL_RES*);