Summary
docs/database/sessions.md and docs/database/mixins.md describe an API that isn't in v0.0.17.
Environment
- Framework checkout:
v0.0.17-5-g2b079c9; smpy / published simple_module_* / @simple-module-py/*: 0.0.17 - Python 3.12.3, uv 0.11.7, node v24.15.0, Linux (Ubuntu)
Found while building a real consumer app (Invoice Manager) on the framework.
Evidence vs. code
sessions.md shows engine_for(...) and DatabaseState.session() — neither exists. Real: get_db reads request.app.state.sm.db.session_factory; out-of-request code uses async with db_state.session_factory() as session: (and init_db(...) does NOT auto-register entity listeners — callers do register_listeners(state), as the root conftest.py does).mixins.md describes before_compile / before_insert / before_update / before_delete listeners and no_tenant() / skip_tenant_filter=True escape hatches — none exist. Real impl is a single before_flush listener + a do_orm_execute hook with with_loader_criteria; the only escape hatch is stmt.execution_options(include_deleted=True).mixins.md documents AuditMixin.created_by/updated_by as int | None from request.state.principal.user_id; real columns are str | None, stamped from the current_user_id ContextVar.
Impact
Consumers can't write out-of-request DB code (seeders, scripts) or reason about tenant/soft-delete bypass from the docs. Suggest aligning these two docs with the real simple_module_db API.
Summary
docs/database/sessions.mdanddocs/database/mixins.mddescribe an API that isn't in v0.0.17.Environment
v0.0.17-5-g2b079c9;smpy/ publishedsimple_module_*/@simple-module-py/*: 0.0.17Found while building a real consumer app (Invoice Manager) on the framework.
Evidence vs. code
sessions.mdshowsengine_for(...)andDatabaseState.session()— neither exists. Real:get_dbreadsrequest.app.state.sm.db.session_factory; out-of-request code usesasync with db_state.session_factory() as session:(andinit_db(...)does NOT auto-register entity listeners — callers doregister_listeners(state), as the rootconftest.pydoes).mixins.mddescribesbefore_compile/before_insert/before_update/before_deletelisteners andno_tenant()/skip_tenant_filter=Trueescape hatches — none exist. Real impl is a singlebefore_flushlistener + ado_orm_executehook withwith_loader_criteria; the only escape hatch isstmt.execution_options(include_deleted=True).mixins.mddocumentsAuditMixin.created_by/updated_byasint | Nonefromrequest.state.principal.user_id; real columns arestr | None, stamped from thecurrent_user_idContextVar.Impact
Consumers can't write out-of-request DB code (seeders, scripts) or reason about tenant/soft-delete bypass from the docs. Suggest aligning these two docs with the real
simple_module_dbAPI.