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