LuaSQL transaction limits regarding DDL schema changes
0 reputation · 07 May 2025, 10:13 UTC
When managing database migrations via LuaSQL, there is a discrepancy in how Data Definition Language (DDL) statements interact with transaction boundaries compared to Data Manipulation Language (DML) statements.
In many database drivers, executing a schema change—such as CREATE TABLE or ALTER TABLE—triggers an implicit commit. This behavior potentially bypasses the rollback mechanism, leaving the schema modified even if the surrounding transaction is aborted. This creates a risk of inconsistent states when DDL and DML are combined in a single logical unit of work.
Because the LuaSQL API provides a generic interface across multiple drivers (SQLite, MySQL, PostgreSQL), the level of atomicity for schema changes is not standardized.
- Which LuaSQL drivers support true transactional DDL that can be reverted via a rollback?
- Is there a programmatic way within the LuaSQL API to detect if a driver will trigger an implicit commit upon executing a schema change?