Search code examples
pythonsqlitepysqlite

How do I enable transactional DDL in pysqlite?


I am using pysqlite which, by default, does not enable transactional DDL (although DDL is transactional from the sqlite3 client).

How do I enable transactional DDL within pysqlite?


Solution

  • pysqlite always performs an implicit commit unless the lowercased query string starts with optional whitespace and one of 'select', 'insert', 'update' , 'delete', or 'replace'. There is no elegant way to turn this off. To work around this, you could edit the pysqlite C source code.