Skip to main content

@nest-native/jobs

Background jobs for NestJS without Redis — a Drizzle-backed job queue

Tx

Transactional Enqueue

enqueue() inserts the job row inside your business transaction via nestjs-cls, so the job exists if and only if your writes committed. No Redis, no dual-write bug.

DI

Nest-Native Handlers

Declare a class with @JobHandler('email.welcome') and register it as a provider. Handlers are discovered at bootstrap with full dependency injection; duplicate names fail at startup.

DB

Your Drizzle Database

Per-dialect stores for better-sqlite3 (sync), Postgres, and MySQL (async), with a jobs table you add to your schema and migrate with drizzle-kit. The core engine stays dialect-agnostic.

Re

Retries, Delays & Unique Jobs

Jittered exponential backoff, RetryableError / PermanentError steering, runAt / delayMs scheduling, priority ordering, and uniqueKey dedup among active jobs.

Zero

Zero Runtime Dependencies

The published package keeps runtime dependencies empty. Nest, Drizzle, and your driver stay under the host application's control as peer dependencies.

Test

100% Tested

The engine is covered to 100% across branches, functions, lines, and statements — all three dialects, with a gated real-MySQL round-trip proving the dedup contract on a live server.