Why are both a connection and a cursor needed in the Python database API specification? In the context of SQLite3 these objects seem redundant, as shown:
- in the question "Why do you need to create a cursor when querying a sqlite database?".
- even in SQLite3's official documentation, which calls cursor objects "often superfluous" and provides shortcut methods which act on connections instead of cursors.
The main reason for the existence in SQLite3 of both connection and cursor objects seems to be compliance with the Python database API specification v2.0. This specification is applicable not just to SQLite interfaces such as SQLite3 but to a range of databases in Python. From a design perspective, why is it beneficial to differentiate between a connection and a cursor? Are there any conceptual or efficiency advantages?