2015-09-25 00:30:32 -05:00
|
|
|
#pragma once
|
2015-09-15 16:30:25 -05:00
|
|
|
#include <fstream>
|
|
|
|
#include <iostream>
|
|
|
|
#include <vector>
|
|
|
|
#include "Relation.h"
|
|
|
|
|
2015-09-15 23:48:50 -05:00
|
|
|
//still in progress
|
2015-09-17 18:30:45 -05:00
|
|
|
class DBEngine{
|
2015-09-15 21:31:19 -05:00
|
|
|
vector<Relation> tables;
|
2015-09-25 00:30:32 -05:00
|
|
|
vector<string> commands;
|
2015-09-15 23:48:50 -05:00
|
|
|
int size;
|
2015-09-25 00:30:32 -05:00
|
|
|
|
2015-09-15 16:30:25 -05:00
|
|
|
public:
|
2015-09-17 18:30:45 -05:00
|
|
|
DBEngine();
|
|
|
|
void createTable(string n);
|
|
|
|
void createTable(string n, vector<Attribute> a);
|
|
|
|
void createTable(Relation r);
|
|
|
|
vector<Relation> getRelations();
|
|
|
|
//void showTable(Relation r);
|
2015-09-22 09:03:42 -05:00
|
|
|
Relation& getTableFromName(string n);
|
2015-09-17 18:30:45 -05:00
|
|
|
void saveToFile(vector<string> cmds);
|
2015-09-25 00:30:32 -05:00
|
|
|
Relation selection(string attName, string s, Relation r);
|
2015-09-17 18:30:45 -05:00
|
|
|
Relation projection(vector<string> input, Relation r);
|
2015-09-25 00:30:32 -05:00
|
|
|
Relation product(string s1, Relation r1, Relation r2);
|
2015-09-22 09:03:42 -05:00
|
|
|
void rename(Relation& r, vector<string> oldnames, vector<string> newnames);
|
2015-09-26 23:24:24 -05:00
|
|
|
<<<<<<< HEAD
|
2015-09-25 00:30:32 -05:00
|
|
|
void save();
|
|
|
|
void storeCommands(string s);
|
|
|
|
//Relation setUnion(Relation r1, Relation r2);
|
2015-09-26 23:24:24 -05:00
|
|
|
=======
|
|
|
|
Relation setUnion(Relation r1, Relation r2);
|
|
|
|
>>>>>>> master
|
2015-09-17 18:30:45 -05:00
|
|
|
//void setDiff();
|
2015-09-25 00:30:32 -05:00
|
|
|
//void crossProduct();
|
2015-09-15 16:30:25 -05:00
|
|
|
};
|