This repository has been archived on 2025-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
dmspine64backup/test.cpp
2015-09-28 19:11:26 -05:00

59 lines
1.4 KiB
C++
Executable file

#include <iostream>
#include <vector>
#include "Parser.h"
//#include "Condition.h"
#include "DBEngine.h"
using namespace std;
int main () {
DBEngine engine;
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");
att2.addCell("Turkey Sandwich");
att2.addCell("Caesar Salad");
att2.addCell("Pizza");
att3.addCell("Steak");
att3.addCell("Shrimp");
att3.addCell("Ribs");
vector<Attribute> v;
v.push_back(att1);
v.push_back(att2);
v.push_back(att3);
engine.createTable("Food", v);
Attribute att4("Dessert", "VARCHAR(20)", true);
Attribute att5("Midnight Snack", "VARCHAR(20)", false);
att4.addCell("Ice Cream Sundae");
att4.addCell("Chocolate Bar");
att5.addCell("Hummus and Carrots");
att5.addCell("Potato Chips");
vector<Attribute> v2;
v2.push_back(att4);
v2.push_back(att5);
engine.createTable("MoarFood", v2);
//engine.getTableFromName("Food").display();
//engine.getTableFromName("MoarFood").display();
engine.crossProduct(engine.getTableFromName("Food"), engine.getTableFromName("MoarFood")).display();
string x;
cout << "Enter DBMS Commands: ";
while(getline(cin, x))
{
//cout << x << endl;
parse(x, engine);
cout << "Enter DBMS Commands: ";
}
}