Npgsql 7.0.0

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
.NET 5.0 .NET Core 3.1 .NET Standard 2.0
dotnet add package Npgsql --version 7.0.0
NuGet\Install-Package Npgsql -Version 7.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Npgsql" Version="7.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Npgsql --version 7.0.0
#r "nuget: Npgsql, 7.0.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Npgsql as a Cake Addin
#addin nuget:?package=Npgsql&version=7.0.0

// Install Npgsql as a Cake Tool
#tool nuget:?package=Npgsql&version=7.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.

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1.1K)

Showing the top 5 NuGet packages that depend on Npgsql:

Package Downloads
Npgsql.EntityFrameworkCore.PostgreSQL The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

PostgreSQL/Npgsql provider for Entity Framework Core.

AspNetCore.HealthChecks.NpgSql

HealthChecks.NpgSql is a health check for Postgress Sql.

Npgsql.EntityFrameworkCore.PostgreSQL.Design

PostgreSQL/Npgsql provider for Entity Framework Core.

Hangfire.PostgreSql

PostgreSql storage implementation for Hangfire (background job system for ASP.NET and aspnet core applications).

Npgsql.Json.NET The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.

GitHub repositories (182)

Showing the top 5 popular GitHub repositories that depend on Npgsql:

Repository Stars
DapperLib/Dapper
Dapper - a simple object mapper for .Net
dotnet/orleans
Cloud Native application framework for .NET
nopSolutions/nopCommerce
ASP.NET Core eCommerce software. nopCommerce is a free and open-source shopping cart.
Radarr/Radarr
A fork of Sonarr to work with movies à la Couchpotato.
dotnetcore/CAP
Distributed transaction solution in micro-service base on eventually consistency, also an eventbus with Outbox pattern
Version Downloads Last updated
7.0.0 196,680 11/9/2022
7.0.0-rc.2 28,324 10/11/2022
7.0.0-rc.1 15,129 9/16/2022
7.0.0-preview.7 19,231 8/9/2022
7.0.0-preview.6 20,948 7/13/2022
7.0.0-preview.5 9,879 6/19/2022
7.0.0-preview.4 21,903 5/11/2022
7.0.0-preview.3 24,008 4/19/2022
7.0.0-preview.2 32,871 3/16/2022
7.0.0-preview.1 652,349 2/17/2022
6.0.7 2,068,700 9/16/2022
6.0.6 2,927,076 8/4/2022
6.0.5 3,160,273 6/19/2022
6.0.4 4,551,215 4/19/2022
6.0.3 5,607,335 1/27/2022
6.0.2 2,833,649 12/20/2021
6.0.1 3,159,068 12/3/2021
6.0.0 4,211,336 11/9/2021
6.0.0-rc.2 129,058 10/14/2021
6.0.0-rc.1 38,496 9/24/2021
6.0.0-preview7 25,089 8/16/2021
6.0.0-preview6 7,467 7/31/2021
6.0.0-preview5 28,667 7/1/2021
6.0.0-preview4 53,865 5/27/2021
6.0.0-preview3 56,203 4/15/2021
6.0.0-preview2 53,739 3/11/2021
5.0.15 69,719 9/16/2022
5.0.14 152,209 6/19/2022
5.0.13 181,660 4/26/2022
5.0.12 420,209 2/1/2022
5.0.11 1,028,797 11/12/2021
5.0.10 6,629,535 9/15/2021
5.0.7 7,424,673 6/13/2021
5.0.5 2,830,049 5/11/2021
5.0.4 3,842,076 3/25/2021
5.0.3 4,572,202 1/26/2021
5.0.2 3,648,388 1/19/2021
5.0.1.1 2,065,608 12/12/2020
5.0.0 3,345,114 11/15/2020
4.1.12 148,536 6/19/2022
4.1.11 61,608 4/26/2022
4.1.10 388,096 11/12/2021
4.1.9 1,734,578 4/6/2021
4.1.8 2,413,501 1/21/2021
4.1.7 380,020 12/12/2020
4.1.6 789,864 11/15/2020
4.1.5 2,750,609 9/28/2020
4.1.4 3,090,460 7/19/2020
4.1.3.1 15,232,356 2/20/2020
4.1.3 6,457,442 1/31/2020
4.1.2 4,400,388 11/14/2019
4.1.1 2,723,670 10/2/2019
4.1.0 525,843 9/26/2019
4.0.13 4,591 6/19/2022
4.0.12 60,408 5/16/2021
4.0.11 189,713 7/19/2020
4.0.10 4,355,268 9/9/2019
4.0.9 933,742 8/14/2019
4.0.8 760,356 7/18/2019
4.0.7 5,827,025 5/21/2019
4.0.6 2,833,119 4/11/2019
4.0.5 1,117,275 3/3/2019
4.0.4 6,530,504 12/6/2018
4.0.3 5,114,128 9/8/2018
4.0.2 2,764,753 7/8/2018
4.0.1 697,869 7/1/2018
4.0.0 1,572,905 5/30/2018
4.0.0-rc1 69,584 5/8/2018
4.0.0-preview2 67,768 4/11/2018
4.0.0-preview1 15,801 3/19/2018
3.2.7 3,724,168 2/27/2018
3.2.6 4,688,276 12/3/2017
3.2.5 4,916,674 7/25/2017
3.2.4.1 215,859 6/22/2017
3.2.4 22,681 6/13/2017
3.2.3 56,885 6/1/2017
3.2.2 1,479,398 3/21/2017
3.2.1 103,671 2/14/2017
3.2.0 55,176 1/27/2017
3.1.10 70,558 2/14/2017
3.1.9 3,262,747 11/20/2016
3.1.8 311,274 9/24/2016
3.1.7 326,036 8/6/2016
3.1.6 97,590 7/12/2016
3.1.5 227,577 6/28/2016
3.1.4 65,838 6/16/2016
3.1.3 261,832 5/30/2016
3.1.2 79,151 5/22/2016
3.1.1 170,062 5/19/2016
3.1.0 95,422 5/16/2016
3.0.8 32,852 6/16/2016
3.0.7 24,530 5/3/2016
3.0.6 6,091 5/1/2016
3.0.5 208,834 1/1/2016
3.0.4 27,340 12/6/2015
3.0.3 56,336 9/27/2015
3.0.2 20,692 9/4/2015
3.0.1 27,175 8/18/2015
3.0.0 32,211 8/7/2015
2.2.7 333,983 9/18/2015
2.2.6 24,722 8/27/2015
2.2.5 295,555 3/11/2015
2.2.4.3 31,372 2/6/2015
2.2.4.1 12,009 2/3/2015
2.2.3 268,160 11/26/2014
2.2.2 24,971 11/1/2014
2.2.1 44,083 9/24/2014
2.2.0 21,653 9/1/2014
2.1.3 61,433 4/9/2014
2.1.2 12,737 3/28/2014
2.1.1 13,976 3/21/2014
2.1.0 21,434 3/19/2014
2.0.14.3 70,278 12/21/2013
2.0.12.1 63,018 12/17/2012
2.0.11 131,677 2/6/2011