added functino to get content from database

This commit is contained in:
simplypower-bbj
2022-12-18 11:04:19 +01:00
parent 7f2268605a
commit 1dd12c894a
2 changed files with 51 additions and 1 deletions
+7 -1
View File
@@ -169,4 +169,10 @@ def insert_list(username_list, timestamp_list, content_list):
}
dt.insert(val_dict)
except Exception as e:
logging.warning(e)
logging.warning(e)
def get_content():
with Data_table() as dt:
query = f'SELECT * FROM {dt._name} ORDER BY time DESC '
df = pd.read_sql_query(query, dt.con)
return df['content']