Vous avez des améliorations (ou des corrections) à proposer pour ce document :
je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.
Return a new :class:`.CursorResult` that "horizontally splices"
together the rows of this :class:`.CursorResult` with that of another
:class:`.CursorResult`.
.. tip:: This method is for the benefit of the SQLAlchemy ORM and is
not intended for general use.
"horizontally splices" means that for each row in the first and second
result sets, a new row that concatenates the two rows together is
produced, which then becomes the new row. The incoming
:class:`.CursorResult` must have the identical number of rows. It is
typically expected that the two result sets come from the same sort
order as well, as the result rows are spliced together based on their
position in the result.
The expected use case here is so that multiple INSERT..RETURNING
statements (which definitely need to be sorted) against different
tables can produce a single result that looks like a JOIN of those two
tables.
E.g.::
r1 = connection.execute(
users.insert().returning(
users.c.user_name, users.c.user_id, sort_by_parameter_order=True
),
user_values,
)
r2 = connection.execute(
addresses.insert().returning(
addresses.c.address_id,
addresses.c.address,
addresses.c.user_id,
sort_by_parameter_order=True,
),
address_values,
)
rows = r1.splice_horizontally(r2).all()
assert rows == [
("john", 1, 1, "foo@bar.com", 1),
("jack", 2, 2, "bar@bat.com", 2),
]
.. versionadded:: 2.0
.. seealso::
:meth:`.CursorResult.splice_vertically`
Améliorations / Corrections
Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.
Emplacement :
Description des améliorations :