Update test.cpp
This commit is contained in:
parent
4b1fbf077d
commit
78914574da
1 changed files with 31 additions and 6 deletions
37
test.cpp
37
test.cpp
|
@ -1,10 +1,12 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include "Parserv3.h"
|
||||||
#include "DBEngine.h"
|
#include "DBEngine.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
//still in progress
|
//still in progress
|
||||||
|
/*
|
||||||
int main() {
|
int main() {
|
||||||
DBEngine engine;
|
DBEngine engine;
|
||||||
Attribute att1("Breakfast", "VARCHAR(20)", true);
|
Attribute att1("Breakfast", "VARCHAR(20)", true);
|
||||||
|
@ -26,7 +28,7 @@ int main() {
|
||||||
v.push_back(att2);
|
v.push_back(att2);
|
||||||
v.push_back(att3);
|
v.push_back(att3);
|
||||||
|
|
||||||
//Relation r("Food", v);
|
Relation r("Food", v);
|
||||||
//r.renameAttribute("Breakfast", "BFST");
|
//r.renameAttribute("Breakfast", "BFST");
|
||||||
//r.display();
|
//r.display();
|
||||||
|
|
||||||
|
@ -50,7 +52,6 @@ int main() {
|
||||||
newa.push_back("Hcnul");
|
newa.push_back("Hcnul");
|
||||||
newa.push_back("Rennid");
|
newa.push_back("Rennid");
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
//Projection test
|
//Projection test
|
||||||
vector<string> projectTest;
|
vector<string> projectTest;
|
||||||
projectTest.push_back("Breakfast");
|
projectTest.push_back("Breakfast");
|
||||||
|
@ -62,10 +63,34 @@ int main() {
|
||||||
sub_r.display();
|
sub_r.display();
|
||||||
|
|
||||||
//engine.rename(r, o, n);
|
//engine.rename(r, o, n);
|
||||||
}
|
|
||||||
=======
|
|
||||||
engine.rename(engine.getTableFromName("Food"), old, newa);
|
engine.rename(engine.getTableFromName("Food"), old, newa);
|
||||||
engine.getTableFromName("Food").display();
|
engine.getTableFromName("Food").display();
|
||||||
cout << "finished";
|
cout << "finished";
|
||||||
}
|
}
|
||||||
>>>>>>> master
|
|
||||||
|
*/
|
||||||
|
int main () {
|
||||||
|
|
||||||
|
string ss = "INSERT INTO animals VALUES FROM ( Joe , cat , 4 ) ;";
|
||||||
|
string ss2 = "SHOW Dogs ;";
|
||||||
|
string ss3 = "EXIT ; ";
|
||||||
|
|
||||||
|
DBEngine engine;
|
||||||
|
|
||||||
|
// vector<string> listOfTokens = tokenize(ss);
|
||||||
|
// vector<string> listOfTokens2 = tokenize(ss2);
|
||||||
|
// vector<string> listOfTokens3 = tokenize(ss3);
|
||||||
|
|
||||||
|
// par_line(listOfTokens);
|
||||||
|
// par_line(listOfTokens2);
|
||||||
|
// par_line(listOfTokens3);
|
||||||
|
|
||||||
|
parse(ss, engine);
|
||||||
|
parse(ss2, engine);
|
||||||
|
parse(ss3, engine);
|
||||||
|
|
||||||
|
engine.save();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
Reference in a new issue