class documentation

Defines a generated column, i.e. "GENERATED ALWAYS AS" syntax. The :class:`.Computed` construct is an inline construct added to the argument list of a :class:`_schema.Column` object:: from sqlalchemy import Computed Table('square', metadata_obj, Column('side', Float, nullable=False), Column('area', Float, Computed('side * side')) ) See the linked documentation below for complete details. .. versionadded:: 1.3.11 .. seealso:: :ref:`computed_ddl`

Method __init__ Construct a GENERATED ALWAYS AS DDL construct to accompany a :class:`_schema.Column`.
Method copy Undocumented
Class Variable __visit_name__ Undocumented
Instance Variable column Undocumented
Instance Variable persisted Undocumented
Instance Variable sqltext Undocumented
Method _as_for_update Undocumented
Method _copy Undocumented
Method _set_parent Associate with this SchemaEvent's parent object.

Inherited from FetchedValue:

Method __repr__ Undocumented
Class Variable has_argument Undocumented
Class Variable is_clause_element Undocumented
Class Variable is_server_default Undocumented
Class Variable reflected Undocumented
Instance Variable for_update Undocumented
Method _clone Undocumented

Inherited from SchemaItem (via FetchedValue):

Class Variable create_drop_stringify_dialect Undocumented
Property info Info dictionary associated with the object, allowing user-defined data to be associated with this :class:`.SchemaItem`.
Method _init_items Initialize the list of child items for this SchemaItem.
Method _schema_item_copy Undocumented
Class Variable _use_schema_map Undocumented

Inherited from SchemaEventTarget (via FetchedValue, SchemaItem):

Class Variable dispatch Undocumented
Method _set_parent_with_dispatch Undocumented

Inherited from EventTarget (via FetchedValue, SchemaItem, SchemaEventTarget):

Class Variable __slots__ Undocumented

Inherited from Visitable (via FetchedValue, SchemaItem, SchemaEventTarget, EventTarget):

Method __class_getitem__ Undocumented
Method __init_subclass__ Undocumented
Class Method _generate_compiler_dispatch Undocumented
Method _compiler_dispatch Undocumented
Class Variable _original_compiler_dispatch Undocumented
@_document_text_coercion('sqltext', ':class:`.Computed`', ':paramref:`.Computed.sqltext`')
def __init__(self, sqltext: _DDLColumnArgument, persisted: Optional[bool] = None): (source)

Construct a GENERATED ALWAYS AS DDL construct to accompany a :class:`_schema.Column`. :param sqltext: A string containing the column generation expression, which will be used verbatim, or a SQL expression construct, such as a :func:`_expression.text` object. If given as a string, the object is converted to a :func:`_expression.text` object. :param persisted: Optional, controls how this column should be persisted by the database. Possible values are: * ``None``, the default, it will use the default persistence defined by the database. * ``True``, will render ``GENERATED ALWAYS AS ... STORED``, or the equivalent for the target database if supported. * ``False``, will render ``GENERATED ALWAYS AS ... VIRTUAL``, or the equivalent for the target database if supported. Specifying ``True`` or ``False`` may raise an error when the DDL is emitted to the target database if the database does not support that persistence option. Leaving this parameter at its default of ``None`` is guaranteed to succeed for all databases that support ``GENERATED ALWAYS AS``.

@util.deprecated('1.4', 'The :meth:`_schema.Computed.copy` method is deprecated and will be removed in a future release.')
def copy(self, *, target_table: Optional[Table] = None, **kw: Any) -> Computed: (source)

Undocumented

persisted = (source)

Undocumented

Undocumented

def _as_for_update(self, for_update: bool) -> FetchedValue: (source)
def _copy(self, *, target_table: Optional[Table] = None, **kw: Any) -> Computed: (source)
def _set_parent(self, parent: SchemaEventTarget, **kw: Any): (source)

Associate with this SchemaEvent's parent object.