1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
|
Column Elements and Expressions
===============================
.. currentmodule:: sqlalchemy.sql.expression
The expression API consists of a series of classes each of which represents a
specific lexical element within a SQL string. Composed together
into a larger structure, they form a statement construct that may
be *compiled* into a string representation that can be passed to a database.
The classes are organized into a hierarchy that begins at the basemost
:class:`.ClauseElement` class. Key subclasses include :class:`.ColumnElement`,
which represents the role of any column-based expression
in a SQL statement, such as in the columns clause, WHERE clause, and ORDER BY
clause, and :class:`.FromClause`, which represents the role of a token that
is placed in the FROM clause of a SELECT statement.
.. _sqlelement_foundational_constructors:
Column Element Foundational Constructors
-----------------------------------------
Standalone functions imported from the ``sqlalchemy`` namespace which are
used when building up SQLAlchemy Expression Language constructs.
.. autofunction:: and_
.. autofunction:: bindparam
.. autofunction:: case
.. autofunction:: cast
.. autofunction:: column
.. autoclass:: custom_op
:members:
.. autofunction:: distinct
.. autofunction:: extract
.. autofunction:: false
.. autodata:: func
.. autofunction:: lambda_stmt
.. autofunction:: literal
.. autofunction:: literal_column
.. autofunction:: not_
.. autofunction:: null
.. autofunction:: or_
.. autofunction:: outparam
.. autofunction:: text
.. autofunction:: true
.. autofunction:: tuple_
.. autofunction:: type_coerce
.. autoclass:: quoted_name
.. attribute:: quote
whether the string should be unconditionally quoted
.. _sqlelement_modifier_constructors:
Column Element Modifier Constructors
-------------------------------------
Functions listed here are more commonly available as methods from any
:class:`_sql.ColumnElement` construct, for example, the
:func:`_sql.label` function is usually invoked via the
:meth:`_sql.ColumnElement.label` method.
.. autofunction:: all_
.. autofunction:: any_
.. autofunction:: asc
.. autofunction:: between
.. autofunction:: collate
.. autofunction:: desc
.. autofunction:: funcfilter
.. autofunction:: label
.. autofunction:: nulls_first
.. autofunction:: nulls_last
.. autofunction:: over
.. autofunction:: within_group
Column Element Class Documentation
-----------------------------------
The classes here are generated using the constructors listed at
:ref:`sqlelement_foundational_constructors` and
:ref:`sqlelement_modifier_constructors`.
.. autoclass:: BinaryExpression
:members:
.. autoclass:: BindParameter
:members:
.. autoclass:: Case
:members:
.. autoclass:: Cast
:members:
.. autoclass:: ClauseList
:members:
.. autoclass:: ColumnClause
:members:
.. autoclass:: ColumnCollection
:members:
.. autoclass:: ColumnElement
:members:
:inherited-members:
:undoc-members:
.. autoclass:: ColumnOperators
:members:
:special-members:
:inherited-members:
.. autoclass:: Extract
:members:
.. autoclass:: False_
:members:
.. autoclass:: FunctionFilter
:members:
.. autoclass:: Label
:members:
.. autoclass:: Null
:members:
.. autoclass:: Operators
:members:
:special-members:
.. autoclass:: Over
:members:
.. autoclass:: TextClause
:members:
.. autoclass:: Tuple
:members:
.. autoclass:: WithinGroup
:members:
.. autoclass:: sqlalchemy.sql.elements.WrapsColumnExpression
:members:
.. autoclass:: True_
:members:
.. autoclass:: TypeCoerce
:members:
.. autoclass:: UnaryExpression
:members:
|