Backend Types supportedΒΆ

This table give a comprehensive list of the SQL Types that are expected to be supported by the database backends. If the type is not supported then the backend will have to emulate the behavior described here.

The columns are in the following order:

  • The SQL type [1] representing the field

  • The python type expected on input

  • The python type received on output

None will represent the NULL value and vice versa, it can be used as input or output for any SQL type.

SQL Type

Python input type

Python output type

BOOL

bool

bool

SMALLINT

int

int

INTEGER

int

int

BIGINT

int

int

REAL

float / int

float

FLOAT

float / int

float

NUMERIC

decimal.Decimal

decimal.Decimal

VARCHAR / VARCHAR(length)

str

str

TEXT

str

str

TIMESTAMP

datetime.datetime [2]

datetime.datetime [2]

DATETIME

datetime.datetime without microseconds [2]

datetime.datetime without microseconds [2]

DATE

datetime.date

datetime.date

TIME

datetime.time

datetime.time

INTERVAL

datetime.timedelta

datetime.timedelta

BLOB

bytes

bytes

JSON

dict

dict