2015-09-30 17:10:16 -05:00
|
|
|
#include <iostream>
|
|
|
|
#include <vector>
|
2015-10-06 13:07:31 -05:00
|
|
|
#include "Parser.h"
|
2015-09-30 17:10:16 -05:00
|
|
|
//#include "Condition.h"
|
|
|
|
#include "DBEngine.h"
|
2015-10-06 13:07:31 -05:00
|
|
|
//#include "user.h"
|
2015-09-30 17:10:16 -05:00
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
2015-10-06 13:07:31 -05:00
|
|
|
int main () {
|
|
|
|
DBEngine engine;
|
2015-09-25 00:29:00 -05:00
|
|
|
|
2015-09-27 16:48:08 -05:00
|
|
|
Attribute att1("Breakfast", "VARCHAR(20)", true);
|
|
|
|
Attribute att2("Lunch", "VARCHAR(20)", false);
|
|
|
|
Attribute att3("Dinner", "VARCHAR(20)", false);
|
|
|
|
|
|
|
|
att1.addCell("Pancakes");
|
|
|
|
att1.addCell("Waffles");
|
|
|
|
att1.addCell("Biscuits");
|
2015-10-05 16:50:19 -05:00
|
|
|
att1.addCell("Pancakes");
|
2015-09-27 16:48:08 -05:00
|
|
|
att2.addCell("Turkey Sandwich");
|
|
|
|
att2.addCell("Caesar Salad");
|
|
|
|
att2.addCell("Pizza");
|
2015-10-05 16:50:19 -05:00
|
|
|
att2.addCell("Sushi");
|
2015-09-27 16:48:08 -05:00
|
|
|
att3.addCell("Steak");
|
|
|
|
att3.addCell("Shrimp");
|
|
|
|
att3.addCell("Ribs");
|
2015-10-05 16:50:19 -05:00
|
|
|
att3.addCell("Lasagna");
|
2015-09-27 16:48:08 -05:00
|
|
|
|
|
|
|
vector<Attribute> v;
|
|
|
|
v.push_back(att1);
|
|
|
|
v.push_back(att2);
|
|
|
|
v.push_back(att3);
|
|
|
|
|
2015-09-22 09:03:42 -05:00
|
|
|
engine.createTable("Food", v);
|
2015-10-06 19:10:48 -05:00
|
|
|
//engine.updateCmd("Food", "Dinner", "SUCCESS", "Breakfast", "Pancakes");
|
2015-10-06 13:07:31 -05:00
|
|
|
engine.getTableFromName("Food").display();
|
2015-10-06 19:10:48 -05:00
|
|
|
//engine.deleteCmd("Food", "Breakfast", "Pancakes");
|
|
|
|
|
|
|
|
vector<string> tuple;
|
|
|
|
tuple.push_back("A pancake");
|
|
|
|
tuple.push_back("A turkey sandwich");
|
|
|
|
tuple.push_back("A steak");
|
|
|
|
|
|
|
|
engine.getTableFromName("Food").updateTuple(tuple, 0);
|
2015-10-06 13:20:04 -05:00
|
|
|
engine.getTableFromName("Food").display();
|
2015-09-30 17:10:16 -05:00
|
|
|
}
|