Npgsql 6.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
TestContainers
Package Description
56
Weasel.Postgresql
Npgsql Helpers and Postgresql Schema Migration Tool, spin off of Marten
43
Marten
Postgresql as a Document Db and Event Store for .Net Development
43
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
40
Weasel.Postgresql
Npgsql Helpers and Postgresql Schema Migration Tool, spin off of Marten
39
Marten
Postgresql as a Document Db and Event Store for .Net Development
38
Weasel.Postgresql
Npgsql Helpers and Postgresql Schema Migration Tool, spin off of Marten
37
Weasel.Postgresql
Npgsql Helpers and Postgresql Schema Migration Tool, spin off of Marten
36
Weasel.Postgresql
Npgsql Helpers and Postgresql Schema Migration Tool, spin off of Marten
35
Marten
Postgresql as a Document Db and Event Store for .Net Development
35
TestContainers
Package Description
35
Weasel.Postgresql
Npgsql Helpers and Postgresql Schema Migration Tool, spin off of Marten
34
Weasel.Postgresql
Npgsql Helpers and Postgresql Schema Migration Tool, spin off of Marten
33

Version Downloads Last updated
9.0.2 7 12/14/2024
9.0.1 8 11/19/2024
9.0.0 7 11/19/2024
8.0.6 8 11/19/2024
8.0.5 6 10/25/2024
8.0.4 8 09/18/2024
8.0.3 23 05/22/2024
8.0.2 11 02/20/2024
8.0.1 8 12/15/2023
8.0.0 6 12/15/2023
8.0.0-rc.2 6 06/29/2024
8.0.0-preview.4 9 08/28/2024
8.0.0-preview.3 9 02/20/2024
8.0.0-preview.2 13 04/03/2023
8.0.0-preview.1 17 06/05/2023
7.0.9 7 11/19/2024
7.0.8 7 10/25/2024
7.0.7 14 05/22/2024
7.0.6 9 07/05/2024
7.0.4 7 02/20/2024
7.0.2 24 06/11/2023
7.0.1 12 06/11/2023
7.0.0 23 04/04/2023
7.0.0-rc.2 7 08/26/2023
7.0.0-rc.1 10 08/23/2023
7.0.0-preview.7 10 12/02/2023
7.0.0-preview.6 5 11/04/2024
7.0.0-preview.5 27 04/02/2023
7.0.0-preview.4 34 04/05/2023
7.0.0-preview.3 8 08/07/2024
7.0.0-preview.2 9 02/20/2024
7.0.0-preview.1 26 03/31/2023
6.0.13 7 11/19/2024
6.0.12 7 09/20/2024
6.0.11 14 05/22/2024
6.0.10 8 01/07/2024
6.0.9 49 04/03/2023
6.0.8 36 03/30/2023
6.0.7 24 04/02/2023
6.0.6 33 04/22/2023
6.0.5 11 06/11/2023
6.0.4 26 04/08/2023
6.0.3 15 06/12/2023
6.0.2 12 06/12/2023
6.0.1 7 06/11/2023
6.0.0 9 06/11/2023
6.0.0-rc.2 7 08/22/2023
6.0.0-rc.1 16 08/22/2023
6.0.0-preview7 9 02/20/2024
6.0.0-preview6 50 04/03/2023
6.0.0-preview5 5 06/29/2024
6.0.0-preview4 8 02/20/2024
6.0.0-preview3 7 06/29/2024
6.0.0-preview2 29 04/21/2023
5.0.18 13 05/22/2024
5.0.17 7 12/15/2023
5.0.16 5 09/03/2024
5.0.15 8 06/13/2023
5.0.14 11 04/11/2023
5.0.13 45 03/30/2023
5.0.12 16 06/13/2023
5.0.11 14 03/30/2023
5.0.10 31 03/30/2023
5.0.7 12 03/20/2023
5.0.5 34 05/18/2021
5.0.4 11 06/12/2023
5.0.3 37 03/30/2023
5.0.2 17 06/12/2023
5.0.1.1 19 03/27/2023
5.0.0 12 04/03/2023
4.1.14 23 05/22/2024
4.1.13 14 05/22/2024
4.1.12 10 06/13/2023
4.1.11 30 05/06/2023
4.1.10 41 04/22/2023
4.1.9 26 04/06/2023
4.1.8 9 09/03/2022
4.1.7 10 06/11/2023
4.1.6 55 03/30/2023
4.1.5 12 06/11/2023
4.1.4 8 06/11/2023
4.1.3.1 8 08/21/2023
4.1.3 8 06/11/2023
4.1.2 7 06/11/2023
4.1.1 10 06/11/2023
4.1.0 10 06/11/2023
4.0.17 22 06/12/2024
4.0.16 17 05/22/2024
4.0.14 12 05/22/2024
4.0.13 7 06/14/2023
4.0.12 8 06/13/2023
4.0.11 9 06/12/2023
4.0.10 9 06/13/2023
4.0.9 6 06/10/2023
4.0.8 18 06/11/2023
4.0.7 20 03/28/2023
4.0.6 10 06/11/2023
4.0.5 9 06/11/2023
4.0.4 7 06/11/2023
4.0.3 9 06/11/2023
4.0.2 7 06/11/2023
4.0.1 9 06/11/2023
4.0.0 14 01/29/2020
4.0.0-rc1 5 08/22/2023
4.0.0-preview2 8 06/29/2024
4.0.0-preview1 12 02/15/2024
3.2.7 18 11/29/2019
3.2.6 37 06/12/2023
3.2.5 6 06/11/2023
3.2.4.1 16 08/21/2023
3.2.4 7 06/12/2023
3.2.3 8 06/12/2023
3.2.2 9 06/10/2023
3.2.1 31 06/01/2023
3.2.0 8 06/12/2023
3.1.10 7 06/12/2023
3.1.9 8 06/11/2023
3.1.8 9 06/11/2023
3.1.7 45 04/19/2023
3.1.6 10 06/11/2023
3.1.5 8 06/12/2023
3.1.4 11 06/12/2023
3.1.3 7 06/11/2023
3.1.2 8 06/12/2023
3.1.1 6 06/12/2023
3.1.0 10 06/11/2023
3.0.8 37 04/10/2023
3.0.7 8 06/12/2023
3.0.6 7 06/13/2023
3.0.5 10 06/11/2023
3.0.4 13 04/04/2023
3.0.3 52 03/26/2023
3.0.2 8 06/11/2023
3.0.1 7 06/12/2023
3.0.0 7 06/12/2023
2.2.7 8 06/11/2023
2.2.6 8 06/12/2023
2.2.5 8 06/12/2023
2.2.4.3 8 08/26/2023
2.2.4.1 8 08/22/2023
2.2.3 7 06/12/2023
2.2.2 7 06/11/2023
2.2.1 6 06/11/2023
2.2.0 9 06/11/2023
2.1.3 10 12/30/2023
2.1.2 36 05/03/2023
2.1.1 9 06/11/2023
2.1.0 8 06/11/2023
2.0.14.3 13 08/23/2023
2.0.12.1 38 03/30/2023
2.0.11 33 03/30/2023