class CompilerElement(Visitable): (source)
Known subclasses: sqlalchemy.sql.elements.ClauseElement
, sqlalchemy.sql.elements.CompilerColumnElement
base class for SQL elements that can be compiled to produce a SQL string. .. versionadded:: 2.0
Method | __str__ |
Undocumented |
Method | compile |
Compile this SQL expression. |
Class Variable | __slots__ |
Undocumented |
Class Variable | __visit |
Undocumented |
Class Variable | stringify |
Undocumented |
Class Variable | supports |
Undocumented |
Method | _compiler |
Return a compiler appropriate for this ClauseElement, given a Dialect. |
Inherited from Visitable
:
Method | __class |
Undocumented |
Method | __init |
Undocumented |
Class Method | _generate |
Undocumented |
Method | _compiler |
Undocumented |
Class Variable | _original |
Undocumented |
@util.preload_module(
def compile(self, bind:
Optional[ Union[ Engine, Connection]]
= None, dialect: Optional[ Dialect]
= None, **kw: Any
) -> Compiled
:
(source)
¶
sqlalchemy.sql.elements.DQLDMLClauseElement
Compile this SQL expression. The return value is a :class:`~.Compiled` object. Calling ``str()`` or ``unicode()`` on the returned value will yield a string representation of the result. The :class:`~.Compiled` object also can return a dictionary of bind parameter names and values using the ``params`` accessor. :param bind: An :class:`.Connection` or :class:`.Engine` which can provide a :class:`.Dialect` in order to generate a :class:`.Compiled` object. If the ``bind`` and ``dialect`` parameters are both omitted, a default SQL compiler is used. :param column_keys: Used for INSERT and UPDATE statements, a list of column names which should be present in the VALUES clause of the compiled statement. If ``None``, all columns from the target table object are rendered. :param dialect: A :class:`.Dialect` instance which can generate a :class:`.Compiled` object. This argument takes precedence over the ``bind`` argument. :param compile_kwargs: optional dictionary of additional parameters that will be passed through to the compiler within all "visit" methods. This allows any custom flag to be passed through to a custom compilation construct, for example. It is also used for the case of passing the ``literal_binds`` flag through:: from sqlalchemy.sql import table, column, select t = table('t', column('x')) s = select(t).where(t.c.x == 5) print(s.compile(compile_kwargs={"literal_binds": True})) .. versionadded:: 0.9.0 .. seealso:: :ref:`faq_sql_expression_string`
sqlalchemy.dialects.mssql.base.TryCast
, sqlalchemy.dialects.mysql.dml.Insert
, sqlalchemy.dialects.mysql.dml.Insert
, sqlalchemy.dialects.mysql.dml.Insert
, sqlalchemy.dialects.mysql.dml.OnDuplicateClause
, sqlalchemy.dialects.postgresql.aggregate_order_by
, sqlalchemy.dialects.postgresql.array
, sqlalchemy.dialects.postgresql.dml.Insert
, sqlalchemy.dialects.postgresql.dml.Insert
, sqlalchemy.dialects.postgresql.dml.Insert
, sqlalchemy.dialects.postgresql.dml.OnConflictClause
, sqlalchemy.dialects.sqlite.dml.Insert
, sqlalchemy.dialects.sqlite.dml.Insert
, sqlalchemy.dialects.sqlite.dml.Insert
, sqlalchemy.dialects.sqlite.dml.OnConflictClause
, sqlalchemy.sql.ddl._CreateDropBase
Undocumented