summaryrefslogtreecommitdiff
path: root/doc/build/core/types.rst
diff options
context:
space:
mode:
Diffstat (limited to 'doc/build/core/types.rst')
-rw-r--r--doc/build/core/types.rst102
1 files changed, 41 insertions, 61 deletions
diff --git a/doc/build/core/types.rst b/doc/build/core/types.rst
index 131e8e64d..b4781ee51 100644
--- a/doc/build/core/types.rst
+++ b/doc/build/core/types.rst
@@ -9,7 +9,7 @@ SQLAlchemy provides abstractions for most common database data types,
and a mechanism for specifying your own custom data types.
The methods and attributes of type objects are rarely used directly.
-Type objects are supplied to :class:`~sqlalchemy.Table` definitions
+Type objects are supplied to :class:`~sqlalchemy.schema.Table` definitions
and can be supplied as type hints to `functions` for occasions where
the database driver returns an incorrect type.
@@ -24,7 +24,7 @@ the database driver returns an incorrect type.
SQLAlchemy will use the ``Integer`` and ``String(32)`` type
information when issuing a ``CREATE TABLE`` statement and will use it
again when reading back rows ``SELECTed`` from the database.
-Functions that accept a type (such as :func:`~sqlalchemy.Column`) will
+Functions that accept a type (such as :func:`~sqlalchemy.schema.Column`) will
typically accept a type class or instance; ``Integer`` is equivalent
to ``Integer()`` with no construction arguments in this case.
@@ -41,76 +41,58 @@ type is emitted in ``CREATE TABLE``, such as ``VARCHAR`` see `SQL
Standard Types`_ and the other sections of this chapter.
.. autoclass:: BigInteger
- :show-inheritance:
- :members:
+ :members:
.. autoclass:: Boolean
- :show-inheritance:
- :members:
+ :members:
.. autoclass:: Date
- :show-inheritance:
- :members:
+ :members:
.. autoclass:: DateTime
- :show-inheritance:
:members:
.. autoclass:: Enum
- :show-inheritance:
:members: __init__, create, drop
.. autoclass:: Float
- :show-inheritance:
:members:
.. autoclass:: Integer
- :show-inheritance:
:members:
.. autoclass:: Interval
- :show-inheritance:
- :members:
+ :members:
.. autoclass:: LargeBinary
- :show-inheritance:
- :members:
+ :members:
.. autoclass:: Numeric
- :show-inheritance:
:members:
.. autoclass:: PickleType
- :show-inheritance:
- :members:
+ :members:
.. autoclass:: SchemaType
- :show-inheritance:
:members:
:undoc-members:
.. autoclass:: SmallInteger
- :show-inheritance:
- :members:
+ :members:
.. autoclass:: String
- :show-inheritance:
:members:
.. autoclass:: Text
- :show-inheritance:
:members:
.. autoclass:: Time
- :show-inheritance:
:members:
.. autoclass:: Unicode
- :show-inheritance:
:members:
.. autoclass:: UnicodeText
- :show-inheritance:
:members:
.. _types_sqlstandard:
@@ -123,70 +105,70 @@ name when ``CREATE TABLE`` is issued. Some types may not be supported
on all databases.
.. autoclass:: BIGINT
- :show-inheritance:
+
.. autoclass:: BINARY
- :show-inheritance:
+
.. autoclass:: BLOB
- :show-inheritance:
+
.. autoclass:: BOOLEAN
- :show-inheritance:
+
.. autoclass:: CHAR
- :show-inheritance:
+
.. autoclass:: CLOB
- :show-inheritance:
+
.. autoclass:: DATE
- :show-inheritance:
+
.. autoclass:: DATETIME
- :show-inheritance:
+
.. autoclass:: DECIMAL
- :show-inheritance:
+
.. autoclass:: FLOAT
- :show-inheritance:
+
.. autoclass:: INT
- :show-inheritance:
+
.. autoclass:: sqlalchemy.types.INTEGER
- :show-inheritance:
+
.. autoclass:: NCHAR
- :show-inheritance:
+
.. autoclass:: NVARCHAR
- :show-inheritance:
+
.. autoclass:: NUMERIC
- :show-inheritance:
+
.. autoclass:: REAL
- :show-inheritance:
+
.. autoclass:: SMALLINT
- :show-inheritance:
+
.. autoclass:: TEXT
- :show-inheritance:
+
.. autoclass:: TIME
- :show-inheritance:
+
.. autoclass:: TIMESTAMP
- :show-inheritance:
+
.. autoclass:: VARBINARY
- :show-inheritance:
+
.. autoclass:: VARCHAR
- :show-inheritance:
+
.. _types_vendor:
@@ -194,7 +176,7 @@ Vendor-Specific Types
---------------------
Database-specific types are also available for import from each
-database's dialect module. See the :ref:`sqlalchemy.dialects_toplevel`
+database's dialect module. See the :ref:`dialect_toplevel`
reference for the database you're interested in.
For example, MySQL has a ``BIGINT`` type and PostgreSQL has an
@@ -300,7 +282,7 @@ to and from the database is required.
.. autoclass:: TypeDecorator
:members:
:inherited-members:
- :show-inheritance:
+
TypeDecorator Recipes
~~~~~~~~~~~~~~~~~~~~~
@@ -361,6 +343,8 @@ many decimal places. Here's a recipe that rounds them down::
value = value.quantize(self.quantize)
return value
+.. _custom_guid_type:
+
Backend-agnostic GUID Type
^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -690,7 +674,7 @@ to integers::
class MyInt(Integer):
class comparator_factory(Integer.Comparator):
def log(self, other):
- return func.log(self, other)
+ return func.log(self.expr, other)
Using the above type::
@@ -738,29 +722,25 @@ is needed, use :class:`.TypeDecorator` instead.
.. autoclass:: UserDefinedType
:members:
- :show-inheritance:
+
.. _types_api:
Base Type API
--------------
-.. autoclass:: AbstractType
- :members:
- :show-inheritance:
-
.. autoclass:: TypeEngine
:members:
- :show-inheritance:
+
.. autoclass:: Concatenable
:members:
:inherited-members:
- :show-inheritance:
+
.. autoclass:: NullType
- :show-inheritance:
+
.. autoclass:: Variant
- :show-inheritance:
+
:members: with_variant, __init__