BlogDoFT.Libs.DapperUtils.Postgres
10.1.1
dotnet add package BlogDoFT.Libs.DapperUtils.Postgres --version 10.1.1
NuGet\Install-Package BlogDoFT.Libs.DapperUtils.Postgres -Version 10.1.1
<PackageReference Include="BlogDoFT.Libs.DapperUtils.Postgres" Version="10.1.1" />
<PackageVersion Include="BlogDoFT.Libs.DapperUtils.Postgres" Version="10.1.1" />
<PackageReference Include="BlogDoFT.Libs.DapperUtils.Postgres" />
paket add BlogDoFT.Libs.DapperUtils.Postgres --version 10.1.1
#r "nuget: BlogDoFT.Libs.DapperUtils.Postgres, 10.1.1"
#:package BlogDoFT.Libs.DapperUtils.Postgres@10.1.1
#addin nuget:?package=BlogDoFT.Libs.DapperUtils.Postgres&version=10.1.1
#tool nuget:?package=BlogDoFT.Libs.DapperUtils.Postgres&version=10.1.1
BlogDoFT.Libs.DapperUtils.Postgres
Dapper utilities and helpers for Postgres. Implements abstractions for pagination, SQL builders and a connection factory tailored to Npgsql.
This package provides concrete implementations for the abstractions defined in BlogDoFT.Libs.DapperUtils.Abstractions, and includes:
- Paginated SQL builders and pagination helpers
- OrderBy and Where clause helpers
IConnectionFactoryimplementation that reads connection string fromIConfiguration
Quick start
- Reference both
BlogDoFT.Libs.DapperUtils.AbstractionsandBlogDoFT.Libs.DapperUtils.Postgresfrom your data project. - Register the connection factory in DI and use the
IConnectionFactoryto getIDbConnectioninstances:
// Program.cs
builder.Services.AddSingleton<IConnectionFactory>(sp =>
new NpgConnectionFactory(sp.GetRequiredService<IConfiguration>()));
// Usage
using var conn = serviceProvider.GetRequiredService<IConnectionFactory>().GetNewConnection();
var rows = await conn.QueryAsync<MyDto>("SELECT * FROM my_table LIMIT 10");
Configuration (appsettings.json)
This library expects a connection string named Default in the ConnectionStrings section. Example:
{
"ConnectionStrings": {
"Default": "Host=localhost;Port=5432;Database=mydb;Username=myuser;Password=secret"
}
}
Notes and tips
- The Npgsql connection factory sets the
SearchPathtopublicby default. If your schema differs, update the connection builder in a custom factory or pass schema via configuration. - The project registers Dapper type handlers for
DateOnlyandTimeOnlyto map to Postgres types. Ensure your database uses compatible column types.
Versioning
Starting with v10.0.0, this library's version numbering follows the major version of the .NET runtime it targets. For example, this version is compatible with .NET 10, so the major version is 10 — this explains the jump from the previous 1.x version series.
| 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
- BlogDoFT.Libs.DapperUtils.Abstractions (>= 10.1.1)
- BlogDoFT.Libs.Extensions (>= 10.1.1)
- Dapper (>= 2.1.86)
- Microsoft.Extensions.Configuration (>= 10.0.12)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.12)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.12)
- Npgsql (>= 10.0.3)
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 |
|---|---|---|
| 10.1.1 | 91 | 9/24/2026 |
| 10.1.0 | 89 | 9/14/2026 |
| 10.0.1 | 98 | 9/14/2026 |
| 10.0.0 | 94 | 9/13/2026 |
| 1.14.0 | 140 | 9/13/2026 |
| 1.13.0 | 86 | 9/13/2026 |
| 1.12.0 | 382 | 8/27/2026 |
| 1.11.0 | 103 | 8/27/2026 |
| 1.10.0 | 349 | 11/16/2025 |
| 1.9.0 | 248 | 11/5/2025 |
| 1.8.0 | 246 | 11/3/2025 |
| 1.7.0 | 262 | 11/3/2025 |
| 1.6.3 | 226 | 10/21/2025 |
| 1.6.0 | 228 | 10/21/2025 |
| 1.5.0 | 226 | 10/8/2025 |
| 1.4.0 | 219 | 10/3/2025 |
| 1.3.0 | 204 | 8/22/2025 |
| 1.2.0 | 234 | 8/9/2025 |
| 1.1.1 | 155 | 8/2/2025 |
| 1.1.0 | 146 | 8/1/2025 |