NpgsqlRest.DartClient 1.0.0

dotnet add package NpgsqlRest.DartClient --version 1.0.0
                    
NuGet\Install-Package NpgsqlRest.DartClient -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NpgsqlRest.DartClient" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NpgsqlRest.DartClient" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="NpgsqlRest.DartClient" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NpgsqlRest.DartClient --version 1.0.0
                    
#r "nuget: NpgsqlRest.DartClient, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NpgsqlRest.DartClient@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NpgsqlRest.DartClient&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=NpgsqlRest.DartClient&version=1.0.0
                    
Install as a Cake Tool

NpgsqlRest.DartClient

Automatic Dart client code generation for NpgsqlRest, targeting Flutter projects.

Generates plain Dart modules that call NpgsqlRest endpoints using package:http — no other dependencies, works on all Flutter targets (mobile, desktop, web).

Generated code

For every endpoint the generator emits:

  • A request class with a toJson() method (one field per routine parameter, optional-named constructor parameters).
  • A response class with a fromJson() factory (one field per column), or a plain Dart type for scalar responses.
  • An async function wrapping the HTTP call: query-string, path and JSON-body parameters handled automatically.
  • Optional ApiResult<T>/ApiError wrappers carrying the HTTP status code and problem-details errors (IncludeStatusCode).
  • Multipart upload functions for upload endpoints (http.MultipartRequest, files sent as form field file, optional progress callback reporting uploaded bytes, optional XSRF token header).
  • Server-sent events support for SSE endpoints: a create{Name}EventSource factory returning an SseSubscription (built on streamed package:http responses — no extra dependency), and SSE-aware functions accepting onMessage, id, closeAfterMs and awaitConnectionMs, attaching the execution-id header to the triggering request.
  • Raw responses for proxies: proxy_out and void proxy pass-through endpoints return Future<http.Response> directly.
  • Optional per-call parseUrl / parseRequest hooks (IncludeParseUrlParam / IncludeParseRequestParam) to rewrite the URI or request before sending.

Testing: generated modules expose a top-level http.Client? httpClient variable — assign a MockClient from package:http/testing.dart to intercept requests in tests.

Type mapping

PostgreSQL Dart
smallint, integer, bigint int
real, double precision, numeric, money double
boolean bool
json, jsonb dynamic (configurable via DefaultJsonType)
date, timestamp, timestamptz DateTime (configurable via UseDateTimeType)
everything else (text, uuid, time, interval, ranges, ...) String
arrays List<T>

All model fields are nullable (T?).

Known limits

  • numeric/money map to double — arbitrary precision beyond IEEE 754 is lost (the JSON wire format already carries a JSON number).
  • Dart int on the web (dart2js) is limited to 2^53; bigint values beyond that lose precision on Flutter Web.
  • Multi-dimensional PostgreSQL arrays are typed as one-dimensional List<T> (PostgreSQL's type system does not expose array dimensionality).

Comment annotations

Per-endpoint overrides in routine comments:

  • dartclient = off — exclude the endpoint from generation.
  • dartclient_module=name — group the endpoint into module file name (falls back to tsclient_module, so SQL-file directory grouping applies to both generators).
  • dartclient_status_code=true — wrap this endpoint's response in ApiResult<T>.
  • dartclient_events=false — generate a plain function for an SSE endpoint (no event-source parameters).
  • dartclient_parse_url=true / dartclient_parse_request=true — add the per-call rewrite hooks to this endpoint.
  • dartclient_export_url=true — emit a {name}Url() URL-builder function.
  • dartclient_url_only=true — emit only the URL-builder function.
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 44 7/9/2026