1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Generate UML/SQL/CQL/Go/Rust/Crystal database schema and fake data from a textual specification

Discussion in 'MySQL' started by ecstaticcoder, Jun 20, 2018.

  1. #1
    For those interested, I've just released an improved version of Basil, my open-source database generation tool.
    SEMrush
    You can download it here :

    https://github.com/senselogic/BASIL

    Basically, it uses a textual specification of a database to generate its schema (UML, SQL, CQL, Go, Rust, Crystal) and fake data (SQL, CQL).

    Here is a sample script to generate the schema and fake data for a sample blog web site :
    
    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
    
    Code (markup):
     
    ecstaticcoder, Jun 20, 2018 IP
    SEMrush