Registry / database / better-queue-sql

better-queue-sql

JSON →
library1.0.6jsnpmunverified

A SQL-based store plugin for the better-queue library, enabling persistent queue storage in relational databases. Version 1.0.6 is the latest stable release, though the project appears unmaintained since 2016. It integrates with better-queue's store interface to replace the default in-memory store with SQL backends, allowing queues to survive process restarts. Compared to memory-only stores, it adds durability but requires careful schema management and connection pooling.

database
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Package is CommonJS-only; ESM import is not supported.

var SQLStore = require('better-queue-sql');

Queue comes from better-queue, not this package.

var Queue = require('better-queue');

Both patterns work; the inline type is simpler for basic use.

var q = new Queue(fn, { store: { type: 'sql', ... } });

Shows how to create a SQLite-backed queue using better-queue-sql.

var Queue = require('better-queue'); var SQLStore = require('better-queue-sql'); var store = new SQLStore({ client: 'sqlite3', connection: { filename: './queue.db' }, tableName: 'my_queue' }); var q = new Queue(function (input, cb) { // process task console.log('Processing:', input); cb(null, 'done'); }, { store: store }); q.push({ task: 1 }); q.push({ task: 2 });
Debug
Known footguns
breakingPackage requires better-queue@3.x peer dep; incompatible with v4+.
deprecatedPackage last updated 2016; no ESM support, no TypeScript types.
gotchaSQLStore expects a knex instance or config object; incorrect config causes silent fails.
gotchaTable must be created manually or via knex migrations; store does not auto-create.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
8 hits · last 30 days
gptbot
3
bingbot
1
ahrefsbot
1
Resources