Registry / database / drizzle-docs-generator

drizzle-docs-generator

JSON →
library0.7.2jsnpmunverified

A CLI tool (v0.7.2) that generates DBML and Markdown documentation from Drizzle ORM schema definitions. It extracts JSDoc comments as DBML Notes, supports both v1 (defineRelations) and v0 (relations) relation APIs, and offers watch mode for auto-regeneration. Key differentiators: no file extension required for schema imports, directory import support, and multiple output formats including ER diagrams. Released actively on npm, requires Node >=24 and peer dependency drizzle-orm >=0.44.0 or >=1.0.0-beta.0.

npm install drizzle-docs-generator
INSTALL
IMPORT
SIG · DRIZZLE-DOCS-GENER
D
drizzle-docs-generator
databasejavascriptv0.7.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

drizzle-docs-generator (CLI)
✓ npx drizzle-docs generate ./schema.ts -d postgresql
✗ drizzle-docs-generator generate ...
After local install, use npx or pnpm dlx. The binary is 'drizzle-docs', not 'drizzle-docs-generator'.
Local install via npm
✓ npm install --save-dev drizzle-docs-generator
✗ npm install drizzle-docs-generator
Should be installed as a dev dependency, not a production dependency.
Global install
✓ npm install -g drizzle-docs-generator
✗ pnpm add -g drizzle-docs-generator
pnpm global install is valid, but the command is still 'drizzle-docs'.

Installation, schema definition with JSDoc comments, and generation of Markdown docs with ER diagram.

// 1. Install as dev dependency npm install --save-dev drizzle-docs-generator // 2. Create a sample schema file: src/db/schema.ts import { pgTable, serial, text } from 'drizzle-orm/pg-core'; /** Users table */ export const users = pgTable("users", { /** User ID */ id: serial("id").primaryKey(), /** User name */ name: text("name").notNull(), }); // 3. Generate Markdown documentation npx drizzle-docs generate ./src/db/schema.ts -d postgresql -o ./docs
Debug
Known issues
gotchaCLI binary name is 'drizzle-docs', not 'drizzle-docs-generator'. Running 'drizzle-docs-generator generate' will fail.
fix
Use 'npx drizzle-docs' or 'drizzle-docs' after global install.
affects: >=0.1.0
breakingRequires Node.js version >=24. Older Node versions will fail to run.
fix
Upgrade Node.js to v24 or later.
affects: >=0.7.0
deprecatedThe --output option '-o' must be a directory for Markdown format (default), not a file.
fix
Use '--single-file' if you want a single file output, and specify a file path.
affects: >=0.1.0
gotchaWatch mode (-w) will not work if the output is a single file (?), or if the schema file has syntax errors.
fix
Ensure the schema file can be parsed and that the output directory exists.
affects: >=0.1.0
breakingPeer dependency drizzle-orm must be >=0.44.0 or >=1.0.0-beta.0. Older versions will cause runtime errors.
fix
Upgrade drizzle-orm to a compatible version.
affects: >=0.7.0
Errors
Common errors & fixes
Error: Cannot find module 'drizzle-docs'
The package is not installed globally or locally.
fix
Run 'npm install --save-dev drizzle-docs-generator' or 'npm install -g drizzle-docs-generator'.
Error: Type 'PostgresJsDatabase' is not assignable to type 'DrizzleConfig'
Incompatible version of drizzle-orm.
fix
Upgrade drizzle-orm to >=0.44.0 (for v0) or >=1.0.0-beta.0 (for v1).
Error: Failed to load schema. SyntaxError: Unexpected token
Schema file contains TypeScript syntax not supported by the parser, or import paths are incorrect.
fix
Ensure all imports in the schema file are valid and use relative paths without extensions.
Error: ENOENT: no such file or directory, open './schema.dbml'
Output path includes a file name but the format is Markdown (default), which expects a directory.
fix
Use '--single-file' for Markdown single file output, or change to DBML format with '-f dbml'.
Upgrade
Version history
0.7.2latest on npm
Audit
Dependencies
drizzle-ormrequiredPeer dependency - the tool reads and interprets Drizzle ORM schema definitions
Agent activity
20 hits · last 30 days
node
16
Amazon
1
Bingbot
1
Resources
drizzle-docs-generator — npm install drizzle-docs-generator · libregistry