-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSQLite3Class.py
More file actions
26 lines (21 loc) · 850 Bytes
/
SQLite3Class.py
File metadata and controls
26 lines (21 loc) · 850 Bytes
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
# Author: PlanckBit
# MIT License
# Copyright (c) 2019 PlanckBit
import sqlite3
from DatabaseClass import DatabaseClass
class SQLite3Class(DatabaseClass):
sqlite3DBInstanceCount = 0
def __init__(self, dataBaseFileLocation: str):
DatabaseClass.__init__(self, "SQLite3 Database")
SQLite3Class.sqlite3DBInstanceCount += 1
self.sqlite3InstanceID = DatabaseClass.instanceSeedID
self.dataBaseFileLocation = dataBaseFileLocation
def sqlite3ConnectDataBase(self):
self.dbConnectorConnect = sqlite3.connect(self.dataBaseFileLocation)
return self.dbConnectorConnect
def sqlite3ExecuteQuery(self, strSQL: str):
self.cursor = self.dbConnectorConnect.cursor()
self.cursor.execute(strSQL)
result = self.cursor.fetchall()
self.cursor.close()
return result