sqlalchemy mysql database field corresponding to the field with the problem

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  BIGINTBLOG 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, performance  BOOLEAN  or SMALLINT  can specify whether to create constraints when instantiating (created by default).
Date/DateTime/Time  (timezone=False)
Date type,  Time  and  DateTime  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 database  VARCHAR  , 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 performance  TEXT  .
UnicodeText
Reference  Unicode  .

Published 18 original articles · won praise 10 · views 60000 +

Guess you like

Origin blog.csdn.net/qq_34146899/article/details/52722968