Represent a scalar ``VALUES`` construct that can be used as a COLUMN element in a statement. The :class:`_expression.ScalarValues` object is created from the :meth:`_expression.Values.scalar_values` method. It's also automatically generated when a :class:`_expression.Values` is used
| 3557 | |
| 3558 | |
| 3559 | class ScalarValues(roles.InElementRole, GroupedElement, ColumnElement[Any]): |
| 3560 | """Represent a scalar ``VALUES`` construct that can be used as a |
| 3561 | COLUMN element in a statement. |
| 3562 | |
| 3563 | The :class:`_expression.ScalarValues` object is created from the |
| 3564 | :meth:`_expression.Values.scalar_values` method. It's also |
| 3565 | automatically generated when a :class:`_expression.Values` is used in |
| 3566 | an ``IN`` or ``NOT IN`` condition. |
| 3567 | |
| 3568 | .. versionadded:: 2.0.0b4 |
| 3569 | |
| 3570 | """ |
| 3571 | |
| 3572 | __visit_name__ = "scalar_values" |
| 3573 | |
| 3574 | _traverse_internals: _TraverseInternalsType = [ |
| 3575 | ("_column_args", InternalTraversal.dp_clauseelement_list), |
| 3576 | ("_data", InternalTraversal.dp_dml_multi_values), |
| 3577 | ("literal_binds", InternalTraversal.dp_boolean), |
| 3578 | ] |
| 3579 | |
| 3580 | def __init__( |
| 3581 | self, |
| 3582 | columns: Sequence[NamedColumn[Any]], |
| 3583 | data: Tuple[Sequence[Tuple[Any, ...]], ...], |
| 3584 | literal_binds: bool, |
| 3585 | ): |
| 3586 | super().__init__() |
| 3587 | self._column_args = columns |
| 3588 | self._data = data |
| 3589 | self.literal_binds = literal_binds |
| 3590 | |
| 3591 | @property |
| 3592 | def _column_types(self) -> List[TypeEngine[Any]]: |
| 3593 | return [col.type for col in self._column_args] |
| 3594 | |
| 3595 | def __clause_element__(self) -> ScalarValues: |
| 3596 | return self |
| 3597 | |
| 3598 | if TYPE_CHECKING: |
| 3599 | |
| 3600 | def self_group( |
| 3601 | self, against: Optional[OperatorType] = None |
| 3602 | ) -> Self: ... |
| 3603 | |
| 3604 | def _ungroup(self) -> ColumnElement[Any]: ... |
| 3605 | |
| 3606 | |
| 3607 | class SelectBase( |