Npgsql 6.0.9

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,467
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
49
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
59
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
868
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
1,603
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
4,828
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
9,673
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
13,915
Npgsql.EntityFrameworkCore.PostgreSQL.Design
Npgsql.EntityFrameworkCore.PostgreSQL.Design
3,456
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.
47
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.
54
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.
56

Version Downloads Last updated
8.0.2 8 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 29 05/09/2023
8.0.0-preview.2 19 04/04/2023
8.0.0-preview.1 15 04/04/2023
7.0.6 5 09/25/2023
7.0.4 17 06/07/2023
7.0.2 15 04/04/2023
7.0.1 11 01/15/2023
7.0.0 1,566 11/15/2022
7.0.0-rc.2 59 12/01/2022
7.0.0-rc.1 30 09/22/2022
7.0.0-preview.7 17 09/04/2022
7.0.0-preview.6 57 07/30/2022
7.0.0-preview.5 50 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 48 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,825 01/15/2023
6.0.7 13,381 09/21/2022
6.0.6 44 09/03/2022
6.0.5 19 08/21/2022
6.0.4 48 08/25/2022
6.0.3 155 06/28/2022
6.0.2 27 09/02/2022
6.0.1 41 08/21/2022
6.0.0 31 09/03/2022
6.0.0-rc.2 52 08/25/2022
6.0.0-rc.1 25 08/23/2022
6.0.0-preview7 26 09/05/2022
6.0.0-preview6 44 08/24/2022
6.0.0-preview5 20 08/04/2022
6.0.0-preview4 35 08/24/2022
6.0.0-preview3 9 08/22/2022
6.0.0-preview2 37 08/25/2022
5.0.17 6 09/23/2023
5.0.16 22 04/04/2023
5.0.15 27 09/22/2022
5.0.14 64 08/24/2022
5.0.13 10 09/08/2022
5.0.12 29 09/02/2022
5.0.11 15 09/02/2022
5.0.10 9,605 06/27/2022
5.0.7 12 09/09/2022
5.0.5 30 09/07/2022
5.0.4 40 08/23/2022
5.0.3 40 09/03/2022
5.0.2 13 09/09/2022
5.0.1.1 44 09/08/2022
5.0.0 54 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 52 08/22/2022
4.1.7 19 09/02/2022
4.1.6 13 09/07/2022
4.1.5 45 09/08/2022
4.1.4 24 09/03/2022
4.1.3.1 9 09/07/2022
4.1.3 59 09/09/2022
4.1.2 30 09/09/2022
4.1.1 40 09/03/2022
4.1.0 37 08/26/2022
4.0.13 30 08/23/2022
4.0.12 30 09/09/2022
4.0.11 24 09/02/2022
4.0.10 45 09/09/2022
4.0.9 24 09/02/2022
4.0.8 16 08/21/2022
4.0.7 40 09/03/2022
4.0.6 18 09/02/2022
4.0.5 22 08/22/2022
4.0.4 17 09/02/2022
4.0.3 50 09/07/2022
4.0.2 46 09/09/2022
4.0.1 57 09/02/2022
4.0.0 56 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 22 06/29/2022
3.2.6 25 07/02/2022
3.2.5 35 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 15 08/24/2022
3.2.1 23 09/08/2022
3.2.0 53 09/02/2022
3.1.10 45 09/07/2022
3.1.9 3,460 06/27/2022
3.1.8 11 09/08/2022
3.1.7 24 08/15/2022
3.1.6 15 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 61 09/08/2022
3.1.1 48 08/23/2022
3.1.0 59 08/23/2022
3.0.8 22 09/08/2022
3.0.7 46 08/24/2022
3.0.6 49 07/31/2022
3.0.5 14 09/03/2022
3.0.4 21 07/11/2022
3.0.3 27 08/21/2022
3.0.2 41 09/07/2022
3.0.1 28 08/26/2022
3.0.0 18 08/22/2022
2.2.7 41 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 25 09/08/2022
2.2.2 22 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 40 07/13/2022
2.1.1 28 08/24/2022
2.1.0 65 09/10/2022
2.0.14.3 41 09/02/2022
2.0.12.1 22 08/24/2022
2.0.11 40 08/26/2022