Skip to main content

0️⃣ Zero-to-One/Many Relationships, Colors and more!

dbdiagramdbdocs

Valentine’s Day taught us relationships can be rock-solid or a little… optional πŸ’”β€”and your database is no different! Our latest update lets you define optional or mandatory relationships, customize their colors, and add names to make your diagrams clearer and more meaningful.

Optional or Mandatory Relationships (free plan)​

Using the nullable constraint on the foreign key, we can now automatically determine whether a relationship is optional (zero-to-one/many) or mandatory (one-to-one/many) for the parent entity. Take a look at our example below:

Table follows {
following_user_id int [ref: > users.id] // optional, many-to-zero relationship
followed_user_id int [ref: > users.id, null] // optional, many-to-zero relationship
}

Table posts {
id int [pk]
user_id int [ref: > users.id, not null] // mandatory, many-to-one relationship
}

Zero-to-one/many relationship

Custom Color for Relationship Lines (paid plan only)​

Make your diagrams more readable by assigning custom colors to relationships. You can either pick up a color directly in the diagram or define it via DBML with this syntax:

Ref: posts.user_id > users.id [color: #aabbcc]

If not defined, the relationship line will inherit the parent table’s header color by default.

We’ve also added a flowing animation to show the direction of each relationship.

Custom color for relationship

Named Relationships (free plan)​

Label your relationships in DBML and see the names pop up on hover in your diagram! These hover-triggered names make it a breeze to identify connections without cluttering the view.

The syntax for naming a relationship is as follows:

Ref user_posts: posts.user_id > users.id

Named relationship

We hope these enhancements improve your database design and communication experience. Try them out and let us know what you think.


πŸ–ΌοΈ Embedded Views

dbdocs

Embedded Views Header Image

Database documentation is a key focus when designing and developing data-driven applications, yet it’s often scattered across multiple tools, making it hard to track and causing friction in technical discussions.

Introducing Embedded Views in dbdocsβ€”a powerful new feature that allows you to seamlessly integrate your database diagrams and documentation into your favorite platforms like Notion, Confluence, and your own websites.

🎬 Watch this video! 🍿

Key Features:

  • πŸ™οΈΒ Customizable Views: Handpick the tables you want to embed, toggle flexibly between Diagram or Document views and customize options like dark mode, version pinning, and more.
  • ⚑️ Live Updates: Your embedded content stays up-to-date with the latest changes in your database schema or pin to a specific version.
  • πŸ”—Β Seamless Integration: Embed interactive diagrams and documentation directly into any documentation platforms you use daily like Notion, Confluence, and even your website.

To learn more, check out the doc here.

This feature is currently in beta and is available to all dbdocs users during this testing phase. We invite you to try out Embedding and share your feedback with us.

We believe this enhancement will greatly improve your database documentation and look forward to yourΒ feedback.


✍️ Allow others to edit your projects

dbdocs

We heard you. It has been lonely and challenging since you are the only person who can publish or update your database documentation. So we’re making it better.

Starting today, you can allow others to contribute to your projects by inviting them with β€œedit” permission.

Invite people with edit permission

Project editors will be able to:

  • βœ… Publish changes to invited projects via dbdocs CLI with command:
    dbdocs build <dbml file path> --project <username>/<project name>
  • βœ… Edit Markdown notes and diagram layouts directly on the document project page.

Project editor

This feature is included as part of our β€œShare with invited users” paid feature.

We believe this enhancement will greatly improve your database documentation and look forward to yourΒ feedback.


🎨 Support Notes & Color for Table Groups

dbdiagramdbdocs

You can now set customized colors and add notes to table groups.

Table Group Notes and Color

Table Group Color​

No more boring, grayed-out table groups that are difficult to spot when zoomed out, as you can now make them more colorful and distinct.

You can directly pick a color for your table group in the UI or use the following coding syntax:

TableGroup "Order Management" [color: #E74C3C] {
...
}

Select color for table group

Table Group Notes​

Add Markdown descriptions for table groups to provide extra information, such as their purposes, specific details about child tables, and so on.

To add notes, use the following syntax:

TableGroup "User Wishlist System" [note: 'Manages the user wishlist functionality'] {
...

// or use multi-line string to define Markdown content
Note: '''
This group manages the user wishlist functionality.
- wishlists: Stores user-specific wishlists.
- wishlist_items: Contains items added to each wishlist.
'''
}

Add notes to table group

Both features are available as part of our paid Table Group feature set.

We believe this enhancement will greatly improve your database designing experience, and we look forward to yourΒ feedback.


βš™οΈ Generate DBML from Direct DB Connection

dbdiagramdbdocs

Our new db2dbml CLI command now allows you to generate DBML code directly from your database. This feature simplifies the database visualization process so that you can focus solely on designing new database structures for your new features. Generate DBML from database

Make sure to use the Import > From Database Connection (via CLI) option to get a detailed guide for your database type: Generate DBML from database

Here is how we use db2dbml (included in dbdocs CLI) to generate DBML and create a database documentation project in dbdocs: Generate DBML from database

Is it safe to allow dbdocs CLI to connect to my database? Yes

  • Everything runs on your local machine, and the database credentials are not tracked or sent anywhere.
  • The database connection is secured.
  • The code is open source from the @dbml/cli & @dbml/connector packages and can be checked here.

Supported databases: PostgreSQL, MySQL, MSSQL, Snowflake, BigQuery.

Please give this feature a try andΒ let us knowΒ what you think.