Npgsql
6.0.5
Prefix Reserved
See the version list below for details.
Install-Package Npgsql -Version 6.0.5
dotnet add package Npgsql --version 6.0.5
<PackageReference Include="Npgsql" Version="6.0.5" />
paket add Npgsql --version 6.0.5
#r "nuget: Npgsql, 6.0.5"
// Install Npgsql as a Cake Addin
#addin nuget:?package=Npgsql&version=6.0.5
// Install Npgsql as a Cake Tool
#tool nuget:?package=Npgsql&version=6.0.5
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 |
.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 |
-
.NETCoreApp 3.1
- System.Diagnostics.DiagnosticSource (>= 6.0.0)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
-
.NETStandard 2.0
- Microsoft.Bcl.AsyncInterfaces (>= 6.0.0)
- Microsoft.Bcl.HashCode (>= 1.1.1)
- System.Collections.Immutable (>= 6.0.0)
- System.Diagnostics.DiagnosticSource (>= 6.0.0)
- System.Memory (>= 4.5.4)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- System.Text.Json (>= 6.0.0)
- System.Threading.Channels (>= 6.0.0)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- System.ValueTuple (>= 4.5.0)
-
.NETStandard 2.1
- System.Collections.Immutable (>= 6.0.0)
- System.Diagnostics.DiagnosticSource (>= 6.0.0)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- System.Text.Json (>= 6.0.0)
- System.Threading.Channels (>= 6.0.0)
-
net5.0
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
-
net6.0
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
NuGet packages (1.0K)
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. |
|
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
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database. |
GitHub repositories (163)
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.
|
|
dotnetcore/CAP
Distributed transaction solution in micro-service base on eventually consistency, also an eventbus with Outbox pattern
|
|
quartznet/quartznet
Quartz Enterprise Scheduler .NET
|
Version | Downloads | Last updated |
---|---|---|
7.0.0-preview.5 | 1,091 | 6/19/2022 |
7.0.0-preview.4 | 10,388 | 5/11/2022 |
7.0.0-preview.3 | 10,020 | 4/19/2022 |
7.0.0-preview.2 | 16,150 | 3/16/2022 |
7.0.0-preview.1 | 195,953 | 2/17/2022 |
6.0.5 | 54,008 | 6/19/2022 |
6.0.4 | 1,562,510 | 4/19/2022 |
6.0.3 | 2,943,605 | 1/27/2022 |
6.0.2 | 1,788,832 | 12/20/2021 |
6.0.1 | 1,496,885 | 12/3/2021 |
6.0.0 | 1,803,985 | 11/9/2021 |
6.0.0-rc.2 | 115,263 | 10/14/2021 |
6.0.0-rc.1 | 31,570 | 9/24/2021 |
6.0.0-preview7 | 22,262 | 8/16/2021 |
6.0.0-preview6 | 7,144 | 7/31/2021 |
6.0.0-preview5 | 21,760 | 7/1/2021 |
6.0.0-preview4 | 49,686 | 5/27/2021 |
6.0.0-preview3 | 51,069 | 4/15/2021 |
6.0.0-preview2 | 42,935 | 3/11/2021 |
5.0.14 | 2,901 | 6/19/2022 |
5.0.13 | 80,702 | 4/26/2022 |
5.0.12 | 236,931 | 2/1/2022 |
5.0.11 | 606,584 | 11/12/2021 |
5.0.10 | 4,675,956 | 9/15/2021 |
5.0.7 | 5,610,889 | 6/13/2021 |
5.0.5 | 2,315,164 | 5/11/2021 |
5.0.4 | 3,018,322 | 3/25/2021 |
5.0.3 | 3,754,531 | 1/26/2021 |
5.0.2 | 3,257,996 | 1/19/2021 |
5.0.1.1 | 1,824,303 | 12/12/2020 |
5.0.0 | 2,894,790 | 11/15/2020 |
4.1.12 | 621 | 6/19/2022 |
4.1.11 | 27,814 | 4/26/2022 |
4.1.10 | 210,432 | 11/12/2021 |
4.1.9 | 1,199,537 | 4/6/2021 |
4.1.8 | 2,113,176 | 1/21/2021 |
4.1.7 | 343,765 | 12/12/2020 |
4.1.6 | 680,597 | 11/15/2020 |
4.1.5 | 2,164,554 | 9/28/2020 |
4.1.4 | 2,767,751 | 7/19/2020 |
4.1.3.1 | 13,362,649 | 2/20/2020 |
4.1.3 | 5,913,728 | 1/31/2020 |
4.1.2 | 4,021,843 | 11/14/2019 |
4.1.1 | 2,469,513 | 10/2/2019 |
4.1.0 | 471,567 | 9/26/2019 |
4.0.13 | 141 | 6/19/2022 |
4.0.12 | 50,603 | 5/16/2021 |
4.0.11 | 154,210 | 7/19/2020 |
4.0.10 | 3,814,123 | 9/9/2019 |
4.0.9 | 872,828 | 8/14/2019 |
4.0.8 | 716,701 | 7/18/2019 |
4.0.7 | 5,423,028 | 5/21/2019 |
4.0.6 | 2,629,694 | 4/11/2019 |
4.0.5 | 1,029,204 | 3/3/2019 |
4.0.4 | 6,020,753 | 12/6/2018 |
4.0.3 | 4,851,247 | 9/8/2018 |
4.0.2 | 2,565,888 | 7/8/2018 |
4.0.1 | 672,011 | 7/1/2018 |
4.0.0 | 1,477,657 | 5/30/2018 |
4.0.0-rc1 | 65,440 | 5/8/2018 |
4.0.0-preview2 | 66,841 | 4/11/2018 |
4.0.0-preview1 | 15,665 | 3/19/2018 |
3.2.7 | 3,084,311 | 2/27/2018 |
3.2.6 | 4,240,499 | 12/3/2017 |
3.2.5 | 4,395,815 | 7/25/2017 |
3.2.4.1 | 205,761 | 6/22/2017 |
3.2.4 | 21,588 | 6/13/2017 |
3.2.3 | 55,019 | 6/1/2017 |
3.2.2 | 1,435,500 | 3/21/2017 |
3.2.1 | 99,268 | 2/14/2017 |
3.2.0 | 52,552 | 1/27/2017 |
3.1.10 | 63,555 | 2/14/2017 |
3.1.9 | 2,539,870 | 11/20/2016 |
3.1.8 | 292,085 | 9/24/2016 |
3.1.7 | 288,986 | 8/6/2016 |
3.1.6 | 90,519 | 7/12/2016 |
3.1.5 | 216,475 | 6/28/2016 |
3.1.4 | 63,637 | 6/16/2016 |
3.1.3 | 257,284 | 5/30/2016 |
3.1.2 | 60,081 | 5/22/2016 |
3.1.1 | 154,595 | 5/19/2016 |
3.1.0 | 85,208 | 5/16/2016 |
3.0.8 | 26,526 | 6/16/2016 |
3.0.7 | 23,554 | 5/3/2016 |
3.0.6 | 5,780 | 5/1/2016 |
3.0.5 | 197,735 | 1/1/2016 |
3.0.4 | 24,154 | 12/6/2015 |
3.0.3 | 53,445 | 9/27/2015 |
3.0.2 | 18,924 | 9/4/2015 |
3.0.1 | 26,643 | 8/18/2015 |
3.0.0 | 27,279 | 8/7/2015 |
2.2.7 | 306,687 | 9/18/2015 |
2.2.6 | 19,198 | 8/27/2015 |
2.2.5 | 270,746 | 3/11/2015 |
2.2.4.3 | 28,518 | 2/6/2015 |
2.2.4.1 | 11,138 | 2/3/2015 |
2.2.3 | 240,356 | 11/26/2014 |
2.2.2 | 21,413 | 11/1/2014 |
2.2.1 | 42,349 | 9/24/2014 |
2.2.0 | 19,652 | 9/1/2014 |
2.1.3 | 51,979 | 4/9/2014 |
2.1.2 | 11,596 | 3/28/2014 |
2.1.1 | 13,670 | 3/21/2014 |
2.1.0 | 15,741 | 3/19/2014 |
2.0.14.3 | 65,727 | 12/21/2013 |
2.0.12.1 | 58,316 | 12/17/2012 |
2.0.11 | 105,583 | 2/6/2011 |