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.
Apply "render derived" to this :class:`_sql.TableValuedAlias`.
This has the effect of the individual column names listed out
after the alias name in the "AS" sequence, e.g.:
.. sourcecode:: pycon+sql
>>> print(
... select(
... func.unnest(array(["one", "two", "three"]))
... .table_valued("x", with_ordinality="o")
... .render_derived()
... )
... )
{printsql}SELECT anon_1.x, anon_1.o
FROM unnest(ARRAY[%(param_1)s, %(param_2)s, %(param_3)s]) WITH ORDINALITY AS anon_1(x, o)
The ``with_types`` keyword will render column types inline within
the alias expression (this syntax currently applies to the
PostgreSQL database):
.. sourcecode:: pycon+sql
>>> print(
... select(
... func.json_to_recordset('[{"a":1,"b":"foo"},{"a":"2","c":"bar"}]')
... .table_valued(column("a", Integer), column("b", String))
... .render_derived(with_types=True)
... )
... )
{printsql}SELECT anon_1.a, anon_1.b FROM json_to_recordset(:json_to_recordset_1)
AS anon_1(a INTEGER, b VARCHAR)
:param name: optional string name that will be applied to the alias
generated. If left as None, a unique anonymizing name will be used.
:param with_types: if True, the derived columns will include the
datatype specification with each column. This is a special syntax
currently known to be required by PostgreSQL for some SQL functions.
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 :