private module containing functions used to emit INSERT, UPDATE
and DELETE statements on behalf of a _orm.Mapper
and its descending
mappers.
The functions here are called only by the unit of work functions in unitofwork.py.
Class | BulkORMDelete |
Undocumented |
Class | BulkORMUpdate |
Undocumented |
Class | BulkUDCompileState |
No class docstring; 1/7 class method, 0/1 class documented |
Function | _bulk_insert |
Undocumented |
Function | _bulk_update |
Undocumented |
Function | _collect_delete_commands |
Identify values to use in DELETE statements for a list of states to be deleted. |
Function | _collect_insert_commands |
Identify sets of values to use in INSERT statements for a list of states. |
Function | _collect_post_update_commands |
Identify sets of values to use in UPDATE statements for a list of states within a post_update operation. |
Function | _collect_update_commands |
Identify sets of values to use in UPDATE statements for a list of states. |
Function | _connections_for_states |
Return an iterator of (state, state.dict, mapper, connection). |
Function | _emit_delete_statements |
Emit DELETE statements corresponding to value lists collected by _collect_delete_commands(). |
Function | _emit_insert_statements |
Emit INSERT statements corresponding to value lists collected by _collect_insert_commands(). |
Function | _emit_post_update_statements |
Emit UPDATE statements corresponding to value lists collected by _collect_post_update_commands(). |
Function | _emit_update_statements |
Emit UPDATE statements corresponding to value lists collected by _collect_update_commands(). |
Function | _finalize_insert_update_commands |
finalize state on states that have been inserted or updated, including calling after_insert/after_update events. |
Function | _organize_states_for_delete |
Make an initial pass across a set of states for DELETE. |
Function | _organize_states_for_post_update |
Make an initial pass across a set of states for UPDATE corresponding to post_update. |
Function | _organize_states_for_save |
Make an initial pass across a set of states for INSERT or UPDATE. |
Function | _postfetch |
Expire attributes in need of newly persisted database state, after an INSERT or UPDATE statement has proceeded for that state. |
Function | _postfetch_bulk_save |
Undocumented |
Function | _postfetch_post_update |
Undocumented |
Function | _sort_states |
Undocumented |
Function | delete_obj |
Issue DELETE statements for a list of objects. |
Function | post_update |
Issue UPDATE statements on behalf of a relationship() which specifies post_update. |
Function | save_obj |
Issue INSERT and/or UPDATE statements for a list of objects. |
Constant | _EMPTY_DICT |
Undocumented |
Undocumented
Undocumented
Identify sets of values to use in UPDATE statements for a list of states.
This function works intricately with the history system to determine exactly what values should be updated as well as how the row should be matched within an UPDATE statement. Includes some tricky scenarios where the primary key of an object might have been changed.
Return an iterator of (state, state.dict, mapper, connection).
The states are sorted according to _sort_states, then paired with the connection they should be using for the given unit of work transaction.
Make an initial pass across a set of states for DELETE.
This includes calling out before_delete and obtaining key information for each state including its dictionary, mapper, the connection to use for the execution per state.
Make an initial pass across a set of states for UPDATE corresponding to post_update.
This includes obtaining key information for each state including its dictionary, mapper, the connection to use for the execution per state.
Make an initial pass across a set of states for INSERT or UPDATE.
This includes splitting out into distinct lists for each, calling before_insert/before_update, obtaining key information for each state including its dictionary, mapper, the connection to use for the execution per state, and the identity flag.
Undocumented
Issue DELETE statements for a list of objects.
This is called within the context of a UOWTransaction during a flush operation.
Issue INSERT and/or UPDATE statements for a list of objects.
This is called within the context of a UOWTransaction during a flush operation, given a list of states to be flushed. The base mapper in an inheritance hierarchy handles the inserts/ updates for all descendant mappers.