Skip to content
On this page

@comment

Postgres Mysql (beta) Sqlite (beta)

Example

Input SQL
sql
-- @comment('Primary user accounts table')
CREATE TABLE users (
  id SERIAL PRIMARY KEY,
  -- @comment('User email address, must be unique')
  email VARCHAR(255) NOT NULL UNIQUE,
  -- @comment('Display name shown in UI')
  name VARCHAR(100) NOT NULL
);
Compiled Output
sql
COMMENT ON TABLE "users" IS 'Primary user accounts table';
COMMENT ON COLUMN "users"."email" IS 'User email address, must be unique';
COMMENT ON COLUMN "users"."name" IS 'Display name shown in UI';

Tags

@comment

Add a COMMENT ON statement to a table, column, view, function, type, or index

Targets: table, column, view, function, type, index

Arguments:Positional: string