File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -312,9 +312,11 @@ async def bulk_upsert_mappings(
312312 index_elements = [getattr (model , x ) for x in pk_fields ],
313313 set_ = {k : getattr (stmnt .excluded , k ) for k in payload [0 ].keys ()},
314314 )
315- results = await session_inst .execute (stmnt )
315+ await session_inst .execute (stmnt )
316316
317- await session_inst .commit ()
317+ results = await session_inst .scalars (
318+ stmnt .returning (model ), execution_options = {"population_existing" : True }
319+ )
318320
319321 return True , results .all ()
320322
Original file line number Diff line number Diff line change @@ -309,9 +309,11 @@ def bulk_upsert_mappings(
309309 index_elements = [getattr (model , x ) for x in pk_fields ],
310310 set_ = {k : getattr (stmnt .excluded , k ) for k in payload [0 ].keys ()},
311311 )
312- results = session_inst .execute (stmnt )
312+ session_inst .execute (stmnt )
313313
314- session_inst .commit ()
314+ results = session_inst .scalars (
315+ stmnt .returning (model ), execution_options = {"populate_existing" : True }
316+ )
315317
316318 return True , results .all ()
317319
You can’t perform that action at this time.
0 commit comments