CodeLogic.PostgreSQL
4.5.2
dotnet add package CodeLogic.PostgreSQL --version 4.5.2
NuGet\Install-Package CodeLogic.PostgreSQL -Version 4.5.2
<PackageReference Include="CodeLogic.PostgreSQL" Version="4.5.2" />
<PackageVersion Include="CodeLogic.PostgreSQL" Version="4.5.2" />
<PackageReference Include="CodeLogic.PostgreSQL" />
paket add CodeLogic.PostgreSQL --version 4.5.2
#r "nuget: CodeLogic.PostgreSQL, 4.5.2"
#:package CodeLogic.PostgreSQL@4.5.2
#addin nuget:?package=CodeLogic.PostgreSQL&version=4.5.2
#tool nuget:?package=CodeLogic.PostgreSQL&version=4.5.2
CodeLogic.PostgreSQL
PostgreSQL database access for CodeLogic applications with multi-database support, a LINQ query builder, table sync, and migrations.
Install
dotnet add package CodeLogic.PostgreSQL
Quick Start
var pgLib = new PostgreSQLLibrary();
// After library initialization via CodeLogic framework:
// Typed repository
var repo = pgLib.GetRepository<User>();
// Fluent query builder
var users = await pgLib.Query<User>()
.Where(u => u.IsActive)
.OrderBy(u => u.Name)
.ToListAsync();
// Transactions
await using var tx = await pgLib.BeginTransactionAsync();
// Table sync (schema migrations)
var result = await pgLib.SyncTableAsync<User>();
Features
- Multi-database support -- manage connections to multiple PostgreSQL instances from one config
- LINQ query builder -- fluent
Query<T>()API withWhere,OrderBy, and typed results - Repository pattern --
GetRepository<T>()for standard CRUD operations - Table sync and migrations -- automatic schema synchronization with backup support
- Connection pooling -- configurable pool sizes, idle timeouts, and slow-query thresholds
Configuration
Config file: config.postgresql.json
{
"Databases": {
"Default": {
"Enabled": true,
"Host": "localhost",
"Port": 5432,
"Database": "mydb",
"Username": "postgres",
"Password": "",
"ConnectionTimeout": 30,
"CommandTimeout": 30,
"MinPoolSize": 5,
"MaxPoolSize": 100,
"SslMode": "Prefer",
"SlowQueryThresholdMs": 1000
}
}
}
Documentation
Full API docs: https://github.com/Media2A/CodeLogic.Libs
Requirements
- .NET 10.0+
- CodeLogic 3.x or 4.x
- Npgsql 9.x
License
MIT — see 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. |
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 |
|---|---|---|
| 4.5.2 | 89 | 5/24/2026 |
| 4.5.1 | 91 | 5/24/2026 |
| 4.5.1-preview.56 | 45 | 5/24/2026 |
| 4.4.2-preview.53 | 51 | 5/24/2026 |
| 4.4.1 | 90 | 5/24/2026 |
| 4.0.5 | 91 | 5/15/2026 |
| 4.0.4 | 98 | 5/9/2026 |
| 4.0.3 | 97 | 5/9/2026 |
| 3.3.1 | 97 | 4/18/2026 |
| 3.3.0 | 103 | 4/18/2026 |
| 3.2.11 | 93 | 4/18/2026 |
| 3.2.10 | 93 | 4/18/2026 |
| 3.2.9 | 93 | 4/18/2026 |
| 3.2.8 | 95 | 4/18/2026 |
| 3.2.7 | 90 | 4/18/2026 |
| 3.2.6 | 88 | 4/18/2026 |
| 3.2.5 | 97 | 4/18/2026 |
| 3.2.4 | 96 | 4/17/2026 |
| 3.2.3 | 100 | 4/17/2026 |
| 3.2.2 | 93 | 4/17/2026 |
# CL.PostgreSQL — Changelog
All notable changes to **CodeLogic.PostgreSQL** are documented here. Versions follow
[Semantic Versioning](https://semver.org/).
## [4.5.0] — 2026-05-24
### Changed
- **Unified versioning.** All CodeLogic.Libs now share a single version line
controlled by `version.txt` in the repo root. This is a version alignment
release — no functional changes to this library.
## [4.0.4] — 2026-04-16
### Changed
- README + manifest refresh for the v4 baseline. No functional changes vs 4.0.3.
- `LibraryManifest.Version` now reads from assembly metadata.
## [4.0.2] — 2026-04-09
### Changed
- Annotated PostgreSQL configuration with `[ConfigField]` for the admin UI surface.
- Aligned with the v4 baseline across all libraries.
## [4.0.0] — 2026-04-09
Major rewrite. Republished as v4.0.0 to reset the version line under the
unified v4 baseline. Repository pattern + attribute-driven schema sync,
mirroring the CL.MySQL2 surface.
### Notes
- The MySQL2 4.0 query-builder rewrite (projection pushdown, SQL aggregation,
smart-cache pools) has not been ported to CL.PostgreSQL yet — repository
CRUD only.
- Earlier history is retained in the
[git log](https://github.com/Media2A/CodeLogic.Libs/commits/main/CL.PostgreSQL).