Delly.DBunny.Sqlite 2026.5.7

dotnet add package Delly.DBunny.Sqlite --version 2026.5.7
                    
NuGet\Install-Package Delly.DBunny.Sqlite -Version 2026.5.7
                    
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="Delly.DBunny.Sqlite" Version="2026.5.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Delly.DBunny.Sqlite" Version="2026.5.7" />
                    
Directory.Packages.props
<PackageReference Include="Delly.DBunny.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 Delly.DBunny.Sqlite --version 2026.5.7
                    
#r "nuget: Delly.DBunny.Sqlite, 2026.5.7"
                    
#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 Delly.DBunny.Sqlite@2026.5.7
                    
#: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=Delly.DBunny.Sqlite&version=2026.5.7
                    
Install as a Cake Addin
#tool nuget:?package=Delly.DBunny.Sqlite&version=2026.5.7
                    
Install as a Cake Tool

Delly.DBunny.Sqlite

License .NET AOT Compatible

SQLite provider implementation for DBunny.

Installation

dotnet add package Delly.DBunny.Sqlite

Quick Start

using Delly.DBunny;
using Delly.DBunny.Sqlite;
using Delly.DBunny.Sql.Extension;
using System.Data.Common;

// Create provider
var provider = new SqliteProvider();
var connectionString = "Data Source=mydb.db;Pooling=False";

using var connection = provider.GetDbConnection(connectionString);
connection.Open();

// Create a table
var columnDescriptors = new List<DbColumnDesciptor>
{
    new DbColumnDesciptor { ColumnName = "Id", ColumnType = "INTEGER", PrimaryKeyFlag = true, NullableFlag = false },
    new DbColumnDesciptor { ColumnName = "Name", ColumnType = "TEXT(100)", PrimaryKeyFlag = false, NullableFlag = false },
    new DbColumnDesciptor { ColumnName = "Age", ColumnType = "INTEGER", PrimaryKeyFlag = false, NullableFlag = true }
};
var createTableSql = provider.SqlProvider.CreateTable(string.Empty, "Users", columnDescriptors);

using var createCommand = provider.GetDbCommand(connection);
createCommand.CommandText = createTableSql.Sql;
await createCommand.ExecuteNonQueryAsync();

// Insert data
var insertSql = new Sqled("INSERT INTO [Users] (Name, Age) VALUES (@name, @age)")
    .Set("name", "John Doe")
    .Set("age", 30);

using var insertCommand = provider.GetDbCommand(connection);
insertCommand.CommandText = insertSql.Sql;
provider.SetParameters(insertCommand, insertSql.Parameters);
await insertCommand.ExecuteNonQueryAsync();

// Query data
var selectSql = new Sqled("SELECT * FROM [Users] WHERE Age > @minAge")
    .Set("minAge", 18);

await provider.ReadAsync(connection, selectSql, async reader =>
{
    while (await reader.ReadAsync())
    {
        var id = reader["Id"];
        var name = reader["Name"];
        var age = reader["Age"];
        Console.WriteLine($"Id: {id}, Name: {name}, Age: {age}");
    }
});

Connection Builder

Use the fluent builder for connection configuration:

using Delly.DBunny.Sqlite;
using Delly.DBunny.Connecting.Extension;

var connectionDefine = new SqliteConnectionDefine()
    .WithDataSource("mydb.db")
    .WithPooling(false)
    .WithForeignKeys(true)
    .WithCacheSize(2000)
    .WithDefaultTimeout(30)
    .WithJournalMode("WAL");

var descriptor = connectionDefine.GetDbConnectionDescriptor(
    SqliteConnectionDefine.DATABASE_TYPE, "Default");

var connectionString = descriptor.ConnectionString;

Connection Parameters

Parameter Default Description
Data Source - Database file path
Version 3 SQLite version (2 or 3)
Password - Database encryption password
Page Size 4096 Page size in bytes
Cache Size 2000 Cache size in pages
Mode ReadWriteCreate File open mode (ReadOnly, ReadWrite, ReadWriteCreate, Memory)
Default Timeout 30 Command timeout in seconds
Journal Mode WAL Journal mode (Delete, Truncate, Persist, Memory, WAL, Off)
Pooling True Enable connection pooling
Foreign Keys True Enable foreign key constraints
Fail If Missing False Fail if database file doesn't exist
Read Only False Open in read-only mode
Legacy Format False Use legacy file format (SQLite 2.x compatible)
DateTime Format ISO8601 DateTime format (ISO8601, Ticks, UnixEpoch, JulianDay, Invariant)
DateTime Kind Utc DateTime kind (Utc, Local, Unspecified)

SQLite Features

  • No Database Layer: SQLite uses a file-based storage, no database operations
  • No Schema Layer: SQLite doesn't use schemas
  • Name Quoting: Uses square brackets [name]
  • Parameter Prefix: @
  • Type Mapping:
    • Boolean, Byte, SByte, Int16, UInt16, Int32, UInt32 → INTEGER
    • Int64, UInt64 → INTEGER
    • Single, Double, Decimal → REAL
    • String → TEXT
    • DateTime → TEXT

SQLite-Specific Notes

Journal Mode

SQLite supports several journal modes for transaction durability:

  • Delete: Default mode, rollback journal is deleted at end of transaction
  • Truncate: Journal is truncated instead of deleted
  • Persist: Journal is kept but marked as invalid
  • Memory: Journal is stored in RAM
  • WAL: Write-Ahead Logging mode, allows concurrent readers and writers (recommended)
  • Off: Disable rollback journal (dangerous, may corrupt database)

Foreign Keys

Foreign key constraints are disabled by default in SQLite. The connection builder enables them by default.

In-Memory Database

For temporary in-memory databases:

var connectionDefine = new SqliteConnectionDefine()
    .WithDataSource(":memory:");

Dependencies

License

MIT License

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  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 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 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 was computed. 
.NET Framework net461 was computed.  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

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
2026.5.7 94 5/19/2026
2026.5.6 101 5/19/2026
2026.5.5 96 5/18/2026
2026.5.4 108 5/18/2026
2026.5.3 96 5/18/2026
2026.5.2 91 5/17/2026