Npgsql 6.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
DBGang.AspNetCore.DataProtection.PostgreSQL
This package stores data protection keys in PostgreSQL database.
14
Hangfire.PostgreSql
PostgreSql storage implementation for Hangfire (background job system for ASP.NET and aspnet core applications).
9
Npgsql.EntityFrameworkCore.PostgreSQL
Npgsql.EntityFrameworkCore.PostgreSQL
8
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
7
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
11
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).
7
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).
10
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.
10
Quantum.FrameworkNetCore
Used for set up Micro-Service.
8
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.5 1 11/02/2024
8.0.4 0 09/10/2024
8.0.3 13 05/12/2024
8.0.2 33 04/20/2024
8.0.1 8 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.8 0 09/10/2024
7.0.7 5 05/21/2024
7.0.6 5 05/05/2024
7.0.4 4 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.7 0 08/09/2022
7.0.0-preview.6 0 07/13/2022
7.0.0-preview.5 4 05/15/2024
7.0.0-preview.4 6 05/18/2024
7.0.0-preview.3 3 05/09/2024
7.0.0-preview.1 0 02/17/2022
6.0.12 0 09/10/2024
6.0.11 0 05/09/2024
6.0.10 4 05/01/2024
6.0.9 5 05/21/2024
6.0.8 7 05/30/2024
6.0.7 18 12/05/2022
6.0.6 0 08/04/2022
6.0.5 5 05/28/2024
6.0.4 11 05/13/2022
6.0.3 7 06/13/2022
6.0.2 3 05/23/2024
6.0.1 3 05/20/2024
6.0.0-rc.2 0 10/14/2021
6.0.0-rc.1 0 09/24/2021
6.0.0-preview6 0 07/31/2021
5.0.18 0 05/09/2024
5.0.17 5 05/09/2024
5.0.16 3 06/01/2024
5.0.15 7 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
5.0.1.1 0 12/12/2020
4.1.14 2 05/21/2024
4.1.13 0 05/09/2024
4.1.12 3 06/01/2024
4.1.11 0 04/26/2022
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 5 05/05/2024
4.1.1 3 05/11/2024
4.1.0 0 09/26/2019
4.0.17 0 06/10/2024
4.0.16 0 05/18/2024
4.0.14 3 05/30/2024
4.0.13 0 06/19/2022
4.0.12 2 05/10/2024
4.0.11 6 05/09/2022
4.0.6 4 05/20/2024
4.0.0-rc1 2 05/05/2024
3.2.6 4 05/20/2024
3.2.4.1 3 05/24/2024
3.2.4 3 05/02/2024
3.2.2 2 05/24/2024
3.2.1 2 05/07/2024
3.2.0 0 01/27/2017
3.1.9 4 05/06/2024
3.1.8 5 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 4 05/09/2022
3.0.5 0 01/01/2016
3.0.4 2 05/28/2024
3.0.2 4 05/01/2024
3.0.1 4 05/02/2024
2.2.5 4 05/07/2024
2.2.1 0 09/24/2014
2.2.0 4 05/06/2022
2.1.2 3 05/22/2024
2.1.0 4 05/07/2024