Npgsql 7.0.2
See the version list below for details.
dotnet add package Npgsql --version 7.0.2
NuGet\Install-Package Npgsql -Version 7.0.2
<PackageReference Include="Npgsql" Version="7.0.2" />
paket add Npgsql --version 7.0.2
#r "nuget: Npgsql, 7.0.2"
// Install Npgsql as a Cake Addin
#addin nuget:?package=Npgsql&version=7.0.2
// Install Npgsql as a Cake Tool
#tool nuget:?package=Npgsql&version=7.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.
Related packages
- The Entity Framework Core provider that works with this provider is Npgsql.EntityFrameworkCore.PostgreSQL.
- Spatial plugin to work with PostgreSQL PostGIS: Npgsql.NetTopologySuite
- NodaTime plugin to use better date/time types with PostgreSQL: Npgsql.NodaTime
- OpenTelemetry support can be set up with Npgsql.OpenTelemetry
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 net481 |
MonoAndroid | monoandroid |
MonoMac | monomac |
MonoTouch | monotouch |
Tizen | tizen40 tizen60 |
Xamarin.iOS | xamarinios |
Xamarin.Mac | xamarinmac |
Xamarin.TVOS | xamarintvos |
Xamarin.WatchOS | xamarinwatchos |
-
.NETCoreApp 3.1
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.0)
- System.Diagnostics.DiagnosticSource (>= 6.0.0)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
-
.NETStandard 2.0
- Microsoft.Bcl.HashCode (>= 1.1.1)
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.0)
- System.Collections.Immutable (>= 7.0.0)
- System.Diagnostics.DiagnosticSource (>= 6.0.0)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- System.Text.Json (>= 7.0.0)
- System.Threading.Channels (>= 7.0.0)
-
.NETStandard 2.1
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.0)
- System.Collections.Immutable (>= 7.0.0)
- System.Diagnostics.DiagnosticSource (>= 6.0.0)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- System.Text.Json (>= 7.0.0)
- System.Threading.Channels (>= 7.0.0)
-
net5.0
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.0)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
-
net6.0
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.0)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
-
net7.0
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.0)
NuGet packages (1.2K)
Showing the top 5 NuGet packages that depend on Npgsql:
Package | Downloads |
---|---|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core. |
|
AspNetCore.HealthChecks.NpgSql
HealthChecks.NpgSql is a health check for Postgress Sql. |
|
Hangfire.PostgreSql
PostgreSql storage implementation for Hangfire (background job system for ASP.NET and aspnet core applications). |
|
Npgsql.EntityFrameworkCore.PostgreSQL.Design
PostgreSQL/Npgsql provider for Entity Framework Core. |
|
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database. |
GitHub repositories (190)
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 |
---|---|---|
8.0.0-preview.2 | 474 | 3/20/2023 |
8.0.0-preview.1 | 5,428 | 3/3/2023 |
7.0.2 | 673,364 | 2/15/2023 |
7.0.1 | 1,853,187 | 12/17/2022 |
7.0.0 | 1,345,248 | 11/9/2022 |
7.0.0-rc.2 | 45,942 | 10/11/2022 |
7.0.0-rc.1 | 23,624 | 9/16/2022 |
7.0.0-preview.7 | 27,228 | 8/9/2022 |
7.0.0-preview.6 | 26,832 | 7/13/2022 |
7.0.0-preview.5 | 11,631 | 6/19/2022 |
7.0.0-preview.4 | 25,701 | 5/11/2022 |
7.0.0-preview.3 | 30,486 | 4/19/2022 |
7.0.0-preview.2 | 36,559 | 3/16/2022 |
7.0.0-preview.1 | 1,212,136 | 2/17/2022 |
6.0.9 | 80,624 | 2/15/2023 |
6.0.8 | 870,748 | 12/17/2022 |
6.0.7 | 5,252,202 | 9/16/2022 |
6.0.6 | 4,998,986 | 8/4/2022 |
6.0.5 | 4,492,807 | 6/19/2022 |
6.0.4 | 6,196,562 | 4/19/2022 |
6.0.3 | 7,357,033 | 1/27/2022 |
6.0.2 | 3,409,052 | 12/20/2021 |
6.0.1 | 4,271,089 | 12/3/2021 |
6.0.0 | 6,617,831 | 11/9/2021 |
6.0.0-rc.2 | 132,823 | 10/14/2021 |
6.0.0-rc.1 | 43,043 | 9/24/2021 |
6.0.0-preview7 | 27,616 | 8/16/2021 |
6.0.0-preview6 | 7,733 | 7/31/2021 |
6.0.0-preview5 | 32,065 | 7/1/2021 |
6.0.0-preview4 | 55,597 | 5/27/2021 |
6.0.0-preview3 | 58,203 | 4/15/2021 |
6.0.0-preview2 | 58,424 | 3/11/2021 |
5.0.16 | 14,776 | 2/15/2023 |
5.0.15 | 195,382 | 9/16/2022 |
5.0.14 | 201,700 | 6/19/2022 |
5.0.13 | 223,827 | 4/26/2022 |
5.0.12 | 524,505 | 2/1/2022 |
5.0.11 | 1,351,616 | 11/12/2021 |
5.0.10 | 7,569,933 | 9/15/2021 |
5.0.7 | 8,603,325 | 6/13/2021 |
5.0.5 | 3,175,279 | 5/11/2021 |
5.0.4 | 4,449,348 | 3/25/2021 |
5.0.3 | 5,021,897 | 1/26/2021 |
5.0.2 | 3,857,514 | 1/19/2021 |
5.0.1.1 | 2,211,095 | 12/12/2020 |
5.0.0 | 3,622,206 | 11/15/2020 |
4.1.12 | 267,110 | 6/19/2022 |
4.1.11 | 72,027 | 4/26/2022 |
4.1.10 | 524,163 | 11/12/2021 |
4.1.9 | 2,046,366 | 4/6/2021 |
4.1.8 | 2,561,923 | 1/21/2021 |
4.1.7 | 395,884 | 12/12/2020 |
4.1.6 | 852,639 | 11/15/2020 |
4.1.5 | 3,106,470 | 9/28/2020 |
4.1.4 | 3,270,324 | 7/19/2020 |
4.1.3.1 | 16,242,166 | 2/20/2020 |
4.1.3 | 6,779,909 | 1/31/2020 |
4.1.2 | 4,651,613 | 11/14/2019 |
4.1.1 | 2,946,201 | 10/2/2019 |
4.1.0 | 556,274 | 9/26/2019 |
4.0.13 | 16,630 | 6/19/2022 |
4.0.12 | 68,644 | 5/16/2021 |
4.0.11 | 214,814 | 7/19/2020 |
4.0.10 | 4,625,139 | 9/9/2019 |
4.0.9 | 965,046 | 8/14/2019 |
4.0.8 | 790,318 | 7/18/2019 |
4.0.7 | 6,105,527 | 5/21/2019 |
4.0.6 | 2,948,835 | 4/11/2019 |
4.0.5 | 1,167,082 | 3/3/2019 |
4.0.4 | 6,882,142 | 12/6/2018 |
4.0.3 | 5,270,138 | 9/8/2018 |
4.0.2 | 2,893,512 | 7/8/2018 |
4.0.1 | 714,070 | 7/1/2018 |
4.0.0 | 1,628,635 | 5/30/2018 |
4.0.0-rc1 | 70,346 | 5/8/2018 |
4.0.0-preview2 | 67,861 | 4/11/2018 |
4.0.0-preview1 | 15,875 | 3/19/2018 |
3.2.7 | 4,238,405 | 2/27/2018 |
3.2.6 | 4,897,019 | 12/3/2017 |
3.2.5 | 5,329,309 | 7/25/2017 |
3.2.4.1 | 220,599 | 6/22/2017 |
3.2.4 | 23,136 | 6/13/2017 |
3.2.3 | 57,754 | 6/1/2017 |
3.2.2 | 1,503,331 | 3/21/2017 |
3.2.1 | 106,002 | 2/14/2017 |
3.2.0 | 56,880 | 1/27/2017 |
3.1.10 | 74,342 | 2/14/2017 |
3.1.9 | 3,831,075 | 11/20/2016 |
3.1.8 | 322,089 | 9/24/2016 |
3.1.7 | 358,627 | 8/6/2016 |
3.1.6 | 100,142 | 7/12/2016 |
3.1.5 | 234,854 | 6/28/2016 |
3.1.4 | 67,395 | 6/16/2016 |
3.1.3 | 264,498 | 5/30/2016 |
3.1.2 | 95,420 | 5/22/2016 |
3.1.1 | 178,461 | 5/19/2016 |
3.1.0 | 105,822 | 5/16/2016 |
3.0.8 | 36,262 | 6/16/2016 |
3.0.7 | 25,059 | 5/3/2016 |
3.0.6 | 6,210 | 5/1/2016 |
3.0.5 | 215,334 | 1/1/2016 |
3.0.4 | 28,575 | 12/6/2015 |
3.0.3 | 57,317 | 9/27/2015 |
3.0.2 | 21,001 | 9/4/2015 |
3.0.1 | 27,491 | 8/18/2015 |
3.0.0 | 34,514 | 8/7/2015 |
2.2.7 | 352,094 | 9/18/2015 |
2.2.6 | 30,718 | 8/27/2015 |
2.2.5 | 303,865 | 3/11/2015 |
2.2.4.3 | 32,674 | 2/6/2015 |
2.2.4.1 | 12,693 | 2/3/2015 |
2.2.3 | 285,245 | 11/26/2014 |
2.2.2 | 27,092 | 11/1/2014 |
2.2.1 | 44,871 | 9/24/2014 |
2.2.0 | 22,529 | 9/1/2014 |
2.1.3 | 64,238 | 4/9/2014 |
2.1.2 | 13,199 | 3/28/2014 |
2.1.1 | 14,167 | 3/21/2014 |
2.1.0 | 23,280 | 3/19/2014 |
2.0.14.3 | 72,900 | 12/21/2013 |
2.0.12.1 | 64,835 | 12/17/2012 |
2.0.11 | 142,995 | 2/6/2011 |