Count the number of rows in the sessions table
()
| 512 | |
| 513 | |
| 514 | async def count_session_rows() -> int: |
| 515 | """Count the number of rows in the sessions table""" |
| 516 | query = """ |
| 517 | SELECT COUNT(*) FROM sessions |
| 518 | WHERE id > '{last_session_id}' |
| 519 | """ |
| 520 | query = query.format( |
| 521 | last_session_id=LAST_SESSION_ID if LAST_SESSION_ID else '00000000-0000-0000-0000-000000000000' |
| 522 | ) |
| 523 | async with get_supabase_pool().connection() as conn: |
| 524 | async with conn.cursor() as cur: |
| 525 | await cur.execute(query) |
| 526 | rows = await cur.fetchone() |
| 527 | return rows[0] |
| 528 | |
| 529 | |
| 530 | def init_files(): |
no test coverage detected
searching dependent graphs…