Column Elements and Expressions¶
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
ClauseElement class. Key subclasses include 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 FromClause, which represents the role of a token that
is placed in the FROM clause of a SELECT statement.
Column Element Foundational Constructors¶
Standalone functions imported from the sqlalchemy namespace which are
used when building up SQLAlchemy Expression Language constructs.
Column Element Modifier Constructors¶
Functions listed here are more commonly available as methods from any
ColumnElement construct, for example, the
label() function is usually invoked via the
ColumnElement.label() method.
| Object Name | Description |
|---|---|
Synonym for the |
|
Legacy synonym for the |
- function sqlalchemy.sql.expression.nullsfirst()¶
Synonym for the
nulls_first()function.Changed in version 2.0.5: restored missing legacy symbol
nullsfirst().
- function sqlalchemy.sql.expression.nullslast()¶
Legacy synonym for the
nulls_last()function.Changed in version 2.0.5: restored missing legacy symbol
nullslast().
Column Element Class Documentation¶
The classes here are generated using the constructors listed at Column Element Foundational Constructors and Column Element Modifier Constructors.
| Object Name | Description |
|---|---|
General purpose “column expression” argument. |
- sqlalchemy.sql.expression.ColumnExpressionArgument¶
General purpose “column expression” argument.
Added in version 2.0.13.
This type is used for “column” kinds of expressions that typically represent a single SQL column expression, including
ColumnElement, as well as ORM-mapped attributes that will have a__clause_element__()method.
Column Element Typing Utilities¶
Standalone utility functions imported from the sqlalchemy namespace
to improve support by type checkers.