Skip to content
On this page

@docs

Schema documentation metadata plus project-level HTML/Markdown rendering

Postgres Mysql (beta) Sqlite (beta) Mssql

TIP

The @docs namespace generates HTML documentation and Mermaid ER diagrams rather than SQL output. Run sqldoc codegen to see the rendered results.

Example

Generate schema docs

The namespace contributes metadata in SQL and renders files at project compile time.

sql
-- @docs.description('Central inventory of all products')
CREATE TABLE products (
  id SERIAL PRIMARY KEY,
  name TEXT NOT NULL
);

Tags

@docs.emit

Include or exclude this object from documentation

Targets: table, view, function, type

Arguments:Positional: boolean

@docs.description

Set custom description text for this object in documentation

Targets: table, column, view, function, type

Arguments:Positional: string

@docs.previously

Indicate this object was renamed from a previous name

Targets: table, column

Arguments:Positional: string