Claudalisk.Jobs.PostgreSql
0.1.0-alpha.5
dotnet add package Claudalisk.Jobs.PostgreSql --version 0.1.0-alpha.5
NuGet\Install-Package Claudalisk.Jobs.PostgreSql -Version 0.1.0-alpha.5
<PackageReference Include="Claudalisk.Jobs.PostgreSql" Version="0.1.0-alpha.5" />
<PackageVersion Include="Claudalisk.Jobs.PostgreSql" Version="0.1.0-alpha.5" />
<PackageReference Include="Claudalisk.Jobs.PostgreSql" />
paket add Claudalisk.Jobs.PostgreSql --version 0.1.0-alpha.5
#r "nuget: Claudalisk.Jobs.PostgreSql, 0.1.0-alpha.5"
#:package Claudalisk.Jobs.PostgreSql@0.1.0-alpha.5
#addin nuget:?package=Claudalisk.Jobs.PostgreSql&version=0.1.0-alpha.5&prerelease
#tool nuget:?package=Claudalisk.Jobs.PostgreSql&version=0.1.0-alpha.5&prerelease
Claudalisk.Jobs.PostgreSql
The PostgreSQL transport for Claudalisk.Jobs: one jobs table in each jobs module's schema.
Setup
services.AddClaudaliskPersistence(connectionString);
services.AddClaudaliskJobs();
services.AddClaudaliskPostgreSqlJobs();
AddClaudaliskPostgreSqlJobs registers the transport as a singleton and the writer as a scoped service. It needs AddClaudaliskPersistence.
- The writer uses the scope's connection, so a job row is inserted in the unit of work that queues it. If the unit of work rolls back, the job is never queued. It also sends a
NOTIFYon the module's channel. - The transport claims jobs with
FOR UPDATE SKIP LOCKED, so workers do not take the same row. An idle worker waits withLISTENon the module's channel.
The table
An app creates the table from a migration:
migrationBuilder.Sql(JobsTable.CreateSql("ordering"));
The schema must be a lower-case identifier (letters, digits and underscores, not starting with a digit), or the helpers throw ArgumentException. CreateSql never changes. Later changes are separate helpers, each with a drop counterpart:
CreatePruneIndexSql/DropPruneIndexSqlCreateRunningIndexSql/DropRunningIndexSql: add it in every module schema, because the stale sweep searches running rows for old heartbeatsCreateClaimIndexSql/DropClaimIndexSql: replaces the claim index with a partial one that matches the claim orderCreateDedupeIndexSql/DropDedupeIndexSqlRenameColumnsSql/RestoreColumnsSql: renames six columns so they carry the mark of their type
DropDedupeIndexSql does not restore the queued duplicates that CreateDedupeIndexSql canceled.
Column names
From 0.1.0-alpha.5 the transport reads and writes these names, so every jobs table needs RenameColumnsSql before the app runs on that version:
CreateSql creates |
RenameColumnsSql renames it to |
|---|---|
not_before |
not_before_timestamp |
created_at |
created_timestamp |
started_at |
started_timestamp |
heartbeat_at |
heartbeat_timestamp |
finished_at |
finished_timestamp |
cancel_requested |
is_cancel_requested |
An app adds one migration for each schema that has a jobs table:
protected override void Up(MigrationBuilder migrationBuilder) => migrationBuilder.Sql(JobsTable.RenameColumnsSql("ordering"));
protected override void Down(MigrationBuilder migrationBuilder) => migrationBuilder.Sql(JobsTable.RestoreColumnsSql("ordering"));
- A rename keeps the rows, and PostgreSQL updates the indexes to follow the columns.
- A new app calls
RenameColumnsSqlright afterCreateSql, in the same migration. - The index helpers work on either set of names, so they may come before or after the rename.
- The names of
JobRecordand of the JSON the jobs router returns do not change. TheClaudalisk.JobsREADME explains delivery, retries, deduplication and lanes.
Limits
- Delivery is at least once.
- The package uses PostgreSQL features (advisory locks,
LISTEN,SKIP LOCKED,jsonb) and no other database.
| Product | Versions 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. net11.0 is compatible. |
-
net10.0
- Claudalisk.Jobs (>= 0.1.0-alpha.5)
- Claudalisk.Persistence (>= 0.1.0-alpha.5)
-
net11.0
- Claudalisk.Jobs (>= 0.1.0-alpha.5)
- Claudalisk.Persistence (>= 0.1.0-alpha.5)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Claudalisk.Jobs.PostgreSql:
| Package | Downloads |
|---|---|
|
Claudalisk.Scheduling
Cron schedules from configuration that queue commands as jobs of the scheduler's own jobs module, once per scheduled time. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-alpha.5 | 86 | 11/24/2026 |
| 0.1.0-alpha.4 | 161 | 11/22/2026 |
| 0.1.0-alpha.3 | 75 | 11/22/2026 |
| 0.1.0-alpha.2 | 74 | 11/21/2026 |
| 0.1.0-alpha.1 | 644 | 11/8/2026 |