Spindle.Persistence.EFCore.Sqlite 0.2.1

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

Spindle.Persistence.EFCore

Entity Framework Core persistence for Spindle.Net. The relational model is shared by four provider packages, each of which contains its own migrations.

Install the provider package for your database, then register it before the Spindle runtime:

services.AddSpindleSqlite("Data Source=spindle.db");

services.AddSpindleWorker();

The available registrations are:

services.AddSpindleSqlite(sqliteConnectionString);
services.AddSpindlePostgreSql(postgreSqlConnectionString);
services.AddSpindleMySql(mySqlConnectionString);
services.AddSpindleSqlServer(sqlServerConnectionString);

All registrations also accept an optional Action<DbContextOptionsBuilder> that runs after Spindle's provider defaults. Use it for application-specific EF Core options, such as EnableSensitiveDataLogging() when that is appropriate for the environment. SQL Server sensitive-data logging is disabled by default.

PostgreSQL and SQL Server additionally accept an optional schema. The schema is applied to Spindle's entity tables and migrations history table, and is created by generated migration SQL when needed:

services.AddSpindlePostgreSql(
    postgreSqlConnectionString,
    schema: "spindle",
    configure: options => options.EnableDetailedErrors());

MySQL and SQLite do not expose schema parameters because their installed EF Core providers do not support EF Core schemas.

Create or migrate the schema during application startup using the normal EF Core APIs:

await using var scope = services.CreateAsyncScope();
var contextFactory = scope.ServiceProvider
    .GetRequiredService<IDbContextFactory<SpindleDbContext>>();
await using var database = await contextFactory.CreateDbContextAsync();
await database.Database.MigrateAsync();

Managing migrations

The repository includes equivalent Bash and PowerShell helpers that run dotnet ef against the provider-specific projects:

./scripts/migrations.sh add all AddFlowPriority
./scripts/migrations.sh check all
./scripts/migrations.sh list sqlite
./scripts/migrations.sh script postgresql 0
./scripts/migrations.ps1 add all AddFlowPriority
./scripts/migrations.ps1 check all
./scripts/migrations.ps1 list sqlite
./scripts/migrations.ps1 script postgresql 0

Supported provider names are sqlite, postgresql, mysql, and sqlserver; all runs the command for every provider. Use remove <provider> --force in Bash or remove <provider> -Force in PowerShell only when a migration can be removed without checking a database. The script command accepts optional from-migration and to-migration arguments and writes SQL to standard output. Both scripts use net10.0 for design-time operations by default; set SPINDLE_EF_FRAMEWORK to override it. The add, check, list, and remove commands always use schema-neutral design-time models. To validate a PostgreSQL or SQL Server migration script for a non-default schema, set SPINDLE_EF_SCHEMA before using the script command. The marker and value are ignored by the MySQL and SQLite design-time factories.

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 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 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. 
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.2.1 97 8/25/2026
0.2.0 93 8/25/2026
0.1.0 95 8/25/2026