Skip to main content
libSQL adds a few statements to the SQLite grammar. See the libSQL extensions documentation. Vector index syntax is covered in Vector search.

Alter a column in place

Change a column’s type, NOT NULL, DEFAULT, CHECK, COLLATE, or REFERENCES clause without recreating the table:
A new CHECK or NOT NULL constraint applies to later writes only, and existing rows are not validated. The statement cannot rename the column and cannot add a UNIQUE constraint.
Do not add AUTOINCREMENT to a column with ALTER COLUMN. Declare AUTOINCREMENT when you create the table instead.

Random row IDs

Create a table whose row IDs are assigned randomly, so they reveal neither insert order nor row count:
RANDOM ROWID cannot be combined with AUTOINCREMENT. An explicit rowid on insert is still honored.
Last modified on November 2, 2026