Skip to content

SQL Schema

XTDB’s schema is largely inferred, but you may create tables ahead-of-time if required, to prevent table-not-found or column-not-found errors.

Normally this isn’t required - you can simply INSERT data to get started.

Tables can be created or altered with the CREATE TABLE statement.

CREATE OR ALTER TABLE <table name> ( <column name> , )
  • Column names are optional and do not yet support a type declaration.
  • CREATE TABLE does not fail if the table exists; any columns declared will be added to the existing table.

e.g.:

CREATE TABLE users (_id, name, email);