257 def GetData(self,tableName):
258
259
260 cur = self.db.cursor()
261 querystring = "SELECT tbl_name FROM sqlite_master WHERE type='table' AND tbl_name='"+tableName+"'"
262 cur.execute(querystring)
263 checkTable = cur.fetchall()
264 if len(checkTable)==0:
265 Logging.log.info(f'Table {tableName} not found in the SQLite DB. Falling back on the default config')
266 return []
267
268
269 cur = self.db.cursor()
270 querystring = "SELECT * FROM "+tableName+" order by "+tableName+"_data_id"
271 cur.execute(querystring)
272 rows = cur.fetchall()
273
274 ncols=len(cur.description)
275 dbData=[]
276 for row in rows:
277 dbDataRow={}
278 for i in range(1,ncols):
279 dbDataRow[cur.description[i][0]]=row[i]
280 Logging.log.debug(f'Fetched Data Row for {tableName}')
281 Logging.log.debug(f'{dbDataRow}')
282 dbData.append(dbDataRow)
283
284 return dbData