{"id":45302,"library":"liteque","title":"Liteque","description":"Liteque is a simple, typesafe SQLite-based job queue for Node.js, built on better-sqlite3. Version 0.8.0 is the latest stable release; the project follows a regular release cadence. It differentiates from other queues (e.g., Bull, Bee-Queue) by using SQLite as the backing store, eliminating the need for Redis or additional infrastructure. Designed for single-process or embedded use cases, it offers TypeScript-first APIs with Zod schema validation for job data, configurable retries, concurrency control, and lifecycle hooks (onComplete, onError).","status":"active","version":"0.8.0","language":"javascript","source_language":"en","source_url":"https://github.com/karakeep-app/liteque","tags":["javascript","sqlite","queue","typescript"],"install":[{"cmd":"npm install liteque","lang":"bash","label":"npm"},{"cmd":"yarn add liteque","lang":"bash","label":"yarn"},{"cmd":"pnpm add liteque","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required as a peer dependency to provide synchronous SQLite database access for job storage and queue operations.","package":"better-sqlite3","optional":false}],"imports":[{"note":"Named export; no default import.","wrong":"import buildDBClient from 'liteque'","symbol":"buildDBClient","correct":"import { buildDBClient } from 'liteque'"},{"note":"ESM-only package; use import syntax or dynamic import with CommonJS.","wrong":"const { Runner } = require('liteque')","symbol":"Runner","correct":"import { Runner } from 'liteque'"},{"note":"Generic type parameter: new SqliteQueue<YourDataType>(...).","wrong":"","symbol":"SqliteQueue","correct":"import { SqliteQueue } from 'liteque'"}],"quickstart":{"code":"import { buildDBClient, Runner, SqliteQueue } from 'liteque';\nimport { z } from 'zod';\n\nconst db = buildDBClient(':memory:', { runMigrations: true });\n\nconst requestSchema = z.object({ message: z.string() });\ntype ZRequest = z.infer<typeof requestSchema>;\n\nconst queue = new SqliteQueue<ZRequest>('requests', db, {\n  defaultJobArgs: { numRetries: 2 },\n  keepFailedJobs: false,\n});\n\nawait queue.enqueue({ message: 'Hello world' });\n\nconst worker = new Runner<ZRequest>(queue, {\n  run: async (job) => { console.log(job.data.message); },\n  onComplete: async (job) => { console.log('Done'); },\n  onError: async (job) => { console.error(job.error); },\n}, {\n  concurrency: 1,\n  pollIntervalMs: 1000,\n  timeoutSecs: 60,\n  validator: requestSchema,\n});\n\nawait worker.start();","lang":"typescript","description":"Demonstrates setting up a SQLite queue, enqueuing a job, and running a worker with lifecycle hooks."},"warnings":[{"fix":"Always provide a Zod schema or similar validator in the third argument to Runner.","message":"The 'validator' option in Runner is required for type safety; omitting it may cause runtime errors with malformed jobs.","severity":"gotcha","affected_versions":">=0.4.0"},{"fix":"Set 'runMigrations: true' in buildDBClient options, or update database schema manually.","message":"Migration from earlier versions (pre-0.7.0) required manual schema changes; 'runMigrations: true' is now the default.","severity":"breaking","affected_versions":"<0.7.0"},{"fix":"Use a persistent file path for long-lived queues.","message":"Using an in-memory database (':memory:') means all jobs are lost when the process exits. Not suitable for production.","severity":"gotcha","affected_versions":"all"},{"fix":"Use WAL mode on the database file and tune SQLite's busy timeout.","message":"Concurrency greater than 1 may lead to SQLITE_BUSY errors if multiple workers access the same in-memory database concurrently.","severity":"gotcha","affected_versions":">0.5.0"},{"fix":"Replace 'timeoutSecs' with 'jobTimeoutSecs' in the Runner options object.","message":"The 'timeoutSecs' option in Runner is deprecated as of v0.8.0; use 'jobTimeoutSecs' instead.","severity":"deprecated","affected_versions":"0.8.0"}],"env_vars":null,"search_vec":"'0.8.0':20 'addit':56 'api':72 'back':48 'base':9 'bee':41 'bee-queu':40 'better':17 'better-sqlite3':16 'built':14 'bull':39 'cadenc':32 'case':66 'concurr':82 'configur':80 'control':83 'data':79 'design':58 'differenti':34 'e.g':38 'elimin':50 'embed':64 'first':71 'follow':28 'hook':86 'infrastructur':57 'javascript':89 'job':10,78 'latest':23 'lifecycl':85 'litequ':1,2 'need':52 'node.js':13 'offer':68 'oncomplet':87 'onerror':88 'process':62 'project':27 'queue':11,37,42,91 'redi':54 'regular':30 'releas':25,31 'retri':81 'schema':75 'simpl':5 'singl':61 'single-process':60 'sqlite':8,45,90 'sqlite-bas':7 'sqlite3':18 'stabl':24 'store':49 'typesaf':6 'typescript':70,92 'typescript-first':69 'use':44,65 'valid':76 'version':19 'zod':74","created_at":"2026-06-07T12:54:20.394942+00:00","updated_at":"2026-06-07T12:54:20.394942+00:00","problems":[{"fix":"Install better-sqlite3: npm install better-sqlite3","cause":"Missing peer dependency better-sqlite3.","error":"Cannot find module 'better-sqlite3'"},{"fix":"Use named import: import { buildDBClient } from 'liteque'","cause":"Incorrect import: default import used but it's a named export.","error":"TypeError: buildDBClient is not a function"},{"fix":"Provide a validator (Zod schema) in Runner's third argument.","cause":"No validator passed to Runner; job data didn't match expected type.","error":"SchemaValidationError: Invalid job data"},{"fix":"Use a file-based database and enable WAL mode: PRAGMA journal_mode=WAL; or reduce concurrency.","cause":"High concurrency with in-memory database or missing WAL mode.","error":"SQLITE_BUSY: database is locked"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/karakeep-app/liteque#readme","github":"https://github.com/karakeep-app/liteque","docs":null,"changelog":null,"pypi":null,"npm":"liteque","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}