โก
NpgsqlRestAutomatic PostgreSQL Web Server
SQL is declarative โ your API should be too. Write SQL, annotate it with comments to declare caching, auth, retries, rate limiting, and everything in between. PostgreSQL is the architecture.
SQL is declarative โ your API should be too. Write SQL, annotate it with comments to declare caching, auth, retries, rate limiting, and everything in between. PostgreSQL is the architecture.
_ __ __ ____ __
/ | / /___ ____ ________/ / / __ \___ _____/ /_
/ |/ / __ \/ __ `/ ___/ __ \/ /_/ / _ \/ ___/ __/
/ /| / /_/ / /_/ (__ ) /_/ / _, _/ __(__ ) /_
/_/ |_/ .___/\__, /____/\__, /_/ |_|\___/____/\__/
/_/ /____/ /_/

PostgreSQL is the architecture โ not a detail to abstract away
Declare what you want from your endpoint โ caching, authorization, timeouts, retries, rate limiting โ right where the SQL lives.
/*
HTTP GET /users/
@authorize admin, user
@cached
@cache_expires_in 30sec
@timeout 5min
@table_format = excel
@excel_file_name = users.xlsx
*/
select id, name, email, role
from users
where $1 is null or department_id = $1;create or replace function api.get_users(
_department_id int
)
returns table (id int, name text, email text, role text)
language sql
begin atomic;
select id, name, email, role
from users
where
_department_id is null
or department_id = _department_id;
end;
comment on function api.get_users(int) is '
HTTP GET /users/
@authorize admin, user
@cached
@cache_expires_in 30sec
@timeout 10sec
@retry_strategy aggressive
@rate_limiter_policy authenticated_limit
@tsclient_module = users
';