a commit for any NON-DDL statement happens automatically only when you're in an HTTP request.
DDL statements (as you pointed out in the code) happen to be committed no matter what.
This goes along with a solid/standard/legacy "mvc" pattern, where you DO NOT alter the model at the same time you alter the data, which is basically piping DDL and NON-DDL statements.
99% of the times you don't alter the model(no DDL).
When you migrate, you do it in an HTTP request that does only that, without trying to insert/delete/update data .... this "coincidence of nightmares" is exacerbated by pyDAL users accustomed to "automigrations" without flipping a bit ..... other layers have a whole different package for it, or several different commands, or whatever (south, manage.py, alembic, etc) where at the very least there is a solid and explicit workflow, or when through inspection python can argue what went right and what went wrong after issuing a command.
Back to pyDAL, for that 1% cases where you want to alter the model AND the data (and it just doesn't happen because you're an "accustomed user"), funny thing happen, which is that:
- data piped until a DDL is "forcefully" committed (by the code, (but it'll happen also because of backends internals)) . And this happens irregardless of the environment.
- data piped AFTER the DDL is committed or not depending on the environment (shell or http)