-------------------------------------
SQLAlchemy Core defines a fixed set of expression operators available to all column expressions.
-Some of these operations have the effect of overloading Python's built in operators;
+Some of these operations have the effect of overloading Python's built-in operators;
examples of such operators include
:meth:`.ColumnOperators.__eq__` (``table.c.somecolumn == 'foo'``),
:meth:`.ColumnOperators.__invert__` (``~table.c.flag``),
The Core expression constructs in all cases consult the type of the expression in order to determine
the behavior of existing operators, as well as to locate additional operators that aren't part of
-the built in set. The :class:`.TypeEngine` base class defines a root "comparison" implementation
+the built-in set. The :class:`.TypeEngine` base class defines a root "comparison" implementation
:class:`.TypeEngine.Comparator`, and many specific types provide their own sub-implementations of this
class. User-defined :class:`.TypeEngine.Comparator` implementations can be built directly into a
simple subclass of a particular type in order to override or define new operations. Below,
type that is explicitly known to be a decimal type
(e.g. ``DECIMAL``, ``NUMERIC``, others) and not a floating point
type (e.g. ``FLOAT``, ``REAL``, others).
- If the database column on the server is in fact a floating-point type
+ If the database column on the server is in fact a floating-point
type, such as ``FLOAT`` or ``REAL``, use the :class:`.Float`
type or a subclass, otherwise numeric coercion between
``float``/``Decimal`` may or may not function as expected.
return self.metadata and self.metadata.bind or None
def create(self, bind=None, checkfirst=False):
- """Issue CREATE ddl for this type, if applicable."""
+ """Issue CREATE DDL for this type, if applicable."""
if bind is None:
bind = _bind_or_error(self)
t.create(bind=bind, checkfirst=checkfirst)
def drop(self, bind=None, checkfirst=False):
- """Issue DROP ddl for this type, if applicable."""
+ """Issue DROP DDL for this type, if applicable."""
if bind is None:
bind = _bind_or_error(self)
default, the database value of the enumeration is used as the
sorting function.
- .. versionadded:: 1.3.8
+ .. versionadded:: 1.3.8
appropriate naming convention; see
:ref:`constraint_naming_conventions` for background.
- .. versionchanged:: 1.4 - this flag now defaults to False, meaning
- no CHECK constraint is generated for a non-native enumerated
- type.
-
-
+ .. versionchanged:: 1.4 - this flag now defaults to False, meaning
+ no CHECK constraint is generated for a non-native enumerated
+ type.
:param name: if a CHECK constraint is generated, specify
the name of the constraint.
self.none_as_null = none_as_null
class JSONElementType(TypeEngine):
- """common function for index / path elements in a JSON expression."""
+ """Common function for index / path elements in a JSON expression."""
_integer = Integer()
_string = String()
__visit_name__ = "ARRAY"
zero_indexes = False
- """if True, Python zero-based indexes should be interpreted as one-based
+ """If True, Python zero-based indexes should be interpreted as one-based
on the SQL expression side."""
class Comparator(Indexable.Comparator, Concatenable.Comparator):
"""Return the corresponding type object from the underlying DB-API, if
any.
- This can be useful for calling ``setinputsizes()``, for example.
+ This can be useful for calling ``setinputsizes()``, for example.
"""
return None
coerce_to_is_types = (util.NoneType,)
"""Specify those Python types which should be coerced at the expression
level to "IS <constant>" when compared using ``==`` (and same for
- ``IS NOT`` in conjunction with ``!=``.
+ ``IS NOT`` in conjunction with ``!=``).
For most SQLAlchemy types, this includes ``NoneType``, as well as
``bool``.