{"id":40842,"library":"drizzle-docs-generator","title":"drizzle-docs-generator","description":"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.","status":"active","version":"0.7.2","language":"javascript","source_language":"en","source_url":"https://github.com/rikeda71/drizzle-docs-generator","tags":["javascript","cli","database","dbml","documentation","drizzle","drizzle-orm","mermaid","schema","typescript"],"install":[{"cmd":"npm install drizzle-docs-generator","lang":"bash","label":"npm"},{"cmd":"yarn add drizzle-docs-generator","lang":"bash","label":"yarn"},{"cmd":"pnpm add drizzle-docs-generator","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency - the tool reads and interprets Drizzle ORM schema definitions","package":"drizzle-orm","optional":false}],"imports":[{"note":"After local install, use npx or pnpm dlx. The binary is 'drizzle-docs', not 'drizzle-docs-generator'.","wrong":"drizzle-docs-generator generate ...","symbol":"drizzle-docs-generator (CLI)","correct":"npx drizzle-docs generate ./schema.ts -d postgresql"},{"note":"Should be installed as a dev dependency, not a production dependency.","wrong":"npm install drizzle-docs-generator","symbol":"Local install via npm","correct":"npm install --save-dev drizzle-docs-generator"},{"note":"pnpm global install is valid, but the command is still 'drizzle-docs'.","wrong":"pnpm add -g drizzle-docs-generator","symbol":"Global install","correct":"npm install -g drizzle-docs-generator"}],"quickstart":{"code":"// 1. Install as dev dependency\nnpm install --save-dev drizzle-docs-generator\n\n// 2. Create a sample schema file: src/db/schema.ts\nimport { pgTable, serial, text } from 'drizzle-orm/pg-core';\n\n/** Users table */\nexport const users = pgTable(\"users\", {\n  /** User ID */\n  id: serial(\"id\").primaryKey(),\n  /** User name */\n  name: text(\"name\").notNull(),\n});\n\n// 3. Generate Markdown documentation\nnpx drizzle-docs generate ./src/db/schema.ts -d postgresql -o ./docs","lang":"typescript","description":"Installation, schema definition with JSDoc comments, and generation of Markdown docs with ER diagram."},"warnings":[{"fix":"Use 'npx drizzle-docs' or 'drizzle-docs' after global install.","message":"CLI binary name is 'drizzle-docs', not 'drizzle-docs-generator'. Running 'drizzle-docs-generator generate' will fail.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Upgrade Node.js to v24 or later.","message":"Requires Node.js version >=24. Older Node versions will fail to run.","severity":"breaking","affected_versions":">=0.7.0"},{"fix":"Use '--single-file' if you want a single file output, and specify a file path.","message":"The --output option '-o' must be a directory for Markdown format (default), not a file.","severity":"deprecated","affected_versions":">=0.1.0"},{"fix":"Ensure the schema file can be parsed and that the output directory exists.","message":"Watch mode (-w) will not work if the output is a single file (?), or if the schema file has syntax errors.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Upgrade drizzle-orm to a compatible version.","message":"Peer dependency drizzle-orm must be >=0.44.0 or >=1.0.0-beta.0. Older versions will cause runtime errors.","severity":"breaking","affected_versions":">=0.7.0"}],"env_vars":null,"search_vec":"'0.44.0':76 '1.0.0':78 '24':69 'activ':64 'api':35 'auto':42 'auto-regener':41 'beta.0':79 'cli':6,81 'comment':23 'databas':82 'dbml':11,25,83 'definerel':30 'definit':19 'depend':72 'diagram':62 'differenti':45 'directori':53 'doc':3 'document':14,84 'drizzl':2,16,74,85,87 'drizzle-docs-gener':1 'drizzle-orm':73,86 'er':61 'extens':48 'extract':21 'file':47 'format':59 'generat':4,10 'import':52,54 'includ':60 'javascript':80 'jsdoc':22 'key':44 'markdown':13 'mermaid':89 'mode':39 'multipl':57 'node':68 'note':26 'npm':66 'offer':37 'orm':17,75,88 'output':58 'peer':71 'regener':43 'relat':33,34 'releas':63 'requir':49,67 'schema':18,51,90 'support':27,55 'tool':7 'typescript':91 'v0':32 'v0.7.2':8 'v1':29 'watch':38","created_at":"2026-06-04T18:49:31.074780+00:00","updated_at":"2026-06-04T18:49:31.074780+00:00","problems":[{"fix":"Run 'npm install --save-dev drizzle-docs-generator' or 'npm install -g drizzle-docs-generator'.","cause":"The package is not installed globally or locally.","error":"Error: Cannot find module 'drizzle-docs'"},{"fix":"Upgrade drizzle-orm to >=0.44.0 (for v0) or >=1.0.0-beta.0 (for v1).","cause":"Incompatible version of drizzle-orm.","error":"Error: Type 'PostgresJsDatabase' is not assignable to type 'DrizzleConfig'"},{"fix":"Ensure all imports in the schema file are valid and use relative paths without extensions.","cause":"Schema file contains TypeScript syntax not supported by the parser, or import paths are incorrect.","error":"Error: Failed to load schema. SyntaxError: Unexpected token"},{"fix":"Use '--single-file' for Markdown single file output, or change to DBML format with '-f dbml'.","cause":"Output path includes a file name but the format is Markdown (default), which expects a directory.","error":"Error: ENOENT: no such file or directory, open './schema.dbml'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/rikeda71/drizzle-docs-generator#readme","github":"https://github.com/rikeda71/drizzle-docs-generator","docs":null,"changelog":null,"pypi":null,"npm":"drizzle-docs-generator","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}