Annotations Reference
Complete reference for all NpgsqlRest comment annotations. For an introduction to how annotations work, see the Comment Annotations Guide.
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
- ENABLED - Enable endpoint for specific tags
- DISABLED - Disable endpoint for specific tags
- TAGS - Filter annotations by tags
Authorization
- AUTHORIZE - Require authentication
- ALLOW_ANONYMOUS - Allow unauthenticated access
- LOGIN - Mark as sign-in endpoint
- LOGOUT - Mark as sign-out endpoint
Basic Authentication
- BASIC_AUTH - Enable HTTP Basic Authentication
- BASIC_AUTH_REALM - Set authentication realm
- BASIC_AUTH_COMMAND - Set validation function
Request Configuration
- REQUEST_PARAM_TYPE - Query string vs body parameters
- REQUEST_HEADERS_MODE - Control header passing
- REQUEST_HEADERS_PARAMETER_NAME - Header parameter name
- BODY_PARAMETER_NAME - Body parameter name
- QUERY_STRING_NULL_HANDLING - NULL handling in query strings
Response Configuration
- Response Headers - Set custom response headers
- RESPONSE_NULL_HANDLING - NULL handling in responses
Raw Output Mode
- RAW - Return raw text instead of JSON
- SEPARATOR - Column separator for raw output
- NEW_LINE - Row separator for raw output
- COLUMN_NAMES - Include column headers
Caching
- CACHED - Enable response caching
- CACHE_EXPIRES_IN - Set cache expiration
Performance
- BUFFER_ROWS - Row buffering count
- COMMAND_TIMEOUT - Query timeout
- RETRY_STRATEGY - Retry behavior
Server-Sent Events
- SSE - Enable Server-Sent Events
- SSE_EVENTS_LEVEL - Notice level for SSE
- SSE_EVENTS_SCOPE - SSE distribution scope
Upload
- UPLOAD - File upload handling
Policies
- ERROR_CODE_POLICY - Error handling policy
- RATE_LIMITER_POLICY - Rate limiting policy
Context & Security
- USER_CONTEXT - Enable user context
- USER_PARAMETERS - Add user parameters
- CONNECTION - Named database connection
- SECURITY_SENSITIVE - Obfuscate logs
Parameter Annotations
- PARAMETER_HASH - Hash one parameter using another
Custom
- Custom Parameters - Custom key-value settings