123456789101112131415 |
- import model
- from client_controller import _my_tabulate
- model.connect()
- model.cursor.execute('''
- EXPLAIN QUERY PLAN
- DELETE FROM sessions
- WHERE
- (SELECT COUNT(*) as newer
- FROM sessions s2
- WHERE user_id = s2.user_id
- AND rowid < s2.rowid) >= 10
- '''.replace('?','1'))
- print(_my_tabulate(model.cursor.fetchall(),tablefmt='pipe'))
|