Hi was Zero consider in DBML syntax for relationships?
(0-M, 0-1)
Could this be added? perhaps it could be defined like
table1.key 0< table2.key
or
table1.key 0- table2.key
?
Hi was Zero consider in DBML syntax for relationships?
(0-M, 0-1)
Could this be added? perhaps it could be defined like
table1.key 0< table2.key
or
table1.key 0- table2.key
?
Update March 2025: This feature was recently released. You can now test it by defining a relationship with and without nullability for the foreign key. For instance:
Table follows {
following_user_id int [ref: > users.id] // optional relationship
followed_user_id int [ref: > users.id, null] // optional relationship
}
Table posts {
id int [pk]
user_id int [ref: > users.id, not null] // mandatory relationship
}
Table users {
id int [pk]
}
The outcome will be as follows:
Hi @Tommy, Optional refs have been fully supported with a syntax to denote in dbml version 9.0.0. You can check the doc here: DBML Syntax — Core Database Markup | DBML
A glance of the syntax:
Table users {
id int [pk]
}
Table profiles {
id int [pk]
uid int [unique]
}
Ref: users.id ?-? profiles.id // users can have a profile or not, a profile can belong to a user or not