Skip to content
Written with Claude

Annotations Reference

Complete reference for all NpgsqlRest comment annotations. For an introduction to how annotations work, see the Comment Annotations Guide.

INFO

All annotations work in both PostgreSQL function/procedure comments (COMMENT ON FUNCTION ...) and SQL file endpoints (-- and /* */ comments in .sql files). The "SQL File Annotations" section below lists annotations that are specific to SQL files.

How to Use This Reference

Each annotation has its own page with:

  • Recognized keywords
  • Syntax explanation
  • Working examples from the test suite
  • Related annotations

Annotation Categories

HTTP & Routing

  • HTTP - Expose function as HTTP endpoint
  • PATH - Set custom endpoint path
  • PROXY - Mark endpoint as reverse proxy
  • PROXY_OUT - Execute function first, then forward result to upstream
  • ENABLED - Enable endpoint for specific tags
  • DISABLED - Disable endpoint for specific tags
  • TAGS - Filter annotations by tags
  • OPENAPI - Hide from the OpenAPI document or override the section tag
  • HTTP CUSTOM TYPES - Define HTTP request on composite type for external API calls
  • INTERNAL - Mark endpoint as internal-only (accessible via proxy/HTTP client types, not public HTTP)

Authorization

Basic Authentication

Request Configuration

Response Configuration

  • Response Headers - Set custom response headers
  • RESPONSE_NULL_HANDLING - NULL handling in responses
  • NESTED - Serialize composite type columns as nested JSON objects
  • SINGLE - Return a single record as a JSON object instead of an array
  • VOID - Force endpoint to return 204 No Content

Table Format Output

  • Custom Parameters - table_format, excel_file_name, excel_sheet for HTML table and Excel rendering

Raw Output Mode

Caching

Performance

Format References

Server-Sent Events

Upload

Policies

Context & Security

Parameter Annotations

  • PARAM - Rename, retype, set defaults, and configure parameters
  • PARAMETER_HASH - Hash one parameter using another
  • ENCRYPT - Encrypt parameter values before sending to PostgreSQL
  • DECRYPT - Decrypt result column values before returning to client

SQL File Annotations

  • DEFINE_PARAM - Define virtual HTTP parameters not bound to SQL
  • RESULT_NAME - Rename result keys in multi-command SQL file endpoints
  • SKIP - Exclude commands from multi-command results
  • RETURNS - Skip Describe step and resolve return columns from a composite type (for runtime-created temp tables)

Custom

Comments