Skip to content
On this page

@deprecated

Marks schema objects as deprecated in SQL comments and generated docs

Postgres Mysql (beta) Sqlite (beta)

Example

Deprecate a legacy table

Adds comment metadata and docs status markers.

Input SQL
sql
-- @deprecated.replace('user_profiles')
CREATE TABLE user_settings (
  id SERIAL PRIMARY KEY,
  user_id INTEGER NOT NULL
);
Compiled Output
sql
COMMENT ON TABLE "user_settings" IS 'DEPRECATED: use user_profiles instead';

Tags

@deprecated

Mark this SQL object as deprecated

Targets: table, column, view, function, type

Arguments: No arguments.

@deprecated.replace

Mark as deprecated with a replacement suggestion

Targets: table, column, view, function, type

Arguments:Positional: string

@deprecated.remove

Mark as deprecated with a scheduled removal date

Targets: table, column, view, function, type

Arguments:Positional: string