55 lines
1.1 KiB
C++
Executable file
55 lines
1.1 KiB
C++
Executable file
#include <fstream>
|
|
#include <iostream>
|
|
#include <vector>
|
|
#include "Relation.h"
|
|
|
|
//still in progress
|
|
class DBEngine {
|
|
vector<Relation> tables;
|
|
int size;
|
|
|
|
public:
|
|
DBEngine(){
|
|
size = 0;
|
|
}
|
|
|
|
void createTable(string n, vector<Attribute> a) {
|
|
Relation r(n, a);
|
|
tables.push_back(r);
|
|
}
|
|
|
|
void createTable(Relation r) {
|
|
tables.push_back(r);
|
|
}
|
|
|
|
Relation getTableFromName(string n) {
|
|
//will return first occurence
|
|
for(int i = 0; i < tables.size(); i++) {
|
|
if (tables[i].getTableName() == n) {
|
|
return tables[i];
|
|
}
|
|
}
|
|
}
|
|
|
|
void showTables(Relation r) {
|
|
r.display();
|
|
}
|
|
|
|
void saveToFile() { /*Becca*/ }
|
|
void insertTuple() { /*DONE*/ }
|
|
void deleteTuple() { /*DONE*/ }
|
|
void selectTuples() { /*William*/ }
|
|
void project() { /*DONE*/ }
|
|
void product() { /*Brandon*/ }
|
|
|
|
bool unionComp(Relation r1, Relation r2) {
|
|
//Two relations are union-compatible if they have the same # of attributes and each attribute must be
|
|
//from the same domain
|
|
//return (() && ());
|
|
}
|
|
|
|
|
|
vector<Relation> getRelations() {
|
|
return tables;
|
|
}
|
|
};
|