Skip to content

Editing columns

Columns are edited on the Columns sub-tab of the Design tab.

The Columns sub-tab of the Design tab The Columns sub-tab of the Design tab

To add a column:

  1. Click Add to open the column properties dialog.

    The column properties dialog The column properties dialog

  2. Set the column's properties — name, type, size, precision, default value, collation, and the Not Null and Unique options.

  3. Click OK.

To modify a column: select it in the list, click Modify, change its properties, and click OK.

The column dialog also has a Check Constraints page, for a rule that applies to this one column — see Editing constraints. The column's role in the primary key and any foreign-key reference are edited on the Primary Key and Foreign Keys sub-tabs instead.

To delete a column: select it, click Delete, and confirm with OK.

To reorder columns: select a column and use the Move Up and Move Down buttons.

Autoincrement columns

SQLite supports a single auto-increment column per table, and only when it is declared as INTEGER PRIMARY KEY. To create one, go to the Primary Key tab, declare a single-column INTEGER primary key, and tick Autoincrement.

The primary key column dialog The primary key column dialog

Columns in a STRICT table

If the table has Strict ticked on its General page, SQLite accepts only six column types: INT, INTEGER, REAL, TEXT, BLOB and ANY. The SQL Type list narrows to those six, and the type mappings are not offered — a column declared VARCHAR(20) would stop the table being created at all.

Ticking Strict on a table that already has other types does not rewrite them: which of the six was meant is your decision, so the editor reports each offending column as an error instead. See Data types.

Tip

SQLite is flexible about types — in principle any column can hold any kind of value — but declaring a sensible type (such as INTEGER, TEXT, or REAL) documents your intent and controls how SQLite Expert maps and displays the data. See Data types for how the mapping works.

See also: Editing primary keys · Editing constraints · Data types