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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Net4x.DapperLibrary.SQLite" Version="1.9.9.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Net4x.DapperLibrary.SQLite" Version="1.9.9.8" />
                    
Directory.Packages.props
<PackageReference Include="Net4x.DapperLibrary.SQLite" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Net4x.DapperLibrary.SQLite --version 1.9.9.8
                    
#r "nuget: Net4x.DapperLibrary.SQLite, 1.9.9.8"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Net4x.DapperLibrary.SQLite@1.9.9.8
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Net4x.DapperLibrary.SQLite&version=1.9.9.8
                    
Install as a Cake Addin
#tool nuget:?package=Net4x.DapperLibrary.SQLite&version=1.9.9.8
                    
Install as a Cake Tool

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 � a DapperContext configured for the SQLite ADO.NET provider with convenient Use / UseOnce helpers.
  • SQLiteProviderFactory � configures parameter behavior, data adapter hooks and the DatabaseModel factory for SQLite.
  • SQLiteDatabaseModel / SQLiteDatabaseModelTypes / SQLiteDatabaseEnumTypes � SQLite-specific delimiters, batch terminator, parameter naming and SQL type mappings.
  • SQLiteClientFactory � a small DbProviderFactory wrapper producing SQLite ADO.NET objects used by the provider factory.

Key types

  • SQLiteDapperContext

    • Derives from DapperContext and wires a SQLiteProviderFactory instance.
    • Provides static Use, Use(IContextCreator), Use(string, string) and UseOnce helpers to integrate with DapperContextFactory and to configure context creation for tests and applications.
    • Default in-memory connection string is provided: Data Source=InMemory;Mode=Memory;Cache=Shared (registered as a DapperConnectionStringSettings alias named ConnectionString).
  • SQLiteProviderFactory

    • Inherits from ProviderFactoryBase and uses SQLiteClientFactory.Instance.
    • Sets ParameterModel.AddIndex = true and AddPrefixInParameterName = false to match SQLite parameter behavior.
    • Installs a PrepareCommandParameters delegate and wires RowUpdated / RowUpdating events on created DbDataAdapter instances.
  • SQLiteDatabaseModel and related types

    • Delimiters: " (double-quote) for identifiers.
    • Batch terminator: ;.
    • Parameter prefix: $ and parameter base name: Par.
    • Type mappings reflect SQLite capabilities (e.g. Int32/Int64 as INTEGER, Text as TEXT, Blob as BLOB, Decimal/Double as REAL).
  • SQLiteClientFactory

    • A custom DbProviderFactory wrapper that constructs SQLiteCommand, SQLiteConnection, SQLiteDataAdapter, etc., and is used so the provider factory can remain provider-agnostic.

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.SQLite ADO.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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
Loading failed