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 :func:`_expression.select` construct with its columns
clause replaced with the given entities.
By default, this method is exactly equivalent to as if the original
:func:`_expression.select` had been called with the given entities.
E.g. a statement::
s = select(table1.c.a, table1.c.b)
s = s.with_only_columns(table1.c.b)
should be exactly equivalent to::
s = select(table1.c.b)
In this mode of operation, :meth:`_sql.Select.with_only_columns`
will also dynamically alter the FROM clause of the
statement if it is not explicitly stated.
To maintain the existing set of FROMs including those implied by the
current columns clause, add the
:paramref:`_sql.Select.with_only_columns.maintain_column_froms`
parameter::
s = select(table1.c.a, table2.c.b)
s = s.with_only_columns(table1.c.a, maintain_column_froms=True)
The above parameter performs a transfer of the effective FROMs
in the columns collection to the :meth:`_sql.Select.select_from`
method, as though the following were invoked::
s = select(table1.c.a, table2.c.b)
s = s.select_from(table1, table2).with_only_columns(table1.c.a)
The :paramref:`_sql.Select.with_only_columns.maintain_column_froms`
parameter makes use of the :attr:`_sql.Select.columns_clause_froms`
collection and performs an operation equivalent to the following::
s = select(table1.c.a, table2.c.b)
s = s.select_from(*s.columns_clause_froms).with_only_columns(table1.c.a)
:param \*entities: column expressions to be used.
:param maintain_column_froms: boolean parameter that will ensure the
FROM list implied from the current columns clause will be transferred
to the :meth:`_sql.Select.select_from` method first.
.. versionadded:: 1.4.23
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 :