Npgsql 6.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.

Showing the top 20 packages that depend on Npgsql.

Packages Downloads
Npgsql.EntityFrameworkCore.PostgreSQL
Npgsql.EntityFrameworkCore.PostgreSQL
36
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
36
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
37
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
39
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
50
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
63
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
90
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
151
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
177
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
37
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
38
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
56
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
61
Serilog.Sinks.PostgreSQL
Serilog sink for writing to PostgreSQL table
182

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