โก
NpgsqlRestAutomatic PostgreSQL Web Server
Create professional, high-performance HTTP REST APIs for PostgreSQL databases in minutes and generate type-safe client code automatically.
Create professional, high-performance HTTP REST APIs for PostgreSQL databases in minutes and generate type-safe client code automatically.
_ __ __ ____ __
/ | / /___ ____ ________/ / / __ \___ _____/ /_
/ |/ / __ \/ __ `/ ___/ __ \/ /_/ / _ \/ ___/ __/
/ /| / /_/ / /_/ (__ ) /_/ / _, _/ __(__ ) /_
/_/ |_/ .___/\__, /____/\__, /_/ |_|\___/____/\__/
/_/ /____/ /_/

Clean PostgreSQL Architecture - PostgreSQL First Architecture - PostgreSQL Driven Architecture
Simple comment annotations turn PostgreSQL functions into fully-featured REST endpoints.
create function api.get_users(
_department_id int
_format text
)
returns setof user_info
language sql
as $$
select id, name, email, role
from users
where _department_id is null or department_id = _department_id;
$$;
comment on function api.get_users(int, text) is '
HTTP GET /users/
@authorize admin, user
@cached
@cache_expires_in 30sec
@timeout 10sec
@retry_strategy aggressive
@rate_limiter_policy authenticated_limit
@validate _format using json_or_excel
@table_format = {_format}
@tsclient_module = users
';