Produces static Sails / Waterline models by reverse engineering existing databases
To install this adapter, run:
$ npm install --save sails-model-reverser
An example follows which uses the Apache Derby adapter (sails-derby) to reverse engineer and create models for the TESTTABLE table of the TESTDB database (running on the standard port of localhost).
Each model is written to a single file and is placed in the path specified
/path/for/output in the example below). If no
output path is specified, the files will be placed in the
sub-directory of this module (so, probably
Each model is generated to use the connection specified by
myConnection in the example below). If no
connection name is specified, the default connection name,
At the time of this writing, sails-derby is the only tested adapter.
var Reverser = ;var adapter = ;var connection =url: 'jdbc:derby://localhost:1527/TESTDB'minpoolsize: 10maxpoolsize: 100;var tables ='TESTTABLE';var options =outputPath: '/path/for/output'connectionName: 'myConnection';var reverser = adapter connection tables options;reverser;