Skip to content

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

Notifications You must be signed in to change notification settings

luca-montaigut/SkeemaParser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published