- marked as enhancement
Some docs on what's "fair game" in extensions would be good
Issue #1913
resolved
After reading:
http://www.sqlalchemy.org/docs/orm/interfaces.html
...I'm still left wondering what's fair game to do in each of the methods of SessionExtensions and MapperExtensions.
For example, it's probably not a good idea to implement a versioned rows extension as a MapperExtension, however, there's no clue in the docs as to why that might be.
Yes, what makes sense can likely be infererred from reading through the source, but it'd be good to know what the intension is in terms of what sort of things are/aren't sensible to do in any of the methods...
Comments (4)
-
repo owner -
repo owner - changed milestone to 0.7.0
since events are getting an overhaul for 0.7, targeting this there for now.
-
repo owner - changed status to resolved
this is covered exhaustively by
#1902 -
repo owner - removed milestone
Removing milestone: 0.7.0 (automated comment)
- Log in to comment
there is a clue for sure:
http://www.sqlalchemy.org/docs/orm/interfaces.html?highlight=mapperextension#sqlalchemy.orm.interfaces.MapperExtension.before_insert
Column-based attributes can be modified within this method which will result in the new value being inserted. However no changes to the overall flush plan can be made, and manipulation of the Session will not have the desired effect. To manipulate the Session within an extension, use SessionExtension.
we can't exactly predict various use cases like a "versioned" extension. There are certainly ways to do versioning in the MapperExtension, and efficiently too - just issue INSERT statements on the provided connection.