Npgsql 9.0.3
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 |
---|---|
TestContainers
Package Description
|
61 |
Marten
Postgresql as a Document Db and Event Store for .Net Development
|
48 |
Weasel.Postgresql
Npgsql Helpers and Postgresql Schema Migration Tool, spin off of Marten
|
46 |
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
45 |
TestContainers
Package Description
|
44 |
Marten
Postgresql as a Document Db and Event Store for .Net Development
|
43 |
Weasel.Postgresql
Npgsql Helpers and Postgresql Schema Migration Tool, spin off of Marten
|
42 |
Weasel.Postgresql
Npgsql Helpers and Postgresql Schema Migration Tool, spin off of Marten
|
41 |
Weasel.Postgresql
Npgsql Helpers and Postgresql Schema Migration Tool, spin off of Marten
|
40 |
Weasel.Postgresql
Npgsql Helpers and Postgresql Schema Migration Tool, spin off of Marten
|
38 |
Marten
Postgresql as a Document Db and Event Store for .Net Development
|
38 |
Weasel.Postgresql
Npgsql Helpers and Postgresql Schema Migration Tool, spin off of Marten
|
37 |
Weasel.Postgresql
Npgsql Helpers and Postgresql Schema Migration Tool, spin off of Marten
|
36 |
Weasel.Postgresql
Npgsql Helpers and Postgresql Schema Migration Tool, spin off of Marten
|
35 |
.NET 6.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.2)
- System.Diagnostics.DiagnosticSource (>= 8.0.1)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- System.Text.Json (>= 8.0.5)
.NET 8.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.2)
Version | Downloads | Last updated |
---|---|---|
9.0.3 | 4 | 02/26/2025 |
9.0.2 | 10 | 12/14/2024 |
9.0.1 | 11 | 11/19/2024 |
9.0.0 | 11 | 11/19/2024 |
8.0.7 | 5 | 02/26/2025 |
8.0.6 | 11 | 11/19/2024 |
8.0.5 | 10 | 10/25/2024 |
8.0.4 | 13 | 09/18/2024 |
8.0.3 | 28 | 05/22/2024 |
8.0.2 | 14 | 02/20/2024 |
8.0.1 | 12 | 12/15/2023 |
8.0.0 | 11 | 12/15/2023 |
8.0.0-rc.2 | 11 | 06/29/2024 |
8.0.0-preview.4 | 14 | 08/28/2024 |
8.0.0-preview.3 | 13 | 02/20/2024 |
8.0.0-preview.2 | 16 | 04/03/2023 |
8.0.0-preview.1 | 21 | 06/05/2023 |
7.0.10 | 5 | 03/19/2025 |
7.0.9 | 13 | 11/19/2024 |
7.0.8 | 9 | 10/25/2024 |
7.0.7 | 17 | 05/22/2024 |
7.0.6 | 13 | 07/05/2024 |
7.0.4 | 11 | 02/20/2024 |
7.0.2 | 27 | 06/11/2023 |
7.0.1 | 18 | 06/11/2023 |
7.0.0 | 28 | 04/04/2023 |
7.0.0-rc.2 | 9 | 08/26/2023 |
7.0.0-rc.1 | 12 | 08/23/2023 |
7.0.0-preview.7 | 15 | 12/02/2023 |
7.0.0-preview.6 | 9 | 11/04/2024 |
7.0.0-preview.5 | 29 | 04/02/2023 |
7.0.0-preview.4 | 41 | 04/05/2023 |
7.0.0-preview.3 | 11 | 08/07/2024 |
7.0.0-preview.2 | 13 | 02/20/2024 |
7.0.0-preview.1 | 30 | 03/31/2023 |
6.0.13 | 11 | 11/19/2024 |
6.0.12 | 10 | 09/20/2024 |
6.0.11 | 18 | 05/22/2024 |
6.0.10 | 13 | 01/07/2024 |
6.0.9 | 52 | 04/03/2023 |
6.0.8 | 39 | 03/30/2023 |
6.0.7 | 28 | 04/02/2023 |
6.0.6 | 36 | 04/22/2023 |
6.0.5 | 15 | 06/11/2023 |
6.0.4 | 33 | 04/08/2023 |
6.0.3 | 20 | 06/12/2023 |
6.0.2 | 17 | 06/12/2023 |
6.0.1 | 10 | 06/11/2023 |
6.0.0 | 13 | 06/11/2023 |
6.0.0-rc.2 | 11 | 08/22/2023 |
6.0.0-rc.1 | 18 | 08/22/2023 |
6.0.0-preview7 | 13 | 02/20/2024 |
6.0.0-preview6 | 55 | 04/03/2023 |
6.0.0-preview5 | 11 | 06/29/2024 |
6.0.0-preview4 | 12 | 02/20/2024 |
6.0.0-preview3 | 9 | 06/29/2024 |
6.0.0-preview2 | 33 | 04/21/2023 |
5.0.18 | 17 | 05/22/2024 |
5.0.17 | 12 | 12/15/2023 |
5.0.16 | 8 | 09/03/2024 |
5.0.15 | 13 | 06/13/2023 |
5.0.14 | 14 | 04/11/2023 |
5.0.13 | 48 | 03/30/2023 |
5.0.12 | 20 | 06/13/2023 |
5.0.11 | 18 | 03/30/2023 |
5.0.10 | 36 | 03/30/2023 |
5.0.7 | 16 | 03/20/2023 |
5.0.5 | 37 | 05/18/2021 |
5.0.4 | 16 | 06/12/2023 |
5.0.3 | 40 | 03/30/2023 |
5.0.2 | 22 | 06/12/2023 |
5.0.1.1 | 23 | 03/27/2023 |
5.0.0 | 16 | 04/03/2023 |
4.1.14 | 26 | 05/22/2024 |
4.1.13 | 17 | 05/22/2024 |
4.1.12 | 13 | 06/13/2023 |
4.1.11 | 34 | 05/06/2023 |
4.1.10 | 45 | 04/22/2023 |
4.1.9 | 31 | 04/06/2023 |
4.1.8 | 12 | 09/03/2022 |
4.1.7 | 14 | 06/11/2023 |
4.1.6 | 60 | 03/30/2023 |
4.1.5 | 16 | 06/11/2023 |
4.1.4 | 12 | 06/11/2023 |
4.1.3.1 | 12 | 08/21/2023 |
4.1.3 | 11 | 06/11/2023 |
4.1.2 | 12 | 06/11/2023 |
4.1.1 | 13 | 06/11/2023 |
4.1.0 | 13 | 06/11/2023 |
4.0.17 | 26 | 06/12/2024 |
4.0.16 | 20 | 05/22/2024 |
4.0.14 | 15 | 05/22/2024 |
4.0.13 | 11 | 06/14/2023 |
4.0.12 | 13 | 06/13/2023 |
4.0.11 | 15 | 06/12/2023 |
4.0.10 | 12 | 06/13/2023 |
4.0.9 | 10 | 06/10/2023 |
4.0.8 | 23 | 06/11/2023 |
4.0.7 | 25 | 03/28/2023 |
4.0.6 | 16 | 06/11/2023 |
4.0.5 | 12 | 06/11/2023 |
4.0.4 | 11 | 06/11/2023 |
4.0.3 | 14 | 06/11/2023 |
4.0.2 | 9 | 06/11/2023 |
4.0.1 | 12 | 06/11/2023 |
4.0.0 | 18 | 01/29/2020 |
4.0.0-rc1 | 8 | 08/22/2023 |
4.0.0-preview2 | 11 | 06/29/2024 |
4.0.0-preview1 | 15 | 02/15/2024 |
3.2.7 | 23 | 11/29/2019 |
3.2.6 | 42 | 06/12/2023 |
3.2.5 | 11 | 06/11/2023 |
3.2.4.1 | 19 | 08/21/2023 |
3.2.4 | 10 | 06/12/2023 |
3.2.3 | 13 | 06/12/2023 |
3.2.2 | 12 | 06/10/2023 |
3.2.1 | 35 | 06/01/2023 |
3.2.0 | 11 | 06/12/2023 |
3.1.10 | 10 | 06/12/2023 |
3.1.9 | 12 | 06/11/2023 |
3.1.8 | 14 | 06/11/2023 |
3.1.7 | 49 | 04/19/2023 |
3.1.6 | 15 | 06/11/2023 |
3.1.5 | 11 | 06/12/2023 |
3.1.4 | 16 | 06/12/2023 |
3.1.3 | 11 | 06/11/2023 |
3.1.2 | 11 | 06/12/2023 |
3.1.1 | 11 | 06/12/2023 |
3.1.0 | 14 | 06/11/2023 |
3.0.8 | 41 | 04/10/2023 |
3.0.7 | 12 | 06/12/2023 |
3.0.6 | 10 | 06/13/2023 |
3.0.5 | 12 | 06/11/2023 |
3.0.4 | 16 | 04/04/2023 |
3.0.3 | 56 | 03/26/2023 |
3.0.2 | 12 | 06/11/2023 |
3.0.1 | 10 | 06/12/2023 |
3.0.0 | 12 | 06/12/2023 |
2.2.7 | 11 | 06/11/2023 |
2.2.6 | 13 | 06/12/2023 |
2.2.5 | 12 | 06/12/2023 |
2.2.4.3 | 13 | 08/26/2023 |
2.2.4.1 | 10 | 08/22/2023 |
2.2.3 | 10 | 06/12/2023 |
2.2.2 | 12 | 06/11/2023 |
2.2.1 | 10 | 06/11/2023 |
2.2.0 | 13 | 06/11/2023 |
2.1.3 | 13 | 12/30/2023 |
2.1.2 | 40 | 05/03/2023 |
2.1.1 | 14 | 06/11/2023 |
2.1.0 | 11 | 06/11/2023 |
2.0.14.3 | 19 | 08/23/2023 |
2.0.12.1 | 43 | 03/30/2023 |
2.0.11 | 38 | 03/30/2023 |