13.13.4.1 Introduction

Python 2.5

13.13.4.1 Introduction

SQLite natively supports the following types: NULL, INTEGER, REAL, TEXT, BLOB.

The following Python types can thus be sent to SQLite without any problem:

Python type SQLite type
None NULL
int INTEGER
long INTEGER
float REAL
str (UTF8-encoded) TEXT
unicode TEXT
buffer BLOB

This is how SQLite types are converted to Python types by default:

SQLite type Python type
NULL None
INTEGER int or long, depending on size
REAL float
TEXT depends on text_factory, unicode by default
BLOB buffer

The type system of the sqlite3 module is extensible in two ways: you can store additional Python types in a SQLite database via object adaptation, and you can let the sqlite3 module convert SQLite types to different Python types via converters.

See About this document... for information on suggesting changes.