diff --git a/DBEngine.h b/DBEngine.h index 4834ed6..dadb143 100755 --- a/DBEngine.h +++ b/DBEngine.h @@ -42,12 +42,12 @@ public: file.close(); } - void insertTuple(Relation r, vector t) { r.addTuple(t); } + //void insertTuple(Relation r, vector t) { r.addTuple(t); } //need to add find by name - void deleteTuple(Relation r, int n) { + /*void deleteTuple(Relation r, int n) { cout << "a"; - r.removeTuple(n); } + r.removeTuple(n); }*/ void selectTuples() { // diff --git a/Relation.h b/Relation.h index 85a9f15..995e3ea 100755 --- a/Relation.h +++ b/Relation.h @@ -17,7 +17,7 @@ public: int getSize() { return size; } - void addTuple(vector tuple) { + /*void addTuple(vector tuple) { //Loop through the attribute columns for(int i = 0; i < att.size(); i++) { @@ -66,7 +66,7 @@ public: } } return tupleSlot; - } + }*/ string getTableName() { return name; diff --git a/a.out b/a.out new file mode 100755 index 0000000..e1e1ddd Binary files /dev/null and b/a.out differ diff --git a/test.cpp b/test.cpp index 726d10d..897d3cf 100755 --- a/test.cpp +++ b/test.cpp @@ -8,7 +8,7 @@ using namespace std; int main() { DBEngine engine; - Attribute att1("shamWow", "VARCHAR(10)", true); + /*Attribute att1("shamWow", "VARCHAR(10)", true); att1.addRow("rag"); att1.addRow("sponge"); att1.addRow("wooow"); @@ -22,7 +22,7 @@ int main() { vector vec; vec.push_back(att1); - vec.push_back(att2); + vec.push_back(att2);*/ Attribute att3("name", "VARCHAR(20)", true); att3.addRow("Fry"); @@ -41,17 +41,24 @@ int main() { vec2.push_back(att4); //beginning testing of core DB functions + cout << "\a"; engine.createTable("table1", vec2); - engine.createTable("table2", vec); + cout << "\a"; + //engine.createTable("table2", vec); engine.showTable(engine.getTableFromName("table1")); + cout << "\n\n"; - Attribute att5("name", "VARCHAR(20)", true); + cout << "\a"; + + /*Attribute att5("name", "VARCHAR(20)", true); att5.addRow("Yrf"); att5.addRow("Redneb"); att5.addRow("Aleel"); att5.addRow("Grebdoiz"); + cout << "\a"; + Attribute att6("age", "INTEGER", false); att6.addRow("44"); att6.addRow("10"); @@ -62,7 +69,7 @@ int main() { vec3.push_back(att5); vec3.push_back(att6); - engine.createTable("table3", vec3); + engine.createTable("table3", vec3);*/ //cout << "\n"; //cout << engine.unionComp(engine.getTableFromName("table1"), engine.getTableFromName("table2")); @@ -71,18 +78,18 @@ int main() { //engine.project((engine.getTableFromName("table1")), "name"); - vector cmds; + /*vector cmds; cmds.push_back("CREATE TABLE animals (name VARCHAR(20), kind VARCHAR(8), years INTEGER) PRIMARY KEY (name, kind);"); cmds.push_back("SHOW animals;"); - engine.saveToFile(cmds); + engine.saveToFile(cmds);*/ vector t; t.push_back("Professor"); t.push_back("180"); //engine.insertTuple((engine.getTableFromName("table1")), t); - engine.deleteTuple((engine.getTableFromName("table1")), 2); + //engine.deleteTuple((engine.getTableFromName("table1")), 2); cout << "\n\n"; engine.showTable((engine.getTableFromName("table1")));