- Notifications
You must be signed in to change notification settings - Fork 16.9k
/
Copy pathmydb.py
31 lines (22 loc) · 602 Bytes
/
mydb.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
classMyDB:
def__init__(self):
self.connection=Connection()
defconnect(self, connection_string):
returnself.connection
classConnection:
def__init__(self):
self.cur=Cursor()
defcursor(self):
returnself.cur
defclose(self):
pass
classCursor():
defexecute(self, query):
ifquery=="select id from employee_db where name=John":
return123
elifquery=="select id from employee_db where name=Tom":
return789
else:
return-1
defclose(self):
pass