-
Notifications
You must be signed in to change notification settings - Fork 1
/
database.h
42 lines (30 loc) · 876 Bytes
/
database.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef YAACRL_DATABASE_H
#define YAACRL_DATABASE_H
#include "mysql/mysql.h"
#include "string"
#define FIELD_FILE_SHA1 "file_sha1"
#define FIELD_SONG_ID "song_id"
#define FIELD_SONGNAME "song_name"
#define FIELD_OFFSET "offset"
#define FIELD_HASH "hash"
class Database {
MYSQL *connection;
public:
Database(const char *, const char *);
~Database();
int setup();
int drop_tables();
int insert_song(char *, char hash[41]);
int insert_hashes(int, void*);
int set_song_fingerprinted(int);
int return_matches(void*, void*, int ** );
std::string get_song_by_id(int sid);
//void get_songs();
//void delete_unfingerprinted_songs();
//void get_num_songs();
//void get_num_fingerprints();
//void insert(hash, sid, offset);
//void query(hash);
//void get_iterable_kv_pairs();
};
#endif //YAACRL_DATABASE_H