waterline-pg-json-import
Construct a Waterline ORM from a Postgres Schema.
Install
$ npm install waterline-pg-json-import --save
Usage
Input JSON
First export your Postgres schema using https://www.npmjs.org/package/pg-json-schema-export
Run the Importer
var importer = ;var json = // output from pg-json-schema-export;var configuration = adapters: disk: connections: readme: adapter: 'disk' ;var orm = importer;var collections;waterline;
API
.initialize(json, connection)
Generate the Waterline ORM
@param | description |
---|---|
json |
JSON object representing the exported schema |
connection |
name of the Waterline connection to use |
@return | description |
Array |
Array of Waterline.Collection objects |
.import(json, waterline)
Import JSON into a Database
@param | description |
---|---|
json |
JSON object containing the exported data |
waterline |
reference to the Waterline instance used to initialize the ORM |
@return | description |
Object |
Report of number of rows inserted into each table |
License
MIT