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

@revealui/db

v0.2.1

Published

Database schemas and Drizzle ORM integration for RevealUI.

Readme

@revealui/db

Database schemas and Drizzle ORM integration for RevealUI.

Test Coverage: ~60% (best coverage in project, but still needs improvement)

Features

  • Drizzle ORM: Type-safe database queries with Drizzle
  • Schema Management: Database schema definitions for all RevealUI tables
  • Multiple Providers: Works with Neon, Supabase, and Vercel Postgres
  • Type Generation: Auto-generate TypeScript types from database schema
  • Migrations: Database migration management with Drizzle Kit
  • Type-safe: Full TypeScript support with inferred types

Installation

pnpm add @revealui/db

Usage

Import Database Client

import { createClient } from '@revealui/db/client'

const db = createClient({
  connectionString: process.env.POSTGRES_URL!
})

Import Schemas

// Import all schemas
import * as schema from '@revealui/db/schema'

// Import specific schemas
import { users } from '@revealui/db/schema/users'
import { posts } from '@revealui/db/schema/cms'
import { agentContexts } from '@revealui/db/schema/agents'
import { vectorMemory } from '@revealui/db/schema/vector'

Query Database

import { createClient } from '@revealui/db/client'
import { users } from '@revealui/db/schema/users'
import { eq } from 'drizzle-orm'

const db = createClient({ connectionString: process.env.POSTGRES_URL! })

// Query users
const allUsers = await db.select().from(users)

// Query with filter
const user = await db.select().from(users).where(eq(users.email, '[email protected]'))

// Insert user
await db.insert(users).values({
  email: '[email protected]',
  name: 'New User'
})

Available Exports

  • @revealui/db - Main export with database client
  • @revealui/db/client - Database client factory
  • @revealui/db/schema - All database schemas
  • @revealui/db/schema/agents - Agent-related tables
  • @revealui/db/schema/cms - CMS tables (posts, pages, media)
  • @revealui/db/schema/users - User and authentication tables
  • @revealui/db/schema/vector - Vector memory tables
  • @revealui/db/schema/crdt-operations - CRDT operation log
  • @revealui/db/schema/node-ids - Node ID mapping
  • @revealui/db/schema/rate-limits - Rate limiting tables
  • @revealui/db/schema/sites - Site configuration tables
  • @revealui/db/types - TypeScript types for database entities

Database Management

# Generate types from schema
pnpm --filter @revealui/db generate:types

# Generate migration files
pnpm --filter @revealui/db db:generate

# Run migrations
pnpm --filter @revealui/db db:migrate

# Push schema changes (development only)
pnpm --filter @revealui/db db:push

# Open Drizzle Studio (database GUI)
pnpm --filter @revealui/db db:studio

Type Safety

All database operations are fully type-safe:

import { createClient } from '@revealui/db/client'
import { users } from '@revealui/db/schema/users'

const db = createClient({ connectionString: process.env.POSTGRES_URL! })

// TypeScript knows the shape of user rows
const allUsers = await db.select().from(users)
// allUsers: { id: string, email: string, name: string | null, ... }[]

// Insert is type-checked
await db.insert(users).values({
  email: '[email protected]',
  name: 'Test User'
  // TypeScript error if you add invalid fields
})

Related Documentation

License

MIT