Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def get_logs():
- with sqlite3.connect(DBNAME) as connection:
- connection.row_factory = sqlite3.Row
- cursor = connection.cursor()
- cursor.execute(
- """SELECT
- hosts.hostname,
- ping_time,
- timestamp
- FROM logs
- LEFT JOIN hosts ON logs.host_id=hosts.id
- ORDER BY timestamp DESC
- """
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement