Naravel.Queue.Database 0.2.0

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

Naravel.Queue.Database

NuGet Downloads .NET 10 License: MIT

EF Core-backed queue driver for Naravel.Queue - works with any EF Core provider (SQL Server, PostgreSQL, SQLite, MySQL).

Fact Detail
Install dotnet add package Naravel.Queue.Database
Targets .NET 10
Needs Naravel.Queue, Microsoft.EntityFrameworkCore and Microsoft.EntityFrameworkCore.Relational, which NuGet installs with it, and the EF Core provider of your own database
Driver database, added with AddDatabaseDriver<TContext>

What you get

  • Your own database is the queue. ConfigureQueueJobs() maps the jobs, failed-jobs and batches tables onto your DbContext.
  • No locking hints. A worker claims a job with a compare-and-swap update, so two workers cannot take the same row on any provider.
  • Priorities and delays. Jobs come out by priority, then by the time they become available.
  • Fenced reservations. A worker that outlives its visibility timeout cannot acknowledge the copy that another worker now owns; the job simply runs a second time.
  • Dispatch inside your transaction. AddTransactionalEnqueue() lets one SaveChanges commit an order and its job together, or neither.

Quick start

{
  "NaravelQueue": {
    "Default": "db",
    "Stores": { "db": { "Driver": "database" } }
  }
}
using Microsoft.EntityFrameworkCore;
using Naravel.Queue.Database;
using Naravel.Queue.Extensions;

// AppDbContext is your own context. UseSqlite comes from the Microsoft.EntityFrameworkCore.Sqlite package, which
// Naravel.Queue.Database does not install: use the provider package of your own database instead
builder.Services.AddDbContextFactory<AppDbContext>(o => o.UseSqlite("Data Source=queue.db"));
builder.Services.AddQueue(builder.Configuration);
builder.Services.AddDatabaseDriver<AppDbContext>(builder.Configuration);
builder.Services.AddQueueWorker();

public class AppDbContext(DbContextOptions<AppDbContext> options) : DbContext(options)
{
    public DbSet<JobRecord> QueueJobs => Set<JobRecord>();

    protected override void OnModelCreating(ModelBuilder modelBuilder) => modelBuilder.ConfigureQueueJobs();
}

Nothing creates the tables on its own: add an EF Core migration and apply it, which is the production path for every provider. VisibilityTimeoutSeconds (default 300) is how long a job may stay reserved by a worker that has disappeared before it goes back to the queue. Every store that uses the database driver on the same context type shares one table. Failed jobs are kept in memory unless you add builder.Services.AddDatabaseFailedJobStore<AppDbContext>().

Package Adds
Naravel.Queue Jobs, retries with backoff, chaining, batching and the background worker

Learn more

Part of Naravel: Laravel's names, .NET's type system. All Naravel packages share one version.

Product Compatible and additional computed target framework versions.
.NET 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.0 98 11/13/2026
0.1.1 105 11/2/2026
0.1.0 113 11/1/2026