obsdb: Add func _get_positions()

This commit is contained in:
Teemu Ikonen
2023-06-10 14:35:04 +03:00
parent 843e665ff2
commit f228e369a5

View File

@@ -270,6 +270,14 @@ class ObservationDB(ObservationDBBase):
""")
return [t[0] for t in timestamps.fetchall()]
def _get_positions(self):
"""Return a list of all rows in observation table."""
cur = self.con.cursor()
locations = cur.execute("""
SELECT * FROM observations;
""").fetchall()
return [{k: loc[k] for k in loc.keys()} for loc in locations]
def remove(self, timestamp):
"""Remove an observation and its associated wifi, cell and bt rows."""
cur = self.con.cursor()