npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@vorsteh-queue/adapter-drizzle

v0.5.0

Published

Drizzle ORM adapter for Vorsteh Queue with PostgreSQL support

Downloads

17

Readme

@vorsteh-queue/adapter-drizzle

Drizzle ORM adapter for Vorsteh Queue supporting PostgreSQL databases.

Features

  • PostgreSQL Support: Full PostgreSQL compatibility with PGlite, node-postgres, and postgres.js
  • Type Safety: Full TypeScript support with Drizzle ORM
  • SKIP LOCKED: Concurrent job processing without lock contention
  • JSON Payloads: Complex data structures with proper serialization
  • UTC-First: All timestamps stored as UTC for reliable timezone handling

Requirements

  • Node.js 20+
  • PostgreSQL 12+ (for SKIP LOCKED support)
  • ESM only - This package is ESM-only and cannot be imported with require()

Installation

npm install @vorsteh-queue/adapter-drizzle drizzle-orm
# or
pnpm add @vorsteh-queue/adapter-drizzle drizzle-orm

Note: Make sure your project has "type": "module" in package.json or use .mjs file extensions.

Usage

import { drizzle } from "drizzle-orm/node-postgres"
import { Pool } from "pg"

import { PostgresQueueAdapter } from "@vorsteh-queue/adapter-drizzle"
import { Queue } from "@vorsteh-queue/core"

// Setup PostgreSQL connection
const pool = new Pool({
  connectionString: "postgresql://user:password@localhost:5432/database",
})
const db = drizzle(pool)

interface EmailPayload {
  to: string
  subject: string
  body: string
}

interface EmailResult {
  messageId: string
  sent: boolean
}

// Create adapter and queue
const adapter = new PostgresQueueAdapter(db)
const queue = new Queue(adapter, { name: "my-queue" })

// Register job handlers
queue.register<EmailPayload, EmailResult>("send-email", async (job) => {
  console.log(`Sending email to ${job.payload.to}`)

  // Send email logic here
  await sendEmail(job.payload)

  return {
    messageId: "msg_123",
    sent: true,
  }
})

// Add jobs
await queue.add("send-email", {
  to: "[email protected]",
  subject: "Welcome!",
  body: "Welcome to our service!",
})

// Start processing
queue.start()

Schema Setup

Using Drizzle Schemas (Recommended)

import { drizzle } from "drizzle-orm/node-postgres"

import { postgresSchema } from "@vorsteh-queue/adapter-drizzle"

const db = drizzle(pool, { schema: postgresSchema })

Using Drizzle Kit Migrations

// src/schema/index.ts - Your application schema
import { pgTable, serial, varchar } from "drizzle-orm/pg-core"

import { postgresSchema } from "@vorsteh-queue/adapter-drizzle"

// Your existing tables
export const users = pgTable("users", {
  id: serial("id").primaryKey(),
  name: varchar("name", { length: 255 }),
})

// Export queue schema alongside your schema
export const queueJobs = postgresSchema.queueJobs
# Generate and run migrations
npx drizzle-kit generate
npx drizzle-kit migrate

Supported PostgreSQL Drivers

  • node-postgres (pg)
  • postgres.js (postgres)
  • PGlite (for embedded/testing)

Testing

pnpm test

License

MIT License - see LICENSE file for details.