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

@devdogsuga/db

v0.1.3

Published

Supabase client factories and the Drizzle/postgres-js client factory, merged. Generic over a consumer-supplied `Database` type — no generated types or schema data ship here.

Downloads

653

Readme

@devdogsuga/db

Supabase client factories and the Drizzle/postgres-js client factory, merged into one published package. Migrated from DevDogsUGA's packages/supabase and packages/drizzle.

Nothing here ships repo data: no generated Database type, no app→schema map, no migrations. Every client is generic over a Database type the consumer supplies from its own generated database.types.ts.

@devdogsuga/db/client

Browser-safe Supabase client factories, scoped to one Postgres schema at construction:

import { createBrowserClient } from "@devdogsuga/db/client";
import type { Database } from "~/supabase/database.types";

const supabase = createBrowserClient<Database, "platform">({
  url,
  key,
  schema: "platform",
});

createServerClient takes the same options plus a cookies adapter, for RSC / Route Handlers / Server Actions.

@devdogsuga/db/server

Server-only. The module's first line is import "server-only", so an accidental browser import of this subpath fails at build rather than leaking a service key at runtime.

Under plain Vitest, that guard throws on import: server-only only turns into a no-op when a Next.js server bundle aliases it. A consumer testing code that reaches this subpath needs both of these in its Vitest config:

  • resolve.alias["server-only"] pointing at an empty stub module.

  • test.server.deps.inline: [/@devdogsuga\/db/]. Without it Vitest hands this package to Node's native import(), which resolves the real server-only before the alias is ever consulted.

  • createAdminClient — the service-role Supabase client. Bypasses RLS.

  • createDb — the shared postgres-js + Drizzle client factory:

import { createDb } from "@devdogsuga/db/server";

export const db = createDb(env.DB_URL, relations);

drizzle-orm and postgres are peer dependencies, not bundled deps: the consumer's own pinned versions are what actually run, matching the source package's contract.

@devdogsuga/db/typegen

The machinery that generates a Database type from a live connection — generateDatabaseTypes({ dbUrl, outFile, cwd }) runs supabase gen types via pnpm exec (so the consumer's lockfile-pinned CLI version runs, not a bundled copy) and writes the result to outFile, formatting it with pnpm exec prettier by default. It writes no file of its own — the consumer decides where its database.types.ts lives.

What didn't move

  • database.types.ts — generated repo data. Regenerate it into the consumer repo with @devdogsuga/db/typegen.
  • SCHEMAS / AppKey / SchemaName (the product repo's schemas.ts) — the app→Postgres-schema map is DevDogsUGA's own data, not framework. It stays in DevDogsUGA and can import DatabaseSchema<Database> from @devdogsuga/db/client to key its own map's values.
  • The RLS persona test suite (packages/supabase/testing/**) — exercises DevDogsUGA's actual business schema (profile, reports, moderation policy, attendance, …), not this package's own code. It stays in DevDogsUGA, retargeted to import its clients from @devdogsuga/db/client and @devdogsuga/db/server. This package's own client/server factories are covered by mocked unit tests in src/client/index.test.ts and src/server/index.test.ts instead; there is no live-DB lane here (the vitest.rls.config.ts placeholder was deleted once that became clear).