Net4x.DapperLibrary.SQLite
1.9.9.8
dotnet add package Net4x.DapperLibrary.SQLite --version 1.9.9.8
NuGet\Install-Package Net4x.DapperLibrary.SQLite -Version 1.9.9.8
<PackageReference Include="Net4x.DapperLibrary.SQLite" Version="1.9.9.8" />
<PackageVersion Include="Net4x.DapperLibrary.SQLite" Version="1.9.9.8" />
<PackageReference Include="Net4x.DapperLibrary.SQLite" />
paket add Net4x.DapperLibrary.SQLite --version 1.9.9.8
#r "nuget: Net4x.DapperLibrary.SQLite, 1.9.9.8"
#:package Net4x.DapperLibrary.SQLite@1.9.9.8
#addin nuget:?package=Net4x.DapperLibrary.SQLite&version=1.9.9.8
#tool nuget:?package=Net4x.DapperLibrary.SQLite&version=1.9.9.8
DapperLibrary.SQLite
SQLite provider integration for DapperLibrary. This project provides a SQLite-specific DapperContext implementation, a provider factory and database model/type mappings tailored for SQLite.
Purpose
Make DapperLibrary work naturally with SQLite by providing:
SQLiteDapperContext� aDapperContextconfigured for the SQLite ADO.NET provider with convenientUse/UseOncehelpers.SQLiteProviderFactory� configures parameter behavior, data adapter hooks and theDatabaseModelfactory for SQLite.SQLiteDatabaseModel/SQLiteDatabaseModelTypes/SQLiteDatabaseEnumTypes� SQLite-specific delimiters, batch terminator, parameter naming and SQL type mappings.SQLiteClientFactory� a smallDbProviderFactorywrapper producingSQLiteADO.NET objects used by the provider factory.
Key types
SQLiteDapperContext- Derives from
DapperContextand wires aSQLiteProviderFactoryinstance. - Provides static
Use,Use(IContextCreator),Use(string, string)andUseOncehelpers to integrate withDapperContextFactoryand to configure context creation for tests and applications. - Default in-memory connection string is provided:
Data Source=InMemory;Mode=Memory;Cache=Shared(registered as aDapperConnectionStringSettingsalias namedConnectionString).
- Derives from
SQLiteProviderFactory- Inherits from
ProviderFactoryBaseand usesSQLiteClientFactory.Instance. - Sets
ParameterModel.AddIndex = trueandAddPrefixInParameterName = falseto match SQLite parameter behavior. - Installs a
PrepareCommandParametersdelegate and wiresRowUpdated/RowUpdatingevents on createdDbDataAdapterinstances.
- Inherits from
SQLiteDatabaseModeland related types- Delimiters:
"(double-quote) for identifiers. - Batch terminator:
;. - Parameter prefix:
$and parameter base name:Par. - Type mappings reflect SQLite capabilities (e.g.
Int32/Int64asINTEGER,TextasTEXT,BlobasBLOB,Decimal/DoubleasREAL).
- Delimiters:
SQLiteClientFactory- A custom
DbProviderFactorywrapper that constructsSQLiteCommand,SQLiteConnection,SQLiteDataAdapter, etc., and is used so the provider factory can remain provider-agnostic.
- A custom
Usage examples
Create and use a SQLiteDapperContext directly:
using var context = new SQLiteDapperContext();
// use context.Operations / context.Schema / context.SaveDataTable etc.
Register a creator for test or application bootstrap:
// simple registration for shared usage
SQLiteDapperContext.Use();
// or bind an explicit connection string and provider
SQLiteDapperContext.UseOnce("Data Source=mydb.sqlite;","System.Data.SQLite");
In-memory testing:
// default alias in the library points to Data Source=InMemory;Mode=Memory;Cache=Shared
using var context = new SQLiteDapperContext();
// create tables and execute test queries against the in-memory DB
When using DbDataAdapter-based save operations, you can subscribe to row update events via the provider factory which raises RowUpdating/RowUpdated events.
Multi-targeting & client compatibility
- The project is multi-targeted with conditional compilation present in the solution to support older .NET Framework targets and modern .NET runtimes used throughout the repository.
- This project depends on
System.Data.SQLite(the native ADO.NET SQLite provider). Ensure the consuming project references the correct SQLite ADO.NET package for its target framework.
Synchronous vs asynchronous usage
- The DapperLibrary core exposes both synchronous and asynchronous APIs; the SQLite-specific provider and the
System.Data.SQLiteADO.NET provider historically have limited or provider-specific async support. As a result:- Prefer synchronous methods when targeting runtimes/providers that do not implement true async I/O.
- Use the async variants (
GetDataReaderAsync,GetDataTableAsync,SetDataAsync, etc.) in environments where the underlying provider supports async methods and you need non-blocking behavior. - When writing tests against the in-memory SQLite connection, synchronous operations are often simpler and reliable due to provider semantics.
Notes and best practices
- SQLite parameter naming in this library uses
$as the prefix and does not automatically add a prefix to parameter names (AddPrefixInParameterName = false), so pass parameter names consistently with that convention when building raw commands. - The default in-memory connection string is useful for unit tests. For durable storage, provide a file-based connection string.
- The provider factory ensures parameter indexing (via
ParameterModel.AddIndex = true) which keeps the parameter placeholder handling consistent with other providers in the DapperLibraries solution.
Consult source files under DbContexts and SQLite for implementation details and for extension points.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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 was computed. 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 was computed. 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 Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net35 is compatible. net40 is compatible. net403 was computed. net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 is compatible. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 3.5
- Net4x.BaseTypes (>= 1.3.1.17)
- Net4x.DapperLibrary.Base (>= 1.9.9.8)
- System.Data.SQLite (>= 1.0.118)
-
.NETFramework 4.0
- Net4x.BaseTypes (>= 1.3.1.17)
- Net4x.DapperLibrary.Base (>= 1.9.9.8)
- System.Data.SQLite (>= 1.0.118)
-
.NETFramework 4.5
- Net4x.BaseTypes (>= 1.3.1.17)
- Net4x.DapperLibrary.Base (>= 1.9.9.8)
- System.Data.SQLite (>= 1.0.118)
-
.NETFramework 4.6.1
- Net4x.BaseTypes (>= 1.3.1.17)
- Net4x.DapperLibrary.Base (>= 1.9.9.8)
- System.Data.SQLite (>= 1.0.118)
-
.NETStandard 2.0
- Net4x.BaseTypes (>= 1.3.1.17)
- Net4x.DapperLibrary.Base (>= 1.9.9.8)
- System.Configuration.ConfigurationManager (>= 9.0.0)
- System.Data.SQLite.Core (>= 1.0.118)
-
.NETStandard 2.1
- Net4x.BaseTypes (>= 1.3.1.17)
- Net4x.DapperLibrary.Base (>= 1.9.9.8)
- System.Configuration.ConfigurationManager (>= 9.0.0)
- System.Data.SQLite.Core (>= 1.0.118)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Net4x.DapperLibrary.SQLite:
| Package | Downloads |
|---|---|
|
Net4x.DapperLibrary.InMemory
Package Description |
|
|
Net4x.EntityFramework.Library
Package Description |
|
|
Net4x.CodiceFiscaleLibrary
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.9.9.8 | 148 | 2/2/2026 |
| 1.9.9.7 | 234 | 1/13/2026 |
| 1.9.9.6 | 150 | 1/6/2026 |
| 1.9.9.5 | 150 | 1/6/2026 |
| 1.9.9.4 | 149 | 1/6/2026 |
| 1.9.9.3 | 210 | 1/5/2026 |
| 1.9.9.2 | 151 | 12/30/2025 |
| 1.9.9.1 | 158 | 12/30/2025 |
| 1.9.9 | 247 | 12/22/2025 |
| 1.6.0.12 | 202 | 12/12/2025 |
| 1.6.0.11 | 198 | 12/12/2025 |
| 1.6.0.10 | 516 | 12/9/2025 |
| 1.6.0.9 | 267 | 12/4/2025 |
| 1.6.0.8 | 273 | 12/4/2025 |
| 1.6.0.7 | 332 | 11/30/2025 |
| 1.6.0.6 | 260 | 11/27/2025 |
| 1.6.0.5 | 303 | 11/22/2025 |
| 1.6.0.4 | 201 | 11/16/2025 |
| 1.6.0.3 | 233 | 11/15/2025 |
| 1.6.0.2 | 383 | 11/14/2025 |