-
Notifications
You must be signed in to change notification settings - Fork 0
/
query_funcs.h
41 lines (28 loc) · 1.19 KB
/
query_funcs.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
#include <pqxx/pqxx>
using namespace std;
using namespace pqxx;
#ifndef _QUERY_FUNCS_
#define _QUERY_FUNCS_
void add_player(connection *C, int team_id, int jersey_num, string first_name, string last_name,
int mpg, int ppg, int rpg, int apg, double spg, double bpg);
void add_team(connection *C, string name, int state_id, int color_id, int wins, int losses);
void add_state(connection *C, string name);
void add_color(connection *C, string name);
/*
* All use_ params are used as flags for corresponding attributes
* a 1 for a use_ param means this attribute is enabled (i.e. a WHERE clause is needed)
* a 0 for a use_ param means this attribute is disabled
*/
void query1(connection *C,
int use_mpg, int min_mpg, int max_mpg,
int use_ppg, int min_ppg, int max_ppg,
int use_rpg, int min_rpg, int max_rpg,
int use_apg, int min_apg, int max_apg,
int use_spg, double min_spg, double max_spg,
int use_bpg, double min_bpg, double max_bpg
);
void query2(connection *C, string team_color);
void query3(connection *C, string team_name);
void query4(connection *C, string team_state, string team_color);
void query5(connection *C, int num_wins);
#endif //_QUERY_FUNCS_