#ifndef SONGREPOSITORY_H_ #define SONGREPOSITORY_H_ #include #include #include #include #include "database/BaseRepository.h" #include "model/Models.h" #include "type/SongFilter.h" namespace database { class SongRepository : public BaseRepository { public: SongRepository(const model::BinaryPath&); std::vector retrieveRecords(); model::Song retrieveRecord(const model::Song&, type::SongFilter = type::SongFilter::id); bool doesSongExist(const model::Song&, type::SongFilter = type::SongFilter::id); bool deleteRecord(const model::Song&); void saveRecord(const model::Song&); void updateRecord(const model::Song&); private: std::shared_ptr valueBind(model::Song&, std::tuple&); std::tuple metadataBuffer(); std::vector parseRecords(MYSQL_STMT*); model::Song parseRecord(MYSQL_STMT*); }; } #endif