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

44 lines
1,005 B
C++
Raw Normal View History

2015-09-15 20:16:58 -05:00
#include <iostream>
#include <vector>
2015-09-15 21:31:19 -05:00
#include "DBEngine.h"
2015-09-15 20:16:58 -05:00
using namespace std;
2015-09-14 15:04:54 -05:00
2015-09-15 21:31:19 -05:00
//still in progress
2015-09-14 15:04:54 -05:00
int main() {
2015-09-15 20:16:58 -05:00
DBEngine engine;
2015-09-17 17:14:28 -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");
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);
Relation r("AltFood", v);
//r.display();
engine.createTable("Food", v);
engine.createTable(r);
engine.createTable("Sadness");
//vector<Relation> rs = engine.getRelations();
Relation r2 = engine.getTableFromName("Food");
r2.display();
2015-09-17 18:30:45 -05:00
vector<string> v1 = r2.getAttributeNames();
for (int i = 0; i < v.size(); ++i){
cout << v1[i];
}
2015-09-17 18:34:03 -05:00
}