Enhancement: Update db_helper to take in days parameter
This commit is contained in:
@@ -100,11 +100,11 @@ class DBHelper():
|
||||
|
||||
return cursor.fetchall()
|
||||
|
||||
def query_breaks(self) -> list:
|
||||
def query_breaks(self, days) -> list:
|
||||
self.__CONN = connect_config(self._config)
|
||||
self.__CONN.autocommit = True
|
||||
cursor = self.__CONN.cursor()
|
||||
cursor.execute(f"SELECT * FROM breaks")
|
||||
cursor.execute(f"SELECT * FROM breaks WHERE date >= NOW() - INTERVAL '1 day' and DATE <= NOW() + interval '{days} days' ORDER BY date ASC;")
|
||||
self.__CONN.commit()
|
||||
|
||||
return cursor.fetchall()
|
||||
|
||||
Reference in New Issue
Block a user