I found that I misunderstood the behavior of the `rowcount`. Related links: https://docs.python.org/3/library/sqlite3.html#sqlite3.Cursor.rowcount https://stackoverflow.com/questions/839069/cursor-rowcount-always-1-in-sqlite3-in-python3k https://stackoverflow.com/questions/21829266/how-to-get-the-numbers-of-data-rows-from-sqlite-table-in-python