大整数
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'
Run Code Online (Sandbox Code Playgroud)
大数据
class BIGINT(BigInteger):
"""The SQL BIGINT type."""
__visit_name__ = 'BIGINT'
Run Code Online (Sandbox Code Playgroud)
但是 Column(BigInteger) 和 Column(BIGINT) 都可以工作,都可以在 postgresql 中定义一个 bigint。如何区分它们?
它们都可以工作,但是BIGINT必须从特定的方言导入,例如您的情况下的 postgres。如果您将数据库更改为例如。mysql,你可能有问题。使用BigIntegersqlalchemy 处理映射,取决于您使用的数据库,所以您应该更喜欢这个。
| 归档时间: |
|
| 查看次数: |
2740 次 |
| 最近记录: |