-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHL_Engine_SQLite_Processing.py
More file actions
69 lines (62 loc) · 1.65 KB
/
HL_Engine_SQLite_Processing.py
File metadata and controls
69 lines (62 loc) · 1.65 KB
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
"""
HL_Engine_SQLite_Processing.py
Author:Akhil P Jacob
HLDynamic-Integrations
"""
import sqlite3
class SQLiteProcessingEngine:
"""SQLite Processing Class"""
def dmlLite_create(self, dbname, query):
"""Create Database"""
try:
conn = sqlite3.connect(dbname)
c = conn.cursor()
c.execute(query)
except:
return False
def dmlLite_insert(self, dbname, query):
"""Insert Database"""
try:
conn = sqlite3.connect(dbname)
c = conn.cursor()
c.execute(query)
conn.commit()
c.close()
return True
except:
return False
def dmLite_delete(self, dbname, query):
"""Delete Database"""
try:
conn = sqlite3.connect(dbname)
c = conn.cursor()
c.execute(query)
conn.commit()
return True
except:
return False
def dmLite_findData(self, dbname, query):
"""Find Data"""
try:
conn = sqlite3.connect(dbname)
c = conn.cursor()
c.execute(query)
data = c.fetchall()
if len(data) == 0:
return "null"
else:
d = data[0]
return d[0]
except:
return False
def dmLite_findAll(self, dbname, query):
"""Find All data"""
try:
conn = sqlite3.connect(dbname)
c = conn.cursor()
c.execute(query)
data = c.fetchall()
for row in data:
return row
except:
return False