文章内容
2020/11/10 18:08:06,作 者: 黄兵
SQLAlchemy BigInteger与BIGINT区别
BigInteger
定义:
class BigInteger(Integer): """A type for bigger ``int`` integers. Typically generates a ``BIGINT`` in DDL, and otherwise acts like a normal :class:`.Integer` on the Python side. """ __visit_name__ = 'big_integer'
BIGINT
定义:
class BIGINT(BigInteger): """The SQL BIGINT type.""" __visit_name__ = 'BIGINT'
BigInteger
与BIGINT
有什么区别呢?
BIGINT
必须从特定的方言中导入,使用BigInteger
由sqlalchemy自动处理映射,这取决于您所使用的数据库。
因此在数据库改变的时候,使用BigInteger
可以避免潜在的一些问题,存在的这些问题都由sqlalchemy自动处理。
参考资料:
1、What's the difference between BIGINT and BigInteger in SQLAlchemy?
评论列表