The Python SQLite API automatically manages transactions when leaving the `with` block: https://docs.python.org/3/library/sqlite3.html#how-to-use-the-connection-context-manager