AdaskoTheBeAsT.Dapper.NodaTime.Sqlite
6.0.0
dotnet add package AdaskoTheBeAsT.Dapper.NodaTime.Sqlite --version 6.0.0
NuGet\Install-Package AdaskoTheBeAsT.Dapper.NodaTime.Sqlite -Version 6.0.0
<PackageReference Include="AdaskoTheBeAsT.Dapper.NodaTime.Sqlite" Version="6.0.0" />
<PackageVersion Include="AdaskoTheBeAsT.Dapper.NodaTime.Sqlite" Version="6.0.0" />
<PackageReference Include="AdaskoTheBeAsT.Dapper.NodaTime.Sqlite" />
paket add AdaskoTheBeAsT.Dapper.NodaTime.Sqlite --version 6.0.0
#r "nuget: AdaskoTheBeAsT.Dapper.NodaTime.Sqlite, 6.0.0"
#:package AdaskoTheBeAsT.Dapper.NodaTime.Sqlite@6.0.0
#addin nuget:?package=AdaskoTheBeAsT.Dapper.NodaTime.Sqlite&version=6.0.0
#tool nuget:?package=AdaskoTheBeAsT.Dapper.NodaTime.Sqlite&version=6.0.0
AdaskoTheBeAsT.Dapper.NodaTime.Sqlite
SQLite dialect for AdaskoTheBeAsT.Dapper.NodaTime.
It registers the NodaTime type handlers and shapes every parameter with the matching SqliteType in addition
to DbType.
Provider client: Microsoft.Data.Sqlite.
Installation
dotnet add package AdaskoTheBeAsT.Dapper.NodaTime.Sqlite
Usage
using AdaskoTheBeAsT.Dapper.NodaTime.Sqlite;
using NodaTime;
SqliteDapperNodaTimeSetup.Register(DateTimeZoneProviders.Tzdb);
Call it once during startup. The dialect is public as SqliteNodaTimeConfiguration if you want to pass it to
DapperNodaTimeSetup.Register yourself.
Parameter mapping
SQLite has no date/time storage class, so date-like values are stored as text and numeric values as integers.
| NodaTime type | Value written | DbType |
SqliteType |
Recommended column |
|---|---|---|---|---|
Instant |
DateTime (UTC) |
DateTime2 |
Text |
TEXT |
LocalDate |
DateTime at midnight |
Date |
Text |
TEXT |
LocalDateTime |
DateTime (unspecified) |
DateTime2 |
Text |
TEXT |
LocalTime |
TimeSpan since midnight |
Time |
Text |
TEXT |
OffsetDateTime |
DateTimeOffset |
DateTimeOffset |
Text |
TEXT |
Offset |
int seconds |
Int32 |
Integer |
INTEGER |
Duration |
long nanoseconds |
Int64 |
Integer |
INTEGER |
Period |
ISO8601 roundtrip string | AnsiString |
Text |
TEXT |
CalendarSystem |
calendar id | AnsiString |
Text |
TEXT |
DateTimeZone |
time zone id | AnsiString |
Text |
TEXT |
Because the values arrive back as strings, the handlers parse them with CultureInfo.InvariantCulture and
DateTimeStyles.RoundtripKind. Sorting and range filters in SQL work as long as the ISO layout written by
Microsoft.Data.Sqlite is preserved.
Recommended schema
CREATE TABLE Events (
Id INTEGER PRIMARY KEY,
CreatedAt TEXT NOT NULL, -- Instant
ScheduledAt TEXT NOT NULL, -- LocalDateTime
EventDate TEXT NOT NULL, -- LocalDate
StartTime TEXT NOT NULL, -- LocalTime
StartsAtWithOffset TEXT NULL, -- OffsetDateTime
UtcOffsetSeconds INTEGER NULL, -- Offset
RunTimeNanoseconds INTEGER NULL,-- Duration
Recurrence TEXT NULL, -- Period
Calendar TEXT NULL, -- CalendarSystem
TimeZone TEXT NULL); -- DateTimeZone
Example
using Dapper;
using Microsoft.Data.Sqlite;
using NodaTime;
using var connection = new SqliteConnection("Data Source=events.db");
await connection.ExecuteAsync(
"INSERT INTO Events (Id, CreatedAt, ScheduledAt) VALUES (@Id, @CreatedAt, @ScheduledAt)",
new
{
Id = 1L,
CreatedAt = SystemClock.Instance.GetCurrentInstant(),
ScheduledAt = new LocalDateTime(2025, 11, 23, 10, 0),
});
Native library note
Microsoft.Data.Sqlite needs a native SQLite build at runtime. If your host application does not already
provide one, add a bundle package such as SQLitePCLRaw.bundle_e_sqlite3. On .NET Framework with
AnyCPU, prefer the SQLitePCLRaw.bundle_* packages: the 3.x SQLitePCLRaw.lib.* packages reject
AnyCPU builds and require an explicit platform or runtime identifier.
Target frameworks
net10.0, net9.0, net8.0, net481, net48, net472, net471, net47, net462.
Links
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Framework | net462 is compatible. net463 was computed. net47 is compatible. net471 is compatible. net472 is compatible. net48 is compatible. net481 is compatible. |
-
.NETFramework 4.6.2
- AdaskoTheBeAsT.Dapper.NodaTime (>= 6.0.0)
- Microsoft.Data.Sqlite (>= 10.0.10 && < 11.0.0)
- SQLitePCLRaw.bundle_e_sqlite3 (>= 2.1.12 && < 3.0.0)
- System.Text.Json (>= 10.0.10 && < 11.0.0)
-
.NETFramework 4.7
- AdaskoTheBeAsT.Dapper.NodaTime (>= 6.0.0)
- Microsoft.Data.Sqlite (>= 10.0.10 && < 11.0.0)
- SQLitePCLRaw.bundle_e_sqlite3 (>= 2.1.12 && < 3.0.0)
- System.Text.Json (>= 10.0.10 && < 11.0.0)
-
.NETFramework 4.7.1
- AdaskoTheBeAsT.Dapper.NodaTime (>= 6.0.0)
- Microsoft.Data.Sqlite (>= 10.0.10 && < 11.0.0)
- SQLitePCLRaw.bundle_e_sqlite3 (>= 2.1.12 && < 3.0.0)
- System.Text.Json (>= 10.0.10 && < 11.0.0)
-
.NETFramework 4.7.2
- AdaskoTheBeAsT.Dapper.NodaTime (>= 6.0.0)
- Microsoft.Data.Sqlite (>= 10.0.10 && < 11.0.0)
- SQLitePCLRaw.bundle_e_sqlite3 (>= 2.1.12 && < 3.0.0)
- System.Text.Json (>= 10.0.10 && < 11.0.0)
-
.NETFramework 4.8
- AdaskoTheBeAsT.Dapper.NodaTime (>= 6.0.0)
- Microsoft.Data.Sqlite (>= 10.0.10 && < 11.0.0)
- SQLitePCLRaw.bundle_e_sqlite3 (>= 2.1.12 && < 3.0.0)
- System.Text.Json (>= 10.0.10 && < 11.0.0)
-
.NETFramework 4.8.1
- AdaskoTheBeAsT.Dapper.NodaTime (>= 6.0.0)
- Microsoft.Data.Sqlite (>= 10.0.10 && < 11.0.0)
- SQLitePCLRaw.bundle_e_sqlite3 (>= 2.1.12 && < 3.0.0)
- System.Text.Json (>= 10.0.10 && < 11.0.0)
-
net10.0
- AdaskoTheBeAsT.Dapper.NodaTime (>= 6.0.0)
- Microsoft.Data.Sqlite (>= 10.0.10 && < 11.0.0)
- SQLitePCLRaw.bundle_e_sqlite3 (>= 2.1.12 && < 3.0.0)
-
net8.0
- AdaskoTheBeAsT.Dapper.NodaTime (>= 6.0.0)
- Microsoft.Data.Sqlite (>= 8.0.27 && < 9.0.0)
- SQLitePCLRaw.bundle_e_sqlite3 (>= 2.1.12 && < 3.0.0)
-
net9.0
- AdaskoTheBeAsT.Dapper.NodaTime (>= 6.0.0)
- Microsoft.Data.Sqlite (>= 9.0.18 && < 10.0.0)
- SQLitePCLRaw.bundle_e_sqlite3 (>= 2.1.12 && < 3.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 6.0.0 | 35 | 7/29/2026 |