class documentation

class HasPrefixes(object):

Known subclasses: sqlalchemy.orm.query.Query, sqlalchemy.sql.dml.UpdateBase, sqlalchemy.sql.expression.Select, sqlalchemy.sql.selectable.CTE

View In Hierarchy

Undocumented

Method ​_setup​_prefixes Undocumented
Method prefix​_with Add one or more expressions following the statement keyword, i.e. SELECT, INSERT, UPDATE, or DELETE. Generative.
Class Variable ​_has​_prefixes​_traverse​_internals Undocumented
Instance Variable ​_prefixes Undocumented
def _setup_prefixes(self, prefixes, dialect=None):

Undocumented

@_generative
@_document_text_coercion('expr', ':meth:`_expression.HasPrefixes.prefix_with`', ':paramref:`.HasPrefixes.prefix_with.*expr`')
def prefix_with(self, *expr, **kw):

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 _expression.HasPrefixes.prefix_with.

Parameters
*exprtextual or _expression.ClauseElement construct which will be rendered following the INSERT, UPDATE, or DELETE keyword.
**kwA single keyword 'dialect' is accepted. This is an optional string dialect name which will limit rendering of this prefix to only that dialect.
_has_prefixes_traverse_internals =

Undocumented

_prefixes =

Undocumented