Exports and dbdiagram synchronization
Produce code and documentation, then review remote synchronization.
Export a schema for its audience#
Open DBML Export on the entry file. Select SQL DDL, Prisma, TypeScript interfaces, diagrams, or documentation. Imported declarations must be visible to that entry module; exporting an isolated module can intentionally produce a smaller model.
| Output | Check before sharing |
|---|---|
| SQL | Dialect, keys, defaults, identity columns, constraints, sample seed data |
| Prisma | Mappings, scalar/relation fields, composite keys, referential actions |
| TypeScript | Type mappings, nullable/optional representation, naming |
| HTML/Markdown | Notes, ownership/classification metadata, included objects |
| SVG/PNG/PDF | Active DiagramView, detail level, layout, labels |
A generated TypeScript interface is a type description, not a database client. Review type choices such as decimal and timestamp in the context of your application’s runtime representation.
Connect the official CLI#
Install dbdiagram using Node.js 22.14 or newer. In the editor’s dbdiagram menu, choose Initialize dbdiagram Project…, then Log in to dbdiagram…. Select a full executable path in the action dialog if the IDE cannot discover the CLI.
Credentials remain managed by the CLI; DBDIAGRAM_TOKEN is supported through the IDE process environment. Do not put tokens in the DBML or companion layout file.
Push or pull deliberately#
Use Push to dbdiagram… only after confirming the linked diagram. For Pull from dbdiagram…, read the displayed diff and choose Apply pull to write the selected remote changes locally. A pull is not applied silently.
Commit the schema, companion schema.dbdiagram positions, and non-secret .dbdiagram/settings.json together when sharing a setup. Independent DiagramView layouts and unrelated visualization settings should be retained.
Publish to dbdocs… publishes documentation through the CLI. Inspect what the selected entry module exposes before publishing a model that includes internal notes or records.
Manual for version 2026.2.4 · Reviewed