Support for Zero-to-One and Zero-to-Many Relationships in DBML

While dbdiagram.io already supports One-to-One, it lacks explicit support for:

  1. Zero-to-One Relationship
    A parent record may have no child record or exactly one child record. This could be represented by a nullable foreign key with a unique constraint. Example:
Table users {
  id int [pk]
}

Table user_profiles {
  user_id int [ref: - users.id, nullable, unique]  // Zero-to-One
}
  1. Zero-to-Many Relationship
    A parent record may have no associated records or many. A nullable foreign key should clearly support this relationship. Example:
Table users {
  id int [pk]
}

Table orders {
  user_id int [ref: > users.id, nullable]  // Zero-to-Many
}

Currently, dbdiagram.io does not provide proper visualization for Zero-to-One and Zero-to-Many relationships. They are not visually represented in the diagram, making it harder for users to understand and convey optional relationships.

These relationships should be clearly indicated in the diagram (e.g., different line styles or annotations) to improve the clarity and usability of DBML in modeling optional relationships. This will make dbdiagram.io more intuitive and aligned with real-world database design needs.

Hi,

Thank you for the suggestion. We have noted your request in our backlog and will let you know when we start implementing it.