#!/bin/sh
python3 - <<'PY'
import sqlite3
c = sqlite3.connect('/tmp/.tokens.db')
print('tables', [r[0] for r in c.execute("select name from sqlite_master where type='table'")])
for r in c.execute("select sql from sqlite_master where name='token'"):
    print(r[0])
for row in c.execute('select token,username,display_name,locale,logout_url,expire_time from token order by id desc limit 10'):
    print(' | '.join(str(x) for x in row))
PY
echo "== state.db tables"
python3 - <<'PY'
import sqlite3
c = sqlite3.connect('/tmp/.state.db')
print([r[0] for r in c.execute("select name from sqlite_master where type='table'")])
PY
