Skip to content

NpgsqlRestYour SQL is the API

Annotate PostgreSQL functions and SQL files with comments to declare HTTP routes, auth, caching, retries, and rate limits. Get a fast, typed REST API โ€” no controllers, no models, no boilerplate.

~ npgsqlrest
$โ–Œ
4,500+
req/s on a single hostยน
74
production endpoints,
zero C# or Pythonยฒ
5ร—
faster iteration on
signature changesยณ
MIT
licensed,
open source
  • Declare, don't code โ€” caching, auth, retries, rate limiting โ€” all declared as SQL annotations.
  • PostgreSQL at the center โ€” the opposite of Clean Architecture: the database drives everything.
  • Types flow outward โ€” PostgreSQL types generate TypeScript clients automatically.
  • No middle tier โ€” no controllers, no models, no mapping layers, no boilerplate.
  • Iterate 5ร— faster โ€” schema is the single source of truth; signature changes propagate to typed clients automatically, and an entire class of type-drift bugs simply cannot happen.
  • Production-grade by default โ€” response caching, rate limiting, retries, PostgreSQL multi-host failover, load balancing, and Excel/HTML response rendering โ€” configured in JSON, not custom middleware.

Declarative Annotations โ€‹

Declare what you want from your endpoint โ€” caching, authorization, timeouts, retries, rate limiting โ€” right where the SQL lives.

SQL File

~ sql/users.sql
$โ–Œ

PostgreSQL Function

~ sql/get_users.sql
$โ–Œ

From the Blog โ€‹


Build, Test, Publish and ReleaseLicenseGitHub StarsGitHub ForksCrafted with Claude
โค๏ธ Support this project: Patreon ยท Buy Me a Coffee
Released under the MIT License.
Copyright ยฉ 2024-2026 VB Consulting