lamed_mysql

0.0.3 • Public • Published

lamed_mysql

Generate create tables scripts from json specification.

  • Sample json file:
{
  "config": {
    "databaseName": "ig_clone",
    "table_timestamp" : "{T}",
    "table_noFields" : "!",
    "table_fieldSeperator" : "|-|",
    "field_defaultType" : "VARCHAR(255)",
    "field_unique" : "#",
    "field_nullable": "@",
    "relation_1toMany" : "<--",
    "relation_many2Many" : "<-->",
    "relation_manyTableSeperator": "||"
  },
  "tables": [
    "users{T}   |-|username#,password@,email#",
    "photos{T}  |-|image_url",
    "comments{T}|-|comment_text",
    "tags{T}    |-|tag_name",
    "photo_tags!",
    "likes{T}",
    "follows{T}"
  ],
  "relationships": [
    "users <--photos",
    "users <--comments",
    "photos<--comments",
    "users <-->photos||likes",
    "users <-->users ||follows",
    "photos<-->tags  ||photo_tags",
    "follow_reason<--followers_following"
  ],
  "data": [
    {
      "follow_reason": [
        "follower",
        "following"
      ]
    }
  ]
}

Readme

Keywords

none

Package Sidebar

Install

npm i lamed_mysql

Weekly Downloads

1

Version

0.0.3

License

MIT

Unpacked Size

33.3 kB

Total Files

17

Last publish

Collaborators

  • perezlamed