I have a use case where I need to query a database(sqlite) and read the most recently added row. I would refresh every 5-10 mins and keep extracting the most recently added row. Is there a way to do so?
con = sqlite3.connect(<db_name>)
cur = con.cursor()
print(cur)
cur.execute("select * from <table_name>;")
results = cur.fetchall()
print(len(results))
con.close()
db = Database(<db_name>)
print(db.query("Select last_insert_rowid()"))
This only provides the location of the last inserted row. I'd like to print out the row. There is no timestamp column in the database just id and some fields that are not time related.