#sails-sql-converter-cli

###Description:
This is a command line tool for generating sails models from sql scheme.
Design your database using any UML software you want export your design
to sql and use this tool to generate sails models.
Linux or MacOS
$ npm install sails-sql-converter-cli -gMicrosoft Windows
$ npm install sails-sql-converter-cli -g$ sails-sql -f newdb.sql-h --help : show a help massage
-o --out : specify where the generated files should be saved.
Defaults to the location where the command is runned
-f --file : specify the sql file
Table
Create
Primary Key
Foreign Key
References
varchar, char, tinyblob, tinytext -> string
int, smallint, tinyint, mediumint, bigint -> interger
float, double, decimal -> float
blob, text -> text
mediumblob, mediumtext -> mediumtext
longblob, longtext -> longtext
date -> date
datetime, timestamp -> datetime
binary -> binary
$ cat user.sql
/*
CREATE TABLE IF NOT EXISTS `mydb`.`User` (
`user_id` INT NOT NULL,
`username` VARCHAR(45) NULL,
`password` VARCHAR(45) NULL,
`type` VARCHAR(45) NULL,
PRIMARY KEY (`user_id`))
*/
$ sails-sql -f user.sql
/*
User.js
module.exports = {
attributes: {
username: 'string',
password: 'string',
type: 'string',
}
};
*/