class documentation

class Computed(FetchedValue, SchemaItem):

View In Hierarchy

Defines a generated column, i.e. "GENERATED ALWAYS AS" syntax.

The .Computed construct is an inline construct added to the argument list of a _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.

New in version 1.3.11.
Method __init__ Construct a GENERATED ALWAYS AS DDL construct to accompany a _schema.Column.
Method ​_as​_for​_update Undocumented
Method ​_copy Undocumented
Method ​_set​_parent Associate with this SchemaEvent's parent object.
Method copy Undocumented
Class Variable __visit​_name__ Undocumented
Instance Variable column Undocumented
Instance Variable persisted Undocumented
Instance Variable sqltext Undocumented

Inherited from FetchedValue:

Method __repr__ Undocumented
Method ​_clone 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

Inherited from SchemaEventTarget (via FetchedValue):

Method ​_set​_parent​_with​_dispatch Undocumented

Inherited from SchemaItem:

Method __repr__ Undocumented
Method ​_init​_items Initialize the list of child items for this SchemaItem.
Method ​_schema​_item​_copy Undocumented
Class Variable ​_use​_schema​_map Undocumented
Class Variable create​_drop​_stringify​_dialect Undocumented
Property info Info dictionary associated with the object, allowing user-defined data to be associated with this .SchemaItem.

Inherited from SchemaEventTarget (via SchemaItem):

Method ​_set​_parent​_with​_dispatch Undocumented

Inherited from Traversible (via SchemaItem):

Method get​_children Return immediate child .visitors.Traversible elements of this .visitors.Traversible.
Method __class​_getitem__ Undocumented
@_document_text_coercion('sqltext', ':class:`.Computed`', ':paramref:`.Computed.sqltext`')
def __init__(self, sqltext, persisted=None):
Construct a GENERATED ALWAYS AS DDL construct to accompany a _schema.Column.
Parameters
sqltextA string containing the column generation expression, which will be used verbatim, or a SQL expression construct, such as a _expression.text object. If given as a string, the object is converted to a _expression.text object.
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.

def _as_for_update(self, for_update):
def _copy(self, target_table=None, **kw):

Undocumented

def _set_parent(self, parent, **kw):
Associate with this SchemaEvent's parent object.
@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=None, **kw):

Undocumented

__visit_name__: str =
column =
persisted =

Undocumented

sqltext =

Undocumented