r"""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_
(
self,
*prefixes: _TextCoercedExpressionArgument[Any],
dialect: str = "*",
)
| 388 | ":paramref:`.HasPrefixes.prefix_with.*prefixes`", |
| 389 | ) |
| 390 | def prefix_with( |
| 391 | self, |
| 392 | *prefixes: _TextCoercedExpressionArgument[Any], |
| 393 | dialect: str = "*", |
| 394 | ) -> Self: |
| 395 | r"""Add one or more expressions following the statement keyword, i.e. |
| 396 | SELECT, INSERT, UPDATE, or DELETE. Generative. |
| 397 | |
| 398 | This is used to support backend-specific prefix keywords such as those |
| 399 | provided by MySQL. |
| 400 | |
| 401 | E.g.:: |
| 402 | |
| 403 | stmt = table.insert().prefix_with("LOW_PRIORITY", dialect="mysql") |
| 404 | |
| 405 | # MySQL 5.7 optimizer hints |
| 406 | stmt = select(table).prefix_with("/*+ BKA(t1) */", dialect="mysql") |
| 407 | |
| 408 | Multiple prefixes can be specified by multiple calls |
| 409 | to :meth:`_expression.HasPrefixes.prefix_with`. |
| 410 | |
| 411 | :param \*prefixes: textual or :class:`_expression.ClauseElement` |
| 412 | construct which |
| 413 | will be rendered following the INSERT, UPDATE, or DELETE |
| 414 | keyword. |
| 415 | :param dialect: optional string dialect name which will |
| 416 | limit rendering of this prefix to only that dialect. |
| 417 | |
| 418 | """ |
| 419 | self._prefixes = self._prefixes + tuple( |
| 420 | [ |
| 421 | (coercions.expect(roles.StatementOptionRole, p), dialect) |
| 422 | for p in prefixes |
| 423 | ] |
| 424 | ) |
| 425 | return self |
| 426 | |
| 427 | |
| 428 | class HasSuffixes: |
no outgoing calls