Linger.DataAccess.Sqlite 0.8.4-preview

This is a prerelease version of Linger.DataAccess.Sqlite.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Linger.DataAccess.Sqlite --version 0.8.4-preview
                    
NuGet\Install-Package Linger.DataAccess.Sqlite -Version 0.8.4-preview
                    
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="Linger.DataAccess.Sqlite" Version="0.8.4-preview" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Linger.DataAccess.Sqlite" Version="0.8.4-preview" />
                    
Directory.Packages.props
<PackageReference Include="Linger.DataAccess.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 Linger.DataAccess.Sqlite --version 0.8.4-preview
                    
#r "nuget: Linger.DataAccess.Sqlite, 0.8.4-preview"
                    
#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 Linger.DataAccess.Sqlite@0.8.4-preview
                    
#: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=Linger.DataAccess.Sqlite&version=0.8.4-preview&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Linger.DataAccess.Sqlite&version=0.8.4-preview&prerelease
                    
Install as a Cake Tool

Linger.DataAccess.Sqlite

中文 | English

SQLite database access library with SQLite-specific optimizations and factory methods.

Features

  • Factory methods for easy database creation
  • Security-first: Parameterized queries prevent SQL injection
  • SQLite optimizations: VACUUM, ANALYZE, and performance features
  • Async support: Full async/await with CancellationToken
  • Database management: Backup, restore, and schema operations
  • Supports core batch query helpers from Linger.DataAccess (see core README)

Basic Usage

using Linger.DataAccess.Sqlite;

var fileDb = SqliteHelper.CreateFileDatabase("myapp.db");

// Parameterized query
var users = fileDb.Query("SELECT * FROM users WHERE age > @age", new SQLiteParameter("@age", 18));

// Batch query (delegates to core implementation)
var ids = Enumerable.Range(1, 3000).Select(i => i.ToString()).ToList();
var dt = fileDb.QueryInBatches("SELECT * FROM users WHERE id IN ({0})", ids); // default batchSize=1000

// SQLite specific maintenance
await fileDb.VacuumDatabaseAsync();
await fileDb.AnalyzeDatabaseAsync();

SQLite Specific APIs

await sqlite.VacuumDatabaseAsync();
await sqlite.AnalyzeDatabaseAsync();
await sqlite.BackupDatabaseAsync("backup.db");
var tables = await sqlite.GetTableNamesAsync();
bool exists = await sqlite.TableExistsAsync("users");

Best Practices

  • Prefer parameterized queries
  • Run VACUUM / ANALYZE periodically
  • Adjust batchSize only if needed for extremely large IN lists
  • Use transactions for multi-statement changes
Product 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 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 Framework net472 is compatible.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
0.9.1-preview 0 9/16/2025
0.9.0-preview 62 9/12/2025
0.8.5-preview 137 8/31/2025
0.8.4-preview 256 8/25/2025
0.8.3-preview 116 8/20/2025
0.8.2-preview 149 8/4/2025
0.8.1-preview 94 7/30/2025
0.1.2-alpha 83 12/17/2024
0.1.1-alpha 76 12/17/2024
0.1.0-alpha 76 12/6/2024
0.0.2-alpha 69 10/3/2024