2020-05-17 19:10:41 +00:00
|
|
|
# Entity-Relationship Diagrams - Domain Specific Language
|
|
|
|
|
|
|
|
## Goals
|
|
|
|
|
|
|
|
## Example
|
|
|
|
|
|
|
|
### An entity User
|
|
|
|
|
|
|
|
```
|
2020-05-17 19:12:29 +00:00
|
|
|
ENTITY User {
|
|
|
|
id: UUID,
|
|
|
|
password_hash: VARCHAR(250),
|
|
|
|
role: VARCHAR(10),
|
|
|
|
created_at: DATETIME,
|
|
|
|
updated_at: DATETIME
|
|
|
|
}
|
2020-05-17 19:10:41 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### An entity Url
|
|
|
|
|
|
|
|
```
|
2020-05-17 19:12:29 +00:00
|
|
|
ENTITY Url {
|
|
|
|
id: VARCHAR(250),
|
|
|
|
custom_id: VARCHAR(250),
|
|
|
|
source_url: TEXT,
|
|
|
|
short_url: VARCHAR(250),
|
|
|
|
created_at: DATETIME,
|
|
|
|
updated_at: DATETIME,
|
|
|
|
expires_at: DATETIME
|
|
|
|
};
|
2020-05-17 19:10:41 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### An relationship ManageLinks
|
|
|
|
|
|
|
|
```
|
2020-05-17 19:12:29 +00:00
|
|
|
RELATIONSHIP ManagesLinks {
|
|
|
|
LINK User (1, 1),
|
|
|
|
LINK Url (0, N),
|
|
|
|
};
|
2020-05-17 19:10:41 +00:00
|
|
|
```
|