class documentation

class ColumnDefault(DefaultGenerator):

View In Hierarchy

A plain default value on a column.

This could correspond to a constant, a callable function, or a SQL clause.

.ColumnDefault is generated automatically whenever the default, onupdate arguments of _schema.Column are used. A .ColumnDefault can be passed positionally as well.

For example, the following:

Column('foo', Integer, default=50)

Is equivalent to:

Column('foo', Integer, ColumnDefault(50))
Method __init__ Construct a new .ColumnDefault.
Method __repr__ Undocumented
Method ​_maybe​_wrap​_callable Wrap callables that don't accept a context.
Instance Variable arg Undocumented
Property ​_arg​_is​_typed Undocumented
Property is​_callable Undocumented
Property is​_clause​_element Undocumented
Property is​_scalar Undocumented

Inherited from DefaultGenerator:

Method ​_execute​_on​_connection Undocumented
Method ​_set​_parent Associate with this SchemaEvent's parent object.
Method execute Compile and execute this .Executable.
Class Variable __visit​_name__ Undocumented
Class Variable is​_sequence Undocumented
Class Variable is​_server​_default Undocumented
Instance Variable column Undocumented
Instance Variable for​_update Undocumented
Property bind Return the connectable associated with this default.

Inherited from Executable (via DefaultGenerator):

Method ​_add​_context​_option Add a context option to this statement.
Method ​_set​_compile​_options Assign the compile options to a new value.
Method ​_update​_compile​_options update the _compile_options with new keys.
Method execution​_options Set non-SQL options for the statement which take effect during execution.
Method get​_execution​_options Get the non-SQL options which will take effect during execution.
Method options Apply options to this statement.
Method scalar Compile and execute this .Executable, returning the result's scalar representation.
Class Variable ​_bind Undocumented
Class Variable ​_executable​_traverse​_internals Undocumented
Class Variable ​_with​_context​_options Undocumented
Class Variable ​_with​_options Undocumented
Class Variable is​_delete Undocumented
Class Variable is​_dml Undocumented
Class Variable is​_insert Undocumented
Class Variable is​_select Undocumented
Class Variable is​_text Undocumented
Class Variable is​_update Undocumented
Class Variable supports​_execution Undocumented
Instance Variable ​_compile​_options Undocumented
Instance Variable ​_execution​_options Undocumented
Property ​_effective​_plugin​_target Undocumented

Inherited from StatementRole (via DefaultGenerator, Executable):

Class Variable ​_propagate​_attrs Undocumented
Class Variable ​_role​_name Undocumented

Inherited from SQLRole (via DefaultGenerator, Executable, StatementRole):

Class Variable allows​_lambda Undocumented
Class Variable uses​_inspection Undocumented

Inherited from Generative (via DefaultGenerator, Executable):

Method ​_generate Undocumented

Inherited from SchemaItem (via DefaultGenerator):

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 DefaultGenerator, SchemaItem):

Method ​_set​_parent​_with​_dispatch Undocumented

Inherited from Traversible (via DefaultGenerator, SchemaItem):

Method get​_children Return immediate child .visitors.Traversible elements of this .visitors.Traversible.
Method __class​_getitem__ Undocumented
def __init__(self, arg, **kwargs):
Construct a new .ColumnDefault.
Parameters
arg

argument representing the default value. May be one of the following:

  • a plain non-callable Python value, such as a string, integer, boolean, or other simple type. The default value will be used as is each time.
  • a SQL expression, that is one which derives from _expression.ColumnElement. The SQL expression will be rendered into the INSERT or UPDATE statement, or in the case of a primary key column when RETURNING is not used may be pre-executed before an INSERT within a SELECT.
  • A Python callable. The function will be invoked for each new row subject to an INSERT or UPDATE. The callable must accept exactly zero or one positional arguments. The one-argument form will receive an instance of the .ExecutionContext, which provides contextual information as to the current _engine.Connection in use as well as the current statement and parameters.
**kwargsUndocumented
def __repr__(self):
def _maybe_wrap_callable(self, fn):

Wrap callables that don't accept a context.

This is to allow easy compatibility with default callables that aren't specific to accepting of a context.

arg =

Undocumented

@util.memoized_property
@util.preload_module('sqlalchemy.sql.sqltypes')
_arg_is_typed =

Undocumented

@util.memoized_property
is_callable =

Undocumented

@util.memoized_property
is_clause_element =

Undocumented

@util.memoized_property
is_scalar =

Undocumented