luca-montaigut / SkeemaParser

A parser for "schema.rb" file who return a hash of your schema in a "schema.json" file (downloadable)

Home Page:https://luca-montaigut.github.io/SkeemaParser/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A parser for "schema.rb" file who return a hash of your schema in a "schema.json" file (downloadable)

Valide for Rails 5+ schema.rb (maybe before but untested)

How tu use

You can put a schema.rb file in the input file form on SkeemaParser and receive a hash of your schema.rb downloadable in .json like this :

{
  tableName:
  {
    columnName: columnType,
    ... ,
    index: [columnName, ...]
  },
  ...
}

You can found it in the browser console too like this :

{tableName: {columnName: columnType, ... , index: [columnName, ...]}, ...}

If you want to use the parser in your own programme, get the file skeemaParser.js and use the class like this :

const yourVariable = new Skeema(yourSchemaRbFile).parse();

NB : "yourSchemaRbFile" has to be a string (more on this here)

Purpose

Made to be used in a project of create automated seeds.rb file template based on schema.rb file.

🐰 Author

Luca Montaigut : https://github.com/luca-montaigut

Based on : https://github.com/rubysolo/skeema

About

A parser for "schema.rb" file who return a hash of your schema in a "schema.json" file (downloadable)

https://luca-montaigut.github.io/SkeemaParser/


Languages

Language:JavaScript 73.8%Language:HTML 15.7%Language:CSS 10.5%