Npgsql 9.0.1

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
PostgreSQL/Npgsql provider for Entity Framework Core.
41
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
42
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
44
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
45
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
46
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
59
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
72
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
94
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
177
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
189
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
41
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
42
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
43
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
44
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
47
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
59
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
79
Serilog.Sinks.PostgreSQL
Serilog sink for writing to PostgreSQL table
207

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