-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmain.py
72 lines (53 loc) · 1.83 KB
/
main.py
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
69
70
71
72
__author__ = 'Bernardo Godinho - @bernardogo'
from query.evaluator import evaluator
from storage.io import general
from catalog.core import catalogCore
from storage.tablemgr import manager
from buffer.bufmgr import buffer_pool
from query.commands.insert import *
from query.commands.select import *
from query.commands.update import *
main_pool = buffer_pool()
def main():
print ("dsad")
io = general()
#io.initPage(2)
io.write()
eval = evaluator()
eval.execute(
"""
create table table_name
(
column_name1 data_type(size),
column_name2 data_type(size),
column_name3 data_type(size),
);
"""
)
tblm = manager()
tblm.createTable("students2", [["id", "integer"], ["phone", "string"]])
ctlg2 = catalogCore()
ctlg2.loadCatalog("students2")
ctlg2.printCtlg()
ins = insert()
#ins.insertRecord("students2", ["26", "terce32441iro"])
#for x in range(25, 82):
# ins.insertRecord("students3", [str(x), "terce3PG32323o" + str(x)])
sel = select()
upd = update()
#sel.selection("students2", [])
upd.update("students2", [['phone', 'terceiro2221see']], [['phone', 'terceiro2221seesss']])
sel.selection("students2", [['phone', 'terce32441iro']])
print("321-----")
#sel.selection("students2", [])
#sel.selection("students3", [])
#sel.join("students2", "students3", sel.selection("students2", []), sel.selection("students3", []), "id")
main_pool.forceBuffer()
print(main_pool.pool)
from query.parser.sqlparse import parser
pt = parser()
#print(pt.parse("select * from x where x = 3 and y = 9"))
#eval.execQuery("insert into students2 values (\"83\", \"gravado\")")
print("select")
eval.execQuery("select * from students2 where id = '26'") #where phone = terce32441iro
main()