Npgsql 8.0.2

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,441
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
48
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
58
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
868
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
1,602
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
4,750
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
9,606
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
13,854
Npgsql.EntityFrameworkCore.PostgreSQL.Design
Npgsql.EntityFrameworkCore.PostgreSQL.Design
3,430
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
43
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
44
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
45
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
49
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
50
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
52
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
53
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
54

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