Giter Site home page Giter Site logo

loopback-discover-models's Introduction

I simple CLI tool to discover and write new model.json and model.js files by using loopback's datasource.discoverSchema API

Usage

``` ./node_modules/.bin/loopback-discover-schemas -h Usage: loopback-discover-schemas [OPTIONS] [ARGS]

Options: --serverPath [PATH]Path to server.js (relative to CWD). (Default is /server/server.js) --modelConfigPath [PATH]Path to model-config.json (relative to CWD). (Default is /server/model-config.json) --modelDir [PATH] Path to models folder (relative to CWD). (Default is /common/models) --dataSource [STRING]Name of the data source from data sources.json (required). (Default is db) --allNewModels [BOOLEAN]Discover and create all models not in modelDir. (Default is false) --modelName STRING Name of a single model/table/collection to create. --owner STRING Name of owner/schema/database for the models. --relations [BOOLEAN]Include relations. (Default is false) --allOwners [BOOLEAN]Include All Owners. (Default is false) --views [BOOLEAN] Include views. (Default is false) --skip STRING Comma seperate model names to skip when discovering new models. -h, --help Display help and usage details


<h5>Generate Models for all tables in the database that don't already exist as models.</h5>

./node_modules/.bin/loopback-discover-schemas --allNewModels


<h5>generate new models, but skip the tables 'migrations' and 'some_other_table'</h5>

./node_modules/.bin/loopback-discover-schemas --allNewModels --skip migrations,some_other_table


<h5>Generate new models and put them in a different folder</h5>

./node_modules/.bin/loopback-discover-schemas --allNewModels --modelDir /server/models


<h5>Use prompts instead of cli flags (good for use with npm run).</h5>

./node_modules/.bin/loopback-discover-schemas --prompt


<h5>Generate Model for a specific table/collectiom (modelName should be the table/collection name).</h5>

./node_modules/.bin/loopback-discover-schemas --modelName some_table


<h5>Generate Model for a specific table/collectiom (modelName should be the table/collection name).</h5>

./node_modules/.bin/loopback-discover-schemas --modelName some_table

loopback-discover-models's People

Contributors

slively avatar

Watchers

Andy Kellerstrass avatar James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.