10 lines
451 B
Python
10 lines
451 B
Python
|
|
from app.db.platform_store import get_platform_store
|
||
|
|
|
||
|
|
store = get_platform_store()
|
||
|
|
with store.connect() as conn:
|
||
|
|
rows = conn.execute(
|
||
|
|
"SELECT id, user_id, login_at, logout_at, duration_seconds FROM sessions ORDER BY login_at DESC LIMIT 10"
|
||
|
|
).fetchall()
|
||
|
|
print(f"sessions count: {len(rows)}")
|
||
|
|
for r in rows:
|
||
|
|
print(f" user={r['user_id'][:25]}... login={r['login_at']} logout={r['logout_at']} dur={r['duration_seconds']}")
|