Npgsql 7.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
Hangfire.PostgreSql
PostgreSql storage implementation for Hangfire (background job system for ASP.NET and aspnet core applications).
10
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
9
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
10
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
11
Npgsql.EntityFrameworkCore.PostgreSQL.Design
Npgsql.EntityFrameworkCore.PostgreSQL.Design
9
Npgsql.EntityFrameworkCore.PostgreSQL.Design
Npgsql.EntityFrameworkCore.PostgreSQL.Design
10
Npgsql.EntityFrameworkCore.PostgreSQL.Design
PostgreSQL/Npgsql provider for Entity Framework Core.
11

Version Downloads Last updated
9.0.2 1 25.12.2024
9.0.1 0 19.11.2024
9.0.0 3 01.12.2024
8.0.6 3 29.11.2024
8.0.5 5 06.12.2024
8.0.4 2 11.12.2024
8.0.3 8 12.09.2024
8.0.2 9 22.04.2024
8.0.1 8 22.09.2024
8.0.0 0 21.11.2023
8.0.0-rc.2 5 22.09.2024
8.0.0-preview.4 2 05.12.2024
8.0.0-preview.3 8 22.09.2024
8.0.0-preview.2 0 20.03.2023
8.0.0-preview.1 0 03.03.2023
7.0.9 3 15.12.2024
7.0.8 0 10.09.2024
7.0.7 6 22.09.2024
7.0.6 9 22.09.2024
7.0.4 5 02.12.2024
7.0.2 5 01.12.2024
7.0.1 0 17.12.2022
7.0.0 3 16.12.2024
7.0.0-rc.2 5 01.12.2024
7.0.0-rc.1 3 15.12.2024
7.0.0-preview.7 0 09.08.2022
7.0.0-preview.6 0 13.07.2022
7.0.0-preview.5 5 11.12.2024
7.0.0-preview.4 7 22.09.2024
7.0.0-preview.3 8 22.09.2024
7.0.0-preview.2 3 01.12.2024
7.0.0-preview.1 0 17.02.2022
6.0.13 2 06.12.2024
6.0.12 5 11.12.2024
6.0.11 11 22.09.2024
6.0.10 0 14.09.2023
6.0.9 0 15.02.2023
6.0.8 0 17.12.2022
6.0.7 6 22.09.2024
6.0.6 4 26.11.2024
6.0.5 6 22.09.2024
6.0.4 0 19.04.2022
6.0.3 6 22.09.2024
6.0.2 6 22.09.2024
6.0.1 8 22.09.2024
6.0.0 8 15.04.2024
6.0.0-rc.2 3 30.11.2024
6.0.0-rc.1 9 22.09.2024
6.0.0-preview7 0 16.08.2021
6.0.0-preview6 3 16.12.2024
6.0.0-preview5 3 15.12.2024
6.0.0-preview4 5 22.09.2024
6.0.0-preview3 7 22.09.2024
6.0.0-preview2 5 22.09.2024
5.0.18 8 22.09.2024
5.0.17 6 22.09.2024
5.0.16 5 22.09.2024
5.0.15 0 16.09.2022
5.0.14 0 19.06.2022
5.0.13 5 27.11.2024
5.0.12 3 22.09.2024
5.0.11 0 12.11.2021
5.0.10 8 22.09.2024
5.0.7 0 13.06.2021
5.0.5 3 22.09.2024
5.0.4 6 22.09.2024
5.0.3 0 26.01.2021
5.0.2 0 19.01.2021
5.0.1.1 8 22.09.2024
5.0.0 0 15.11.2020
4.1.14 0 18.05.2024
4.1.13 3 11.12.2024
4.1.12 5 02.12.2024
4.1.11 3 26.11.2024
4.1.10 5 22.09.2024
4.1.9 3 29.11.2024
4.1.8 0 21.01.2021
4.1.7 7 22.09.2024
4.1.6 0 15.11.2020
4.1.5 5 02.12.2024
4.1.4 0 19.07.2020
4.1.3.1 8 22.09.2024
4.1.3 7 22.09.2024
4.1.2 8 22.09.2024
4.1.1 5 09.12.2024
4.1.0 7 22.09.2024
4.0.17 8 22.09.2024
4.0.16 2 11.12.2024
4.0.14 0 09.05.2024
4.0.13 0 19.06.2022
4.0.12 0 16.05.2021
4.0.11 8 22.09.2024
4.0.10 5 22.09.2024
4.0.9 6 22.09.2024
4.0.8 3 29.11.2024
4.0.7 7 22.09.2024
4.0.6 0 11.04.2019
4.0.5 6 22.09.2024
4.0.4 8 22.09.2024
4.0.3 11 22.09.2024
4.0.2 3 15.12.2024
4.0.1 0 01.07.2018
4.0.0 3 28.11.2024
4.0.0-rc1 6 22.09.2024
4.0.0-preview2 0 11.04.2018
4.0.0-preview1 6 22.09.2024
3.2.7 9 22.09.2024
3.2.6 3 28.11.2024
3.2.5 7 22.09.2024
3.2.4.1 3 15.12.2024
3.2.4 0 13.06.2017
3.2.3 0 01.06.2017
3.2.2 0 21.03.2017
3.2.1 8 22.09.2024
3.2.0 5 22.09.2024
3.1.10 9 22.09.2024
3.1.9 6 28.11.2024
3.1.8 6 22.09.2024
3.1.7 8 22.09.2024
3.1.6 0 12.07.2016
3.1.5 0 28.06.2016
3.1.4 0 16.06.2016
3.1.3 0 30.05.2016
3.1.2 7 22.09.2024
3.1.1 3 29.11.2024
3.1.0 0 16.05.2016
3.0.8 8 22.09.2024
3.0.7 7 22.09.2024
3.0.6 3 15.12.2024
3.0.5 0 01.01.2016
3.0.4 9 22.09.2024
3.0.3 0 27.09.2015
3.0.2 6 22.09.2024
3.0.1 7 22.09.2024
3.0.0 6 22.09.2024
2.2.7 0 18.09.2015
2.2.6 3 15.12.2024
2.2.5 4 22.09.2024
2.2.4.3 3 15.12.2024
2.2.4.1 0 03.02.2015
2.2.3 0 26.11.2014
2.2.2 7 22.09.2024
2.2.1 0 24.09.2014
2.2.0 6 22.09.2024
2.1.3 3 26.11.2024
2.1.2 4 24.11.2024
2.1.1 0 21.03.2014
2.1.0 6 22.09.2024
2.0.14.3 0 21.12.2013
2.0.12.1 0 17.12.2012
2.0.11 3 22.09.2024