文档中心MogDBMogDB StackUqbar
v5.0

文档:v5.0

支持的版本:

其他版本:

Python类型和SQL类型的映射

许多标准的Python类型被改编成SQL,并在执行查询时作为Python对象返回。

下表显示了Python和PostgreSQL类型之间的默认映射:

Python PostgreSQL
None NULL
bool bool
float real,double
int, long smallint, integer, bigint
Decimal numeric
str, unicode varchar, text
buffer, memoryview, bytearray, bytes, Buffer protocol bytea
date date
time time, timetz
datetime timestamp, timestamptz
timedelta interval
list ARRAY
tuple, namedtuple Composite types, IN syntax
dict hstore
Psycopg’s Range range
Anything™ json
UUID uuid
ipaddress objects inet, cidr

更多信息,请参考社区项目文档

Copyright © 2011-2024 www.enmotech.com All rights reserved.