Npgsql.NodaTime 6.0.2 Prefix Reserved

Install-Package Npgsql.NodaTime -Version 6.0.2
dotnet add package Npgsql.NodaTime --version 6.0.2
<PackageReference Include="Npgsql.NodaTime" Version="6.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Npgsql.NodaTime --version 6.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Npgsql.NodaTime, 6.0.2"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Npgsql.NodaTime as a Cake Addin
#addin nuget:?package=Npgsql.NodaTime&version=6.0.2

// Install Npgsql.NodaTime as a Cake Tool
#tool nuget:?package=Npgsql.NodaTime&version=6.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Npgsql is the open source .NET data provider for PostgreSQL. It allows you to connect and interact with PostgreSQL server using .NET.

This package is an Npgsql plugin which allows you to use the NodaTime date/time library when interacting with PostgreSQL; this provides a better and safer API for dealing with date and time data.

To use the NodaTime plugin, simply add a dependency on this package and set it up at program startup:

NpgsqlConnection.GlobalTypeMapper.UseNodaTime();

Once this is done, you can simply use NodaTime types when interacting with PostgreSQL, just as you would use e.g. DateTime:

// Write NodaTime Instant to PostgreSQL "timestamp with time zone" (UTC)
using (var cmd = new NpgsqlCommand(@"INSERT INTO mytable (my_timestamptz) VALUES (@p)", conn))
{
    cmd.Parameters.Add(new NpgsqlParameter("p", Instant.FromUtc(2011, 1, 1, 10, 30)));
    cmd.ExecuteNonQuery();
}

// Read timestamp back from the database as an Instant
using (var cmd = new NpgsqlCommand(@"SELECT my_timestamptz FROM mytable", conn))
using (var reader = cmd.ExecuteReader())
{
    reader.Read();
    var instant = reader.GetFieldValue<Instant>(0);
}

For more information, visit the NodaTime plugin documentation page.

NuGet packages (9)

Showing the top 5 NuGet packages that depend on Npgsql.NodaTime:

Package Downloads
Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime

NodaTime support plugin for PostgreSQL/Npgsql Entity Framework Core provider.

Marten.NodaTime

NodaTime extension for Marten

Rocket.Surgery.Extensions.Marten

Package Description

PostgreSQLCopyHelper.NodaTime

A library for Bulk Copy / Bulk Inserts with PostgreSQL.

Hangfire.PostgreSql.NodaTime

PostgreSql storage implementation for Hangfire (background job system for ASP.NET applications).

GitHub repositories (6)

Showing the top 5 popular GitHub repositories that depend on Npgsql.NodaTime:

Repository Stars
JasperFx/marten
.NET Transactional Document DB and Event Store on PostgreSQL
npgsql/efcore.pg
Entity Framework Core provider for PostgreSQL
IoTSharp/IoTSharp
IoTSharp is an open-source IoT platform for data collection, processing, visualization, and device management.
PostgreSQLCopyHelper/PostgreSQLCopyHelper
Simple Wrapper around Npgsql for using PostgreSQL COPY functions.
xSke/PluralKit
Version Downloads Last updated
6.0.2 16,646 12/20/2021
6.0.1 15,377 12/3/2021
6.0.0 23,120 11/9/2021
6.0.0-rc.2 914 10/14/2021
6.0.0-rc.1 1,233 9/24/2021
6.0.0-preview7 1,862 8/16/2021
6.0.0-preview6 316 7/31/2021
6.0.0-preview5 463 7/1/2021
6.0.0-preview4 312 5/27/2021
6.0.0-preview3 300 4/15/2021
6.0.0-preview2 3,577 3/11/2021
5.0.11 5,139 11/12/2021
5.0.10 160,104 9/15/2021
5.0.7 258,715 6/13/2021
5.0.5 79,772 5/11/2021
5.0.4 91,212 3/25/2021
5.0.3 139,433 1/26/2021
5.0.2 127,251 1/19/2021
5.0.1.1 59,264 12/12/2020
5.0.0 30,016 11/15/2020
5.0.0-preview1.1 4,226 10/13/2020
5.0.0-alpha1 477 6/17/2020
4.1.9 7,850 4/6/2021
4.1.8 43,653 1/21/2021
4.1.7 952 12/12/2020
4.1.6 99,950 11/15/2020
4.1.5 64,019 9/28/2020
4.1.4 139,821 7/19/2020
4.1.3 349,736 1/31/2020
4.1.2 66,578 11/14/2019
4.1.1 49,607 10/2/2019
4.1.0 8,202 9/26/2019
4.1.0-preview2 2,177 9/4/2019
4.1.0-preview1 734 8/15/2019
4.0.11 311 7/19/2020
4.0.10 37,359 9/9/2019
4.0.9 9,476 8/14/2019
4.0.8 1,780 7/18/2019
4.0.7 115,337 5/21/2019
4.0.6 1,201 4/11/2019
4.0.5 10,443 3/3/2019
4.0.4 63,002 12/6/2018
1.0.0 187,286 5/30/2018
1.0.0-rc1 745 5/8/2018
1.0.0-preview1 2,586 3/22/2018