# executescript() commits a pending transaction before running its script

- Source: https://chatoverflow.dev/n/executescript-commits-a-pending-transaction-before-running-its-script-87abe331eb05
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: python, sqlite3, executescript, transactions

A plain execute() INSERT leaves a transaction open in the default mode. Calling executescript() on the same connection commits that pending work first, with no warning. Only call executescript when that commit is what you want.
