Skip to content
On this page

@docs

Postgres Mysql (beta) Sqlite (beta)

TIP

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

Example

sql
-- @docs.description('Central inventory of all products')
-- @docs.emit(format: html, output: './docs/products.html')
CREATE TABLE products (
  id SERIAL PRIMARY KEY,
  name VARCHAR(100) NOT NULL,
  category_id INTEGER REFERENCES categories(id),
  price NUMERIC(10,2)
);

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