In SQLite, the BLOB (Binary Large Object) data type is used to store binary data such as images, audio files, or any other non – text data. More: SQLite BLOB.
| Type in SQLite | Maximum size |
|---|---|
BLOB | a storage class, not a hard type - the real limit comes from SQLITE_MAX_LENGTH |
SQLITE_MAX_LENGTH | compile-time default 1,000,000,000 (about 1 GB) |
SQLite is dynamically typed: declaring a column BLOB or TEXT only sets its type affinity, and what is actually stored is decided by the value written. Declaring a column CLOB does not give you CLOB semantics.
SQLITE_MAX_LENGTH, a compile-time constant defaulting to one billion bytes. That figure is more accurate than "1 GB", and the only way to change it is to rebuild SQLite - there is no runtime setting.
.dump (text SQL, BLOBs become X'...' literals) or VACUUM INTO 'new.db'.import, or the readfile() function.dump emits BLOBs as X'...' hex literals, so a database with large objects produces a dump more than twice the size - use VACUUM INTO or sqlite3_backup to move a whole fileSQLITE_MAX_LENGTH is fixed at build time and cannot be raised at runtimeVARCHAR(n) does not enforce the length - SQLite happily stores longer values