class HasPrefixes: (source)
Known subclasses: sqlalchemy.orm.query.Query
, sqlalchemy.sql.dml.UpdateBase
, sqlalchemy.sql.selectable.CTE
, sqlalchemy.sql.selectable.Select
Undocumented
Method | prefix |
Add one or more expressions following the statement keyword, i.e. SELECT, INSERT, UPDATE, or DELETE. Generative. |
Class Variable | _has |
Undocumented |
Instance Variable | _prefixes |
Undocumented |
@_document_text_coercion(
def prefix_with(self, *prefixes:
_TextCoercedExpressionArgument[ Any]
, dialect: str
= '*') -> Self
:
(source)
¶
Add one or more expressions following the statement keyword, i.e. SELECT, INSERT, UPDATE, or DELETE. Generative. This is used to support backend-specific prefix keywords such as those provided by MySQL. E.g.:: stmt = table.insert().prefix_with("LOW_PRIORITY", dialect="mysql") # MySQL 5.7 optimizer hints stmt = select(table).prefix_with( "/*+ BKA(t1) */", dialect="mysql") Multiple prefixes can be specified by multiple calls to :meth:`_expression.HasPrefixes.prefix_with`. :param \*prefixes: textual or :class:`_expression.ClauseElement` construct which will be rendered following the INSERT, UPDATE, or DELETE keyword. :param dialect: optional string dialect name which will limit rendering of this prefix to only that dialect.