Skip to content

DESCRIBE

DESCRIBE returns catalog metadata.

{ DESCRIBE | DESC } [TABLE] table_name [FORMAT JSON]
DESCRIBE DATABASE FORMAT JSON

The tabular table form reports columns. FORMAT JSON returns the versioned table descriptor envelope; DATABASE is available only with FORMAT JSON.

table_name names a relation. TABLE is optional. FORMAT JSON selects one JSON value instead of the legacy tabular shape.

The tabular result contains Field, Type, Null, Key, Default and Extra. JSON mode returns one descriptor column and one row.

DESCRIBE reads transaction-visible catalog metadata and makes no changes.

A missing object fails. DESCRIBE DATABASE without FORMAT JSON is rejected. Descriptor JSON is versioned and should be parsed by field, not by formatting.

Table metadata requires CONNECT, schema USAGE and SELECT on the relation. Database-wide description is bootstrap-only.

CREATE TABLE ref_describe (
id INTEGER PRIMARY KEY,
title TEXT NOT NULL DEFAULT 'untitled'
);
DESCRIBE ref_describe;

See Defining a Schema, SHOW and Protocol Internals.