-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
333 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Table Users as U1 { | ||
|
||
} | ||
|
||
Table Users as U2 { | ||
|
||
} | ||
|
||
Table Products as U1 { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Table User { | ||
id int | ||
secret nvarbinary(MAX) | ||
name varchar("MAX") | ||
code varbinary('MAX') | ||
ssid int(10) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Table bookings { | ||
id integer | ||
country varchar | ||
booking_date date | ||
created_at timestamp | ||
|
||
indexes { | ||
(id, country) [pk] // composite primary key | ||
created_at [name: 'created_at_index', note: 'Date'] | ||
booking_date | ||
(country, booking_date) [unique] | ||
booking_date [type: hash] | ||
(`id*2`) | ||
(`id*3`,`getdate()`) | ||
(`id*3`,id) | ||
} | ||
} | ||
// End of program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Project { | ||
Table v1.Users { | ||
id integer | ||
status v2.Status [default: v2.Status.new] | ||
} | ||
|
||
Enum v2.Status { | ||
new | ||
churn | ||
active | ||
tenant | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Table A as A { | ||
id int [primary key] | ||
} | ||
|
||
Table "B" as B { | ||
id int [primary key] | ||
} | ||
|
||
Table C as "C" { | ||
id int [primary key] | ||
} | ||
|
||
Table "D" as "D" { | ||
id int [primary key] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Table Users { | ||
id integer | ||
id integer | ||
id integer | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Enum status { | ||
churn | ||
churn | ||
churn | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Table Users { | ||
id integer | ||
} | ||
|
||
Table Users { | ||
name char(255) | ||
} | ||
|
||
TableGroup Users { | ||
|
||
} | ||
|
||
TableGroup Users { | ||
|
||
} | ||
|
||
Enum Users { | ||
|
||
} | ||
|
||
Enum Users { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
enum v."A" { | ||
|
||
} | ||
|
||
enum { | ||
"1" | ||
"1" | ||
1 | ||
a | ||
"ab" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Table users as U { | ||
id int [pk, increment] | ||
} | ||
|
||
Table user_role_in_diagram { | ||
user_id int | ||
diagram_id int | ||
role int [note: 'Role = sum(user's available permissions bit value)'] | ||
Indexes { | ||
(user_id, diagram_id) [pk] | ||
} | ||
} | ||
|
||
Table permissions { | ||
bit int [pk] | ||
name varchar | ||
} | ||
|
||
Table diagrams { | ||
id int [pk, increment] // auto-increment | ||
} | ||
|
||
Ref: "users"."id" - "user_role_in_diagram"."user_id" | ||
|
||
Ref: "diagrams"."id" - "user_role_in_diagram"."diagram_id" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
Table A { | ||
id int | ||
ssid | ||
} | ||
|
||
Enum E { | ||
a1 e [note: 'abc'] | ||
a2 [note: 'abc'] e | ||
a3 e f | ||
a4 e | ||
} | ||
|
||
TableGroup G { | ||
A a | ||
A a a | ||
} | ||
|
||
Ref { | ||
A.id > A.id [delete: cascade] a | ||
} | ||
|
||
Ref { | ||
A.id > A.id a [delete: cascade] | ||
} | ||
|
||
Ref { | ||
A.id > A.id a | ||
} | ||
|
||
Ref { | ||
A.id > A.id a a | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Project B { | ||
Table A { | ||
|
||
} | ||
|
||
Table A { | ||
|
||
} | ||
|
||
Table B { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Table "customer" { | ||
"customer_id" SMALLINT [pk, not null, increment] | ||
"store_id" TINYINT [not null] | ||
"first_name" VARCHAR(45) [not null] | ||
"last_name" VARCHAR(45) [not null, default: faLse] | ||
"email" VARCHAR(50) [default: NULL] | ||
"address_id" SMALLINT [not NULL] | ||
"active" BOOLEAN [not null, default: TRUE] | ||
"create_date" DATETIME [not null] | ||
"last_update" TIMESTAMP [default: `CURRENT_TIMESTAMP`] | ||
} | ||
|
||
Table cities { | ||
id integer [primary key] | ||
name e [default: "hello"] | ||
country_id integer | ||
note: "sasasa" | ||
} | ||
|
||
Table country { | ||
id integer | ||
cities string[] | ||
} | ||
|
||
Table citites { | ||
id integer | ||
name string | ||
indexes { | ||
id name | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Enum status { | ||
|
||
} | ||
|
||
Enum public.status { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Table A { | ||
Note: ''' This is a local note ''' | ||
Note { | ||
'This is another local note' | ||
} | ||
} | ||
|
||
Note { | ||
'This is a global note' | ||
} | ||
|
||
Note: ''' | ||
This is another global note | ||
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Ref a: Users.id < Products.uid [update: no action] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Table A { | ||
id integer | ||
code number | ||
} | ||
|
||
Table B { | ||
id integer | ||
code number | ||
} | ||
|
||
Table C { | ||
id integer | ||
code number | ||
Ref: id > A.id | ||
Ref: code > B.code | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
Table users [headercolor: #3498DB] { | ||
id integer [primary key] | ||
username varchar(255) [not null, unique] | ||
} | ||
|
||
Note note2 { | ||
'One line note' | ||
} | ||
|
||
Note note2 { | ||
'One line note' | ||
} | ||
|
||
Note note3 { | ||
'One line note' | ||
} | ||
|
||
Note "note3" { | ||
'One line note' | ||
} | ||
|
||
Note schema.note3[] { | ||
''' | ||
# Title | ||
body | ||
''' | ||
} | ||
Note "schema.note4" { | ||
''' | ||
# Title | ||
body | ||
''' | ||
} | ||
|
||
Note "schema"."note5" [headercolor: #3457DB] { | ||
''' | ||
# Title | ||
body | ||
''' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Table Users [ | ||
headercolor: #123, | ||
note: 'This is a note', | ||
note: 'This is a duplicate note' | ||
] { | ||
id integer [primary key] // pk | ||
name string [not null] /* not null */ | ||
age integer [default: 18, note: 'This is a note', note: 'This is another note'] | ||
/* ----- | ||
----- */ | ||
status v2.status [default: v2.status.new] | ||
dob char(255) [null] | ||
} | ||
|
||
Enum v2.status { | ||
churn | ||
new | ||
active | ||
tenant | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.