Npgsql 8.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.

Showing the top 20 packages that depend on Npgsql.

Packages Downloads
Npgsql.EntityFrameworkCore.PostgreSQL
Npgsql.EntityFrameworkCore.PostgreSQL
3,625
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
53
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
68
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
874
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
1,610
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
5,292
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
10,064
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
14,299
Npgsql.EntityFrameworkCore.PostgreSQL.Design
Npgsql.EntityFrameworkCore.PostgreSQL.Design
3,612
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
55
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
57
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
60
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
64
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
66
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
67
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
68

Version Downloads Last updated
8.0.3 5 05/22/2024
8.0.2 10 02/16/2024
8.0.1 7 12/05/2023
8.0.0 6 11/21/2023
8.0.0-rc.2 9 10/13/2023
8.0.0-preview.4 17 05/31/2023
8.0.0-preview.3 36 05/09/2023
8.0.0-preview.2 23 04/04/2023
8.0.0-preview.1 19 04/04/2023
7.0.7 3 05/22/2024
7.0.6 9 09/25/2023
7.0.4 21 06/07/2023
7.0.2 23 04/04/2023
7.0.1 14 01/15/2023
7.0.0 1,571 11/15/2022
7.0.0-rc.2 68 12/01/2022
7.0.0-rc.1 39 09/22/2022
7.0.0-preview.7 21 09/04/2022
7.0.0-preview.6 68 07/30/2022
7.0.0-preview.5 59 09/08/2022
7.0.0-preview.4 29 09/07/2022
7.0.0-preview.3 16 09/08/2022
7.0.0-preview.2 60 09/02/2022
7.0.0-preview.1 11 09/07/2022
6.0.11 3 05/22/2024
6.0.10 7 09/27/2023
6.0.9 19 04/04/2023
6.0.8 5,288 01/15/2023
6.0.7 13,718 09/21/2022
6.0.6 53 09/03/2022
6.0.5 23 08/21/2022
6.0.4 53 08/25/2022
6.0.3 161 06/28/2022
6.0.2 31 09/02/2022
6.0.1 50 08/21/2022
6.0.0 37 09/03/2022
6.0.0-rc.2 63 08/25/2022
6.0.0-rc.1 31 08/23/2022
6.0.0-preview7 31 09/05/2022
6.0.0-preview6 51 08/24/2022
6.0.0-preview5 25 08/04/2022
6.0.0-preview4 41 08/24/2022
6.0.0-preview3 11 08/22/2022
6.0.0-preview2 43 08/25/2022
5.0.18 3 05/22/2024
5.0.17 8 09/23/2023
5.0.16 28 04/04/2023
5.0.15 32 09/22/2022
5.0.14 71 08/24/2022
5.0.13 15 09/08/2022
5.0.12 34 09/02/2022
5.0.11 17 09/02/2022
5.0.10 9,988 06/27/2022
5.0.7 16 09/09/2022
5.0.5 37 09/07/2022
5.0.4 48 08/23/2022
5.0.3 44 09/03/2022
5.0.2 17 09/09/2022
5.0.1.1 49 09/08/2022
5.0.0 62 08/02/2022
4.1.14 3 05/22/2024
4.1.13 4 05/15/2024
4.1.12 23 08/23/2022
4.1.11 22 09/09/2022
4.1.10 35 08/27/2022
4.1.9 31 09/10/2022
4.1.8 60 08/22/2022
4.1.7 25 09/02/2022
4.1.6 17 09/07/2022
4.1.5 49 09/08/2022
4.1.4 32 09/03/2022
4.1.3.1 11 09/07/2022
4.1.3 67 09/09/2022
4.1.2 35 09/09/2022
4.1.1 51 09/03/2022
4.1.0 44 08/26/2022
4.0.17 2 06/10/2024
4.0.16 4 05/22/2024
4.0.14 3 05/22/2024
4.0.13 36 08/23/2022
4.0.12 37 09/09/2022
4.0.11 30 09/02/2022
4.0.10 54 09/09/2022
4.0.9 27 09/02/2022
4.0.8 19 08/21/2022
4.0.7 46 09/03/2022
4.0.6 20 09/02/2022
4.0.5 29 08/22/2022
4.0.4 20 09/02/2022
4.0.3 55 09/07/2022
4.0.2 57 09/09/2022
4.0.1 68 09/02/2022
4.0.0 66 08/20/2022
4.0.0-rc1 15 09/07/2022
4.0.0-preview2 25 08/24/2022
4.0.0-preview1 24 09/02/2022
3.2.7 27 06/29/2022
3.2.6 30 07/02/2022
3.2.5 42 09/07/2022
3.2.4.1 14 07/31/2022
3.2.4 26 08/22/2022
3.2.3 41 07/05/2022
3.2.2 17 08/24/2022
3.2.1 27 09/08/2022
3.2.0 65 09/02/2022
3.1.10 52 09/07/2022
3.1.9 3,615 06/27/2022
3.1.8 14 09/08/2022
3.1.7 28 08/15/2022
3.1.6 18 09/04/2022
3.1.5 23 09/06/2022
3.1.4 11 09/08/2022
3.1.3 39 07/31/2022
3.1.2 71 09/08/2022
3.1.1 56 08/23/2022
3.1.0 67 08/23/2022
3.0.8 28 09/08/2022
3.0.7 53 08/24/2022
3.0.6 59 07/31/2022
3.0.5 16 09/03/2022
3.0.4 26 07/11/2022
3.0.3 34 08/21/2022
3.0.2 48 09/07/2022
3.0.1 31 08/26/2022
3.0.0 21 08/22/2022
2.2.7 52 09/02/2022
2.2.6 15 07/01/2022
2.2.5 14 08/27/2022
2.2.4.3 23 08/24/2022
2.2.4.1 20 09/09/2022
2.2.3 29 09/08/2022
2.2.2 31 09/09/2022
2.2.1 13 08/21/2022
2.2.0 29 08/22/2022
2.1.3 26 09/08/2022
2.1.2 46 07/13/2022
2.1.1 35 08/24/2022
2.1.0 75 09/10/2022
2.0.14.3 52 09/02/2022
2.0.12.1 26 08/24/2022
2.0.11 46 08/26/2022