/SQLAlchemy-0.7.8/doc/_sources/core/expression_api.txt
Plain Text | 256 lines | 171 code | 85 blank | 0 comment | 0 complexity | fc91113361ec048235b17a08ef6e1b05 MD5 | raw file
1.. _expression_api_toplevel:
2
3SQL Statements and Expressions API
4==================================
5
6.. module:: sqlalchemy.sql.expression
7
8This section presents the API reference for the SQL Expression Language. For a full introduction to its usage,
9see :ref:`sqlexpression_toplevel`.
10
11Functions
12---------
13
14The expression package uses functions to construct SQL expressions. The return value of each function is an object instance which is a subclass of :class:`~sqlalchemy.sql.expression.ClauseElement`.
15
16.. autofunction:: alias
17
18.. autofunction:: and_
19
20.. autofunction:: asc
21
22.. autofunction:: between
23
24.. autofunction:: bindparam
25
26.. autofunction:: case
27
28.. autofunction:: cast
29
30.. autofunction:: sqlalchemy.sql.expression.column
31
32.. autofunction:: collate
33
34.. autofunction:: delete
35
36.. autofunction:: desc
37
38.. autofunction:: distinct
39
40.. autofunction:: except_
41
42.. autofunction:: except_all
43
44.. autofunction:: exists
45
46.. autofunction:: extract
47
48.. autofunction:: false
49
50.. autodata:: func
51
52.. autofunction:: insert
53
54.. autofunction:: intersect
55
56.. autofunction:: intersect_all
57
58.. autofunction:: join
59
60.. autofunction:: label
61
62.. autofunction:: literal
63
64.. autofunction:: literal_column
65
66.. autofunction:: not_
67
68.. autofunction:: null
69
70.. autofunction:: nullsfirst
71
72.. autofunction:: nullslast
73
74.. autofunction:: or_
75
76.. autofunction:: outparam
77
78.. autofunction:: outerjoin
79
80.. autofunction:: over
81
82.. autofunction:: select
83
84.. autofunction:: subquery
85
86.. autofunction:: sqlalchemy.sql.expression.table
87
88.. autofunction:: text
89
90.. autofunction:: true
91
92.. autofunction:: tuple_
93
94.. autofunction:: type_coerce
95
96.. autofunction:: union
97
98.. autofunction:: union_all
99
100.. autofunction:: update
101
102Classes
103-------
104
105.. autoclass:: Alias
106 :members:
107 :show-inheritance:
108
109.. autoclass:: _BindParamClause
110 :members:
111 :show-inheritance:
112
113.. autoclass:: ClauseElement
114 :members:
115 :show-inheritance:
116
117.. autoclass:: ClauseList
118 :members:
119 :show-inheritance:
120
121.. autoclass:: ColumnClause
122 :members:
123 :show-inheritance:
124
125.. autoclass:: ColumnCollection
126 :members:
127 :show-inheritance:
128
129.. autoclass:: ColumnElement
130 :members:
131 :show-inheritance:
132
133.. autoclass:: _CompareMixin
134 :members:
135 :show-inheritance:
136
137.. autoclass:: sqlalchemy.sql.operators.ColumnOperators
138 :members:
139 :undoc-members:
140 :inherited-members:
141 :show-inheritance:
142
143 .. automethod:: __eq__
144 .. automethod:: __ne__
145 .. automethod:: __gt__
146 .. automethod:: __ge__
147 .. automethod:: __lt__
148 .. automethod:: __le__
149 .. automethod:: __neg__
150 .. automethod:: __add__
151 .. automethod:: __mul__
152 .. automethod:: __div__
153 .. automethod:: __truediv__
154 .. automethod:: __sub__
155 .. automethod:: __radd__
156 .. automethod:: __rsub__
157 .. automethod:: __rtruediv__
158 .. automethod:: __rdiv__
159 .. automethod:: __rmul__
160 .. automethod:: __mod__
161
162.. autoclass:: CompoundSelect
163 :members:
164 :show-inheritance:
165
166.. autoclass:: CTE
167 :members:
168 :show-inheritance:
169
170.. autoclass:: Delete
171 :members: where
172 :show-inheritance:
173
174.. autoclass:: Executable
175 :members:
176 :show-inheritance:
177
178.. autoclass:: FunctionElement
179 :members:
180 :show-inheritance:
181
182.. autoclass:: Function
183 :members:
184 :show-inheritance:
185
186.. autoclass:: FromClause
187 :members:
188 :show-inheritance:
189
190.. autoclass:: Insert
191 :members: prefix_with, values, returning
192 :show-inheritance:
193
194.. autoclass:: Join
195 :members:
196 :show-inheritance:
197
198.. autoclass:: sqlalchemy.sql.expression.Operators
199 :members:
200 :undoc-members:
201
202 .. automethod:: __and__
203 .. automethod:: __or__
204 .. automethod:: __invert__
205
206.. autoclass:: Select
207 :members:
208 :show-inheritance:
209
210.. autoclass:: Selectable
211 :members:
212 :show-inheritance:
213
214.. autoclass:: _SelectBase
215 :members:
216 :show-inheritance:
217
218.. autoclass:: TableClause
219 :members:
220 :show-inheritance:
221
222.. autoclass:: Update
223 :members:
224 :show-inheritance:
225
226.. autoclass:: UpdateBase
227 :members:
228 :show-inheritance:
229
230.. autoclass:: ValuesBase
231 :members:
232 :show-inheritance:
233
234.. _generic_functions:
235
236Generic Functions
237-----------------
238
239SQL functions which are known to SQLAlchemy with regards to database-specific
240rendering, return types and argument behavior. Generic functions are invoked
241like all SQL functions, using the :attr:`func` attribute::
242
243 select([func.count()]).select_from(sometable)
244
245Note that any name not known to :attr:`func` generates the function name as is
246- there is no restriction on what SQL functions can be called, known or
247unknown to SQLAlchemy, built-in or user defined. The section here only
248describes those functions where SQLAlchemy already knows what argument and
249return types are in use.
250
251.. automodule:: sqlalchemy.sql.functions
252 :members:
253 :undoc-members:
254 :show-inheritance:
255
256