When defining field type is the model for each Column
agreement type of operation differ in the types of input and output field types, and support, we differ.
Here are just sqlalchemy.types.*
the type, SQL type standard terms, what is written DDL statement is what the last generation, for example BIGINT
, BLOG
these, but these types are not necessarily supported in all databases. Besides, SQLAlchemy also supports some certain specific types of database, these needs from the specific dialects
import realization in.
- Integer/BigInteger/SmallInteger
- Shaping.
- Boolean
-
Boolean type. Python in performance
True/False
, database support according to circumstances, performanceBOOLEAN
orSMALLINT
can specify whether to create constraints when instantiating (created by default). -
Date/DateTime/Time
(timezone=False)
-
Date type,
Time
andDateTime
the instance of the band can specify whether information. - Interval
-
Time deviation type. Performance in Python
datetime.timedelta()
, database does not support this type is stored as a date. -
Enum
(*enums, **kw)
-
Enumerated types, according to the database supports case, SQLAlchemy will use the native support or use
VARCHAR
to achieve the type of additional constraints of ways. Native support for new types involved in creating, details of control at instantiation. - Float
- Floating point decimal.
-
Numeric
(precision=None, scale=None, decimal_return_scale=None, ...)
-
Fixed-point decimal, Python in performance
Decimal
. -
LargeBinary
(length=None)
- Bytes of data. The database implementation, in the instance of the specified size may be required.
- PickleType
- Python serialized object type.
-
String
(length=None, collation=None, ...)
-
String type, Python in performance
Unicode
, the performance of the databaseVARCHAR
, typically require the specified length. - Unicode
-
Similar to the string type, and in some database implementation, explicitly expressed support for non-ASCII characters. At the same time input and output is also forced to
Unicode
type. - Text
-
Long text type, Python performance
Unicode
, database performanceTEXT
. - UnicodeText
-
Reference
Unicode
.