.. note::
- insert and update defaults configured on individual
- :class:`.Column` objects, i.e. those described at :ref:`metadata_defaults`
- including those configured by the ``default``, ``update``,
- ``server_default`` and ``server_onupdate`` arguments, will continue to
- function normally even if those :class:`.Column` objects are not mapped.
- This is because in the case of ``default`` and ``update``, the
- :class:`.Column` object is still present on the underlying
- :class:`.Table`, thus allowing the default functions to take place when
- the ORM emits an INSERT or UPDATE, and in the case of ``server_default``
- and ``server_onupdate``, the relational database itself maintains these
- functions.
+ insert and update defaults configured on individual :class:`.Column`
+ objects, i.e. those described at :ref:`metadata_defaults` including those
+ configured by the :paramref:`.Column.default`,
+ :paramref:`.Column.onupdate`, :paramref:`.Column.server_default` and
+ :paramref:`.Column.server_onupdate` parameters, will continue to function
+ normally even if those :class:`.Column` objects are not mapped. This is
+ because in the case of :paramref:`.Column.default` and
+ :paramref:`.Column.onupdate`, the :class:`.Column` object is still present
+ on the underlying :class:`.Table`, thus allowing the default functions to
+ take place when the ORM emits an INSERT or UPDATE, and in the case of
+ :paramref:`.Column.server_default` and :paramref:`.Column.server_onupdate`,
+ the relational database itself emits these defaults as a server side
+ behavior.
some_user.preference = None
session.flush() # will delete the Preference object
-See also :ref:`unitofwork_cascades` for detail on cascades.
+.. seealso::
+
+ :ref:`unitofwork_cascades` for detail on cascades.
Deleting based on Filter Criterion
:class:`.Transaction` objects will roll back the
transaction.
- See also:
+ .. seealso::
- :meth:`.Connection.begin_nested` - use a SAVEPOINT
+ :meth:`.Connection.begin_nested` - use a SAVEPOINT
- :meth:`.Connection.begin_twophase` - use a two phase /XID transaction
+ :meth:`.Connection.begin_twophase` - use a two phase /XID transaction
- :meth:`.Engine.begin` - context manager available from
- :class:`.Engine`.
+ :meth:`.Engine.begin` - context manager available from
+ :class:`.Engine`
"""
if self.__branch_from:
still controls the overall ``commit`` or ``rollback`` of the
transaction of a whole.
- See also :meth:`.Connection.begin`,
- :meth:`.Connection.begin_twophase`.
+ .. seealso::
+
+ :meth:`.Connection.begin`
+
+ :meth:`.Connection.begin_twophase`
+
"""
if self.__branch_from:
return self.__branch_from.begin_nested()
:param xid: the two phase transaction id. If not supplied, a
random id will be generated.
- See also :meth:`.Connection.begin`,
- :meth:`.Connection.begin_twophase`.
+ .. seealso::
+
+ :meth:`.Connection.begin`
+
+ :meth:`.Connection.begin_twophase`
"""
with engine.begin() as conn:
conn.execute("some statement", {'x':5, 'y':10})
- See also:
+ .. seealso::
:meth:`.Engine.begin` - engine-level transactional
context
The Transaction object is **not** threadsafe.
- See also: :meth:`.Connection.begin`, :meth:`.Connection.begin_twophase`,
- :meth:`.Connection.begin_nested`.
+ .. seealso::
+
+ :meth:`.Connection.begin`
+
+ :meth:`.Connection.begin_twophase`
+
+ :meth:`.Connection.begin_nested`
.. index::
single: thread safety; Transaction
An :class:`.Engine` object is instantiated publicly using the
:func:`~sqlalchemy.create_engine` function.
- See also:
+ .. seealso::
- :doc:`/core/engines`
+ :doc:`/core/engines`
- :ref:`connections_toplevel`
+ :ref:`connections_toplevel`
"""
with engine.begin() as conn:
conn.execute("some statement", {'x':5, 'y':10})
- See also:
+ .. seealso::
:meth:`.Engine.begin` - engine-level transactional
context
The above :class:`.DDL` object will also be associated with the
:class:`.Table` object represented by ``new_table``.
-
- See also:
+ .. seealso::
:ref:`event_toplevel`
:param multiparams: Multiple parameter sets, a list of dictionaries.
:param params: Single parameter set, a single dictionary.
- See also:
+ .. seealso::
- :meth:`.before_cursor_execute`
+ :meth:`.before_cursor_execute`
"""
:param executemany: boolean, if ``True``, this is an ``executemany()``
call, if ``False``, this is an ``execute()`` call.
- See also:
+ .. seealso::
- :meth:`.before_execute`
+ :meth:`.before_execute`
- :meth:`.after_cursor_execute`
+ :meth:`.after_cursor_execute`
"""
See the example in :ref:`composite_operations` for an overview
of usage , as well as the documentation for :class:`.PropComparator`.
- See also:
+ .. seealso::
- :class:`.PropComparator`
+ :class:`.PropComparator`
- :class:`.ColumnOperators`
+ :class:`.ColumnOperators`
- :ref:`types_operators`
+ :ref:`types_operators`
- :attr:`.TypeEngine.comparator_factory`
+ :attr:`.TypeEngine.comparator_factory`
"""
:attr:`.TypeEngine.comparator_factory` attribute. See
:ref:`types_operators` for more detail.
- See also:
+ .. seealso::
- :class:`.ColumnProperty.Comparator`
+ :class:`.ColumnProperty.Comparator`
- :class:`.RelationshipProperty.Comparator`
+ :class:`.RelationshipProperty.Comparator`
- :class:`.CompositeProperty.Comparator`
+ :class:`.CompositeProperty.Comparator`
- :class:`.ColumnOperators`
+ :class:`.ColumnOperators`
- :ref:`types_operators`
+ :ref:`types_operators`
- :attr:`.TypeEngine.comparator_factory`
+ :attr:`.TypeEngine.comparator_factory`
"""
See the documentation for :class:`.PropComparator` for a brief
overview.
- See also:
+ .. seealso::
- :class:`.PropComparator`
+ :class:`.PropComparator`
- :class:`.ColumnOperators`
+ :class:`.ColumnOperators`
- :ref:`types_operators`
+ :ref:`types_operators`
- :attr:`.TypeEngine.comparator_factory`
+ :attr:`.TypeEngine.comparator_factory`
"""
Public constructor is the :func:`.orm.relationship` function.
- See also:
+ .. seealso::
- :ref:`relationship_config_toplevel`
+ :ref:`relationship_config_toplevel`
"""
See the documentation for :class:`.PropComparator` for a brief
overview of ORM level operator definition.
- See also:
+ .. seealso::
- :class:`.PropComparator`
+ :class:`.PropComparator`
- :class:`.ColumnProperty.Comparator`
+ :class:`.ColumnProperty.Comparator`
- :class:`.ColumnOperators`
+ :class:`.ColumnOperators`
- :ref:`types_operators`
+ :ref:`types_operators`
- :attr:`.TypeEngine.comparator_factory`
+ :attr:`.TypeEngine.comparator_factory`
"""
remaining open, as it only affects connections that are
idle in the pool.
- See also the :meth:`Pool.recreate` method.
+ .. seealso::
+
+ :meth:`Pool.recreate`
"""
so that the ``==`` operation above is replaced by a clause
construct.
- See also:
+ .. seealso::
- :ref:`types_operators`
+ :ref:`types_operators`
- :attr:`.TypeEngine.comparator_factory`
+ :attr:`.TypeEngine.comparator_factory`
- :class:`.ColumnOperators`
+ :class:`.ColumnOperators`
- :class:`.PropComparator`
+ :class:`.PropComparator`
"""
unicode. The recipe at :ref:`coerce_to_unicode` illustrates
how this is done.
- See also:
+ .. seealso::
:class:`.UnicodeText` - unlengthed textual counterpart
to :class:`.Unicode`.
The method is evaluated at statement compile time, as opposed
to statement construction time.
- See also:
+ .. seealso::
- :ref:`types_sql_value_processing`
+ :ref:`types_sql_value_processing`
"""
may be used in an executemany() call against an arbitrary number
of bound parameter sets.
- See also:
+ .. seealso::
- :ref:`types_sql_value_processing`
+ :ref:`types_sql_value_processing`
"""
return None