Npgsql 8.0.4

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,758
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
77
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
877
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
1,625
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
5,693
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
10,402
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
14,637
Npgsql.EntityFrameworkCore.PostgreSQL.Design
Npgsql.EntityFrameworkCore.PostgreSQL.Design
3,747
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
62
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
63
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.
68
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
74
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
75
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
76
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
77
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
79
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
87

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