Npgsql 7.0.7
Npgsql is the open source .NET data provider for PostgreSQL. It allows you to connect and interact with PostgreSQL server using .NET.
Quickstart
Here's a basic code snippet to get you started:
var connString = "Host=myserver;Username=mylogin;Password=mypass;Database=mydatabase";
await using var conn = new NpgsqlConnection(connString);
await conn.OpenAsync();
// Insert some data
await using (var cmd = new NpgsqlCommand("INSERT INTO data (some_field) VALUES (@p)", conn))
{
cmd.Parameters.AddWithValue("p", "Hello world");
await cmd.ExecuteNonQueryAsync();
}
// Retrieve all rows
await using (var cmd = new NpgsqlCommand("SELECT some_field FROM data", conn))
await using (var reader = await cmd.ExecuteReaderAsync())
{
while (await reader.ReadAsync())
Console.WriteLine(reader.GetString(0));
}
Key features
- High-performance PostgreSQL driver. Regularly figures in the top contenders on the TechEmpower Web Framework Benchmarks.
- Full support of most PostgreSQL types, including advanced ones such as arrays, enums, ranges, multiranges, composites, JSON, PostGIS and others.
- Highly-efficient bulk import/export API.
- Failover, load balancing and general multi-host support.
- Great integration with Entity Framework Core via Npgsql.EntityFrameworkCore.PostgreSQL.
For the full documentation, please visit the Npgsql website.
Related packages
- The Entity Framework Core provider that works with this provider is Npgsql.EntityFrameworkCore.PostgreSQL.
- Spatial plugin to work with PostgreSQL PostGIS: Npgsql.NetTopologySuite
- NodaTime plugin to use better date/time types with PostgreSQL: Npgsql.NodaTime
- OpenTelemetry support can be set up with Npgsql.OpenTelemetry
Showing the top 20 packages that depend on Npgsql.
| Packages | Downloads |
|---|---|
|
AgileLabs
Package Description
|
38 |
|
DBGang.AspNetCore.DataProtection.PostgreSQL
This package stores data protection keys in PostgreSQL database.
|
49 |
|
Hangfire.PostgreSql
PostgreSql storage implementation for Hangfire (background job system for ASP.NET and aspnet core applications).
|
33 |
|
Hangfire.PostgreSql
PostgreSql storage implementation for Hangfire (background job system for ASP.NET and aspnet core applications).
|
34 |
|
Hangfire.PostgreSql
PostgreSql storage implementation for Hangfire (background job system for ASP.NET applications).
|
34 |
|
Hangfire.PostgreSql
PostgreSql storage implementation for Hangfire (background job system for ASP.NET applications).
|
39 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
33 |
|
Npgsql.LegacyPostgis
PostGIS plugin for Npgsql, allowing mapping of PostGIS types to the legacy types (e.g. PostgisPoint).
|
34 |
|
Npgsql.LegacyPostgis
PostGIS plugin for Npgsql, allowing mapping of PostGIS types to the legacy types (e.g. PostgisPoint).
|
35 |
|
Npgsql.LegacyPostgis
PostGIS plugin for Npgsql, allowing mapping of PostGIS types to the legacy types (e.g. PostgisPoint).
|
36 |
|
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
|
32 |
|
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
|
33 |
|
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
|
34 |
|
Quantum.FrameworkNetCore
Used for set up Micro-Service.
|
33 |
.NET Core 3.1
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.0)
- System.Diagnostics.DiagnosticSource (>= 6.0.0)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
.NET Standard 2.1
- System.Threading.Channels (>= 7.0.0)
- System.Text.Json (>= 7.0.0)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- System.Diagnostics.DiagnosticSource (>= 6.0.0)
- System.Collections.Immutable (>= 7.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.0)
.NET Standard 2.0
- System.Threading.Channels (>= 7.0.0)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- System.Diagnostics.DiagnosticSource (>= 6.0.0)
- System.Text.Json (>= 7.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.0)
- System.Collections.Immutable (>= 7.0.0)
- Microsoft.Bcl.HashCode (>= 1.1.1)
.NET 5.0
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.0)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
.NET 6.0
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.0)
.NET 7.0
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.0)
| Version | Downloads | Last updated |
|---|---|---|
| 10.0.0-rc.1 | 7 | 10/06/2025 |
| 9.0.4 | 6 | 10/06/2025 |
| 9.0.3 | 33 | 03/26/2025 |
| 9.0.2 | 23 | 01/07/2025 |
| 9.0.1 | 25 | 12/04/2024 |
| 8.0.8 | 8 | 10/06/2025 |
| 8.0.7 | 20 | 03/13/2025 |
| 8.0.6 | 26 | 12/04/2024 |
| 8.0.5 | 25 | 11/02/2024 |
| 8.0.4 | 23 | 12/16/2024 |
| 8.0.3 | 48 | 05/12/2024 |
| 8.0.2 | 78 | 04/20/2024 |
| 8.0.1 | 29 | 05/02/2024 |
| 8.0.0 | 29 | 05/22/2024 |
| 8.0.0-rc.2 | 22 | 05/14/2024 |
| 8.0.0-preview.4 | 19 | 05/06/2024 |
| 8.0.0-preview.3 | 24 | 05/02/2024 |
| 8.0.0-preview.2 | 29 | 05/10/2024 |
| 8.0.0-preview.1 | 21 | 05/02/2024 |
| 7.0.10 | 22 | 03/17/2025 |
| 7.0.9 | 24 | 01/07/2025 |
| 7.0.8 | 19 | 12/15/2024 |
| 7.0.7 | 27 | 05/21/2024 |
| 7.0.6 | 27 | 05/05/2024 |
| 7.0.4 | 28 | 05/14/2024 |
| 7.0.2 | 24 | 05/26/2024 |
| 7.0.1 | 25 | 06/01/2024 |
| 7.0.0 | 24 | 05/09/2024 |
| 7.0.0-rc.2 | 23 | 05/27/2024 |
| 7.0.0-rc.1 | 25 | 05/23/2024 |
| 7.0.0-preview.7 | 21 | 01/01/2025 |
| 7.0.0-preview.6 | 20 | 01/07/2025 |
| 7.0.0-preview.5 | 22 | 05/15/2024 |
| 7.0.0-preview.4 | 22 | 05/18/2024 |
| 7.0.0-preview.3 | 25 | 05/09/2024 |
| 7.0.0-preview.1 | 15 | 01/07/2025 |
| 6.0.13 | 26 | 12/04/2024 |
| 6.0.12 | 22 | 01/07/2025 |
| 6.0.11 | 20 | 01/02/2025 |
| 6.0.10 | 26 | 05/01/2024 |
| 6.0.9 | 22 | 05/21/2024 |
| 6.0.8 | 27 | 05/30/2024 |
| 6.0.7 | 46 | 12/05/2022 |
| 6.0.6 | 19 | 01/07/2025 |
| 6.0.5 | 24 | 05/28/2024 |
| 6.0.4 | 34 | 05/13/2022 |
| 6.0.3 | 23 | 06/13/2022 |
| 6.0.2 | 23 | 05/23/2024 |
| 6.0.1 | 26 | 05/20/2024 |
| 6.0.0-rc.2 | 18 | 01/07/2025 |
| 6.0.0-rc.1 | 25 | 11/14/2024 |
| 6.0.0-preview6 | 21 | 01/07/2025 |
| 5.0.18 | 21 | 01/07/2025 |
| 5.0.17 | 25 | 05/09/2024 |
| 5.0.16 | 20 | 06/01/2024 |
| 5.0.15 | 27 | 05/03/2024 |
| 5.0.14 | 26 | 05/11/2024 |
| 5.0.13 | 21 | 05/21/2024 |
| 5.0.11 | 20 | 05/09/2022 |
| 5.0.3 | 25 | 05/10/2022 |
| 5.0.1.1 | 19 | 01/07/2025 |
| 4.1.14 | 25 | 05/21/2024 |
| 4.1.13 | 23 | 01/07/2025 |
| 4.1.12 | 21 | 06/01/2024 |
| 4.1.11 | 23 | 01/07/2025 |
| 4.1.9 | 23 | 05/26/2024 |
| 4.1.7 | 22 | 05/17/2024 |
| 4.1.4 | 32 | 05/16/2023 |
| 4.1.3.1 | 26 | 05/05/2024 |
| 4.1.1 | 27 | 05/11/2024 |
| 4.1.0 | 18 | 11/14/2024 |
| 4.0.17 | 15 | 01/07/2025 |
| 4.0.16 | 21 | 01/07/2025 |
| 4.0.14 | 23 | 05/30/2024 |
| 4.0.13 | 18 | 12/13/2024 |
| 4.0.12 | 22 | 05/10/2024 |
| 4.0.11 | 26 | 05/09/2022 |
| 4.0.6 | 25 | 05/20/2024 |
| 4.0.0-rc1 | 22 | 05/05/2024 |
| 3.2.6 | 21 | 05/20/2024 |
| 3.2.4.1 | 17 | 05/24/2024 |
| 3.2.4 | 25 | 05/02/2024 |
| 3.2.2 | 18 | 05/24/2024 |
| 3.2.1 | 20 | 05/07/2024 |
| 3.2.0 | 19 | 01/07/2025 |
| 3.1.9 | 25 | 05/06/2024 |
| 3.1.8 | 22 | 05/14/2024 |
| 3.1.7 | 21 | 05/26/2024 |
| 3.1.6 | 30 | 05/15/2024 |
| 3.1.4 | 29 | 05/17/2024 |
| 3.1.3 | 20 | 05/18/2024 |
| 3.1.2 | 20 | 05/04/2024 |
| 3.1.1 | 24 | 05/26/2024 |
| 3.1.0 | 24 | 05/27/2024 |
| 3.0.8 | 21 | 05/09/2022 |
| 3.0.5 | 28 | 01/07/2025 |
| 3.0.4 | 20 | 05/28/2024 |
| 3.0.2 | 24 | 05/01/2024 |
| 3.0.1 | 20 | 05/02/2024 |
| 2.2.5 | 23 | 05/07/2024 |
| 2.2.1 | 21 | 01/07/2025 |
| 2.2.0 | 28 | 05/06/2022 |
| 2.1.2 | 24 | 05/22/2024 |
| 2.1.0 | 21 | 05/07/2024 |