Npgsql 9.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
DBGang.AspNetCore.DataProtection.PostgreSQL
This package stores data protection keys in PostgreSQL database.
28
Hangfire.PostgreSql
PostgreSql storage implementation for Hangfire (background job system for ASP.NET and aspnet core applications).
15
Hangfire.PostgreSql
PostgreSql storage implementation for Hangfire (background job system for ASP.NET and aspnet core applications).
16
Hangfire.PostgreSql
PostgreSql storage implementation for Hangfire (background job system for ASP.NET applications).
15
Npgsql.EntityFrameworkCore.PostgreSQL
Npgsql.EntityFrameworkCore.PostgreSQL
14
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
14
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
16
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
18
Npgsql.LegacyPostgis
PostGIS plugin for Npgsql, allowing mapping of PostGIS types to the legacy types (e.g. PostgisPoint).
14
Npgsql.LegacyPostgis
PostGIS plugin for Npgsql, allowing mapping of PostGIS types to the legacy types (e.g. PostgisPoint).
16
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
15
Quantum.FrameworkNetCore
Used for set up Micro-Service.
16
sqlSugarCore
.Net Core 2.0 SqlSugar ORM ,High-performance, lightweight https://github.com/sunkaixuan/SqlSugar
17
SqlSugarCore
.Net Core3.1 .Net5 .Net6 .Net7 .Net8 安装此版本,好用的ORM框架 ,支持国外主流和国产人大金仓达梦 OceanBase GaussDB QuestDb ClickHouse Oracle MySql Gbase8s SqlServer Sqlite 等, 使用教程:https://www.donet5.com/Home/Doc?typeId=1226
16
SqlSugarCore
.Net Core .Net5 .Net6 .Net7 安装此版本, 版本说明: 5.0.3.5-Max 最低要求.Net Core 3.0+ ,5.0.0-5.0.3.4 最低要求 .Net Core 2.0+ SqlSugar ORM ,High-performance, lightweight
14
SqlSugarCore
好用的ORM框架 .Net Core .Net5 .Net6 .Net7 安装此版本,支持国外主流和国产人大金仓达梦 QuestDb ClickHouse Oracle MySql SqlServer Sqlite, 版本说明: 5.0.3.5-Max 最低要求.Net Core 3.0+ ,5.0.0-5.0.3.4 最低要求 .Net Core 2.0+ SqlSugar ORM ,High-performance, lightweight
18
SqlSugarCore
好用的ORM框架 .Net Core .Net5 .Net6 .Net7 安装此版本,支持国外主流和国产人大金仓达梦, 版本说明: 5.0.3.5-Max 最低要求.Net Core 3.0+ ,5.0.0-5.0.3.4 最低要求 .Net Core 2.0+ SqlSugar ORM ,High-performance, lightweight
14

Version Downloads Last updated
9.0.2 5 01/07/2025
9.0.1 6 12/04/2024
8.0.6 4 12/04/2024
8.0.5 3 11/02/2024
8.0.4 2 12/16/2024
8.0.3 14 05/12/2024
8.0.2 45 04/20/2024
8.0.1 11 05/02/2024
8.0.0 5 05/22/2024
8.0.0-rc.2 6 05/14/2024
8.0.0-preview.4 4 05/06/2024
8.0.0-preview.3 5 05/02/2024
8.0.0-preview.2 9 05/10/2024
8.0.0-preview.1 7 05/02/2024
7.0.9 2 01/07/2025
7.0.8 2 12/15/2024
7.0.7 7 05/21/2024
7.0.6 7 05/05/2024
7.0.4 5 05/14/2024
7.0.2 5 05/26/2024
7.0.1 7 06/01/2024
7.0.0 8 05/09/2024
7.0.0-rc.2 4 05/27/2024
7.0.0-rc.1 4 05/23/2024
7.0.0-preview.7 3 01/01/2025
7.0.0-preview.6 1 01/07/2025
7.0.0-preview.5 6 05/15/2024
7.0.0-preview.4 7 05/18/2024
7.0.0-preview.3 4 05/09/2024
7.0.0-preview.1 1 01/07/2025
6.0.13 4 12/04/2024
6.0.12 2 01/07/2025
6.0.11 2 01/02/2025
6.0.10 6 05/01/2024
6.0.9 6 05/21/2024
6.0.8 9 05/30/2024
6.0.7 21 12/05/2022
6.0.6 1 01/07/2025
6.0.5 6 05/28/2024
6.0.4 13 05/13/2022
6.0.3 8 06/13/2022
6.0.2 4 05/23/2024
6.0.1 5 05/20/2024
6.0.0-rc.2 1 01/07/2025
6.0.0-rc.1 2 11/14/2024
6.0.0-preview6 1 01/07/2025
5.0.18 1 01/07/2025
5.0.17 7 05/09/2024
5.0.16 5 06/01/2024
5.0.15 10 05/03/2024
5.0.14 5 05/11/2024
5.0.13 6 05/21/2024
5.0.11 6 05/09/2022
5.0.3 8 05/10/2022
5.0.1.1 2 01/07/2025
4.1.14 3 05/21/2024
4.1.13 1 01/07/2025
4.1.12 4 06/01/2024
4.1.11 1 01/07/2025
4.1.9 5 05/26/2024
4.1.7 5 05/17/2024
4.1.4 7 05/16/2023
4.1.3.1 7 05/05/2024
4.1.1 4 05/11/2024
4.1.0 3 11/14/2024
4.0.17 2 01/07/2025
4.0.16 1 01/07/2025
4.0.14 7 05/30/2024
4.0.13 2 12/13/2024
4.0.12 5 05/10/2024
4.0.11 8 05/09/2022
4.0.6 6 05/20/2024
4.0.0-rc1 3 05/05/2024
3.2.6 7 05/20/2024
3.2.4.1 4 05/24/2024
3.2.4 5 05/02/2024
3.2.2 3 05/24/2024
3.2.1 4 05/07/2024
3.2.0 1 01/07/2025
3.1.9 6 05/06/2024
3.1.8 6 05/14/2024
3.1.7 6 05/26/2024
3.1.6 9 05/15/2024
3.1.4 8 05/17/2024
3.1.3 4 05/18/2024
3.1.2 3 05/04/2024
3.1.1 6 05/26/2024
3.1.0 5 05/27/2024
3.0.8 6 05/09/2022
3.0.5 1 01/07/2025
3.0.4 4 05/28/2024
3.0.2 7 05/01/2024
3.0.1 5 05/02/2024
2.2.5 6 05/07/2024
2.2.1 1 01/07/2025
2.2.0 6 05/06/2022
2.1.2 4 05/22/2024
2.1.0 5 05/07/2024