RPC 调用
POST/v1/rdb/rest/rpc/:function_name
调用 PostgreSQL 中的存储过程或自定义函数(基于 PostgREST RPC 实现)。支持传递参数,返回函数执行结果。
Request
Path Parameters
function_name stringrequired
存储过程或函数名称
Query Parameters
select string
返回字段,支持 * 或指定字段列表,用于过滤函数返回的列
limit integer
限制返回数量(当函数返回集合时有效)
offset integer
偏移量,用于分页(当函数返回集合时有效)
order string
排序字段,格式为 field.asc 或 field.desc(当函数返回集合时有效)
Header Parameters
params=single-object将请求体作为单个 JSON 参数传递给函数count=exact返回精确计数
Prefer string
偏好设置:
- application/json
Body
object
Responses
- 200
- 400
- 401
- 404
调用成功
- application/json
- Schema
- Example (from schema)
Schema
- MOD1
- MOD2
- MOD3
- Array [
- ]
oneOf
object
object
string
[
null
]
请求错误,如函数不存在或参数错误
- application/json
- Schema
- Example (from schema)
Schema
code string
错误码
details stringnullable
错误详情
hint stringnullable
错误提示
message string
错误信息
{
"code": "PGRST106",
"details": null,
"hint": "Only the following schemas are exposed: public",
"message": "Invalid schema: undefined"
}
鉴权失败
- application/json
- Schema
- Example (from schema)
Schema
code string
错误码
details stringnullable
错误详情
hint stringnullable
错误提示
message string
错误信息
{
"code": "PGRST106",
"details": null,
"hint": "Only the following schemas are exposed: public",
"message": "Invalid schema: undefined"
}
函数不存在
- application/json
- Schema
- Example (from schema)
Schema
code string
错误码
details stringnullable
错误详情
hint stringnullable
错误提示
message string
错误信息
{
"code": "PGRST106",
"details": null,
"hint": "Only the following schemas are exposed: public",
"message": "Invalid schema: undefined"
}
Loading...