holistics / holistics/dbml

Proposal: DBML Tag

Open
#60 0 comments 4 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
3.7k
Forks
233
Avg merge
1d 23h
Merged PRs (30d)
4

Description

# DBML Tag

## Concept
* Support metadata tag/label for DBML element (table, schema,...)
* Each element can have multiple tags associated.
* Each tag can be associated with multiple elements.

## Syntax

### Define the tag block separately.
```
Tag v1.0 {
note: 'version 1.0'
tables: [users, cities, countries]
}

Tag transaction {
note: 'transaction tables'
tables: [users, orders]
}

Table orders {
id int [pk]
user_id int [ref: > users.id]
status order_status
created_at datetime
}
...
```
* All the tag's attributes (note, associated tables) can be declared in the long-form format.

### Define tag inside element
```
Table orders [tags: [transaction, v1.0]] {
id int [pk]
user_id int [ref: > users.id]
status order_status
created_at datetime
}

// or

Table orders {
id int [pk]
user_id [ref: > users.id]
status order_status
created_at datetime

Tags {
v1.0
transaction
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.