www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Textual database designer (Basil 2.0)

For those interested, Basil, my textual database designer, can 
now export database schemas in SQL, CQL, Go and Crystal format, 
and their fake data in SQL and CQL format.

I've slightly changed the syntax so that the table columns can 
use any combination of scalar types, foreign keys, tuples, maps, 
lists and sets.

You can download it here :

https://github.com/senselogic/BASIL

Here are two sample scripts illustrating the new syntax :

BLOG | count 5

     SECTION

         Id : UINT64 | key, unique, incremented
         Number : UINT64
         Name : STRING | capacity 45
         Text : STRING
         Image : STRING | capacity 45

         ImageIndex : UINT64 | !stored

     USER

         Id : UINT64 | key, unique, incremented
         FirstName : STRING | capacity 45
         LastName : STRING | capacity 45
         Email : STRING | capacity 45
         Pseudonym : STRING | capacity 45
         Password : STRING | capacity 45
         Phone : STRING | capacity 45
         Street : STRING
         City : STRING | capacity 45
         Code : STRING | capacity 45
         Region : STRING | capacity 45
         Country : STRING | capacity 45
         Company : STRING | capacity 45
         ItIsAdministrator : BOOL

     ARTICLE | count 15

         Id : UINT64 | key, unique, incremented
         SectionId : SECTION.Id | partitioned
         UserId : USER.Id | clustered
         Title : STRING
         Text : STRING
         Image : STRING | capacity 45
         Date : DATE

         Section : POINTER[ SECTION ] | !stored
         User : POINTER[ USER ] | !stored
         ImageIndex : UINT64 | !stored

     COMMENT | count 30

         Id : UINT64 | key, unique, incremented
         ArticleId : ARTICLE.Id | indexed
         UserId : USER.Id | indexed
         Text : STRING | english 2 4 5 7
         DateTime : DATETIME

         Article : POINTER[ ARTICLE ] | !stored
         User : POINTER[ USER ] | !stored

     SUBSCRIBER

         Id : UINT64 | key, unique, incremented
         Name : STRING | capacity 45
         Email : STRING | capacity 45

TEST | count 10

     SIMPLE

         Uuid : UUID | key, unique
         Bool : BOOL | partitioned
         Int8 : INT8 | clustered
         Uint8 : UINT8 | indexed
         Int16 : INT16
         Uint16 : UINT16
         Int32 : INT32
         Uint32 : UINT32
         Int64 : INT64
         Uint64 : UINT64
         Float32 : FLOAT32
         Float64 : FLOAT64
         String : STRING
         Date : DATE | unique
         DateTime : DATETIME
         Blob : BLOB

     COMPOUND

         Id : INT32 | key, unique, incremented
         Location : Country : STRING | uppercase
         Name : TUPLE[ FirstName : STRING, LastName : STRING ] | 
unique
         NameSet : SET[ TUPLE[ FirstName : STRING, LastName : 
STRING ] ] | count 2
         CompanyMap : MAP[ Phone : STRING, Company : STRING ] | 
count 2
         EmailSet : SET[ Email : STRING ] | count 2
         PhoneList : LIST[ Phone : STRING ] | count 2
         SimpleDate : SIMPLE.Date
         SimpleDateMap : MAP[ COMPOUND.Name, SIMPLE.Date ] | count 
2
         SimpleDateSet : SET[ SIMPLE.Date ] | count 2
         SimpleDateList : LIST[ SIMPLE.Date ] | count 1 3
         NameSetMap : MAP[ SIMPLE.Date, COMPOUND.NameSet ] | count 
2
         SimplePointerArray : ARRAY[ POINTER[ SIMPLE ] ] | !stored
Jun 16 2018