Skip to content

DISABLED

Disable endpoint globally or conditionally based on tags.

Overview

This annotation prevents an endpoint from being created. Use it to:

  • Completely disable an endpoint
  • Conditionally disable an endpoint based on routine volatility or CRUD operation type
  • Hide internal functions that shouldn't be exposed as HTTP endpoints

Tags are automatically assigned based on routine source (function volatility, CRUD operation type). See TAGS for the complete list of automatic tags.

Keywords

disabled

Syntax

disabled
disabled <tag1> [tag2] [tag3] ...
  • Without tags: Disables the endpoint unconditionally
  • With tags: Disables the endpoint only when it has at least one of the specified tags

Examples

Disable Globally

sql
comment on function deprecated_func() is
'HTTP
disabled';

The function will not be exposed as an HTTP endpoint.

Disable Volatile Functions

sql
-- Disable endpoint for volatile functions (side effects)
comment on function dangerous_operation() is
'HTTP POST
disabled volatile';

Disable Write Operations on a Table

sql
-- Make table read-only via API
comment on table reference_data is
'disabled insert update delete';

This disables INSERT, UPDATE, and DELETE endpoints, keeping only SELECT.

Disable for Production

sql
comment on function admin_debug() is
'HTTP
disabled production';

Endpoint is disabled when the routine has production tag but available in other environments.

Selective Disable with Re-enable

sql
comment on function internal_api() is
'HTTP GET
disabled
enabled immutable';

Disables by default, but re-enables for immutable functions only.

Disable Returning Variants

sql
-- Disable all RETURNING variants for simpler API
comment on table orders is
'disabled returning';

This disables all CRUD operations that return data (insert returning, update returning, delete returning).

Behavior

  • When used without tags, unconditionally disables the endpoint
  • When used with tags, disables only if the endpoint has at least one matching tag
  • Can be combined with enabled to create complex enable/disable logic
  • Tags include automatic tags from routine source (volatility, CRUD type) and custom tags
  • Case-insensitive tag matching
  • ENABLED - Enable endpoint globally or by tags
  • TAGS - Automatic tags and conditional annotation application

Released under the MIT License.