Npgsql 6.0.0

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

Version Downloads Last updated
8.0.4 0 9/10/2024
8.0.3 0 5/9/2024
8.0.2 0 2/10/2024
8.0.1 0 12/4/2023
8.0.0 0 11/21/2023
8.0.0-rc.2 0 10/11/2023
8.0.0-preview.4 0 5/17/2023
8.0.0-preview.3 0 4/24/2023
8.0.0-preview.2 0 3/20/2023
8.0.0-preview.1 0 3/3/2023
7.0.8 0 9/10/2024
7.0.7 0 5/9/2024
7.0.6 0 9/14/2023
7.0.4 0 4/24/2023
7.0.2 0 2/15/2023
7.0.1 0 12/17/2022
7.0.0 0 11/9/2022
7.0.0-rc.2 0 10/11/2022
7.0.0-rc.1 0 9/16/2022
7.0.0-preview.7 0 8/9/2022
7.0.0-preview.6 0 7/13/2022
7.0.0-preview.5 0 6/19/2022
7.0.0-preview.4 0 5/11/2022
7.0.0-preview.3 0 4/19/2022
7.0.0-preview.2 0 3/16/2022
7.0.0-preview.1 0 2/17/2022
6.0.12 0 9/10/2024
6.0.11 0 5/9/2024
6.0.10 0 9/14/2023
6.0.9 0 2/15/2023
6.0.8 0 12/17/2022
6.0.7 0 9/16/2022
6.0.6 0 8/4/2022
6.0.5 0 6/19/2022
6.0.4 0 4/19/2022
6.0.3 0 1/27/2022
6.0.2 2 12/25/2022
6.0.1 0 12/3/2021
6.0.0 1 12/25/2022
6.0.0-rc.2 0 10/14/2021
6.0.0-rc.1 0 9/24/2021
6.0.0-preview7 0 8/16/2021
6.0.0-preview6 0 7/31/2021
6.0.0-preview5 0 7/1/2021
6.0.0-preview4 0 5/27/2021
6.0.0-preview3 0 4/15/2021
6.0.0-preview2 0 3/11/2021
5.0.18 0 5/9/2024
5.0.17 0 9/14/2023
5.0.16 0 2/15/2023
5.0.15 0 9/16/2022
5.0.14 0 6/19/2022
5.0.13 0 4/26/2022
5.0.12 0 2/1/2022
5.0.11 0 11/12/2021
5.0.10 0 9/15/2021
5.0.7 0 6/13/2021
5.0.5 0 5/11/2021
5.0.4 0 3/25/2021
5.0.3 0 1/26/2021
5.0.2 0 1/19/2021
5.0.1.1 0 12/12/2020
5.0.0 0 11/15/2020
4.1.14 0 5/18/2024
4.1.13 0 5/9/2024
4.1.12 0 6/19/2022
4.1.11 0 4/26/2022
4.1.10 0 11/12/2021
4.1.9 0 4/6/2021
4.1.8 0 1/21/2021
4.1.7 0 12/12/2020
4.1.6 0 11/15/2020
4.1.5 0 9/28/2020
4.1.4 0 7/19/2020
4.1.3.1 0 2/20/2020
4.1.3 0 1/31/2020
4.1.2 0 11/14/2019
4.1.1 0 10/2/2019
4.1.0 0 9/26/2019
4.0.17 0 6/10/2024
4.0.16 0 5/18/2024
4.0.14 0 5/9/2024
4.0.13 0 6/19/2022
4.0.12 0 5/16/2021
4.0.11 0 7/19/2020
4.0.10 0 9/9/2019
4.0.9 0 8/14/2019
4.0.8 0 7/18/2019
4.0.7 0 5/21/2019
4.0.6 0 4/11/2019
4.0.5 0 3/3/2019
4.0.4 0 12/6/2018
4.0.3 0 9/8/2018
4.0.2 0 7/8/2018
4.0.1 0 7/1/2018
4.0.0 0 5/30/2018
4.0.0-rc1 0 5/8/2018
4.0.0-preview2 0 4/11/2018
4.0.0-preview1 0 3/19/2018
3.2.7 0 2/27/2018
3.2.6 0 12/3/2017
3.2.5 0 7/25/2017
3.2.4.1 0 6/22/2017
3.2.4 0 6/13/2017
3.2.3 0 6/1/2017
3.2.2 0 3/21/2017
3.2.1 0 2/14/2017
3.2.0 0 1/27/2017
3.1.10 0 2/14/2017
3.1.9 0 11/20/2016
3.1.8 0 9/24/2016
3.1.7 0 8/6/2016
3.1.6 0 7/12/2016
3.1.5 0 6/28/2016
3.1.4 0 6/16/2016
3.1.3 0 5/30/2016
3.1.2 0 5/22/2016
3.1.1 0 5/19/2016
3.1.0 0 5/16/2016
3.0.8 0 6/16/2016
3.0.7 0 5/3/2016
3.0.6 0 5/1/2016
3.0.5 0 1/1/2016
3.0.4 0 12/6/2015
3.0.3 0 9/27/2015
3.0.2 0 9/4/2015
3.0.1 0 8/18/2015
3.0.0 0 8/7/2015
2.2.7 0 9/18/2015
2.2.6 0 8/27/2015
2.2.5 0 3/11/2015
2.2.4.3 0 2/6/2015
2.2.4.1 0 2/3/2015
2.2.3 0 11/26/2014
2.2.2 0 11/1/2014
2.2.1 0 9/24/2014
2.2.0 0 9/1/2014
2.1.3 0 4/9/2014
2.1.2 0 3/28/2014
2.1.1 0 3/21/2014
2.1.0 0 3/19/2014
2.0.14.3 0 12/21/2013
2.0.12.1 0 12/17/2012
2.0.11 0 2/6/2011