NpgsqlRest 3.2.0
dotnet add package NpgsqlRest --version 3.2.0
NuGet\Install-Package NpgsqlRest -Version 3.2.0
<PackageReference Include="NpgsqlRest" Version="3.2.0" />
<PackageVersion Include="NpgsqlRest" Version="3.2.0" />
<PackageReference Include="NpgsqlRest" />
paket add NpgsqlRest --version 3.2.0
#r "nuget: NpgsqlRest, 3.2.0"
#:package NpgsqlRest@3.2.0
#addin nuget:?package=NpgsqlRest&version=3.2.0
#tool nuget:?package=NpgsqlRest&version=3.2.0
NpgsqlRest
Automatic REST API Server for PostgreSQL
Transform your PostgreSQL database into a production-ready REST API server with automatic TypeScript code generation and end-to-end type safety.
Documentation | Getting Started | Configuration Reference | Annotation Guide
Key Features
- Instant API Generation - Automatically creates REST endpoints from PostgreSQL functions, procedures, tables, and views
- Declarative Configuration - Configure endpoints directly in your database using comment annotations
- TypeScript Code Generation - Auto-generate type-safe frontend code with full static type checking
- Native Executables - AOT-compiled binaries with zero dependencies and instant startup
- RESTful Path Parameters - Define routes like
/products/{id}with parameters extracted from URL paths - Reverse Proxy Endpoints - Forward requests to upstream services with passthrough or transform modes
- HTTP Custom Types - Enable PostgreSQL functions to call external APIs via annotated composite types
- Enterprise Ready - Authentication, authorization, rate limiting, caching, SSE streaming, OpenAPI 3.0, and more
Quick Start
1. Annotate a PostgreSQL Function
create function hello(_name text)
returns text
language sql as $$
select 'Hello, ' || _name
$$;
comment on function hello(text) is 'HTTP GET /hello';
2. Configure Connection
Create appsettings.json:
{
"ConnectionStrings": {
"Default": "Host=localhost;Port=5432;Database=my_db;Username=postgres;Password=postgres"
}
}
3. Run
# Download from releases, or:
npm i npgsqlrest && npx npgsqlrest
# Or with Docker:
docker run -p 8080:8080 -v ./appsettings.json:/app/appsettings.json vbilopav/npgsqlrest:latest
Your API is now live at http://localhost:8080/hello?name=World
Installation Options
| Method | Command |
|---|---|
| NPM | npm i npgsqlrest |
| Docker | docker pull vbilopav/npgsqlrest:latest |
| Direct Download | Releases |
| .NET Library | dotnet add package NpgsqlRest |
Requirements
- PostgreSQL >= 13
- No runtime dependencies for native executables
Documentation
For complete documentation including configuration options, authentication setup, TypeScript generation, and more, visit npgsqlrest.github.io
Contributing
Contributions are welcome. Please open a pull request with a description of your changes.
License
MIT License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Npgsql (>= 10.0.1)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on NpgsqlRest:
| Package | Downloads |
|---|---|
|
NpgsqlRest.TsClient
Automatic Typescript Client Code Generation for NpgsqlRest |
|
|
NpgsqlRest.CrudSource
CRUD Source for NpgsqlRest |
|
|
NpgsqlRest.HttpFiles
Automatic HTTP Files Generation for NpgsqlRest |
|
|
NpgsqlRest.OpenAPI
Automatic HTTP Files Generation for NpgsqlRest |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.2.0 | 0 | 12/22/2025 |
| 3.1.3 | 34 | 12/21/2025 |
| 3.1.2 | 71 | 12/20/2025 |
| 3.1.1 | 214 | 12/15/2025 |
| 3.1.0 | 107 | 12/13/2025 |
| 3.0.0 | 191 | 11/27/2025 |
| 2.36.2 | 172 | 10/6/2025 |
| 2.36.0 | 177 | 9/29/2025 |
| 2.35.0 | 317 | 9/18/2025 |
| 2.34.0 | 189 | 9/11/2025 |
| 2.33.0 | 224 | 8/29/2025 |
| 2.32.0 | 128 | 8/23/2025 |
| 2.31.0 | 209 | 8/18/2025 |
| 2.30.0 | 173 | 8/9/2025 |
| 2.29.0 | 190 | 7/9/2025 |
| 2.28.0 | 308 | 6/13/2025 |
| 2.27.0 | 204 | 5/19/2025 |
| 2.26.0 | 170 | 5/11/2025 |
| 2.25.0 | 175 | 5/6/2025 |
| 2.24.0 | 201 | 4/28/2025 |
| 2.23.0 | 186 | 4/27/2025 |
| 2.22.0 | 622 | 4/7/2025 |
| 2.21.0 | 506 | 3/24/2025 |
| 2.20.0 | 302 | 3/5/2025 |
| 2.19.0 | 156 | 2/24/2025 |
| 2.18.0 | 151 | 2/23/2025 |
| 2.17.0 | 167 | 1/9/2025 |
| 2.16.1 | 142 | 1/6/2025 |
| 2.16.0 | 137 | 12/30/2024 |
| 2.15.0 | 175 | 12/21/2024 |
| 2.14.0 | 190 | 11/25/2024 |
| 2.13.1 | 168 | 11/23/2024 |
| 2.13.0 | 198 | 11/17/2024 |
| 2.12.1 | 177 | 11/6/2024 |
| 2.12.0 | 159 | 10/30/2024 |
| 2.11.0 | 186 | 9/3/2024 |
| 2.10.0 | 191 | 8/23/2024 |
| 2.9.0 | 133 | 8/2/2024 |
| 2.8.5 | 186 | 6/25/2024 |
| 2.8.4 | 172 | 6/22/2024 |
| 2.8.3 | 176 | 6/11/2024 |
| 2.8.2 | 183 | 6/9/2024 |
| 2.8.1 | 152 | 5/10/2024 |
| 2.8.0 | 169 | 5/2/2024 |
| 2.7.1 | 181 | 4/30/2024 |
| 2.7.0 | 193 | 4/17/2024 |
| 2.6.1 | 184 | 4/16/2024 |
| 2.6.0 | 175 | 4/16/2024 |
| 2.5.0 | 182 | 4/15/2024 |
| 2.4.2 | 200 | 4/14/2024 |
| 2.4.1 | 171 | 4/12/2024 |
| 2.4.0 | 295 | 4/8/2024 |
| 2.3.1 | 167 | 4/5/2024 |
| 2.3.0 | 238 | 4/4/2024 |
| 2.2.0 | 169 | 4/2/2024 |
| 2.1.0 | 191 | 3/29/2024 |
| 2.0.0 | 220 | 3/26/2024 |
| 1.6.3 | 181 | 2/19/2024 |
| 1.6.2 | 180 | 2/3/2024 |
| 1.6.1 | 175 | 2/2/2024 |
| 1.6.0 | 172 | 1/28/2024 |
| 1.5.1 | 162 | 1/27/2024 |
| 1.5.0 | 168 | 1/27/2024 |
| 1.4.0 | 168 | 1/26/2024 |
| 1.3.0 | 170 | 1/23/2024 |
| 1.2.0 | 174 | 1/22/2024 |
| 1.1.0 | 177 | 1/19/2024 |
| 1.0.0 | 181 | 1/18/2024 |
| 0.0.9 | 142 | 1/18/2024 |