Skip to content
Written with Claude

Custom Parameters

Set custom key-value configuration for the endpoint.

Syntax

code
@<key> = <value>

The @ prefix is optional - both @key = value and key = value work identically. Custom parameters with @ prefix are stored without the prefix (e.g., @my_param = value is stored as my_param).

Dynamic Parameter Values

Some parameters support dynamic values using the {param_name} format, where param_name references a function parameter. The value is resolved at runtime from the actual parameter value passed to the endpoint.

Example

sql
sql
create function upload_file(_path text, _file text)
returns void
language sql
begin atomic;
  -- function body
end;

comment on function upload_file(text, text) is '
@upload for file_system
@file_system_path = {_path}
@file_system_file = {_file}
';

Equivalent as a SQL file endpoint (sql/upload-file.sql):

sql
sql
/*
HTTP POST
@upload for file_system
@file_system_path = {path}
@file_system_file = {file}
@param $1 path
@param $2 file
*/
select;

When called with {"_path": "/uploads/images", "_file": "photo.jpg"}, the file will be saved to /uploads/images/photo.jpg.

Built-in Parameters

Many annotations support the @key = value syntax. The following sections link to where each parameter group is documented.

General

These parameters are predefined annotations that also support the key = value syntax:

Upload

Upload handlers accept custom parameters to control file processing behavior per-endpoint:

Table Format

Per-endpoint control of HTML table and Excel spreadsheet rendering:

Server-Sent Events

SSE annotations that also support the key = value syntax:

TypeScript Client

Per-endpoint control of generated TypeScript client code:

Comments