RealDictCursor returns dicts, not tuples. Cannot use [0] for index access. Changed all COUNT(*) to COUNT(*) as count and access via ['count']. Fixes: KeyError: 0 on cur.fetchone()[0] Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
RealDictCursor returns dicts, not tuples. Cannot use [0] for index access. Changed all COUNT(*) to COUNT(*) as count and access via ['count']. Fixes: KeyError: 0 on cur.fetchone()[0] Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>