-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcode1.cpp
68 lines (41 loc) · 1.11 KB
/
code1.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include<iostream>
#include<string>
#include<vector>
#include "Block.h"
#include "Config.h"
#include "Disk.h"
#include "Field.h"
#include "MainMemory.h"
#include "Relation.h"
#include "Schema.h"
#include "SchemaManager.h"
#include "Tuple.h"
using namespace std;
int main(){
cout<<"---------------------------------Initialization-----------------------------\n";
cout<<"Enter the sql query\n";
MainMemory mainMemory;
Disk disk;
SchemaManager schemaManager(&mainMemory, &disk);
vector<string> field_names;
vector<enum FIELD_TYPE> field_types;
//get query from the user
//validate query
//classify query
//get attributes of query
//switch to appropriate action
/* using the query create table contacts (id int , first_name str20, last_name str20, email str20)*/
field_names.push_back("id");
field_names.push_back("first_name");
field_names.push_back("last_name");
field_names.push_back("email");
field_types.push_back(INT);
field_types.push_back(STR20);
field_types.push_back(STR20);
field_types.push_back(STR20);
Schema schema(field_names, field_types);
cout<<schema<<endl;
string ex;
cin>> ex;
return 0;
}