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

@dmc--98/dfe-drizzle

v0.1.3

Published

Drizzle ORM database adapter for Dynamic Form Engine

Readme

@dmc--98/dfe-drizzle

Drizzle ORM adapter for the Dynamic Form Engine.

Install

npm install @dmc--98/dfe-drizzle @dmc--98/dfe-server drizzle-orm

Recommended Migration Flow

Use the adapter-aware CLI first, then hand off to your normal Drizzle migration commands:

npx dfe migrate plan --adapter drizzle
npx dfe migrate generate --adapter drizzle
npx drizzle-kit generate --name add_dfe_tables
npx drizzle-kit migrate
npx dfe migrate doctor --adapter drizzle --database-url "$DATABASE_URL"

What each step does:

  • plan inspects the project and tells you whether the DFE tables are already exposed through the schema entrypoint used by drizzle.config.*.
  • generate scaffolds a DFE schema entrypoint such as src/db/dfe-schema.ts when the project does not expose one yet.
  • drizzle-kit generate and drizzle-kit migrate remain the source of truth for applying the migration.
  • doctor verifies local project wiring and, when DATABASE_URL is provided, checks the live PostgreSQL tables and columns too.

If generate creates a new schema file, export or reference it through the schema entrypoint configured in drizzle.config.* before running Drizzle migrations.

Lower-Level Schema Options

Import the schema in your Drizzle config:

import {
  dfeForms, dfeFormVersions, dfeSteps, dfeFields,
  dfeFieldOptions, dfeSubmissions,
} from '@dmc--98/dfe-drizzle/schema'

Or scaffold a starter entrypoint directly:

npx dfe add drizzle-schema

Usage

import { drizzle } from 'drizzle-orm/node-postgres'
import { DrizzleDatabaseAdapter } from '@dmc--98/dfe-drizzle'

const db = drizzle(pool)
const adapter = new DrizzleDatabaseAdapter(db)

Schema (PostgreSQL)

The schema defines the same tables as the Prisma adapter using drizzle-orm/pg-core:

  • dfe_forms — form definitions
  • dfe_form_versions — versioned configurations
  • dfe_steps — step definitions
  • dfe_fields — field definitions
  • dfe_field_options — dynamic select options
  • dfe_submissions — submission state

Custom API Contract Execution

Same pattern as Prisma — provide your own executor:

const adapter = new DrizzleDatabaseAdapter(db, {
  executeApiContract: async (contract, body) => {
    if (contract.resourceName === 'Employee') {
      const [row] = await db.insert(employees).values(body).returning()
      return row
    }
    throw new Error(`Unknown resource: ${contract.resourceName}`)
  },
})

Links