Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

VARCHAR

You can define a column to be VARCHAR(10), but SQLite will totally disregard it. It can be still useful if your application code can rely on it or if at one point you might want to migrate to another database respects such definitions.

You can’t use this in a STRICT table.

CREATE TABLE people (
    name TEXT,
    phone VARCHAR(10)
);

INSERT INTO people VALUES ('John', '1234567890-123456789');

SELECT * FROM people;
$ sqlite3 < examples/varchar.sql
John|1234567890-123456789