36 lines
1.1 KiB
C++
Executable file
36 lines
1.1 KiB
C++
Executable file
#pragma once
|
|
#include <fstream>
|
|
#include <iostream>
|
|
#include <vector>
|
|
#include "Relation.h"
|
|
|
|
//still in progress
|
|
class DBEngine{
|
|
vector<Relation> tables;
|
|
vector<string> commands;
|
|
int size;
|
|
|
|
public:
|
|
DBEngine();
|
|
void createTable(string n);
|
|
void createTable(string n, vector<Attribute> a);
|
|
void createTable(Relation r);
|
|
void insertValues(string r, vector <string> v);
|
|
vector<Relation> getRelations();
|
|
bool isRelation(string n);
|
|
Relation& getTableFromName(string n);
|
|
void saveToFile(vector<string> cmds);
|
|
Relation selection(string attName, string s, Relation r);
|
|
Relation projection(vector<string> input, Relation r);
|
|
Relation product(string s1, Relation r1, Relation r2);
|
|
void deleteRelation(string n);
|
|
void save();
|
|
void save(string n);
|
|
void storeCommands(string s);
|
|
Relation rename(vector<string> newnames, Relation &r);
|
|
Relation setUnion(Relation r1, Relation r2);
|
|
Relation setDiff(Relation r1, Relation r2);
|
|
Relation crossProduct(Relation r1, Relation r2);
|
|
void updateFromRelationCmd(Relation r, Relation temp, vector<string> attName, vector<string> att);
|
|
void deleteFromRelationCmd(Relation r, Relation temp);
|
|
};
|