SQLite doesn’t have a dedicated CLOB data type. However, it can handle large text data using the TEXT type. In SQLite, the TEXT data type is a fundamental and widely – used option for storing character – based data. More: SQLite TEXT (CLOB).
| Type in SQLite | Maximum size |
|---|---|
TEXT | storage class, subject to the same SQLITE_MAX_LENGTH |
VARCHAR(n) / CLOB | only "type affinity" spellings - SQLite does not enforce a length |
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