Go to the documentation of this file.
4 #include <unordered_map>
14 using std::runtime_error;
21 :
msg(
"Table " + t_name +
" not found") {}
22 virtual const char*
what()
const throw() {
return msg.c_str(); }
35 void add_column(std::string column_name, std::string data_type,
37 void add_foreign_key(std::string from, std::string table, std::string to);
44 throw runtime_error(
"Index out of Bounds in Table:" +
table_name);
52 " does not have column " + name);
std::string msg
Definition: Table.h:17
void set_table_name(std::string table_n)
Definition: Table.h:33
DataType
Different datatypes supported by this project.
Definition: Column.h:16
virtual const char * what() const
Definition: Table.h:22
std::vector< Parser::Column > columns
Definition: Table.h:28
Parser::Column & operator[](int i)
Definition: Table.h:42
std::string table_name
Definition: Table.h:26
std::string get_table_name()
Definition: Table.h:38
std::vector< foreign_key > & get_foreign_keys()
Definition: Table.h:40
std::string get_primary_key()
Definition: Table.h:39
void add_column(std::string column_name, std::string data_type, int size=0)
Definition: Table.cpp:5
std::unordered_map< std::string, int > column_map
Definition: Table.h:27
Parser::Column & operator[](std::string name)
Definition: Table.h:49
void add_foreign_key(std::string from, std::string table, std::string to)
Definition: Table.cpp:22
void set_primary_key(std::string pk)
Definition: Table.h:34
std::vector< foreign_key > foreign_keys
Definition: Table.h:30
TableNotFoundException(std::string &t_name)
Definition: Table.h:20
Parser::Column & get_column(std::string name)
Definition: Table.h:48
std::string primary_key
Definition: Table.h:29
Definition: ForeignKey.h:6
int size
Definition: Column.h:9
std::vector< Parser::Column > & get_columns()
Definition: Table.h:41