DataAccessProvider.PostgreSql
1.3.2
dotnet add package DataAccessProvider.PostgreSql --version 1.3.2
NuGet\Install-Package DataAccessProvider.PostgreSql -Version 1.3.2
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="DataAccessProvider.PostgreSql" Version="1.3.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DataAccessProvider.PostgreSql" Version="1.3.2" />
<PackageReference Include="DataAccessProvider.PostgreSql" />
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 DataAccessProvider.PostgreSql --version 1.3.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DataAccessProvider.PostgreSql, 1.3.2"
#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 DataAccessProvider.PostgreSql@1.3.2
#: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=DataAccessProvider.PostgreSql&version=1.3.2
#tool nuget:?package=DataAccessProvider.PostgreSql&version=1.3.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
DataAccessProvider.Postgres
A PostgreSQL provider for the DataAccessProvider framework, built on top of the Npgsql driver. It offers async operations, parameterized queries, resilience support, and easy DI registration.
Installation
dotnet add package DataAccessProvider.Postgres
Configuration
Add a connection string named PostgresSource to your appsettings.json:
{
"ConnectionStrings": {
"PostgresSource": "Host=localhost;Port=5432;Database=mydb;Username=myuser;Password=mypassword"
}
}
Dependency Injection
// In Startup.cs or Program.cs
services.AddDataAccessProviderCore(configuration);
services.AddDataAccessProviderPostgres(configuration);
// After building the provider
serviceProvider.UseDataAccessProviderPostgres();
You can also register the provider with a raw connection string:
services.AddDataAccessProviderPostgres("Host=localhost;Port=5432;Database=mydb;Username=myuser;Password=mypassword");
Usage
var dataSourceProvider = serviceProvider.GetRequiredService<IDataSourceProvider>();
var queryParams = new PostgresSourceParams
{
Query = "SELECT id, name FROM users WHERE id = @id",
Parameters = new List<NpgsqlParameter>
{
new("@id", 1)
}
};
var result = await dataSourceProvider.ExecuteReaderAsync(queryParams);
Typed Results
public record User(int Id, string Name);
var typedParams = new PostgresSourceParams<User>
{
Query = "SELECT id, name FROM users"
};
var users = await dataSourceProvider.ExecuteReaderAsync(typedParams);
Resilience
If you register an IResiliencePolicy (e.g., via AddDataAccessProviderCore), the provider will automatically apply retries/timeouts around database calls.
| 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- DataAccessProvider.Core (>= 1.3.2)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.1)
- Npgsql (>= 10.0.0)
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.3.2 | 104 | 12/27/2025 |