Npgsql 7.0.6

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.
7
Npgsql.EntityFrameworkCore.PostgreSQL
Npgsql.EntityFrameworkCore.PostgreSQL
8
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
6
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
7
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
10
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
12
Npgsql.LegacyPostgis
PostGIS plugin for Npgsql, allowing mapping of PostGIS types to the legacy types (e.g. PostgisPoint).
6
Npgsql.LegacyPostgis
PostGIS plugin for Npgsql, allowing mapping of PostGIS types to the legacy types (e.g. PostgisPoint).
8
Npgsql.LegacyPostgis
PostGIS plugin for Npgsql, allowing mapping of PostGIS types to the legacy types (e.g. PostgisPoint).
9
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
6
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
7
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
8
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
9
Quantum.FrameworkNetCore
Used for set up Micro-Service.
7
sqlSugarCore
.Net Core 2.0 SqlSugar ORM ,High-performance, lightweight https://github.com/sunkaixuan/SqlSugar
7
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
10

Version Downloads Last updated
8.0.3 9 05/12/2024
8.0.2 23 04/20/2024
8.0.1 3 05/02/2024
8.0.0 4 05/22/2024
8.0.0-rc.2 4 05/14/2024
8.0.0-preview.4 3 05/06/2024
8.0.0-preview.3 3 05/02/2024
8.0.0-preview.2 6 05/10/2024
8.0.0-preview.1 5 05/02/2024
7.0.7 5 05/21/2024
7.0.6 5 05/05/2024
7.0.4 3 05/14/2024
7.0.2 3 05/26/2024
7.0.1 5 06/01/2024
7.0.0 6 05/09/2024
7.0.0-rc.2 3 05/27/2024
7.0.0-rc.1 3 05/23/2024
7.0.0-preview.5 4 05/15/2024
7.0.0-preview.4 5 05/18/2024
7.0.0-preview.3 3 05/09/2024
6.0.10 4 05/01/2024
6.0.9 5 05/21/2024
6.0.8 6 05/30/2024
6.0.7 17 12/05/2022
6.0.5 5 05/28/2024
6.0.4 9 05/13/2022
6.0.3 6 06/13/2022
6.0.2 3 05/23/2024
6.0.1 2 05/20/2024
5.0.17 4 05/09/2024
5.0.16 3 06/01/2024
5.0.15 6 05/03/2024
5.0.14 3 05/11/2024
5.0.13 4 05/21/2024
5.0.11 4 05/09/2022
5.0.3 6 05/10/2022
4.1.14 2 05/21/2024
4.1.12 3 06/01/2024
4.1.9 3 05/26/2024
4.1.7 3 05/17/2024
4.1.4 5 05/16/2023
4.1.3.1 4 05/05/2024
4.1.1 2 05/11/2024
4.0.14 3 05/30/2024
4.0.12 2 05/10/2024
4.0.11 6 05/09/2022
4.0.6 3 05/20/2024
4.0.0-rc1 2 05/05/2024
3.2.6 3 05/20/2024
3.2.4.1 3 05/24/2024
3.2.4 2 05/02/2024
3.2.2 2 05/24/2024
3.2.1 2 05/07/2024
3.1.9 3 05/06/2024
3.1.8 4 05/14/2024
3.1.7 4 05/26/2024
3.1.6 6 05/15/2024
3.1.4 5 05/17/2024
3.1.3 2 05/18/2024
3.1.2 2 05/04/2024
3.1.1 5 05/26/2024
3.1.0 4 05/27/2024
3.0.8 3 05/09/2022
3.0.4 2 05/28/2024
3.0.2 4 05/01/2024
3.0.1 4 05/02/2024
2.2.5 3 05/07/2024
2.2.0 4 05/06/2022
2.1.2 3 05/22/2024
2.1.0 4 05/07/2024